GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CorrSpaceAdopt.C
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998, Agata Experiment, All rights reserved. *
3  * *
4  * Author: The Agata Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 
17 //
18 //
19 #if !defined(__CINT__) || defined(__MAKECINT__)
20 
21 #include <Riostream.h>
22 #include "TFile.h"
23 #include "TMath.h"
24 #include "TRandom.h"
25 #include "TTree.h"
26 #include "TH2F.h"
27 #include "TH1D.h"
28 #include "CorrelatedSpaceTH2.h"
29 #include "CorrelatedSpaceTree2I.h"
30 #endif
31 
33 {
34 
35  TFile* fileIn = new TFile("test1.root", "READ");
36  Gw::CorrelatedSpaceTree2I* csTree = ( Gw::CorrelatedSpaceTree2I*)fileIn->Get("Correlated_Space");
37 
38  TFile* fileOut = new TFile("Import.root", "RECREATE");
39  fileOut->cd();
40 
42 
43  csTH2->Import(csTree);
44 
45  TH1D* h1 = csTH2->GetHistoTot("x");
46 
47  h1->Draw();
48 
49  csTH2->Write();
50 
51  fileOut->Close();
52  fileIn->Close();
53 }
54 
56 {
57 
58  TFile* fileIn = new TFile("test3.root", "READ");
59  Gw::CorrelatedSpaceTH2* csTH2 = (Gw::CorrelatedSpaceTH2*)fileIn->Get("Correlated_Space");
60 
61  TFile* fileOut = new TFile("Import1.root", "RECREATE");
62  fileOut->cd();
63 
65  csTree->Import(csTH2);
66 
67  TH1D* h1 = csTree->GetHistoTot("x");
68 
69  h1->Draw();
70 
71  csTree->Write();
72 
73  fileOut->Close();
74  fileIn->Close();
75 
76 
77 }
78 
CorrelatedSpaceTH2 class that manages a 2D symmetrical correlated space stored in a TH2...
header file for all type of CorrelatedSpaceTree2I
void CorrSpaceTreeAdoptH2()
header file for all type of CorrelatedSpaceTH2
void Import(CorrelatedSpace *cs)
Import another CS.
CorrelatedSpaceTree2I class that manages a 2D symmetrical correlated space of integers store in a tre...
virtual TH1D * GetHistoTot(Option_t *axis="x")
Get histo total projection.
void CorrSpaceH2AdoptTree()