test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UEAnalysisOnRootple.h
Go to the documentation of this file.
1 // This class has been automatically generated on
3 // Tue Sep 11 11:54:39 2007 by ROOT version 5.14/00b
4 // from TTree UEAnalysisTree/UE Analysis Tree
5 // found on file: MB_Pt05/UnderlyingEvent_RootFile_Result.root
7 
8 #ifndef UEAnalysisOnRootple_h
9 #define UEAnalysisOnRootple_h
10 
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 #include <TH1F.h>
15 #include <TProfile.h>
16 #include <TH2D.h>
17 #include <iostream>
18 #include <fstream>
19 
20 //
21 #include <TClonesArray.h>
22 #include <TObjString.h>
23 //
24 
26 public :
27 
28  // declare file handle here
29  TFile *f;
30 
31  TTree *fChain;
32  Int_t fCurrent;
33 
34  // Declaration of leave types
35  Int_t EventKind;
37  Float_t MomentumMC[1000]; //[NumberMCParticles]
38  Float_t TransverseMomentumMC[1000]; //[NumberMCParticles]
39  Float_t EtaMC[1000]; //[NumberMCParticles]
40  Float_t PhiMC[1000]; //[NumberMCParticles]
41  Int_t NumberTracks;
42  Float_t MomentumTK[1000]; //[NumberTracks]
43  Float_t TrasverseMomentumTK[1000]; //[NumberTracks]
44  Float_t EtaTK[1000]; //[NumberTracks]
45  Float_t PhiTK[1000]; //[NumberTracks]
47  Float_t MomentumIJ[1000]; //[NumberInclusiveJet]
48  Float_t TrasverseMomentumIJ[1000]; //[NumberInclusiveJet]
49  Float_t EtaIJ[1000]; //[NumberInclusiveJet]
50  Float_t PhiIJ[1000]; //[NumberInclusiveJet]
52  Float_t MomentumCJ[1000]; //[NumberChargedJet]
53  Float_t TrasverseMomentumCJ[1000]; //[NumberChargedJet]
54  Float_t EtaCJ[1000]; //[NumberChargedJet]
55  Float_t PhiCJ[1000]; //[NumberChargedJet]
57  Float_t MomentumTJ[1000]; //[NumberTracksJet]
58  Float_t TrasverseMomentumTJ[1000]; //[NumberTracksJet]
59  Float_t EtaTJ[1000]; //[NumberTracksJet]
60  Float_t PhiTJ[1000]; //[NumberTracksJet]
62  Float_t MomentumEHJ[1000]; //[NumberCaloJet]
63  Float_t TrasverseMomentumEHJ[1000]; //[NumberCaloJet]
64  Float_t EtaEHJ[1000]; //[NumberCaloJet]
65  Float_t PhiEHJ[1000]; //[NumberCaloJet]
66 
67  //
68  TClonesArray *acceptedTriggers;
69  //
70 
71  // List of branches
72  TBranch *b_EventKind;
74  TBranch *b_MomentumMC;
76  TBranch *b_EtaMC;
77  TBranch *b_PhiMC;
78  TBranch *b_NumberTracks;
79  TBranch *b_MomentumTK;
81  TBranch *b_EtaTK;
82  TBranch *b_PhiTK;
84  TBranch *b_MomentumIJ;
86  TBranch *b_EtaIJ;
87  TBranch *b_PhiIJ;
88  TBranch *b_NumberChargedJet;
89  TBranch *b_MomentumCJ;
91  TBranch *b_EtaCJ;
92  TBranch *b_PhiCJ;
93  TBranch *b_NumberTracksJet;
94  TBranch *b_MomentumTJ;
96  TBranch *b_EtaTJ;
97  TBranch *b_PhiTJ;
98  TBranch *b_NumberCaloJet;
99  TBranch *b_MomentumEHJ;
101  TBranch *b_EtaEHJ;
102  TBranch *b_PhiEHJ;
103 
104  //
106  //
107 
108 
109  //Charged Jet caharacterization
110  TH1F* dr_chgcalo;
111  TH1F* dr_chginc;
113  TH1F* dr_caloinc;
114  TH1F* numb_cal;
115  TH1F* pT_cal;
116  TH1F* eta_cal;
117  TH1F* eta_cal_res;
118  TH1F* phi_cal;
119  TH1F* phi_cal_res;
120  TH1F* numb_chgmc;
121  TH1F* pT_chgmc;
122  TH1F* eta_chgmc;
124  TH1F* phi_chgmc;
127  TH1F* pT_chgreco;
128  TH1F* eta_chgreco;
130  TH1F* phi_chgreco;
132  TH1F* numb_inc;
133  TH1F* pT_inc;
134  TH1F* eta_inc;
135  TH1F* phi_inc;
136  TProfile* calib_chgcalo;
137  TProfile* calib_chginc;
138  TProfile* calib_chgmcreco;
139  TProfile* calib_caloinc;
140  TProfile* calib_chgcalo_eta;
141  TProfile* calib_chginc_eta;
143  TProfile* calib_caloinc_eta;
144  TProfile* calib_chgcalo_phi;
145  TProfile* calib_chginc_phi;
147  TProfile* calib_caloinc_phi;
148 
149  //Underlying Event analysis
153 
154  TProfile* pdN_vs_etaMC;
155  TProfile* pdN_vs_ptMC;
156 
157  TProfile* pdN_vs_dphiMC;
158  TProfile* pdPt_vs_dphiMC;
159 
160  // add histo on fluctuation in UE
162 
163 
164  TProfile* pdN_vs_ptJTransMC;
171  TProfile* pdN_vs_ptJAwayMC;
173  TProfile* pdPt_vs_ptJAwayMC;
174 
175  TH1F* temp1MC;
176  TH1F* temp2MC;
177  TH1F* temp3MC;
178  TH1F* temp4MC;
179 
183 
184  TProfile* pdN_vs_etaRECO;
185  TProfile* pdN_vs_ptRECO;
186 
187  TProfile* pdN_vs_dphiRECO;
188  TProfile* pdPt_vs_dphiRECO;
189 
200 
211 
212  TH1F* temp1RECO;
213  TH1F* temp2RECO;
214  TH1F* temp3RECO;
215  TH1F* temp4RECO;
216 
217  TH1D* fNumbMPIMC;
224 
232 
233 
234 
235  Float_t etaRegion;
236  Float_t piG;
237  Float_t rangePhi;
238  Float_t ptThreshold;
239 
241  virtual ~UEAnalysisOnRootple();
242  virtual Int_t Cut(Long64_t entry);
243  virtual Int_t GetEntry(Long64_t entry);
244  virtual Long64_t LoadTree(Long64_t entry);
245  virtual void MultiAnalysis(char* filelist,char* outname,Float_t weight[13],Float_t eta,Float_t triggerPt,std::string type,std::string trigger,std::string tkpt,Float_t ptCut);
246  virtual void Init(TTree *tree);
247  virtual void BeginJob(char* outname);
248  virtual void EndJob();
249  virtual void Loop(Float_t we,Float_t triggerPt,std::string type,std::string trigger,std::string tkpt);
250  virtual Bool_t Notify();
251  virtual void Show(Long64_t entry = -1);
252  virtual void UEAnalysisMC(Float_t weight,std::string tkpt);
253  virtual void UEAnalysisRECO(Float_t weight,std::string tkpt);
254  virtual void JetCalibAnalysis(Float_t weight,std::string tkpt);
255  virtual void MPIAnalysisMC(Float_t weight,std::string tkpt);
256  virtual void MPIAnalysisRECO(Float_t weight,std::string tkpt);
257  Float_t CalibrationPt(Float_t ptReco,std::string tkpt);
258  Float_t CorrectionPtTrans(Float_t ptReco,std::string tkpt);
259  Float_t CorrectionPtToward(Float_t ptReco,std::string tkpt);
260  Float_t CorrectionPtAway(Float_t ptReco,std::string tkpt);
261  Float_t CorrectionNTrans(Float_t ptReco,std::string tkpt);
262  Float_t CorrectionNToward(Float_t ptReco,std::string tkpt);
263  Float_t CorrectionNAway(Float_t ptReco,std::string tkpt);
264 
265  TFile* hFile;
266 
267 };
268 
269 #endif
270 
271 #ifdef UEAnalysisOnRootple_cxx
272 
274 {
275  std::cout << "UEAnalysisOnRootple constructor " <<std::endl;
276 }
277 
279 {
280  if (!fChain) return;
281  delete fChain->GetCurrentFile();
282 }
283 
284 Int_t UEAnalysisOnRootple::GetEntry(Long64_t entry)
285 {
286 // Read contents of entry.
287  if (!fChain) return 0;
288  return fChain->GetEntry(entry);
289 }
290 Long64_t UEAnalysisOnRootple::LoadTree(Long64_t entry)
291 {
292 // Set the environment to read one entry
293  if (!fChain) return -5;
294  Long64_t centry = fChain->LoadTree(entry);
295  if (centry < 0) return centry;
296  if (!fChain->InheritsFrom(TChain::Class())) return centry;
297  TChain *chain = (TChain*)fChain;
298  if (chain->GetTreeNumber() != fCurrent) {
299  fCurrent = chain->GetTreeNumber();
300  Notify();
301  }
302  return centry;
303 }
304 
305 void UEAnalysisOnRootple::Init(TTree *tree)
306 {
307  // The Init() function is called when the selector needs to initialize
308  // a new tree or chain. Typically here the branch addresses and branch
309  // pointers of the tree will be set.
310  // It is normaly not necessary to make changes to the generated
311  // code, but the routine can be extended by the user if needed.
312  // Init() will be called many times when running on PROOF
313  // (once per file to be processed).
314 
315  // allocate space for file handle here
316  f = new TFile;
317 
318  // Set branch addresses and branch pointers
319  if (!tree) return;
320  fChain = tree;
321  fCurrent = -1;
322  fChain->SetMakeClass(1);
323 
324  //
325  acceptedTriggers = 0;
326  fChain->SetBranchAddress("acceptedTriggers", &acceptedTriggers, &b_acceptedTriggers);
327  //
328 
329  fChain->SetBranchAddress("EventKind", &EventKind, &b_EventKind);
330  fChain->SetBranchAddress("NumberMCParticles", &NumberMCParticles, &b_NumberMCParticles);
331  fChain->SetBranchAddress("MomentumMC", MomentumMC, &b_MomentumMC);
332  fChain->SetBranchAddress("TransverseMomentumMC", TransverseMomentumMC, &b_TransverseMomentumMC);
333  fChain->SetBranchAddress("EtaMC", EtaMC, &b_EtaMC);
334  fChain->SetBranchAddress("PhiMC", PhiMC, &b_PhiMC);
335  fChain->SetBranchAddress("NumberTracks", &NumberTracks, &b_NumberTracks);
336  fChain->SetBranchAddress("MomentumTK", MomentumTK, &b_MomentumTK);
337  fChain->SetBranchAddress("TrasverseMomentumTK", TrasverseMomentumTK, &b_TrasverseMomentumTK);
338  fChain->SetBranchAddress("EtaTK", EtaTK, &b_EtaTK);
339  fChain->SetBranchAddress("PhiTK", PhiTK, &b_PhiTK);
340  fChain->SetBranchAddress("NumberInclusiveJet", &NumberInclusiveJet, &b_NumberInclusiveJet);
341  fChain->SetBranchAddress("MomentumIJ", MomentumIJ, &b_MomentumIJ);
342  fChain->SetBranchAddress("TrasverseMomentumIJ", TrasverseMomentumIJ, &b_TrasverseMomentumIJ);
343  fChain->SetBranchAddress("EtaIJ", EtaIJ, &b_EtaIJ);
344  fChain->SetBranchAddress("PhiIJ", PhiIJ, &b_PhiIJ);
345  fChain->SetBranchAddress("NumberChargedJet", &NumberChargedJet, &b_NumberChargedJet);
346  fChain->SetBranchAddress("MomentumCJ", MomentumCJ, &b_MomentumCJ);
347  fChain->SetBranchAddress("TrasverseMomentumCJ", TrasverseMomentumCJ, &b_TrasverseMomentumCJ);
348  fChain->SetBranchAddress("EtaCJ", EtaCJ, &b_EtaCJ);
349  fChain->SetBranchAddress("PhiCJ", PhiCJ, &b_PhiCJ);
350  fChain->SetBranchAddress("NumberTracksJet", &NumberTracksJet, &b_NumberTracksJet);
351  fChain->SetBranchAddress("MomentumTJ", MomentumTJ, &b_MomentumTJ);
352  fChain->SetBranchAddress("TrasverseMomentumTJ", TrasverseMomentumTJ, &b_TrasverseMomentumTJ);
353  fChain->SetBranchAddress("EtaTJ", EtaTJ, &b_EtaTJ);
354  fChain->SetBranchAddress("PhiTJ", PhiTJ, &b_PhiTJ);
355  fChain->SetBranchAddress("NumberCaloJet", &NumberCaloJet, &b_NumberCaloJet);
356  fChain->SetBranchAddress("MomentumEHJ", MomentumEHJ, &b_MomentumEHJ);
357  fChain->SetBranchAddress("TrasverseMomentumEHJ", TrasverseMomentumEHJ, &b_TrasverseMomentumEHJ);
358  fChain->SetBranchAddress("EtaEHJ", EtaEHJ, &b_EtaEHJ);
359  fChain->SetBranchAddress("PhiEHJ", PhiEHJ, &b_PhiEHJ);
360  Notify();
361 }
362 
364 {
365  // The Notify() function is called when a new file is opened. This
366  // can be either for a new TTree in a TChain or when when a new TTree
367  // is started when using PROOF. It is normaly not necessary to make changes
368  // to the generated code, but the routine can be extended by the
369  // user if needed. The return value is currently not used.
370 
371  return kTRUE;
372 }
373 
374 void UEAnalysisOnRootple::Show(Long64_t entry)
375 {
376 // Print contents of entry.
377 // If entry is not specified, print current entry
378  if (!fChain) return;
379  fChain->Show(entry);
380 }
381 
382 Int_t UEAnalysisOnRootple::Cut(Long64_t entry)
383 {
384 // This function may be called from Loop.
385 // returns 1 if entry is accepted.
386 // returns -1 otherwise.
387  return 1;
388 }
389 #endif
virtual void UEAnalysisMC(Float_t weight, std::string tkpt)
type
Definition: HCALResponse.h:21
virtual void MPIAnalysisRECO(Float_t weight, std::string tkpt)
Float_t CorrectionNToward(Float_t ptReco, std::string tkpt)
Float_t CorrectionPtToward(Float_t ptReco, std::string tkpt)
Float_t TrasverseMomentumIJ[1000]
Float_t CorrectionNAway(Float_t ptReco, std::string tkpt)
virtual Bool_t Notify()
virtual void JetCalibAnalysis(Float_t weight, std::string tkpt)
Float_t TrasverseMomentumTJ[1000]
virtual ~UEAnalysisOnRootple()
TProfile * pdN_vs_ptCJTransMinRECO
Float_t TrasverseMomentumEHJ[1000]
TProfile * pPtRatio_vs_PtJleadRECO
Int_t fCurrent
pointer to the analyzed TTree or TChain
virtual void BeginJob(char *outname)
Float_t CorrectionNTrans(Float_t ptReco, std::string tkpt)
virtual void Loop(Float_t we, Float_t triggerPt, std::string type, std::string trigger, std::string tkpt)
Float_t TransverseMomentumMC[1000]
Float_t CorrectionPtTrans(Float_t ptReco, std::string tkpt)
virtual void Init(TTree *tree)
Float_t TrasverseMomentumCJ[1000]
Int_t EventKind
current Tree number in a TChain
virtual Int_t GetEntry(Long64_t entry)
TProfile * pdPt_vs_ptJTransMinRECO
TProfile * pdN_vs_ptCJTransMaxRECO
virtual Int_t Cut(Long64_t entry)
Float_t CalibrationPt(Float_t ptReco, std::string tkpt)
virtual void MultiAnalysis(char *filelist, char *outname, Float_t weight[13], Float_t eta, Float_t triggerPt, std::string type, std::string trigger, std::string tkpt, Float_t ptCut)
virtual void EndJob()
TProfile * pPtRatio_vs_PhiJleadRECO
TClonesArray * acceptedTriggers
TProfile * pdPt_vs_ptCJTransMinRECO
virtual Long64_t LoadTree(Long64_t entry)
virtual void MPIAnalysisMC(Float_t weight, std::string tkpt)
TProfile * pdPt_vs_ptJTransMaxRECO
virtual void UEAnalysisRECO(Float_t weight, std::string tkpt)
list entry
Definition: mps_splice.py:62
tuple cout
Definition: gather_cfg.py:145
TProfile * pdPt_vs_ptCJTransMaxRECO
virtual void Show(Long64_t entry=-1)
TProfile * pPtRatio_vs_EtaJleadRECO
Float_t CorrectionPtAway(Float_t ptReco, std::string tkpt)
Float_t TrasverseMomentumTK[1000]