ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UfCode/UserArea/StatTools/tree.h
Revision: 1.1
Committed: Wed Dec 8 10:57:13 2010 UTC (14 years, 4 months ago) by kkotov
Content type: text/plain
Branch: MAIN
CVS Tags: V2012-H-02, V2012-01-00, V2011-01-01, V2011-01-00, AnnaDimuon, V01-00-01, V01-00-00, HEAD
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 kkotov 1.1 //////////////////////////////////////////////////////////
2     // This class has been automatically generated on
3     // Sun Nov 28 09:48:32 2010 by ROOT version 5.26/00
4     // from TChain tree/
5     //////////////////////////////////////////////////////////
6    
7     #ifndef tree_h
8     #define tree_h
9    
10     #include <TROOT.h>
11     #include <TChain.h>
12     #include <TFile.h>
13    
14     class tree {
15     public :
16     TTree *fChain; //!pointer to the analyzed TTree or TChain
17     Int_t fCurrent; //!current Tree number in a TChain
18    
19     // Declaration of leaf types
20     Int_t eventInfo_run;
21     Int_t eventInfo_lumi;
22     Int_t eventInfo_event;
23    
24     struct _MuonInfo{
25     int charge;
26     float pt;
27     float eta;
28     float phi;
29    
30     float normChiSquare;
31     float d0;
32    
33     int numValidMuonHits;
34     int numValidPixelHits;
35     int numValidTrackerHits;
36     int numValidStripHits;
37     int numSegmentMatches;
38    
39     float trackIsoSumPt;
40    
41     int isHltMatched;
42     char hltPath[128];
43    
44     } reco1, reco2;
45    
46     Float_t recoCandMass;
47     Float_t recoCandPt;
48     Float_t recoCandMassCktl;
49     Float_t recoCandPtCktl;
50     Int_t cocktail1_charge;
51     Float_t cocktail1_pt;
52     Float_t cocktail1_eta;
53     Float_t cocktail1_phi;
54     Int_t cocktail2_charge;
55     Float_t cocktail2_pt;
56     Float_t cocktail2_eta;
57     Float_t cocktail2_phi;
58    
59     // List of branches
60     TBranch *b_eventInfo; //!
61     TBranch *b_reco1; //!
62     TBranch *b_reco2; //!
63     TBranch *b_recoCandMass; //!
64     TBranch *b_recoCandPt; //!
65     TBranch *b_recoCandMassCktl; //!
66     TBranch *b_recoCandPtCktl; //!
67     TBranch *b_cocktail1; //!
68     TBranch *b_cocktail2; //!
69    
70     tree(TTree *tree=0);
71     virtual ~tree();
72     virtual Int_t Cut(Long64_t entry);
73     virtual Int_t GetEntry(Long64_t entry);
74     virtual Long64_t LoadTree(Long64_t entry);
75     virtual void Init(TTree *tree);
76     virtual void Loop();
77     virtual Bool_t Notify();
78     virtual void Show(Long64_t entry = -1);
79     };
80    
81     #endif
82    
83     #ifdef tree_cxx
84     tree::tree(TTree *tree)
85     {
86     // if parameter tree is not specified (or zero), connect the file
87     // used to generate this class and read the Tree.
88     if (tree == 0) {
89    
90     #ifdef SINGLE_TREE
91     // The following code should be used if you want this class to access
92     // a single tree instead of a chain
93     TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("Memory Directory");
94     if (!f) {
95     f = new TFile("Memory Directory");
96     f->cd("Rint:/");
97     }
98     tree = (TTree*)gDirectory->Get("tree");
99    
100     #else // SINGLE_TREE
101    
102     // The following code should be used if you want this class to access a chain
103     // of trees.
104     TChain * chain = new TChain("tree","");
105     // chain->Add("dimuons_run132440to147195.root/tree");
106     // chain->Add("dimuons_run147196to148058.root/tree");
107     // chain->Add("dimuons_run148059to149442.root/tree");
108     chain->Add("dimuons_DYToMuMu_M-20_CT10_TuneZ2_7TeV-Fall10.root/tree");
109     tree = chain;
110     #endif // SINGLE_TREE
111    
112     }
113     Init(tree);
114     }
115    
116     tree::~tree()
117     {
118     if (!fChain) return;
119     delete fChain->GetCurrentFile();
120     }
121    
122     Int_t tree::GetEntry(Long64_t entry)
123     {
124     // Read contents of entry.
125     if (!fChain) return 0;
126     return fChain->GetEntry(entry);
127     }
128     Long64_t tree::LoadTree(Long64_t entry)
129     {
130     // Set the environment to read one entry
131     if (!fChain) return -5;
132     Long64_t centry = fChain->LoadTree(entry);
133     if (centry < 0) return centry;
134     if (!fChain->InheritsFrom(TChain::Class())) return centry;
135     TChain *chain = (TChain*)fChain;
136     if (chain->GetTreeNumber() != fCurrent) {
137     fCurrent = chain->GetTreeNumber();
138     Notify();
139     }
140     return centry;
141     }
142    
143     void tree::Init(TTree *tree)
144     {
145     // The Init() function is called when the selector needs to initialize
146     // a new tree or chain. Typically here the branch addresses and branch
147     // pointers of the tree will be set.
148     // It is normally not necessary to make changes to the generated
149     // code, but the routine can be extended by the user if needed.
150     // Init() will be called many times when running on PROOF
151     // (once per file to be processed).
152    
153     // Set branch addresses and branch pointers
154     if (!tree) return;
155     fChain = tree;
156     fCurrent = -1;
157     fChain->SetMakeClass(1);
158    
159     fChain->SetBranchAddress("eventInfo", &eventInfo_run, &b_eventInfo);
160     fChain->SetBranchAddress("reco1", &reco1, &b_reco1);
161     fChain->SetBranchAddress("reco2", &reco2, &b_reco2);
162     fChain->SetBranchAddress("recoCandMass", &recoCandMass, &b_recoCandMass);
163     fChain->SetBranchAddress("recoCandPt", &recoCandPt, &b_recoCandPt);
164     fChain->SetBranchAddress("recoCandMassCktl", &recoCandMassCktl, &b_recoCandMassCktl);
165     fChain->SetBranchAddress("recoCandPtCktl", &recoCandPtCktl, &b_recoCandPtCktl);
166     fChain->SetBranchAddress("cocktail1", &cocktail1_charge, &b_cocktail1);
167     fChain->SetBranchAddress("cocktail2", &cocktail2_charge, &b_cocktail2);
168     Notify();
169     }
170    
171     Bool_t tree::Notify()
172     {
173     // The Notify() function is called when a new file is opened. This
174     // can be either for a new TTree in a TChain or when when a new TTree
175     // is started when using PROOF. It is normally not necessary to make changes
176     // to the generated code, but the routine can be extended by the
177     // user if needed. The return value is currently not used.
178    
179     return kTRUE;
180     }
181    
182     void tree::Show(Long64_t entry)
183     {
184     // Print contents of entry.
185     // If entry is not specified, print current entry
186     if (!fChain) return;
187     fChain->Show(entry);
188     }
189     Int_t tree::Cut(Long64_t entry)
190     {
191     // This function may be called from Loop.
192     // returns 1 if entry is accepted.
193     // returns -1 otherwise.
194     return 1;
195     }
196     #endif // #ifdef tree_cxx