CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
hcalCalib.h
Go to the documentation of this file.
1 // This class skeleton has been automatically generated on
3 // from TTree hcalCalibTree/Tree for IsoTrack Calibration
4 // with ROOT version 5.17/02
5 //
6 // TSelector-based code for getting the HCAL resp. correction
7 // from physics events. Works for DiJet and IsoTrack calibration.
8 //
9 // Anton Anastassov (Northwestern)
10 // Email: aa@fnal.gov
11 //
12 // $Id: hcalCalib.h,v 1.4 2009/09/20 08:38:43 andreasp Exp $
13 //
15 
16 #ifndef hcalCalib_h
17 #define hcalCalib_h
18 
19 #include <vector>
20 #include <map>
21 
22 #include <TROOT.h>
23 #include <TChain.h>
24 #include <TFile.h>
25 #include <TSelector.h>
26 #include <TROOT.h>
27 #include <TChain.h>
28 #include <TFile.h>
29 #include <TSelector.h>
30 
31 #include "TLorentzVector.h"
32 #include "TClonesArray.h"
33 #include "TRefArray.h"
34 
35 // needed to get cell coordinates
37 
38 
39 class hcalCalib : public TSelector {
40 public :
41  TTree *fChain;
42 
45  Int_t iEtaHit;
47  TClonesArray *cells;
48  Float_t emEnergy;
49  Float_t targetE;
50  Float_t etVetoJet;
51 
52  Float_t xTrkHcal;
53  Float_t yTrkHcal;
54  Float_t zTrkHcal;
55  Float_t xTrkEcal;
56  Float_t yTrkEcal;
57  Float_t zTrkEcal;
58 
59  TLorentzVector *tagJetP4;
60  TLorentzVector *probeJetP4;
61 
62  Float_t tagJetEmFrac;
63  Float_t probeJetEmFrac;
64 
65  // List of branches
66  TBranch *b_eventNumber;
67  TBranch *b_runNumber;
68  TBranch *b_iEtaHit;
69  TBranch *b_iPhiHit;
70  TBranch *b_cells;
71  TBranch *b_emEnergy;
72  TBranch *b_targetE;
73  TBranch *b_etVetoJet;
74 
75  TBranch *b_xTrkHcal;
76  TBranch *b_yTrkHcal;
77  TBranch *b_zTrkHcal;
78  TBranch *b_xTrkEcal;
79  TBranch *b_yTrkEcal;
80  TBranch *b_zTrkEcal;
81 
82  TBranch *b_tagJetEmFrac;
83  TBranch *b_probeJetEmFrac;
84 
85  TBranch *b_tagJetP4;
86  TBranch *b_probeJetP4;
87 
88 
89  hcalCalib(TTree * /*tree*/ =0) { }
90  virtual ~hcalCalib() { }
91  virtual Int_t Version() const { return 2; }
92  virtual void Begin(TTree *tree);
93  // virtual void SlaveBegin(TTree *tree);
94  virtual void Init(TTree *tree);
95  virtual Bool_t Notify();
96  virtual Bool_t Process(Long64_t entry);
97  virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
98  virtual void SetOption(const char *option) { fOption = option; }
99  virtual void SetObject(TObject *obj) { fObject = obj; }
100  virtual void SetInputList(TList *input) { fInput = input; }
101  virtual TList *GetOutputList() const { return fOutput; }
102  // virtual void SlaveTerminate();
103  virtual void Terminate();
104 
105  //------------ CUTS ---------------
106  Float_t MIN_TARGET_E;
107  Float_t MAX_TARGET_E;
108 
109  Float_t MIN_CELL_E;
110  Float_t MIN_EOVERP;
111  Float_t MAX_EOVERP;
112  Float_t MAX_TRK_EME;
113 
116 
117  Bool_t SUM_DEPTHS;
119  Bool_t COMBINE_PHI;
120 
123 
125  Float_t MAX_CONE_DIST;
126 
129 
133  Float_t MIN_TAGJET_ET;
134 
136 
137  TString CALIB_TYPE; // "ISO_TRACK" or "DI_JET"
138  TString CALIB_METHOD; // L3, matrix inversion, everage then matrix inversion,...
139 
142 
144  TString HISTO_FILENAME;
145 
146 
148 
149 
150  void SetMinTargetE(Float_t e) { MIN_TARGET_E = e; }
151  void SetMaxTargetE(Float_t e) { MAX_TARGET_E = e; }
152  void SetSumDepthsFlag(Bool_t b) { SUM_DEPTHS = b; }
154  void SetCombinePhiFlag(Bool_t b) { COMBINE_PHI = b; }
155  void SetMinCellE(Float_t e) { MIN_CELL_E = e; }
156  void SetMinEOverP(Float_t e) { MIN_EOVERP = e; }
157  void SetMaxEOverP(Float_t e) { MAX_EOVERP = e; }
158  void SetMaxTrkEmE(Float_t e) { MAX_TRK_EME = e; }
159  void SetCalibType(TString s) { CALIB_TYPE = s; }
160  void SetCalibMethod(TString s) { CALIB_METHOD = s; }
161  void SetHbClusterSize(Int_t i) { HB_CLUSTER_SIZE = i; }
162  void SetHeClusterSize(Int_t i) { HE_CLUSTER_SIZE = i; }
163 
165  void SetConeMaxDist(Float_t d) { MAX_CONE_DIST = d; }
166 
169  void SetMaxEtThirdJet(Float_t et) { MAX_ET_THIRD_JET = et; }
170  void SetMinDPhiDiJets(Float_t dphi) { MIN_DPHI_DIJETS = dphi; }
175  void SetMaxTagJetAbsEta(Float_t e) { MAX_TAGJET_ABSETA = e; }
176  void SetMinTagJetEt(Float_t e) { MIN_TAGJET_ET = e; }
177  void SetMinProbeJetAbsEta(Float_t e) { MIN_PROBEJET_ABSETA = e; }
180 
181 
183 
185 
186  Bool_t ReadPhiSymCor();
187 
188  void makeTextFile();
189 
190 
191  // --------- containers passed to minimizers ----------------
192  std::vector< std::vector<Float_t> > cellEnergies;
193  std::vector< std::vector<UInt_t> > cellIds;
194  std::vector< std::pair<Int_t, UInt_t> > refIEtaIPhi; // centroid of jet or hottest tower iEta, iPhi
195  std::vector< Float_t> targetEnergies;
196 
197  std::map<UInt_t, Float_t> phiSymCor; // holds the phi symmetry corrections read from the file
198 
199  std::map<UInt_t, Float_t> solution; // correction coef: solution from L3, holds final coef for hybrid methods as well
200  std::map<Int_t, Float_t> iEtaCoefMap; // correction coef: from matrix inversion AFTER averaging, also intermediate results for hybrid methods
201 
202 
203 
204  // ClassDef(hcalCalib,0);
205 };
206 
207 #endif
208 
209 #ifdef hcalCalib_cxx
210 void hcalCalib::Init(TTree *tree)
211 {
212  // The Init() function is called when the selector needs to initialize
213  // a new tree or chain. Typically here the branch addresses and branch
214  // pointers of the tree will be set.
215  // It is normaly not necessary to make changes to the generated
216  // code, but the routine can be extended by the user if needed.
217  // Init() will be called many times when running on PROOF
218  // (once per file to be processed).
219 
220  // Set object pointer
221  cells = 0;
222  tagJetP4 = 0;
223  probeJetP4 = 0;
224 
225  // Set branch addresses and branch pointers
226  if (!tree) return;
227  fChain = tree;
228 
229  // fChain->SetMakeClass(1);
230 
231  fChain->SetBranchAddress("eventNumber", &eventNumber, &b_eventNumber);
232  fChain->SetBranchAddress("runNumber", &runNumber, &b_runNumber);
233  fChain->SetBranchAddress("iEtaHit", &iEtaHit, &b_iEtaHit);
234  fChain->SetBranchAddress("iPhiHit", &iPhiHit, &b_iPhiHit);
235  fChain->SetBranchAddress("cells", &cells, &b_cells);
236  fChain->SetBranchAddress("emEnergy", &emEnergy, &b_emEnergy);
237  fChain->SetBranchAddress("targetE", &targetE, &b_targetE);
238  fChain->SetBranchAddress("etVetoJet", &etVetoJet, &b_etVetoJet);
239 
240  fChain->SetBranchAddress("xTrkHcal", &xTrkHcal, &b_xTrkHcal);
241  fChain->SetBranchAddress("yTrkHcal", &yTrkHcal, &b_yTrkHcal);
242  fChain->SetBranchAddress("zTrkHcal", &zTrkHcal, &b_zTrkHcal);
243  fChain->SetBranchAddress("xTrkEcal", &xTrkEcal, &b_xTrkEcal);
244  fChain->SetBranchAddress("yTrkEcal", &yTrkEcal, &b_yTrkEcal);
245  fChain->SetBranchAddress("zTrkEcal", &zTrkEcal, &b_zTrkEcal);
246 
247  fChain->SetBranchAddress("tagJetEmFrac", &tagJetEmFrac, &b_tagJetEmFrac);
248  fChain->SetBranchAddress("probeJetEmFrac", &probeJetEmFrac, &b_probeJetEmFrac);
249 
250  fChain->SetBranchAddress("tagJetP4", &tagJetP4, &b_tagJetP4);
251  fChain->SetBranchAddress("probeJetP4", &probeJetP4, &b_probeJetP4);
252 
253 
254 
255 }
256 
257 Bool_t hcalCalib::Notify()
258 {
259  // The Notify() function is called when a new file is opened. This
260  // can be either for a new TTree in a TChain or when when a new TTree
261  // is started when using PROOF. It is normaly not necessary to make changes
262  // to the generated code, but the routine can be extended by the
263  // user if needed. The return value is currently not used.
264 
265  return kTRUE;
266 }
267 
268 #endif // #ifdef hcalCalib_cxx
void SetMaxTagJetAbsEta(Float_t e)
Definition: hcalCalib.h:175
void SetHbClusterSize(Int_t i)
Definition: hcalCalib.h:161
int i
Definition: DBlmapReader.cc:9
std::map< Int_t, Float_t > iEtaCoefMap
Definition: hcalCalib.h:200
virtual void SetOption(const char *option)
Definition: hcalCalib.h:98
void SetMinTagJetEt(Float_t e)
Definition: hcalCalib.h:176
virtual Bool_t Process(Long64_t entry)
Definition: hcalCalib.cc:143
TBranch * b_iEtaHit
Definition: hcalCalib.h:68
TTree * fChain
Definition: hcalCalib.h:41
UInt_t eventNumber
pointer to the analyzed TTree or TChain
Definition: hcalCalib.h:43
Float_t MAX_TARGET_E
Definition: hcalCalib.h:107
TBranch * b_etVetoJet
Definition: hcalCalib.h:73
TString PHI_SYM_COR_FILENAME
Definition: hcalCalib.h:140
void SetOutputCorCoefFileName(TString filename)
Definition: hcalCalib.h:178
void SetMaxEOverP(Float_t e)
Definition: hcalCalib.h:157
TBranch * b_yTrkEcal
Definition: hcalCalib.h:79
void SetMaxProbeJetEmFrac(Float_t f)
Definition: hcalCalib.h:173
void SetSumSmallDepthsFlag(Bool_t b)
Definition: hcalCalib.h:153
void GetCoefFromMtrxInvOfAve()
Definition: hcalCalib.cc:522
virtual TList * GetOutputList() const
Definition: hcalCalib.h:101
TBranch * b_probeJetEmFrac
Definition: hcalCalib.h:83
void SetConeMaxDist(Float_t d)
Definition: hcalCalib.h:165
void SetApplyPhiSymCorFlag(Bool_t b)
Definition: hcalCalib.h:171
TBranch * b_iPhiHit
Definition: hcalCalib.h:69
Float_t xTrkHcal
Definition: hcalCalib.h:52
TString CALIB_TYPE
Definition: hcalCalib.h:137
TLorentzVector * tagJetP4
Definition: hcalCalib.h:59
Float_t tagJetEmFrac
Definition: hcalCalib.h:62
Float_t zTrkHcal
Definition: hcalCalib.h:54
std::map< UInt_t, Float_t > phiSymCor
Definition: hcalCalib.h:197
Float_t xTrkEcal
Definition: hcalCalib.h:55
void SetMinDPhiDiJets(Float_t dphi)
Definition: hcalCalib.h:170
Float_t MAX_EOVERP
Definition: hcalCalib.h:111
Float_t targetE
Definition: hcalCalib.h:49
Bool_t SUM_DEPTHS
Definition: hcalCalib.h:117
Float_t MIN_CELL_E
Definition: hcalCalib.h:109
void SetSumDepthsFlag(Bool_t b)
Definition: hcalCalib.h:152
TLorentzVector * probeJetP4
Definition: hcalCalib.h:60
std::vector< std::pair< Int_t, UInt_t > > refIEtaIPhi
Definition: hcalCalib.h:194
void SetUseConeClustering(Bool_t b)
Definition: hcalCalib.h:164
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
Float_t yTrkEcal
Definition: hcalCalib.h:56
Int_t CALIB_ABS_IETA_MIN
Definition: hcalCalib.h:128
std::vector< Float_t > targetEnergies
Definition: hcalCalib.h:195
virtual Bool_t Notify()
virtual void Begin(TTree *tree)
Definition: hcalCalib.cc:70
TBranch * b_zTrkHcal
Definition: hcalCalib.h:77
TBranch * b_tagJetP4
Definition: hcalCalib.h:85
Int_t HE_CLUSTER_SIZE
Definition: hcalCalib.h:122
tuple obj
Example code starts here #.
Definition: VarParsing.py:655
TBranch * b_runNumber
Definition: hcalCalib.h:67
void SetHistoFileName(TString filename)
Definition: hcalCalib.h:179
void SetMinTargetE(Float_t e)
Definition: hcalCalib.h:150
Int_t iEtaHit
Definition: hcalCalib.h:45
Float_t MAX_TRK_EME
Definition: hcalCalib.h:112
TBranch * b_zTrkEcal
Definition: hcalCalib.h:80
Float_t MIN_DPHI_DIJETS
Definition: hcalCalib.h:115
Int_t HB_CLUSTER_SIZE
Definition: hcalCalib.h:121
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
void SetCaloGeometry(const CaloGeometry *g)
Definition: hcalCalib.h:182
Float_t MIN_TAGJET_ET
Definition: hcalCalib.h:133
void SetCalibAbsIEtaMax(Int_t i)
Definition: hcalCalib.h:167
TBranch * b_eventNumber
Definition: hcalCalib.h:66
void SetPhiSymCorFileName(TString filename)
Definition: hcalCalib.h:172
Bool_t APPLY_PHI_SYM_COR_FLAG
Definition: hcalCalib.h:141
Float_t zTrkEcal
Definition: hcalCalib.h:57
double f[11][100]
TBranch * b_tagJetEmFrac
Definition: hcalCalib.h:82
std::map< UInt_t, Float_t > solution
Definition: hcalCalib.h:199
Float_t emEnergy
Definition: hcalCalib.h:48
void SetMaxTargetE(Float_t e)
Definition: hcalCalib.h:151
Float_t MIN_EOVERP
Definition: hcalCalib.h:110
TBranch * b_cells
Definition: hcalCalib.h:70
void SetMaxTrkEmE(Float_t e)
Definition: hcalCalib.h:158
Float_t MIN_PROBEJET_ABSETA
Definition: hcalCalib.h:135
tuple input
Definition: collect_tpl.py:10
Bool_t COMBINE_PHI
Definition: hcalCalib.h:119
Float_t MAX_ET_THIRD_JET
Definition: hcalCalib.h:114
UInt_t iPhiHit
Definition: hcalCalib.h:46
unsigned int UInt_t
Definition: FUTypes.h:12
virtual void Init(TTree *tree)
Bool_t USE_CONE_CLUSTERING
Definition: hcalCalib.h:124
TString CALIB_METHOD
Definition: hcalCalib.h:138
TString OUTPUT_COR_COEF_FILENAME
Definition: hcalCalib.h:143
void SetMaxTagJetEmFrac(Float_t f)
Definition: hcalCalib.h:174
virtual void Terminate()
Definition: hcalCalib.cc:352
virtual void SetObject(TObject *obj)
Definition: hcalCalib.h:99
void SetCalibAbsIEtaMin(Int_t i)
Definition: hcalCalib.h:168
double b
Definition: hdecay.h:120
Int_t CALIB_ABS_IETA_MAX
Definition: hcalCalib.h:127
TBranch * b_yTrkHcal
Definition: hcalCalib.h:76
void SetCalibMethod(TString s)
Definition: hcalCalib.h:160
Float_t etVetoJet
Definition: hcalCalib.h:50
TBranch * b_emEnergy
Definition: hcalCalib.h:71
void makeTextFile()
Definition: hcalCalib.cc:673
TBranch * b_xTrkEcal
Definition: hcalCalib.h:78
Bool_t ReadPhiSymCor()
Definition: hcalCalib.cc:615
void SetCombinePhiFlag(Bool_t b)
Definition: hcalCalib.h:154
TClonesArray * cells
Definition: hcalCalib.h:47
Bool_t SUM_SMALL_DEPTHS
Definition: hcalCalib.h:118
tuple filename
Definition: lut2db_cfg.py:20
void SetCalibType(TString s)
Definition: hcalCalib.h:159
Float_t MIN_TARGET_E
Definition: hcalCalib.h:106
TString HISTO_FILENAME
Definition: hcalCalib.h:144
Float_t MAX_TAGJET_EMFRAC
Definition: hcalCalib.h:131
virtual Int_t Version() const
Definition: hcalCalib.h:91
virtual ~hcalCalib()
Definition: hcalCalib.h:90
Float_t MAX_TAGJET_ABSETA
Definition: hcalCalib.h:132
string s
Definition: asciidump.py:422
Float_t MAX_PROBEJET_EMFRAC
Definition: hcalCalib.h:130
const CaloGeometry * theCaloGeometry
Definition: hcalCalib.h:147
void SetHeClusterSize(Int_t i)
Definition: hcalCalib.h:162
std::vector< std::vector< Float_t > > cellEnergies
Definition: hcalCalib.h:192
void SetMinCellE(Float_t e)
Definition: hcalCalib.h:155
void SetMaxEtThirdJet(Float_t et)
Definition: hcalCalib.h:169
hcalCalib(TTree *=0)
Definition: hcalCalib.h:89
UInt_t runNumber
Definition: hcalCalib.h:44
std::vector< std::vector< UInt_t > > cellIds
Definition: hcalCalib.h:193
TBranch * b_xTrkHcal
Definition: hcalCalib.h:75
TBranch * b_targetE
Definition: hcalCalib.h:72
Float_t MAX_CONE_DIST
Definition: hcalCalib.h:125
Float_t yTrkHcal
Definition: hcalCalib.h:53
virtual void SetInputList(TList *input)
Definition: hcalCalib.h:100
void SetMinProbeJetAbsEta(Float_t e)
Definition: hcalCalib.h:177
Float_t probeJetEmFrac
Definition: hcalCalib.h:63
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Definition: hcalCalib.h:97
void SetMinEOverP(Float_t e)
Definition: hcalCalib.h:156
TBranch * b_probeJetP4
Definition: hcalCalib.h:86