ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/yangyong/combineICEE/testSelection_cluster.h
Revision: 1.1
Committed: Tue Apr 10 20:03:11 2012 UTC (13 years, 1 month ago) by yangyong
Content type: text/plain
Branch: MAIN
CVS Tags: V2012comb, pi0etaee_laser20111122_eefloatalpha, HEAD
Log Message:
LaserTag:
EcalLaserAPDPNRatios_data_20111122_158851_180363
and alpha Tag ( for Endcap Only)
EcalLaserAlphas_lto420-620_progr_data_20111122

File Contents

# Content
1
2 TChain *fChain;
3
4 int dataflag;
5
6 int totalEntries;
7
8
9 int totalEntriesL1;
10
11
12 int entry;
13
14
15 int doBarrel;
16 int doEndcap;
17
18 int trigger;
19
20
21 float ptminCut;
22 float ptpairCut;
23 float s4s9Cut;
24 float s9s25Cut;
25 float isoCut;
26
27
28 // L1 objects
29 static const int MAXL1OBJ = 20;
30 // static const int MAXL1BITS = 128;
31 // L1 EM isolated objects
32 int nL1EMIso;
33 float L1EMIso_e[MAXL1OBJ];
34 float L1EMIso_et[MAXL1OBJ];
35 float L1EMIso_eta[MAXL1OBJ];
36 float L1EMIso_phi[MAXL1OBJ];
37 // L1 EM non-isolated objects
38 int nL1EMnonIso;
39 float L1EMnonIso_e[MAXL1OBJ];
40 float L1EMnonIso_et[MAXL1OBJ];
41 float L1EMnonIso_eta[MAXL1OBJ];
42 float L1EMnonIso_phi[MAXL1OBJ];
43
44 int bunchX;
45 int orbitNumber;
46 int evtTime;
47
48 int runNumber;
49 int evtNumber;
50 int lumiBlock;
51 static const int MAXL1bits = 500;
52 static const int MAXHLTbits = 500;
53 int nL1bits;
54 int L1bits[MAXL1bits];
55
56 int nL1Alca;
57 int L1Alca[MAXL1bits];
58
59
60 int nL1bitsTech;
61 int L1bitsTech[MAXL1bits];
62
63 int psL1;
64 int L1Cut;
65
66 int dpsL1DecisionWord8E29v3;
67 int dpsL1DecisionWord8E29v3_1;
68 int dpsL1DecisionWord8E29v3_2;
69 int dpsL1DecisionWord8E29v3_3;
70 int dpsL1DecisionWord8E29v3_4;
71 int dpsL1DecisionWord8E29v3_5;
72 int dpsL1DecisionWord8E29v4;
73
74 int dpsL1bits8E29v3[MAXL1bits];
75
76 int dpsL1bits8E29v3_1[MAXL1bits];
77 int dpsL1bits8E29v3_2[MAXL1bits];
78 int dpsL1bits8E29v3_3[MAXL1bits];
79 int dpsL1bits8E29v3_4[MAXL1bits];
80 int dpsL1bits8E29v3_5[MAXL1bits];
81
82
83 int dpsL1bits8E29v4[MAXL1bits];
84
85 int iCountL1NoPrescale8E29v3[500]; ///2009.06.27
86
87 int iCountL1NoPrescale8E29v3_1[500]; ///2009.06.27 EG PS = 10
88 int iCountL1NoPrescale8E29v3_2[500]; ///2009.06.27 EG PS = 20
89 int iCountL1NoPrescale8E29v3_3[500]; ///2009.06.27 EG PS = 50
90 int iCountL1NoPrescale8E29v3_4[500]; ///2009.06.27 EG PS = 2
91 int iCountL1NoPrescale8E29v3_5[500]; ///2009.06.27 EG PS = 4
92
93
94 int iCountL1NoPrescale8E29v4[500]; ///2009.06.27, prescale 100 for EG5, Jet6,10,20
95
96
97 float xOffPVwithBS;
98 float yOffPVwithBS;
99 float zOffPVwithBS;
100
101
102 static const int MAXGenPIZ = 1000;
103
104 int nGenpi0;
105 int nGeneta;
106 float etaGenpi0[MAXGenPIZ];
107 float phiGenpi0[MAXGenPIZ];
108 float etGenpi0[MAXGenPIZ];
109 float eGenpi0[MAXGenPIZ];
110 float mGenpi0[MAXGenPIZ];
111 float dr2phGenpi0[MAXGenPIZ];
112 float dr2phGeneta[MAXGenPIZ];
113 float etaGeneta[MAXGenPIZ];
114 float phiGeneta[MAXGenPIZ];
115 float etGeneta[MAXGenPIZ];
116 float eGeneta[MAXGenPIZ];
117 float ePhtGenpi0[MAXGenPIZ][2];
118 float etaPhtGenpi0[MAXGenPIZ][2];
119 float phiPhtGenpi0[MAXGenPIZ][2];
120 float ePhtGeneta[MAXGenPIZ][2];
121 float etaPhtGeneta[MAXGenPIZ][2];
122 float phiPhtGeneta[MAXGenPIZ][2];
123 float vtxGenpi0[MAXGenPIZ][3];
124 float vtxPhtGenpi0[MAXGenPIZ][3];
125 float vtxGeneta[MAXGenPIZ][3];
126 float vtxPhtGeneta[MAXGenPIZ][3];
127
128
129 int pidMomGenpi0[MAXGenPIZ];
130 int barcodeMomGenpi0[MAXGenPIZ];
131
132 int pidMomGeneta[MAXGenPIZ];
133 int barcodeMomGeneta[MAXGenPIZ];
134
135 int isConvPhtGeneta[MAXGenPIZ][2];
136 float convPht1Geneta[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
137 float convPht2Geneta[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
138
139 int isConvPhtGenpi0[MAXGenPIZ][2];
140 float convPht1Genpi0[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
141 float convPht2Genpi0[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
142 float convVtxPhtGenpi0[MAXGenPIZ][6];
143 float convVtxPhtGeneta[MAXGenPIZ][6];
144
145 static const int MAX3x3ClusEB = 2000;
146 int n3x3ClusEB;
147 float e3x3ClusEB[MAX3x3ClusEB];
148 float eta3x3ClusEB[MAX3x3ClusEB];
149 float phi3x3ClusEB[MAX3x3ClusEB];
150
151 ///tmp by simplelog
152 float leta3x3ClusEB[MAX3x3ClusEB];
153 float lphi3x3ClusEB[MAX3x3ClusEB];
154
155
156 float x3x3ClusEB[MAX3x3ClusEB];
157 float y3x3ClusEB[MAX3x3ClusEB];
158 float z3x3ClusEB[MAX3x3ClusEB];
159
160 int nXt3x3ClusEB[MAX3x3ClusEB];
161 float eXt3x3ClusEB[MAX3x3ClusEB][9];
162 int ietaXt3x3ClusEB[MAX3x3ClusEB][9]; ///index from -85,0,84; ,
163 int iphiXt3x3ClusEB[MAX3x3ClusEB][9]; ///phi, 0,359
164 float etaXt3x3ClusEB[MAX3x3ClusEB][9];
165 float phiXt3x3ClusEB[MAX3x3ClusEB][9];
166
167
168 float xXt3x3ClusEB[MAX3x3ClusEB][9];
169 float yXt3x3ClusEB[MAX3x3ClusEB][9];
170 float zXt3x3ClusEB[MAX3x3ClusEB][9];
171 float S43x3ClusEB[MAX3x3ClusEB];
172 float S63x3ClusEB[MAX3x3ClusEB];
173 float S253x3ClusEB[MAX3x3ClusEB];
174
175 float s4s93x3ClusEB[MAX3x3ClusEB];
176 float s6s93x3ClusEB[MAX3x3ClusEB];
177 float s9s253x3ClusEB[MAX3x3ClusEB];
178
179
180
181 static const int MAX3x3ClusEE = 2000;
182 int n3x3ClusEE;
183 float e3x3ClusEE[MAX3x3ClusEE];
184 float eta3x3ClusEE[MAX3x3ClusEE];
185 float phi3x3ClusEE[MAX3x3ClusEE];
186
187 ///tmp by simplelog
188 float leta3x3ClusEE[MAX3x3ClusEE];
189 float lphi3x3ClusEE[MAX3x3ClusEE];
190 float tXt3x3ClusEB[MAX3x3ClusEB][9];
191
192 float x3x3ClusEE[MAX3x3ClusEE];
193 float y3x3ClusEE[MAX3x3ClusEE];
194 float z3x3ClusEE[MAX3x3ClusEE];
195
196 int nXt3x3ClusEE[MAX3x3ClusEE];
197 float eXt3x3ClusEE[MAX3x3ClusEE][9];
198 int ixXt3x3ClusEE[MAX3x3ClusEE][9]; ///index from -85,0,84; ,
199 int iyXt3x3ClusEE[MAX3x3ClusEE][9]; ///phi, 0,359
200 int izXt3x3ClusEE[MAX3x3ClusEE][9]; ///phi, 0,359
201
202 float etaXt3x3ClusEE[MAX3x3ClusEE][9];
203 float phiXt3x3ClusEE[MAX3x3ClusEE][9];
204 float tXt3x3ClusEE[MAX3x3ClusEE][9];
205
206 float xXt3x3ClusEE[MAX3x3ClusEE][9];
207 float yXt3x3ClusEE[MAX3x3ClusEE][9];
208 float zXt3x3ClusEE[MAX3x3ClusEE][9];
209 float S43x3ClusEE[MAX3x3ClusEE];
210 float S63x3ClusEE[MAX3x3ClusEE];
211 float S253x3ClusEE[MAX3x3ClusEE];
212
213 float s4s93x3ClusEE[MAX3x3ClusEE];
214 float s6s93x3ClusEE[MAX3x3ClusEE];
215 float s9s253x3ClusEE[MAX3x3ClusEE];
216
217
218 float xEBAll[170][360]; ///eta -85, -1, 1, 86, [0,169]. phi, 1,360, [0,359];
219 float yEBAll[170][360];
220 float zEBAll[170][360];
221 float etaEBAll[170][360];
222 float phiEBAll[170][360];
223
224 float dxEBAll[170][360]; ///eta -85, -1, 1, 86, [0,169]. phi, 1,360, [0,359];
225 float dyEBAll[170][360];
226 float dzEBAll[170][360];
227
228 float xEEAll[2][101][101];
229 float yEEAll[2][101][101];
230 float zEEAll[2][101][101];
231 float etaEEAll[2][101][101];
232 float phiEEAll[2][101][101];
233
234
235 float dxEEAll[2][101][101];
236 float dyEEAll[2][101][101];
237 float dzEEAll[2][101][101];
238 int nCrystalCut;
239 int doPizEta;
240 bool useGenVtxforRecoGenMatch;
241 int dataOrMC;
242
243 vector<int> L1bitsUsed;
244 vector<int> L1bitsTechUsed;
245
246 vector<int> L1bitsNotUsed;
247 vector<int> L1bitsTechNotUsed;
248
249 ofstream txtout;
250 int useRecVtxforReco ;
251 int vetoRunList;
252 int evtNotUse;
253 int applyBPTX;
254 int procID;
255 int vetoBeamSrape;
256
257 int nPxlHits ;
258 float clusVtxQual;
259
260 int nHfTowersP ;
261 int nHfTowersN ;
262
263 float sumHfEsubEpPlus;
264 float sumHfEsubEpMinus;
265
266 float sumHfEaddEpPlus;
267 float sumHfEaddEpMinus;
268
269
270 int phyDeclared;
271
272 float highPurityTrackFrac;
273 static const int MAXTRK = 5000;
274 int nTracks;
275 float pxTracks[MAXTRK];
276 float pyTracks[MAXTRK];
277 float pzTracks[MAXTRK];
278 float pTracks[MAXTRK];
279 float ptTracks[MAXTRK];
280 float etaTracks[MAXTRK];
281 float phiTracks[MAXTRK];
282 int pidTracks[MAXTRK];
283 int chargeTracks[MAXTRK];
284 float vxTracks[MAXTRK];
285 float vyTracks[MAXTRK];
286 float vzTracks[MAXTRK];
287 int nhitsTracks[MAXTRK];
288 float nChi2Tracks[MAXTRK];
289 int algoTracks[MAXTRK];
290 int ndofTracks[MAXTRK];
291 int nValidhitsTracks[MAXTRK];
292 int nValidpixelhitsTracks[MAXTRK];
293 int nValidstriphitsTracks[MAXTRK];
294 int qualityFlagTracks[MAXTRK];
295
296 float vBeamSpot[3];
297 int hfCoindence;
298 int vetoHighHitPxl;
299 int recalcs4s9;
300 int applyEnCorr;
301 int corrSeedEnScale;
302 float eSeed;
303 int vetoSpike;
304 int applyPhyDeclare;
305 int validVtx;
306 int NtrkOffPVwithBS;
307 float ptminCut_ee;
308 float s4s9Cut_ee;
309 float s9s25Cut_ee;
310 int passEG3;
311 int passEG2;
312 int passEG4;
313 int passEG5;
314
315
316
317
318 ///make above in one
319 ///first one mean ncut
320 ///at most 10 cuts, 100 steps each.
321 float variable[10];
322 const int ncuts = 5;
323 ///min max cut
324 float init_cutValue[10][2];
325 int nstepCut[10];
326 float cutValues[10][100];
327
328 const int nstepsMAX = 31;
329 //at most 20 steps.
330 int nSigPassed[nstepsMAX][nstepsMAX][nstepsMAX][nstepsMAX][nstepsMAX];
331 int nBkgPassed[nstepsMAX][nstepsMAX][nstepsMAX][nstepsMAX][nstepsMAX];
332
333
334 int IsSignal;
335 int IsBkgrd;
336 int indexBestCuts1[10];
337 int indexBestCuts2[10];
338
339 float isolation;
340
341
342 ///for differetn fom
343 int indexBestCuts[10][10];
344
345 //SB>0.5,0.6...
346 int indexBestCuts_SB[10][10][10];
347
348
349 ///for different fom and cuts
350 TH1F *hh_fom[10][10];
351
352
353 Float_t mpair;
354 Float_t ptpair;
355 Int_t pizMatched;
356 Int_t etaMatched;
357 Int_t pizMatchedv1;
358 Int_t etaMatchedv1;
359 Float_t ptmin;
360 Float_t s4s9min;
361 Float_t s9s25min;
362 Float_t iso;
363 Float_t isoeta;
364 Float_t isov1;
365 Float_t isoetav1;
366 Float_t isov2;
367 Float_t isoetav2;
368 Int_t passL1;
369 Int_t nxt9[2];
370 Int_t seediEta[2];
371 Int_t seediPhi[2];
372
373 int doEcut;
374
375 int testAbsoluteIso;
376 float ptminOpt;
377 int izXt3x3ClusEB[MAX3x3ClusEB][9];
378 Int_t seediZ[2];
379 Float_t etapair;
380 int isoflag;
381 int ptCutSetee;
382 int testpizwind;
383 float eSeed_ee;
384 int fullunpack;
385
386
387 TTree *pizTree;
388
389
390 TTree *etaTree;
391
392 float mpair_3x3;
393 int nxtClus1;
394 float eXtalClus1[25];
395 int ietaXtalClus1[25];
396 int iphiXtalClus1[25];
397 float tXtalClus1[25];
398 int fXtalClus1[25];
399 int nxtClus2;
400 float eXtalClus2[25];
401 int ietaXtalClus2[25];
402 int iphiXtalClus2[25];
403 float tXtalClus2[25];
404 int fXtalClus2[25];
405 int savePizTree;
406
407
408 int passBSC40or41;
409 int passBSC34;
410 int passHF;
411 int passBeamScrape;
412 int passVtx;
413 int passBeamHalo;
414 int passBSC0;
415 int passHighHitPxl;
416 int rmOverlap;
417 float mpairv1;
418 float phipair;
419 float geninfo[6];
420 int start_entry;
421 int end_entry;
422 int calibMethod;
423 int applyCorrEta;
424 int applyCorrPhi;
425 int applyCorrDead;
426
427
428 double corrfactorEta[170];
429 double corrfactorEtatb[170];
430 double corrfactorEtaco[170];
431 double corrfactorPhi[360];
432 double corrfactoriEtaiPhi[170][360];
433
434 ///pre-calib ( all 1) or phi-sym or BS
435 double preCalibiEtaiPhi[170][360];
436
437
438 int iterStep;
439
440 int cutset;
441 int evtRange;
442 int flagiEtaiPhi[170][360];
443 int usePreCalib;
444 int useVtx;
445 float randGausiEtaiPhi[170][360];
446
447 const int kEndcEtaRings = 39;
448 float eta_ring_ee[kEndcEtaRings];
449 float etaBoundary_ee[kEndcEtaRings+1];
450 int nxtal_ring_ee[kEndcEtaRings];
451 float eta_ring_eezside[2][kEndcEtaRings];
452 float etaBoundary_eezside[2][kEndcEtaRings+1];
453
454
455 ///calibration constant fro endcap
456 double corrfactorEtaRings[2][kEndcEtaRings];
457 double corrfactoriZiXiY[2][101][101];
458
459 int izXtalClus1[25];
460 int izXtalClus2[25];
461
462 double corrfactorSM[36];
463 int applyCorrSM;
464 TChain *fChainAlca;
465
466 double corrfactorSM_final[36];
467
468
469
470 float Cpi0Corrv1[170][360];
471 float Cpi0v1[170][360];
472
473 float Ccombv1[170][360];
474 float CcombCorrv1[170][360];
475
476 float Cphi[170][360];
477 float CBS[170][360];
478
479 float CphiCorr[170][360];
480 float CBSCorr[170][360];
481 int flag_ietaiphi[170][360];
482 int ndead_ietaiphi[170][360];
483 int ndeadcorner_ietaiphi[170][360];
484 int ndeadside_ietaiphi[170][360];
485 int ndeadflag_ietaiphi[170][360];
486 double corrfactorDead[20] ;
487 int evtNotUsed;
488
489 ///some correction to crystals
490 double preCorrectionIetaIphi[170][360];
491 double corrfactorIetaSM[38][85];
492 double corrfactorPhiSide[2][360];
493 int validRecHitEndCap[2][101][101];
494 int flag_endcap[2][101][101];
495 int ndeadcorner_endcap[2][101][101];
496 int ndeadside_endcap[2][101][101];
497 int ndeadflag_endcap[2][101][101];