AliPhysics  8d00e07 (8d00e07)
AliAnalysisTaskPSHFE.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE 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 /* $Id$ */
17 
18 /* AliAnalysisTaskPSHFE.cxx
19  *
20  * Macro for analysis of heavy flavour electrons
21  * -Patrick Steffanic
22  */
23 #include "AliAnalysisTaskPSHFE.h"
24 
25  #include <iostream>
26  #include <fstream>
27  #include <vector>
28  #include "Riostream.h"
29  #include "TChain.h"
30  #include "TTree.h"
31  #include "TMath.h"
32  #include "TString.h"
33  #include "TH1F.h"
34  #include "TH2F.h"
35  #include "TCanvas.h"
36  #include "TList.h"
37  #include "TF1.h"
38  #include "TGraph.h"
39  #include "TSystem.h"
40 
41  #include "AliAnalysisTaskSE.h"
42  #include "AliAnalysisManager.h"
43  #include "AliStack.h"
44  #include "AliESDtrackCuts.h"
45  #include "AliAODTrack.h"
46  #include "AliAODCaloCluster.h"
47  #include "AliAODEvent.h"
48  #include "AliAODInputHandler.h"
49  #include "AliPID.h"
50  #include "AliPIDResponse.h"
51  #include "AliTRDPIDResponse.h"
52  #include "AliEventPoolManager.h"
53 
54  using std::cout;
55 using std::endl;
56 
57 
58 ClassImp(AliAnalysisTaskPSHFE)
59 
60  //________________________________________________________________________
61  AliAnalysisTaskPSHFE::AliAnalysisTaskPSHFE() // All data members should be initialised here
63 fOutputMB(0),
64 fOutputEMC7(0),
65 fOutputEMCEGA(0),
66 fOutputEMCJet(0),
67 fTrackCutsStrong(0),
68 fTrackCutsWeak(0),
69 fPoolMan(0),
70 fPool(0),
71 UseNonSignalEvents(0),
72 MBtrg(0),
73 EMC7trg(0),
74 EMCEGAtrg(0),
75 EMCJettrg(0),
76 tagStrong(0),
77 tagPhot(0),
78 
79 
80 fHistTPCNClus_MB(0),
81 fHistITSNClus_MB(0),
82 fHistImpPar_MB(0),
83 fHistImpParTag_MB(0),
84 fHistNevents_MB(0),
85 fHistPtSum_MB(0),
86 fHistPtSumTag_MB(0),
87 fHistPtSumEMC_MB(0),
88 fHistEtaPhi_MB(0),
89 fHistEtaPhiTag_MB(0),
90 fHistEtaPhiTPCOnly_MB(0),
91 fHistDPhi28_MB(0),
92 fHistDPhiDEta28_MB(0),
93 fHistDPhiMix28_MB(0),
94 fHistDPhiDEtaMix28_MB(0),
95 fHistEMC_Had_MB_1Gev(0),
96 fHistInvMassElecLike_MB(0),
97 fHistInvMassElecUnLike_MB(0),
98 fHistOpAngElecLike_MB(0),
99 fHistOpAngElecUnLike_MB(0),
100 fHistPtAssoc_MB(0),
101 fHistPtAssocMix_MB(0),
102 fHistPtTag_MB(0),
103 fHistPhotoMismatch_MB(0),
104 fHistDPhi18Spe_MB(0),
105 
106 fHistTPCNClus_EMC7(0),
107 fHistITSNClus_EMC7(0),
108 fHistImpPar_EMC7(0),
109 fHistImpParTag_EMC7(0),
110 fHistNevents_EMC7(0),
111 fHistPtSum_EMC7(0),
112 fHistPtSumTag_EMC7(0),
113 fHistPtSumEMC_EMC7(0),
114 fHistEtaPhi_EMC7(0),
115 fHistEtaPhiTag_EMC7(0),
116 fHistDPhi28_EMC7(0),
117 fHistDPhiDEta28_EMC7(0),
118 fHistDPhiMix28_EMC7(0),
119 fHistDPhiDEtaMix28_EMC7(0),
120 fHistInvMassElecLike_EMC7(0),
121 fHistInvMassElecUnLike_EMC7(0),
122 fHistOpAngElecLike_EMC7(0),
123 fHistOpAngElecUnLike_EMC7(0),
124 fHistPtAssoc_EMC7(0),
125 fHistPtAssocMix_EMC7(0),
126 fHistPtTag_EMC7(0),
127 fHistPhotoMismatch_EMC7(0),
128 fHistDPhi18Spe_EMC7(0),
129 
130 fHistTPCNClus_EMCEGA(0),
131 fHistITSNClus_EMCEGA(0),
132 fHistImpPar_EMCEGA(0),
133 fHistImpParTag_EMCEGA(0),
134 fHistNevents_EMCEGA(0),
135 fHistPtSum_EMCEGA(0),
136 fHistPtSumTag_EMCEGA(0),
137 fHistPtSumEMC_EMCEGA(0),
138 fHistEtaPhi_EMCEGA(0),
139 fHistEtaPhiTag_EMCEGA(0),
140 fHistDPhi28_EMCEGA(0),
141 fHistDPhiDEta28_EMCEGA(0),
142 fHistDPhiMix28_EMCEGA(0),
143 fHistDPhiDEtaMix28_EMCEGA(0),
144 fHistInvMassElecLike_EMCEGA(0),
145 fHistInvMassElecUnLike_EMCEGA(0),
146 fHistOpAngElecLike_EMCEGA(0),
147 fHistOpAngElecUnLike_EMCEGA(0),
148 fHistPtAssoc_EMCEGA(0),
149 fHistPtAssocMix_EMCEGA(0),
150 fHistPtTag_EMCEGA(0),
151 fHistPhotoMismatch_EMCEGA(0),
152 fHistDPhi18Spe_EMCEGA(0),
153 
154 fHistTPCNClus_EMCJet(0),
155 fHistITSNClus_EMCJet(0),
156 fHistImpPar_EMCJet(0),
157 fHistImpParTag_EMCJet(0),
158 fHistNevents_EMCJet(0),
159 fHistPtSum_EMCJet(0),
160 fHistPtSumTag_EMCJet(0),
161 fHistPtSumEMC_EMCJet(0),
162 fHistEtaPhi_EMCJet(0),
163 fHistEtaPhiTag_EMCJet(0),
164 fHistDPhi28_EMCJet(0),
165 fHistDPhiDEta28_EMCJet(0),
166 fHistDPhiMix28_EMCJet(0),
167 fHistDPhiDEtaMix28_EMCJet(0),
168 fHistInvMassElecLike_EMCJet(0),
169 fHistInvMassElecUnLike_EMCJet(0),
170 fHistOpAngElecLike_EMCJet(0),
171 fHistOpAngElecUnLike_EMCJet(0),
172 fHistPtAssoc_EMCJet(0),
173 fHistPtAssocMix_EMCJet(0),
174 fHistPtTag_EMCJet(0),
175 fHistPhotoMismatch_EMCJet(0),
176 fHistDPhi18Spe_EMCJet(0),
177 
178 fHistPIDRejection(0),
179 fHistNElecPerEvent(0),
180 fHistTestDCA(0),
181 fHistTestEMCEnergy(0),
182 fHistTestTPCdEdx(0),
183 fHistTestEOP(0),
184 fHistTestOGDPhi(0),
185 fHistTestPt(0),
186 fHistTestInvMassElecLike(0),
187 fHistTestInvMassElecUnLike(0),
188 fHistTestInvMassPionLike(0),
189 fHistTestInvMassPionUnLike(0),
190 fHistTestDPhiSpeNoSec(0),
191 fHistTestDPhi18Sec(0),
192 fHistTestDPhi18NoSec(0),
193 fHistTestDPhiType(0)
194 
195  // The last in the above list should not have a comma after it
196 {
197 
198  //Init the DPhi Plots here because they are stored in arrays
199  for(Int_t i=0; i<3; i++){
200  fHistDPhi300_1_MB[i]=0;
201  fHistDPhi1_2_MB[i]=0;
202  fHistDPhi2_4_MB[i]=0;
203  fHistDPhi4_8_MB[i]=0;
204 
205 
206  fHistDPhi300_1_EMC7[i]=0;
207  fHistDPhi1_2_EMC7[i]=0;
208  fHistDPhi2_4_EMC7[i]=0;
209  fHistDPhi4_8_EMC7[i]=0;
210 
211 
212  fHistDPhi300_1_EMCEGA[i]=0;
213  fHistDPhi1_2_EMCEGA[i]=0;
214  fHistDPhi2_4_EMCEGA[i]=0;
215  fHistDPhi4_8_EMCEGA[i]=0;
216 
217  fHistDPhi300_1_EMCJet[i]=0;
218  fHistDPhi1_2_EMCJet[i]=0;
219  fHistDPhi2_4_EMCJet[i]=0;
220  fHistDPhi4_8_EMCJet[i]=0;
221 
222  //ME histos
223 
224  fHistDPhiMix300_1_MB[i]=0;
225  fHistDPhiMix1_2_MB[i]=0;
226  fHistDPhiMix2_4_MB[i]=0;
227  fHistDPhiMix4_8_MB[i]=0;
228 
229  fHistDPhiMix300_1_EMC7[i]=0;
230  fHistDPhiMix1_2_EMC7[i]=0;
231  fHistDPhiMix2_4_EMC7[i]=0;
232  fHistDPhiMix4_8_EMC7[i]=0;
233 
234  fHistDPhiMix300_1_EMCEGA[i]=0;
235  fHistDPhiMix1_2_EMCEGA[i]=0;
236  fHistDPhiMix2_4_EMCEGA[i]=0;
237  fHistDPhiMix4_8_EMCEGA[i]=0;
238 
239  fHistDPhiMix300_1_EMCJet[i]=0;
240  fHistDPhiMix1_2_EMCJet[i]=0;
241  fHistDPhiMix2_4_EMCJet[i]=0;
242  fHistDPhiMix4_8_EMCJet[i]=0;
243  }
244 
245  //Init PID Plots here since they are stored in Arrays
246  for(int i=0;i<6;i++){
247  //MB Plots
248  fHistTPC_EMCTRD_MB[i]=0;
249 
250  fHistEMC_TPCTRD_MB[i]=0;
251 
252  fHistTRD_TPCEMC_MB[i]=0;
253 
254  //EMC7 Plots
255  fHistTPC_EMCTRD_EMC7[i]=0;
256 
257  fHistEMC_TPCTRD_EMC7[i]=0;
258 
259  fHistTRD_TPCEMC_EMC7[i]=0;
260 
261  //EMCEGA Plots
262  fHistTPC_EMCTRD_EMCEGA[i]=0;
263 
264  fHistEMC_TPCTRD_EMCEGA[i]=0;
265 
266  fHistTRD_TPCEMC_EMCEGA[i]=0;
267 
268  //EMCJet Plots
269  fHistTPC_EMCTRD_EMCJet[i]=0;
270 
271  fHistEMC_TPCTRD_EMCJet[i]=0;
272 
273  fHistTRD_TPCEMC_EMCJet[i]=0;
274 
275  }
276 
277  // Dummy constructor ALWAYS needed for I/O.
278 }
279 
280 //________________________________________________________________________
281 AliAnalysisTaskPSHFE::AliAnalysisTaskPSHFE(const char *name) // All data members should be initialised here
282  :AliAnalysisTaskSE(name),
283 fOutputMB(0),
284 fOutputEMC7(0),
285 fOutputEMCEGA(0),
286 fOutputEMCJet(0),
287 fTrackCutsStrong(0),
288 fTrackCutsWeak(0),
289 fPoolMan(0),
290 fPool(0),
291 UseNonSignalEvents(0),
292 MBtrg(0),
293 EMC7trg(0),
294 EMCEGAtrg(0),
295 EMCJettrg(0),
296 tagStrong(0),
297 tagPhot(0),
298 
299 
300 fHistTPCNClus_MB(0),
301 fHistITSNClus_MB(0),
302 fHistImpPar_MB(0),
303 fHistImpParTag_MB(0),
304 fHistNevents_MB(0),
305 fHistPtSum_MB(0),
306 fHistPtSumTag_MB(0),
307 fHistPtSumEMC_MB(0),
308 fHistEtaPhi_MB(0),
309 fHistEtaPhiTag_MB(0),
310 fHistEtaPhiTPCOnly_MB(0),
311 fHistDPhi28_MB(0),
312 fHistDPhiDEta28_MB(0),
313 fHistDPhiMix28_MB(0),
314 fHistDPhiDEtaMix28_MB(0),
315 fHistEMC_Had_MB_1Gev(0),
316 fHistInvMassElecLike_MB(0),
317 fHistInvMassElecUnLike_MB(0),
318 fHistOpAngElecLike_MB(0),
319 fHistOpAngElecUnLike_MB(0),
320 fHistPtAssoc_MB(0),
321 fHistPtAssocMix_MB(0),
322 fHistPtTag_MB(0),
323 fHistPhotoMismatch_MB(0),
324 fHistDPhi18Spe_MB(0),
325 
326 fHistTPCNClus_EMC7(0),
327 fHistITSNClus_EMC7(0),
328 fHistImpPar_EMC7(0),
329 fHistImpParTag_EMC7(0),
330 fHistNevents_EMC7(0),
331 fHistPtSum_EMC7(0),
332 fHistPtSumTag_EMC7(0),
333 fHistPtSumEMC_EMC7(0),
334 fHistEtaPhi_EMC7(0),
335 fHistEtaPhiTag_EMC7(0),
336 fHistDPhi28_EMC7(0),
337 fHistDPhiDEta28_EMC7(0),
338 fHistDPhiMix28_EMC7(0),
339 fHistDPhiDEtaMix28_EMC7(0),
340 fHistInvMassElecLike_EMC7(0),
341 fHistInvMassElecUnLike_EMC7(0),
342 fHistOpAngElecLike_EMC7(0),
343 fHistOpAngElecUnLike_EMC7(0),
344 fHistPtAssoc_EMC7(0),
345 fHistPtAssocMix_EMC7(0),
346 fHistPtTag_EMC7(0),
347 fHistPhotoMismatch_EMC7(0),
348 fHistDPhi18Spe_EMC7(0),
349 
350 fHistTPCNClus_EMCEGA(0),
351 fHistITSNClus_EMCEGA(0),
352 fHistImpPar_EMCEGA(0),
353 fHistImpParTag_EMCEGA(0),
354 fHistNevents_EMCEGA(0),
355 fHistPtSum_EMCEGA(0),
356 fHistPtSumTag_EMCEGA(0),
357 fHistPtSumEMC_EMCEGA(0),
358 fHistEtaPhi_EMCEGA(0),
359 fHistEtaPhiTag_EMCEGA(0),
360 fHistDPhi28_EMCEGA(0),
361 fHistDPhiDEta28_EMCEGA(0),
362 fHistDPhiMix28_EMCEGA(0),
363 fHistDPhiDEtaMix28_EMCEGA(0),
364 fHistInvMassElecLike_EMCEGA(0),
365 fHistInvMassElecUnLike_EMCEGA(0),
366 fHistOpAngElecLike_EMCEGA(0),
367 fHistOpAngElecUnLike_EMCEGA(0),
368 fHistPtAssoc_EMCEGA(0),
369 fHistPtAssocMix_EMCEGA(0),
370 fHistPtTag_EMCEGA(0),
371 fHistPhotoMismatch_EMCEGA(0),
372 fHistDPhi18Spe_EMCEGA(0),
373 
374 fHistTPCNClus_EMCJet(0),
375 fHistITSNClus_EMCJet(0),
376 fHistImpPar_EMCJet(0),
377 fHistImpParTag_EMCJet(0),
378 fHistNevents_EMCJet(0),
379 fHistPtSum_EMCJet(0),
380 fHistPtSumTag_EMCJet(0),
381 fHistPtSumEMC_EMCJet(0),
382 fHistEtaPhi_EMCJet(0),
383 fHistEtaPhiTag_EMCJet(0),
384 fHistDPhi28_EMCJet(0),
385 fHistDPhiDEta28_EMCJet(0),
386 fHistDPhiMix28_EMCJet(0),
387 fHistDPhiDEtaMix28_EMCJet(0),
388 fHistInvMassElecLike_EMCJet(0),
389 fHistInvMassElecUnLike_EMCJet(0),
390 fHistOpAngElecLike_EMCJet(0),
391 fHistOpAngElecUnLike_EMCJet(0),
392 fHistPtAssoc_EMCJet(0),
393 fHistPtAssocMix_EMCJet(0),
394 fHistPtTag_EMCJet(0),
395 fHistPhotoMismatch_EMCJet(0),
396 fHistDPhi18Spe_EMCJet(0),
397 
398 fHistPIDRejection(0),
399 fHistNElecPerEvent(0),
400 fHistTestDCA(0),
401 fHistTestEMCEnergy(0),
402 fHistTestTPCdEdx(0),
403 fHistTestEOP(0),
404 fHistTestOGDPhi(0),
405 fHistTestPt(0),
406 fHistTestInvMassElecLike(0),
407 fHistTestInvMassElecUnLike(0),
408 fHistTestInvMassPionLike(0),
409 fHistTestInvMassPionUnLike(0),
410 fHistTestDPhiSpeNoSec(0),
411 fHistTestDPhi18Sec(0),
412 fHistTestDPhi18NoSec(0),
413 fHistTestDPhiType(0)
414 
415  // The last in the above list should not have a comma after it
416 {
417  // Constructor
418  // Define input and output slots here (never in the dummy constructor)
419  // Input slot #0 works with a TChain - it is connected to the default input container
420  // Output slot #1 writes into a TH1 container
421 
422  for(Int_t i=0; i<3; i++){
423 
424  fHistDPhi300_1_MB[i]=0;
425  fHistDPhi1_2_MB[i]=0;
426  fHistDPhi2_4_MB[i]=0;
427  fHistDPhi4_8_MB[i]=0;
428 
429 
430  fHistDPhi300_1_EMC7[i]=0;
431  fHistDPhi1_2_EMC7[i]=0;
432  fHistDPhi2_4_EMC7[i]=0;
433  fHistDPhi4_8_EMC7[i]=0;
434 
435 
437  fHistDPhi1_2_EMCEGA[i]=0;
438  fHistDPhi2_4_EMCEGA[i]=0;
439  fHistDPhi4_8_EMCEGA[i]=0;
440 
441 
443  fHistDPhi1_2_EMCJet[i]=0;
444  fHistDPhi2_4_EMCJet[i]=0;
445  fHistDPhi4_8_EMCJet[i]=0;
446 
447 
448  //ME histos
449 
451  fHistDPhiMix1_2_MB[i]=0;
452  fHistDPhiMix2_4_MB[i]=0;
453  fHistDPhiMix4_8_MB[i]=0;
454 
455 
460 
461 
466 
467 
472 
473  }
474 
475  //Init PID Plots here since they are stored in Arrays
476  for(Int_t i=0;i<6;i++){
477  //MB Plots
478  fHistTPC_EMCTRD_MB[i]=0;
479 
480  fHistEMC_TPCTRD_MB[i]=0;
481 
482  fHistTRD_TPCEMC_MB[i]=0;
483 
484  //EMC7 Plots
486 
488 
490 
491  //EMCEGA Plots
493 
495 
497 
498  //EMCJet Plots
500 
502 
504 
505  }
506 
507 
508  DefineOutput(1, TList::Class());//MB
509  DefineOutput(2, TList::Class());//EMC7
510  DefineOutput(3, TList::Class());//EMCEGA
511  DefineOutput(4, TList::Class());//EMCJet
512 }
513 
514 //________________________________________________________________________
516 {
517  // Destructor. Clean-up the output list, but not the histograms that are put inside
518  // (the list is owner and will clean-up these histograms). Protect in PROOF case.
519  for(Int_t i=0;i<3;i++){
520 
521  delete fHistDPhi300_1_MB[i];
522  delete fHistDPhi1_2_MB[i];
523  delete fHistDPhi2_4_MB[i];
524  delete fHistDPhi4_8_MB[i];
525 
526  delete fHistDPhi300_1_EMC7[i];
527  delete fHistDPhi1_2_EMC7[i];
528  delete fHistDPhi2_4_EMC7[i];
529  delete fHistDPhi4_8_EMC7[i];
530 
531 
532  delete fHistDPhi300_1_EMCEGA[i];
533  delete fHistDPhi1_2_EMCEGA[i];
534  delete fHistDPhi2_4_EMCEGA[i];
535  delete fHistDPhi4_8_EMCEGA[i];
536 
537 
538  delete fHistDPhi300_1_EMCJet[i];
539  delete fHistDPhi1_2_EMCJet[i];
540  delete fHistDPhi2_4_EMCJet[i];
541  delete fHistDPhi4_8_EMCJet[i];
542 
543 
544  //ME histos
545 
546  delete fHistDPhiMix300_1_MB[i];
547  delete fHistDPhiMix1_2_MB[i];
548  delete fHistDPhiMix2_4_MB[i];
549  delete fHistDPhiMix4_8_MB[i];
550 
551 
552  delete fHistDPhiMix300_1_EMC7[i];
553  delete fHistDPhiMix1_2_EMC7[i];
554  delete fHistDPhiMix2_4_EMC7[i];
555  delete fHistDPhiMix4_8_EMC7[i];
556 
557 
558  delete fHistDPhiMix300_1_EMCEGA[i];
559  delete fHistDPhiMix1_2_EMCEGA[i];
560  delete fHistDPhiMix2_4_EMCEGA[i];
561  delete fHistDPhiMix4_8_EMCEGA[i];
562 
563 
564  delete fHistDPhiMix300_1_EMCJet[i];
565  delete fHistDPhiMix1_2_EMCJet[i];
566  delete fHistDPhiMix2_4_EMCJet[i];
567  delete fHistDPhiMix4_8_EMCJet[i];
568 
569  }
570 
571  //Init PID Plots here since they are stored in Arrays
572  for(Int_t i=0;i<6;i++){
573  //MB Plots
574  delete fHistTPC_EMCTRD_MB[i];
575 
576  delete fHistEMC_TPCTRD_MB[i];
577 
578  delete fHistTRD_TPCEMC_MB[i];
579 
580  //EMC7 Plots
581  delete fHistTPC_EMCTRD_EMC7[i];
582 
583  delete fHistEMC_TPCTRD_EMC7[i];
584 
585  delete fHistTRD_TPCEMC_EMC7[i];
586 
587  //EMCEGA Plots
588  delete fHistTPC_EMCTRD_EMCEGA[i];
589 
590  delete fHistEMC_TPCTRD_EMCEGA[i];
591 
592  delete fHistTRD_TPCEMC_EMCEGA[i];
593 
594  //EMCJet Plots
595  delete fHistTPC_EMCTRD_EMCJet[i];
596 
597  delete fHistEMC_TPCTRD_EMCJet[i];
598 
599  delete fHistTRD_TPCEMC_EMCJet[i];
600 
601  }
602 
603  delete fTrackCutsStrong;
604  delete fTrackCutsWeak;
605 }
606 
607 //________________________________________________________________________
609  // Create histograms
610  // Called once (on the worker node)
611 
612  fOutputMB = new TList();
613  OpenFile(1);
614  fOutputMB->SetOwner(); // IMPORTANT!
615  fOutputEMC7 = new TList();
616  OpenFile(2);
617  fOutputEMC7->SetOwner(); // IMPORTANT!
618  fOutputEMCEGA = new TList();
619  OpenFile(3);
620  fOutputEMCEGA->SetOwner(); // IMPORTANT!
621  fOutputEMCJet = new TList();
622  OpenFile(4);
623  fOutputEMCJet->SetOwner(); // IMPORTANT!
624 
625  //Initialize event pool stuff
626  Double_t vertexBins[5] = { -10, -4, 0, 4, 10 };
627  Int_t nZvtxBins = 4;
628  Double_t multBins[12] = {0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 200};
629  Int_t nMultBins = 11;
630 
631  fPoolMan = new AliEventPoolManager(1000, 10, nMultBins, multBins, nZvtxBins, vertexBins);
632  fPoolMan->Validate();
633 
634  //Some strings for histograms
635  TString ptRangesDPhi[3] = {"1-2Gev", "2-4Gev", "4-8Gev"};
636  TString ptRangesPID[6] = {"1-2GeV", "2-3GeV", "3-4GeV", "4-5GeV", "5-6GeV", ">6GeV"};
637  TString ptRangesRegion[4] = {"1-2Gev", "2-4Gev", "4-6Gev", ">6Gev"};
638 
639  //Strong cuts for heavy flavour
640  fTrackCutsStrong = new AliESDtrackCuts();
641  // TPC
642  fTrackCutsStrong->SetRequireTPCRefit(kTRUE);
643  // ITS
644  fTrackCutsStrong->SetRequireITSRefit(kTRUE);
645  // 7*(0.0026+0.0050/pt^1.01)
646  fTrackCutsStrong->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
647  fTrackCutsStrong->SetMaxDCAToVertexZ(2);
648  fTrackCutsStrong->SetDCAToVertex2D(kFALSE);
649  fTrackCutsStrong->SetRequireSigmaToVertex(kFALSE);
650  fTrackCutsStrong->SetMaxChi2PerClusterITS(36);
651  fTrackCutsStrong->SetMinNClustersTPC(120);
652  fTrackCutsStrong->SetMinNClustersITS(4);
653  fTrackCutsStrong->SetPtRange(1,10e10);
654  fTrackCutsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
655  fTrackCutsStrong->SetMaxChi2PerClusterTPC(2);
656  fTrackCutsStrong->SetMaxDCAToVertexXY(1);
657  fTrackCutsStrong->SetMaxDCAToVertexZ(2);
658  fTrackCutsStrong->SetEtaRange(-.6, .6);
659  fTrackCutsStrong->SetAcceptKinkDaughters(kFALSE);
660 
661  //Weak cuts for heavy flavour
662  fTrackCutsWeak = new AliESDtrackCuts();
663  // TPC
664  fTrackCutsWeak->SetRequireTPCRefit(kTRUE);
665  // ITS
666  fTrackCutsWeak->SetRequireITSRefit(kTRUE);
667  // 7*(0.0026+0.0050/pt^1.01)
668  fTrackCutsWeak->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
669  fTrackCutsWeak->SetMaxDCAToVertexZ(2);
670  fTrackCutsWeak->SetDCAToVertex2D(kFALSE);
671  fTrackCutsWeak->SetRequireSigmaToVertex(kFALSE);
672  fTrackCutsWeak->SetMaxChi2PerClusterITS(36);
673  fTrackCutsWeak->SetMinNClustersTPC(80);
674  fTrackCutsWeak->SetMinNClustersITS(3);
675  fTrackCutsWeak->SetPtRange(1,10e10);
676  fTrackCutsWeak->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
677  fTrackCutsWeak->SetMaxChi2PerClusterTPC(4);
678  //fTrackCutsWeak->SetMaxDCAToVertexXY(2);
679  //fTrackCutsWeak->SetMaxDCAToVertexZ(3);
680  fTrackCutsWeak->SetEtaRange(-.7, .7);
681  fTrackCutsWeak->SetAcceptKinkDaughters(kFALSE);
682 
683  // Create histograms
684 
685  //Photonic e mismatch histo
686 
687  fHistPhotoMismatch_MB = new TH1F("fHistPhotoMismatch_MB", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
688  fHistPhotoMismatch_MB->GetXaxis()->SetTitle("Electrons");
689  fHistPhotoMismatch_MB->GetYaxis()->SetTitle("Cts");
690 
691  fHistPhotoMismatch_EMC7 = new TH1F("fHistPhotoMismatch_EMC7", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
692  fHistPhotoMismatch_EMC7->GetXaxis()->SetTitle("Electrons");
693  fHistPhotoMismatch_EMC7->GetYaxis()->SetTitle("Cts");
694 
695  fHistPhotoMismatch_EMCEGA = new TH1F("fHistPhotoMismatch_EMCEGA", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
696  fHistPhotoMismatch_EMCEGA->GetXaxis()->SetTitle("Electrons");
697  fHistPhotoMismatch_EMCEGA->GetYaxis()->SetTitle("Cts");
698 
699  fHistPhotoMismatch_EMCJet = new TH1F("fHistPhotoMismatch_EMCJet", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
700  fHistPhotoMismatch_EMCJet->GetXaxis()->SetTitle("Electrons");
701  fHistPhotoMismatch_EMCJet->GetYaxis()->SetTitle("Cts");
702 
703  //Invariant mass histos
704 
705  fHistInvMassElecLike_MB = new TH1F("fHistInvMassElecLike_MB", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
706  fHistInvMassElecLike_MB->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
707  fHistInvMassElecLike_MB->GetYaxis()->SetTitle("Cts");
708 
709  fHistInvMassElecLike_EMC7 = new TH1F("fHistInvMassElecLike_EMC7", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
710  fHistInvMassElecLike_EMC7->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
711  fHistInvMassElecLike_EMC7->GetYaxis()->SetTitle("Cts");
712 
713  fHistInvMassElecLike_EMCEGA = new TH1F("fHistInvMassElecLike_EMCEGA", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
714  fHistInvMassElecLike_EMCEGA->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
715  fHistInvMassElecLike_EMCEGA->GetYaxis()->SetTitle("Cts");
716 
717  fHistInvMassElecLike_EMCJet = new TH1F("fHistInvMassElecLike_EMCJet", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
718  fHistInvMassElecLike_EMCJet->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
719  fHistInvMassElecLike_EMCJet->GetYaxis()->SetTitle("Cts");
720 
721  fHistInvMassElecUnLike_MB = new TH1F("fHistInvMassElecUnLike_MB", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
722  fHistInvMassElecUnLike_MB->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
723  fHistInvMassElecUnLike_MB->GetYaxis()->SetTitle("Cts");
724 
725  fHistInvMassElecUnLike_EMC7 = new TH1F("fHistInvMassElecUnLike_EMC7", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
726  fHistInvMassElecUnLike_EMC7->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
727  fHistInvMassElecUnLike_EMC7->GetYaxis()->SetTitle("Cts");
728 
729  fHistInvMassElecUnLike_EMCEGA = new TH1F("fHistInvMassElecUnLike_EMCEGA", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
730  fHistInvMassElecUnLike_EMCEGA->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
731  fHistInvMassElecUnLike_EMCEGA->GetYaxis()->SetTitle("Cts");
732 
733  fHistInvMassElecUnLike_EMCJet = new TH1F("fHistInvMassElecUnLike_EMCJet", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
734  fHistInvMassElecUnLike_EMCJet->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
735  fHistInvMassElecUnLike_EMCJet->GetYaxis()->SetTitle("Cts");
736 
737  //Opening Angle Histos
738 
739  fHistOpAngElecLike_MB = new TH1F("fHistOpAngElecLike_MB", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
740  fHistOpAngElecLike_MB->GetXaxis()->SetTitle("Opening Angle(rad)");
741  fHistOpAngElecLike_MB->GetYaxis()->SetTitle("Cts");
742 
743  fHistOpAngElecLike_EMC7 = new TH1F("fHistOpAngElecLike_EMC7", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
744  fHistOpAngElecLike_EMC7->GetXaxis()->SetTitle("Opening Angle(rad)");
745  fHistOpAngElecLike_EMC7->GetYaxis()->SetTitle("Cts");
746 
747  fHistOpAngElecLike_EMCEGA = new TH1F("fHistOpAngElecLike_EMCEGA", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
748  fHistOpAngElecLike_EMCEGA->GetXaxis()->SetTitle("Opening Angle(rad)");
749  fHistOpAngElecLike_EMCEGA->GetYaxis()->SetTitle("Cts");
750 
751  fHistOpAngElecLike_EMCJet = new TH1F("fHistOpAngElecLike_EMCJet", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
752  fHistOpAngElecLike_EMCJet->GetXaxis()->SetTitle("Opening Angle(rad)");
753  fHistOpAngElecLike_EMCJet->GetYaxis()->SetTitle("Cts");
754 
755  fHistOpAngElecUnLike_MB = new TH1F("fHistOpAngElecUnLike_MB", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
756  fHistOpAngElecUnLike_MB->GetXaxis()->SetTitle("Opening Angle(rad)");
757  fHistOpAngElecUnLike_MB->GetYaxis()->SetTitle("Cts");
758 
759  fHistOpAngElecUnLike_EMC7 = new TH1F("fHistOpAngElecUnLike_EMC7", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
760  fHistOpAngElecUnLike_EMC7->GetXaxis()->SetTitle("Opening Angle(rad)");
761  fHistOpAngElecUnLike_EMC7->GetYaxis()->SetTitle("Cts");
762 
763  fHistOpAngElecUnLike_EMCEGA = new TH1F("fHistOpAngElecUnLike_EMCEGA", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
764  fHistOpAngElecUnLike_EMCEGA->GetXaxis()->SetTitle("Opening Angle(rad)");
765  fHistOpAngElecUnLike_EMCEGA->GetYaxis()->SetTitle("Cts");
766 
767  fHistOpAngElecUnLike_EMCJet = new TH1F("fHistOpAngElecUnLike_EMCJet", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
768  fHistOpAngElecUnLike_EMCJet->GetXaxis()->SetTitle("Opening Angle(rad)");
769  fHistOpAngElecUnLike_EMCJet->GetYaxis()->SetTitle("Cts");
770 
771  //Rejection Histos
772 
773  fHistPIDRejection = new TH1F("fHistPIDRejection", "PID rejection counts for each detector.", 4, 1, 4);
774  fHistPIDRejection->GetXaxis()->SetTitle("Detector");
775  fHistPIDRejection->GetYaxis()->SetTitle("Cts");
776  fHistPIDRejection->GetXaxis()->SetBinLabel(1, "TPC");
777  fHistPIDRejection->GetXaxis()->SetBinLabel(2, "TOF");
778  fHistPIDRejection->GetXaxis()->SetBinLabel(3, "TRD");
779  fHistPIDRejection->GetXaxis()->SetBinLabel(4, "EMC");
780 
781  //Number of electrons per event histo
782  fHistNElecPerEvent = new TH1F("fHistNElecPerEvent", "Number of tagged electrons per event", 5, 1, 5);
783  fHistNElecPerEvent->GetXaxis()->SetTitle("Num. of Electrons");
784  fHistNElecPerEvent->GetYaxis()->SetTitle("Cts");
785 
786  //PID Plots
787 
788  //TPC PID Plots
789  for(Int_t i=0; i<6; i++){
790  //MB
791  fHistTPC_EMCTRD_MB[i] = new TH2F(TString::Format("fHistTPC_EMCTRD_MB_%s",ptRangesPID[i].Data()), TString::Format("TPC nSigma for tracks with Pt between %s after EMC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, -10, 10);
792  fHistTPC_EMCTRD_MB[i]->GetXaxis()->SetTitle("Pt");
793  fHistTPC_EMCTRD_MB[i]->GetYaxis()->SetTitle("nSigma");
794 
795  //EMC7
796  fHistTPC_EMCTRD_EMC7[i] = new TH2F(TString::Format("fHistTPC_EMCTRD_EMC7_%s",ptRangesPID[i].Data()), TString::Format("TPC nSigma for tracks with Pt between %s after EMC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, -10, 10);
797  fHistTPC_EMCTRD_EMC7[i]->GetXaxis()->SetTitle("Pt");
798  fHistTPC_EMCTRD_EMC7[i]->GetYaxis()->SetTitle("nSigma");
799 
800  //EMCEGA
801  fHistTPC_EMCTRD_EMCEGA[i] = new TH2F(TString::Format("fHistTPC_EMCTRD_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("TPC nSigma for tracks with Pt between %s after EMC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, -10, 10);
802  fHistTPC_EMCTRD_EMCEGA[i]->GetXaxis()->SetTitle("Pt");
803  fHistTPC_EMCTRD_EMCEGA[i]->GetYaxis()->SetTitle("nSigma");
804 
805  //EMCJet
806  fHistTPC_EMCTRD_EMCJet[i] = new TH2F(TString::Format("fHistTPC_EMCTRD_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("TPC nSigma for tracks with Pt between %s after EMC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, -10, 10);
807  fHistTPC_EMCTRD_EMCJet[i]->GetXaxis()->SetTitle("Pt");
808  fHistTPC_EMCTRD_EMCJet[i]->GetYaxis()->SetTitle("nSigma");
809  }
810 
811  //EMC PID Plots
812  for(Int_t i=0; i<6; i++){
813  //MB
814  fHistEMC_TPCTRD_MB[i] = new TH1F(TString::Format("fHistEMC_TPCTRD_MB_%s",ptRangesPID[i].Data()), TString::Format("E/p for tracks with Pt between %s after TPC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 1.5);
815  fHistEMC_TPCTRD_MB[i]->GetXaxis()->SetTitle("E/p");
816  fHistEMC_TPCTRD_MB[i]->GetYaxis()->SetTitle("Cts");
817 
818  //EMC7
819  fHistEMC_TPCTRD_EMC7[i] = new TH1F(TString::Format("fHistEMC_TPCTRD_EMC7_%s",ptRangesPID[i].Data()), TString::Format("E/p for tracks with Pt between %s after TPC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 1.5);
820  fHistEMC_TPCTRD_EMC7[i]->GetXaxis()->SetTitle("E/p");
821  fHistEMC_TPCTRD_EMC7[i]->GetYaxis()->SetTitle("Cts");
822 
823  //EMCEGA
824  fHistEMC_TPCTRD_EMCEGA[i] = new TH1F(TString::Format("fHistEMC_TPCTRD_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("E/p for tracks with Pt between %s after TPC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 1.5);
825  fHistEMC_TPCTRD_EMCEGA[i]->GetXaxis()->SetTitle("E/p");
826  fHistEMC_TPCTRD_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
827 
828  //EMCJet
829  fHistEMC_TPCTRD_EMCJet[i] = new TH1F(TString::Format("fHistEMC_TPCTRD_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("E/p for tracks with Pt between %s after EMC and TRD cuts",ptRangesPID[i].Data()), 100, 0, 1.5);
830  fHistEMC_TPCTRD_EMCJet[i]->GetXaxis()->SetTitle("E/p");
831  fHistEMC_TPCTRD_EMCJet[i]->GetYaxis()->SetTitle("Cts");
832  }
833 
834  //TRD PID Plots
835  for(Int_t i=0; i<6; i++){
836  //MB
837  fHistTRD_TPCEMC_MB[i] = new TH2F(TString::Format("fHistTRD_TPCEMC_MB_%s",ptRangesPID[i].Data()), TString::Format("TRD electron Likelihood for tracks with Pt between %s after TPC and EMC cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, 0, 1);
838  fHistTRD_TPCEMC_MB[i]->GetXaxis()->SetTitle("Pt");
839  fHistTRD_TPCEMC_MB[i]->GetYaxis()->SetTitle("electron Likelihood");
840 
841  //EMC7
842  fHistTRD_TPCEMC_EMC7[i] = new TH2F(TString::Format("fHistTRD_TPCEMC_EMC7_%s",ptRangesPID[i].Data()), TString::Format("TRD electron Likelihood for tracks with Pt between %s after TPC and EMC cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, 0, 1);
843  fHistTRD_TPCEMC_EMC7[i]->GetXaxis()->SetTitle("Pt");
844  fHistTRD_TPCEMC_EMC7[i]->GetYaxis()->SetTitle("electron Likelihood");
845 
846  //EMCEGA
847  fHistTRD_TPCEMC_EMCEGA[i] = new TH2F(TString::Format("fHistTRD_TPCEMC_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("TRD electron Likelihood for tracks with Pt between %s after TPC and EMC cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, 0, 1);
848  fHistTRD_TPCEMC_EMCEGA[i]->GetXaxis()->SetTitle("Pt");
849  fHistTRD_TPCEMC_EMCEGA[i]->GetYaxis()->SetTitle("electron Likelihood");
850 
851  //EMCJet
852  fHistTRD_TPCEMC_EMCJet[i] = new TH2F(TString::Format("fHistTRD_TPCEMC_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("TRD electron Likelihood for tracks with Pt between %s after EMC and EMC cuts",ptRangesPID[i].Data()), 100, 0, 10, 800, 0, 1);
853  fHistTRD_TPCEMC_EMCJet[i]->GetXaxis()->SetTitle("Pt");
854  fHistTRD_TPCEMC_EMCJet[i]->GetYaxis()->SetTitle("electron Likelihood");
855  }
856 
857  //DPhi for candidate electrons 2-8 gev and assoc. particles >3gev
858  fHistDPhi28_MB = new TH1F("fHistDPhi28_MB", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
859  fHistDPhi28_MB->GetXaxis()->SetTitle("Delta-Phi");
860  fHistDPhi28_MB->GetYaxis()->SetTitle("Cts");
861 
862  fHistDPhi28_EMC7 = new TH1F("fHistDPhi28_EMC7", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
863  fHistDPhi28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
864  fHistDPhi28_EMC7->GetYaxis()->SetTitle("Cts");
865 
866  fHistDPhi28_EMCEGA = new TH1F("fHistDPhi28_EMCEGA", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
867  fHistDPhi28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
868  fHistDPhi28_EMCEGA->GetYaxis()->SetTitle("Cts");
869 
870  fHistDPhi28_EMCJet = new TH1F("fHistDPhi28_EMCJet", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
871  fHistDPhi28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
872  fHistDPhi28_EMCJet->GetYaxis()->SetTitle("Cts");
873 
874  //DPhi by Eta for triggered particles 2-8 gev and assoc. particles >3gev
875  fHistDPhiDEta28_MB = new TH2F("fHistDPhiDEta28_MB", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
876  fHistDPhiDEta28_MB->GetXaxis()->SetTitle("Delta-Phi");
877  fHistDPhiDEta28_MB->GetYaxis()->SetTitle("Delta-Eta");
878  fHistDPhiDEta28_MB->GetZaxis()->SetTitle("Cts");
879 
880  fHistDPhiDEta28_EMC7 = new TH2F("fHistDPhiDEta28_EMC7", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 550, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
881  fHistDPhiDEta28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
882  fHistDPhiDEta28_EMC7->GetYaxis()->SetTitle("Delta-Eta");
883  fHistDPhiDEta28_EMC7->GetZaxis()->SetTitle("Cts");
884 
885  fHistDPhiDEta28_EMCEGA = new TH2F("fHistDPhiDEta28_EMCEGA", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
886  fHistDPhiDEta28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
887  fHistDPhiDEta28_EMCEGA->GetYaxis()->SetTitle("Delta-Eta");
888  fHistDPhiDEta28_EMCEGA->GetZaxis()->SetTitle("Cts");
889 
890  fHistDPhiDEta28_EMCJet = new TH2F("fHistDPhiDEta28_EMCJet", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
891  fHistDPhiDEta28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
892  fHistDPhiDEta28_EMCJet->GetYaxis()->SetTitle("Delta-Eta");
893  fHistDPhiDEta28_EMCJet->GetZaxis()->SetTitle("Cts");
894 
895  //DPhi for candidate electrons 2-8 gev and assoc. particles >2Gev for Mixed Events
896  fHistDPhiMix28_MB = new TH1F("fHistDPhiMix28_MB", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
897  fHistDPhiMix28_MB->GetXaxis()->SetTitle("Delta-Phi");
898  fHistDPhiMix28_MB->GetYaxis()->SetTitle("Cts");
899 
900  fHistDPhiMix28_EMC7 = new TH1F("fHistDPhiMix28_EMC7", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
901  fHistDPhiMix28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
902  fHistDPhiMix28_EMC7->GetYaxis()->SetTitle("Cts");
903 
904  fHistDPhiMix28_EMCEGA = new TH1F("fHistDPhiMix28_EMCEGA", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
905  fHistDPhiMix28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
906  fHistDPhiMix28_EMCEGA->GetYaxis()->SetTitle("Cts");
907 
908  fHistDPhiMix28_EMCJet = new TH1F("fHistDPhiMix28_EMCJet", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
909  fHistDPhiMix28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
910  fHistDPhiMix28_EMCJet->GetYaxis()->SetTitle("Cts");
911 
912  //DPhi by Eta for triggered particles 2-8 gev and assoc. particles >3gev
913  fHistDPhiDEtaMix28_MB = new TH2F("fHistDPhiDEtaMix28_MB", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
914  fHistDPhiDEtaMix28_MB->GetXaxis()->SetTitle("Delta-Phi");
915  fHistDPhiDEtaMix28_MB->GetYaxis()->SetTitle("Delta-Eta");
916  fHistDPhiDEtaMix28_MB->GetZaxis()->SetTitle("Cts");
917 
918  fHistDPhiDEtaMix28_EMC7 = new TH2F("fHistDPhiDEtaMix28_EMC7", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
919  fHistDPhiDEtaMix28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
920  fHistDPhiDEtaMix28_EMC7->GetYaxis()->SetTitle("Delta-Eta");
921  fHistDPhiDEtaMix28_EMC7->GetZaxis()->SetTitle("Cts");
922 
923  fHistDPhiDEtaMix28_EMCEGA = new TH2F("fHistDPhiDEtaMix28_EMCEGA", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
924  fHistDPhiDEtaMix28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
925  fHistDPhiDEtaMix28_EMCEGA->GetYaxis()->SetTitle("Delta-Eta");
926  fHistDPhiDEtaMix28_EMCEGA->GetZaxis()->SetTitle("Cts");
927 
928  fHistDPhiDEtaMix28_EMCJet = new TH2F("fHistDPhiDEtaMix28_EMCJet", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 50, -0.9, 0.9);
929  fHistDPhiDEtaMix28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
930  fHistDPhiDEtaMix28_EMCJet->GetYaxis()->SetTitle("Delta-Eta");
931  fHistDPhiDEtaMix28_EMCJet->GetZaxis()->SetTitle("Cts");
932 
933  //DPhi by dEdx for triggered particles 2-8 gev and assoc. particles >2gev
934  fHistDPhi18Spe_MB = new TH2F("fHistDPhi18Spe_MB", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
935  fHistDPhi18Spe_MB->GetXaxis()->SetTitle("Delta-Phi");
936  fHistDPhi18Spe_MB->GetYaxis()->SetTitle("Species");
937  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(1, "Unkown");
938  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(2, "Electron");
939  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(3, "Muon");
940  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(4, "Pion");
941  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(5, "Kaon");
942  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(6, "Proton");
943  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(7, "Deuteron");
944  fHistDPhi18Spe_MB->GetZaxis()->SetTitle("Cts");
945 
946  fHistDPhi18Spe_EMC7 = new TH2F("fHistDPhi18Spe_EMC7", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
947  fHistDPhi18Spe_EMC7->GetXaxis()->SetTitle("Delta-Phi");
948  fHistDPhi18Spe_EMC7->GetYaxis()->SetTitle("Species");
949  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(1, "Unkown");
950  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(2, "Electron");
951  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(3, "Muon");
952  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(4, "Pion");
953  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(5, "Kaon");
954  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(6, "Proton");
955  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(7, "Deuteron");
956  fHistDPhi18Spe_EMC7->GetZaxis()->SetTitle("Cts");
957 
958  fHistDPhi18Spe_EMCEGA = new TH2F("fHistDPhi18Spe_EMCEGA", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
959  fHistDPhi18Spe_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
960  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetTitle("Species");
961  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(1, "Unkown");
962  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(2, "Electron");
963  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(3, "Muon");
964  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(4, "Pion");
965  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(5, "Kaon");
966  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(6, "Proton");
967  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(7, "Deuteron");
968  fHistDPhi18Spe_EMCEGA->GetZaxis()->SetTitle("Cts");
969 
970  fHistDPhi18Spe_EMCJet = new TH2F("fHistDPhi18Spe_EMCJet", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 50, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
971  fHistDPhi18Spe_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
972  fHistDPhi18Spe_EMCJet->GetYaxis()->SetTitle("Species");
973  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(1, "Unkown");
974  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(2, "Electron");
975  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(3, "Muon");
976  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(4, "Pion");
977  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(5, "Kaon");
978  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(6, "Proton");
979  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(7, "Deuteron");
980  fHistDPhi18Spe_EMCJet->GetZaxis()->SetTitle("Cts");
981 
982  // Delta Phi for tracks > 300MeV
983  for(Int_t i=0; i<3; i++){
984  fHistDPhi300_1_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-1Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
985  fHistDPhi300_1_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
986  fHistDPhi300_1_MB[i]->GetYaxis()->SetTitle("Cts");
987  }
988 
989  for(Int_t i=0; i<3; i++){
990  fHistDPhi300_1_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-1Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
991  fHistDPhi300_1_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
992  fHistDPhi300_1_EMC7[i]->GetYaxis()->SetTitle("Cts");
993  }
994 
995  for(Int_t i=0; i<3; i++){
996  fHistDPhi300_1_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-1Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
997  fHistDPhi300_1_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
998  fHistDPhi300_1_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
999  }
1000 
1001  for(Int_t i=0; i<3; i++){
1002  fHistDPhi300_1_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-1Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1003  fHistDPhi300_1_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1004  fHistDPhi300_1_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1005  }
1006 
1007  // Delta Phi for tracks > 1GeV
1008  for(Int_t i=0; i<3; i++){
1009  fHistDPhi1_2_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_1-2Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1010  fHistDPhi1_2_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1011  fHistDPhi1_2_MB[i]->GetYaxis()->SetTitle("Cts");
1012  }
1013 
1014  for(Int_t i=0; i<3; i++){
1015  fHistDPhi1_2_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_1-2Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev",ptRangesDPhi[i].Data()).Data(),50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1016  fHistDPhi1_2_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1017  fHistDPhi1_2_EMC7[i]->GetYaxis()->SetTitle("Cts");
1018  }
1019 
1020  for(Int_t i=0; i<3; i++){
1021  fHistDPhi1_2_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_1-2Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1022  fHistDPhi1_2_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1023  fHistDPhi1_2_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1024  }
1025 
1026  for(Int_t i=0; i<3; i++){
1027  fHistDPhi1_2_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_1-2Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1028  fHistDPhi1_2_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1029  fHistDPhi1_2_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1030  }
1031 
1032  // Delta Phi for tracks > 2GeV
1033  for(Int_t i=0; i<3; i++){
1034  fHistDPhi2_4_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-4Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1035  fHistDPhi2_4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1036  fHistDPhi2_4_MB[i]->GetYaxis()->SetTitle("Cts");
1037  }
1038 
1039  for(Int_t i=0; i<3; i++){
1040  fHistDPhi2_4_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-4Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1041  fHistDPhi2_4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1042  fHistDPhi2_4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1043  }
1044 
1045  for(Int_t i=0; i<3; i++){
1046  fHistDPhi2_4_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-4Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1047  fHistDPhi2_4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1048  fHistDPhi2_4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1049  }
1050 
1051  for(Int_t i=0; i<3; i++){
1052  fHistDPhi2_4_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-4Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1053  fHistDPhi2_4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1054  fHistDPhi2_4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1055  }
1056 
1057  // Delta Phi for tracks > 3GeV
1058  for(Int_t i=0; i<3; i++){
1059  fHistDPhi4_8_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4-8Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1060  fHistDPhi4_8_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1061  fHistDPhi4_8_MB[i]->GetYaxis()->SetTitle("Cts");
1062  }
1063 
1064  for(Int_t i=0; i<3; i++){
1065  fHistDPhi4_8_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4-8Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1066  fHistDPhi4_8_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1067  fHistDPhi4_8_EMC7[i]->GetYaxis()->SetTitle("Cts");
1068  }
1069 
1070  for(Int_t i=0; i<3; i++){
1071  fHistDPhi4_8_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4-8Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1072  fHistDPhi4_8_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1073  fHistDPhi4_8_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1074  }
1075 
1076  for(Int_t i=0; i<3; i++){
1077  fHistDPhi4_8_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4-8Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1078  fHistDPhi4_8_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1079  fHistDPhi4_8_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1080  }
1081 
1082 
1083 
1084  //Mixed Event DPhi plots
1085 
1086  // Delta Phi for tracks > 300MeV
1087 
1088  for(Int_t i=0; i<3; i++){
1089  fHistDPhiMix300_1_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-1Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1090  fHistDPhiMix300_1_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1091  fHistDPhiMix300_1_MB[i]->GetYaxis()->SetTitle("Cts");
1092  }
1093 
1094  for(Int_t i=0; i<3; i++){
1095  fHistDPhiMix300_1_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-1Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1096  fHistDPhiMix300_1_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1097  fHistDPhiMix300_1_EMC7[i]->GetYaxis()->SetTitle("Cts");
1098  }
1099 
1100  for(Int_t i=0; i<3; i++){
1101  fHistDPhiMix300_1_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-1Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1102  fHistDPhiMix300_1_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1103  fHistDPhiMix300_1_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1104  }
1105 
1106  for(Int_t i=0; i<3; i++){
1107  fHistDPhiMix300_1_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-1Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1108  fHistDPhiMix300_1_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1109  fHistDPhiMix300_1_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1110  }
1111 
1112  // Delta Phi for tracks > 1GeV
1113  for(Int_t i=0; i<3; i++){
1114  fHistDPhiMix1_2_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_1-2Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1115  fHistDPhiMix1_2_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1116  fHistDPhiMix1_2_MB[i]->GetYaxis()->SetTitle("Cts");
1117  }
1118 
1119  for(Int_t i=0; i<3; i++){
1120  fHistDPhiMix1_2_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_1-2Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1121  fHistDPhiMix1_2_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1122  fHistDPhiMix1_2_EMC7[i]->GetYaxis()->SetTitle("Cts");
1123  }
1124 
1125  for(Int_t i=0; i<3; i++){
1126  fHistDPhiMix1_2_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_1-2Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1127  fHistDPhiMix1_2_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1128  fHistDPhiMix1_2_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1129  }
1130 
1131  for(Int_t i=0; i<3; i++){
1132  fHistDPhiMix1_2_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_1-2Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 1Gev<pt<2Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1133  fHistDPhiMix1_2_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1134  fHistDPhiMix1_2_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1135  }
1136 
1137  // Delta Phi for tracks > 2GeV
1138  for(Int_t i=0; i<3; i++){
1139  fHistDPhiMix2_4_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-4Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1140  fHistDPhiMix2_4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1141  fHistDPhiMix2_4_MB[i]->GetYaxis()->SetTitle("Cts");
1142  }
1143 
1144  for(Int_t i=0; i<3; i++){
1145  fHistDPhiMix2_4_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-4Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1146  fHistDPhiMix2_4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1147  fHistDPhiMix2_4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1148  }
1149 
1150  for(Int_t i=0; i<3; i++){
1151  fHistDPhiMix2_4_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-4Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1152  fHistDPhiMix2_4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1153  fHistDPhiMix2_4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1154  }
1155 
1156  for(Int_t i=0; i<3; i++){
1157  fHistDPhiMix2_4_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-4Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1158  fHistDPhiMix2_4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1159  fHistDPhiMix2_4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1160  }
1161 
1162  // Delta Phi for tracks > 3GeV
1163  for(Int_t i=0; i<3; i++){
1164  fHistDPhiMix4_8_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4-8Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1165  fHistDPhiMix4_8_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1166  fHistDPhiMix4_8_MB[i]->GetYaxis()->SetTitle("Cts");
1167  }
1168 
1169  for(Int_t i=0; i<3; i++){
1170  fHistDPhiMix4_8_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4-8Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1171  fHistDPhiMix4_8_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1172  fHistDPhiMix4_8_EMC7[i]->GetYaxis()->SetTitle("Cts");
1173  }
1174 
1175  for(Int_t i=0; i<3; i++){
1176  fHistDPhiMix4_8_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4-8Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1177  fHistDPhiMix4_8_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1178  fHistDPhiMix4_8_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1179  }
1180 
1181  for(Int_t i=0; i<3; i++){
1182  fHistDPhiMix4_8_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4-8Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 4Gev<pt<8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 50, -TMath::Pi()/2, 3*TMath::Pi()/2);
1183  fHistDPhiMix4_8_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1184  fHistDPhiMix4_8_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1185  }
1186 
1187 
1188 
1189  //Hadron e/p plot
1190  fHistEMC_Had_MB_1Gev = new TH1F("fHistEMC_Had_MB_1Gev", "E/p for hadrons with Pt between 1-2Gev", 100, 0, 1.5);
1191  fHistEMC_Had_MB_1Gev->GetXaxis()->SetTitle("E/p");
1192  fHistEMC_Had_MB_1Gev->GetYaxis()->SetTitle("Cts");
1193 
1194  // Eta-Phi distribution for tagged events
1195  fHistEtaPhiTag_MB = new TH2F("fHistEtaPhiTag_MB", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1196  fHistEtaPhiTag_MB->GetXaxis()->SetTitle("Eta");
1197  fHistEtaPhiTag_MB->GetYaxis()->SetTitle("Phi");
1198 
1199  fHistEtaPhiTag_EMC7 = new TH2F("fHistEtaPhiTag_EMC7", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1200  fHistEtaPhiTag_EMC7->GetXaxis()->SetTitle("Eta");
1201  fHistEtaPhiTag_EMC7->GetYaxis()->SetTitle("Phi");
1202 
1203  fHistEtaPhiTag_EMCEGA = new TH2F("fHistEtaPhiTag_EMCEGA", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1204  fHistEtaPhiTag_EMCEGA->GetXaxis()->SetTitle("Eta");
1205  fHistEtaPhiTag_EMCEGA->GetYaxis()->SetTitle("Phi");
1206 
1207  fHistEtaPhiTag_EMCJet = new TH2F("fHistEtaPhiTag_EMCJet", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1208  fHistEtaPhiTag_EMCJet->GetXaxis()->SetTitle("Eta");
1209  fHistEtaPhiTag_EMCJet->GetYaxis()->SetTitle("Phi");
1210 
1211  // Eta-Phi distribution
1212  fHistEtaPhi_MB = new TH2F("fHistEtaPhi_MB", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1213  fHistEtaPhi_MB->GetXaxis()->SetTitle("Eta");
1214  fHistEtaPhi_MB->GetYaxis()->SetTitle("Phi");
1215 
1216  fHistEtaPhi_EMC7 = new TH2F("fHistEtaPhi_EMC7", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1217  fHistEtaPhi_EMC7->GetXaxis()->SetTitle("Eta");
1218  fHistEtaPhi_EMC7->GetYaxis()->SetTitle("Phi");
1219 
1220  fHistEtaPhi_EMCEGA = new TH2F("fHistEtaPhi_EMCEGA", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1221  fHistEtaPhi_EMCEGA->GetXaxis()->SetTitle("Eta");
1222  fHistEtaPhi_EMCEGA->GetYaxis()->SetTitle("Phi");
1223 
1224  fHistEtaPhi_EMCJet = new TH2F("fHistEtaPhi_EMCJet", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1225  fHistEtaPhi_EMCJet->GetXaxis()->SetTitle("Eta");
1226  fHistEtaPhi_EMCJet->GetYaxis()->SetTitle("Phi");
1227 
1228  fHistEtaPhiTPCOnly_MB = new TH2F("fHistEtaPhiTPCOnly_MB", "Eta-Phi distribution of TPC only tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1229  fHistEtaPhiTPCOnly_MB->GetXaxis()->SetTitle("Eta");
1230  fHistEtaPhiTPCOnly_MB->GetYaxis()->SetTitle("Phi");
1231 
1232  // Energy per event histos
1233  fHistPtSum_MB = new TH1F("fHistPtSum_MB", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1234  fHistPtSum_MB->GetXaxis()->SetTitle("Pt Sum");
1235  fHistPtSum_MB->GetYaxis()->SetTitle("Cts");
1236 
1237  fHistPtSum_EMC7 = new TH1F("fHistPtSum_EMC7", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1238  fHistPtSum_EMC7->GetXaxis()->SetTitle("Pt Sum");
1239  fHistPtSum_EMC7->GetYaxis()->SetTitle("Cts");
1240 
1241  fHistPtSum_EMCEGA = new TH1F("fHistPtSum_EMCEGA", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1242  fHistPtSum_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1243  fHistPtSum_EMCEGA->GetYaxis()->SetTitle("Cts");
1244 
1245  fHistPtSum_EMCJet = new TH1F("fHistPtSum_EMCJet", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1246  fHistPtSum_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1247  fHistPtSum_EMCJet->GetYaxis()->SetTitle("Cts");
1248 
1249  // Energy per tagged event histos
1250  fHistPtSumTag_MB = new TH1F("fHistPtSumTag_MB", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1251  fHistPtSumTag_MB->GetXaxis()->SetTitle("Pt Sum");
1252  fHistPtSumTag_MB->GetYaxis()->SetTitle("Cts");
1253 
1254  fHistPtSumTag_EMC7 = new TH1F("fHistPtSumTag_EMC7", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1255  fHistPtSumTag_EMC7->GetXaxis()->SetTitle("Pt Sum");
1256  fHistPtSumTag_EMC7->GetYaxis()->SetTitle("Cts");
1257 
1258  fHistPtSumTag_EMCEGA = new TH1F("fHistPtSumTag_EMCEGA", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1259  fHistPtSumTag_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1260  fHistPtSumTag_EMCEGA->GetYaxis()->SetTitle("Cts");
1261 
1262  fHistPtSumTag_EMCJet = new TH1F("fHistPtSumTag_EMCJet", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1263  fHistPtSumTag_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1264  fHistPtSumTag_EMCJet->GetYaxis()->SetTitle("Cts");
1265 
1266  // Energy per event in EMC acceptance histos
1267  fHistPtSumEMC_MB = new TH1F("fHistPtSumEMC_MB", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1268  fHistPtSumEMC_MB->GetXaxis()->SetTitle("Pt Sum");
1269  fHistPtSumEMC_MB->GetYaxis()->SetTitle("Cts");
1270 
1271  fHistPtSumEMC_EMC7 = new TH1F("fHistPtSumEMC_EMC7", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1272  fHistPtSumEMC_EMC7->GetXaxis()->SetTitle("Pt Sum");
1273  fHistPtSumEMC_EMC7->GetYaxis()->SetTitle("Cts");
1274 
1275  fHistPtSumEMC_EMCEGA = new TH1F("fHistPtSumEMC_EMCEGA", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1276  fHistPtSumEMC_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1277  fHistPtSumEMC_EMCEGA->GetYaxis()->SetTitle("Cts");
1278 
1279  fHistPtSumEMC_EMCJet = new TH1F("fHistPtSumEMC_EMCJet", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1280  fHistPtSumEMC_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1281  fHistPtSumEMC_EMCJet->GetYaxis()->SetTitle("Cts");
1282 
1283  // Numbers of events
1284  fHistNevents_MB = new TH1F("fHistNevents_MB", "Number of events that have an 'electron'", 2,0,1);
1285  fHistNevents_MB->GetXaxis()->SetBinLabel(1,"Events");
1286  fHistNevents_MB->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1287  fHistNevents_MB->GetYaxis()->SetTitle("Cts");
1288 
1289  fHistNevents_EMC7 = new TH1F("fHistNevents_EMC7", "Number of events that have an 'electron'", 2,0,1);
1290  fHistNevents_EMC7->GetXaxis()->SetBinLabel(1,"Events");
1291  fHistNevents_EMC7->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1292  fHistNevents_EMC7->GetYaxis()->SetTitle("Cts");
1293 
1294  fHistNevents_EMCEGA = new TH1F("fHistNevents_EMCEGA", "Number of events that have an 'electron'", 2,0,1);
1295  fHistNevents_EMCEGA->GetXaxis()->SetBinLabel(1,"Events");
1296  fHistNevents_EMCEGA->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1297  fHistNevents_EMCEGA->GetYaxis()->SetTitle("Cts");
1298 
1299  fHistNevents_EMCJet = new TH1F("fHistNevents_EMCJet", "Number of events that have an 'electron'", 2,0,1);
1300  fHistNevents_EMCJet->GetXaxis()->SetBinLabel(1,"Events");
1301  fHistNevents_EMCJet->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1302  fHistNevents_EMCJet->GetYaxis()->SetTitle("Cts");
1303 
1304  //Impact Parameter histos
1305  fHistImpPar_MB = new TH1F("fHistImpPar_MB", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1306  fHistImpPar_MB->GetXaxis()->SetTitle("Impact Parameter(cm)");
1307  fHistImpPar_MB->GetYaxis()->SetTitle("Count");
1308 
1309  fHistImpPar_EMC7 = new TH1F("fHistImpPar_EMC7", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1310  fHistImpPar_EMC7->GetXaxis()->SetTitle("Impact Parameter(cm)");
1311  fHistImpPar_EMC7->GetYaxis()->SetTitle("Count");
1312 
1313  fHistImpPar_EMCEGA = new TH1F("fHistImpPar_EMCEGA", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1314  fHistImpPar_EMCEGA->GetXaxis()->SetTitle("Impact Parameter(cm)");
1315  fHistImpPar_EMCEGA->GetYaxis()->SetTitle("Count");
1316 
1317  fHistImpPar_EMCJet = new TH1F("fHistImpPar_EMCJet", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1318  fHistImpPar_EMCJet->GetXaxis()->SetTitle("Impact Parameter(cm)");
1319  fHistImpPar_EMCJet->GetYaxis()->SetTitle("Count");
1320 
1321  //Impact Parameter for tagged electrons histos
1322  fHistImpParTag_MB = new TH1F("fHistImpParTag_MB", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1323  fHistImpParTag_MB->GetXaxis()->SetTitle("Impact Parameter(cm)");
1324  fHistImpParTag_MB->GetYaxis()->SetTitle("Count");
1325 
1326  fHistImpParTag_EMC7 = new TH1F("fHistImpParTag_EMC7", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1327  fHistImpParTag_EMC7->GetXaxis()->SetTitle("Impact Parameter(cm)");
1328  fHistImpParTag_EMC7->GetYaxis()->SetTitle("Count");
1329 
1330  fHistImpParTag_EMCEGA = new TH1F("fHistImpParTag_EMCEGA", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1331  fHistImpParTag_EMCEGA->GetXaxis()->SetTitle("Impact Parameter(cm)");
1332  fHistImpParTag_EMCEGA->GetYaxis()->SetTitle("Count");
1333 
1334  fHistImpParTag_EMCJet = new TH1F("fHistImpParTag_EMCJet", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1335  fHistImpParTag_EMCJet->GetXaxis()->SetTitle("Impact Parameter(cm)");
1336  fHistImpParTag_EMCJet->GetYaxis()->SetTitle("Count");
1337 
1338  //Number of clusters per track in TPC
1339  fHistTPCNClus_MB = new TH1F("fHistTPCNClus_MB", "Number of Clusters per track in TPC", 159, 0, 159);
1340  fHistTPCNClus_MB->GetXaxis()->SetTitle("Number of TPC Clusters");
1341  fHistTPCNClus_MB->GetYaxis()->SetTitle("Number of Tracks");
1342 
1343  fHistTPCNClus_EMC7 = new TH1F("fHistTPCNClus_EMC7", "Number of Clusters per track in TPC", 159, 0, 159);
1344  fHistTPCNClus_EMC7->GetXaxis()->SetTitle("Number of TPC Clusters");
1345  fHistTPCNClus_EMC7->GetYaxis()->SetTitle("Number of Tracks");
1346 
1347  fHistTPCNClus_EMCEGA = new TH1F("fHistTPCNClus_EMCEGA", "Number of Clusters per track in TPC", 159, 0, 159);
1348  fHistTPCNClus_EMCEGA->GetXaxis()->SetTitle("Number of TPC Clusters");
1349  fHistTPCNClus_EMCEGA->GetYaxis()->SetTitle("Number of Tracks");
1350 
1351  fHistTPCNClus_EMCJet = new TH1F("fHistTPCNClus_EMCJet", "Number of Clusters per track in TPC", 159, 0, 159);
1352  fHistTPCNClus_EMCJet->GetXaxis()->SetTitle("Number of TPC Clusters");
1353  fHistTPCNClus_EMCJet->GetYaxis()->SetTitle("Number of Tracks");
1354 
1355  //Number of clusters per track in ITS
1356  fHistITSNClus_MB = new TH1F("fHistITSNClus_MB", "Number of Clusters per Track in ITS", 10, 0, 10);
1357  fHistITSNClus_MB->GetXaxis()->SetTitle("Number of ITS Clusters");
1358  fHistITSNClus_MB->GetYaxis()->SetTitle("Number of Tracks");
1359 
1360  fHistITSNClus_EMC7 = new TH1F("fHistITSNClus_EMC7", "Number of Clusters per Track in ITS", 10, 0, 10);
1361  fHistITSNClus_EMC7->GetXaxis()->SetTitle("Number of ITS Clusters");
1362  fHistITSNClus_EMC7->GetYaxis()->SetTitle("Number of Tracks");
1363 
1364  fHistITSNClus_EMCEGA = new TH1F("fHistITSNClus_EMCEGA", "Number of Clusters per Track in ITS", 10, 0, 10);
1365  fHistITSNClus_EMCEGA->GetXaxis()->SetTitle("Number of ITS Clusters");
1366  fHistITSNClus_EMCEGA->GetYaxis()->SetTitle("Number of Tracks");
1367 
1368  fHistITSNClus_EMCJet = new TH1F("fHistITSNClus_EMCJet", "Number of Clusters per Track in ITS", 10, 0, 10);
1369  fHistITSNClus_EMCJet->GetXaxis()->SetTitle("Number of ITS Clusters");
1370  fHistITSNClus_EMCJet->GetYaxis()->SetTitle("Number of Tracks");
1371 
1372  // Pt distribution of all tracks and tagged tracks
1373  fHistPtAssoc_MB = new TH1F("fHistPtAssoc_MB", "Pt distribution for associated tracks", 100,0, 15);
1374  fHistPtAssoc_MB->GetXaxis()->SetTitle("Pt(Gev)");
1375  fHistPtAssoc_MB->GetYaxis()->SetTitle("Count");
1376 
1377  fHistPtAssoc_EMC7 = new TH1F("fHistPtAssoc_EMC7", "Pt distribution for associated tracks", 100,0, 15);
1378  fHistPtAssoc_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1379  fHistPtAssoc_EMC7->GetYaxis()->SetTitle("Count");
1380 
1381  fHistPtAssoc_EMCEGA = new TH1F("fHistPtAssoc_EMCEGA", "Pt distribution for associated tracks", 100,0, 15);
1382  fHistPtAssoc_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1383  fHistPtAssoc_EMCEGA->GetYaxis()->SetTitle("Count");
1384 
1385  fHistPtAssoc_EMCJet = new TH1F("fHistPtAssoc_EMCJet", "Pt distribution for associated tracks", 100,0, 15);
1386  fHistPtAssoc_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1387  fHistPtAssoc_EMCJet->GetYaxis()->SetTitle("Count");
1388 
1389  // Pt distribution of all tracks for mixed events
1390  fHistPtAssocMix_MB = new TH1F("fHistPtAssocMix_MB", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1391  fHistPtAssocMix_MB->GetXaxis()->SetTitle("Pt(Gev)");
1392  fHistPtAssocMix_MB->GetYaxis()->SetTitle("Count");
1393 
1394  fHistPtAssocMix_EMC7 = new TH1F("fHistPtAssocMix_EMC7", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1395  fHistPtAssocMix_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1396  fHistPtAssocMix_EMC7->GetYaxis()->SetTitle("Count");
1397 
1398  fHistPtAssocMix_EMCEGA = new TH1F("fHistPtAssocMix_EMCEGA", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1399  fHistPtAssocMix_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1400  fHistPtAssocMix_EMCEGA->GetYaxis()->SetTitle("Count");
1401 
1402  fHistPtAssocMix_EMCJet = new TH1F("fHistPtAssocMix_EMCJet", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1403  fHistPtAssocMix_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1404  fHistPtAssocMix_EMCJet->GetYaxis()->SetTitle("Count");
1405 
1406  //Impact Parameter for tagged electrons histos
1407  fHistPtTag_MB = new TH1F("fHistPtTag_MB", "Pt distribution for electron candidates", 100,0, 15);
1408  fHistPtTag_MB->GetXaxis()->SetTitle("Pt(Gev)");
1409  fHistPtTag_MB->GetYaxis()->SetTitle("Count");
1410 
1411  fHistPtTag_EMC7 = new TH1F("fHistPtTag_EMC7", "Pt distribution for electron candidates", 100,0, 15);
1412  fHistPtTag_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1413  fHistPtTag_EMC7->GetYaxis()->SetTitle("Count");
1414 
1415  fHistPtTag_EMCEGA = new TH1F("fHistPtTag_EMCEGA", "Pt distribution for electron candidates", 100,0, 15);
1416  fHistPtTag_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1417  fHistPtTag_EMCEGA->GetYaxis()->SetTitle("Count");
1418 
1419  fHistPtTag_EMCJet = new TH1F("fHistPtTag_EMCJet", "Pt distribution for electron candidates", 100,0, 15);
1420  fHistPtTag_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1421  fHistPtTag_EMCJet->GetYaxis()->SetTitle("Count");
1422 
1423  //test histos
1424  fHistTestDCA = new TH1F("fHistTestDCA", "DCA distribution for all tracks with DPhi to any candidate electron <0.1 rad", 100,-15, 15);
1425  fHistTestDCA->GetXaxis()->SetTitle("DCA(cm)");
1426  fHistTestDCA->GetYaxis()->SetTitle("Count");
1427 
1428  fHistTestEMCEnergy = new TH1F("fHistTestEMCEnergy", "Energy from EMCal for all tracks with DPhi to any candidate electron <0.1 rad", 100, 0, 10);
1429  fHistTestEMCEnergy->GetXaxis()->SetTitle("EMC Energy[GeV]");
1430  fHistTestEMCEnergy->GetYaxis()->SetTitle("Counts");
1431 
1432  fHistTestTPCdEdx = new TH2F("fHistTestTPCdEdx", "TPC dE/dx for all tracks with DPhi to any candidate electron <0.1 rad", 100, 0,8, 300, -30, 180);
1433  fHistTestTPCdEdx->GetYaxis()->SetTitle("TPC dE/dx[a.u.]");
1434  fHistTestTPCdEdx->GetXaxis()->SetTitle("pT[GeV/c]");
1435 
1436  fHistTestEOP = new TH1F("fHistTestEOP", "E/p for all tracks with DPhi to any candidate electron <0.1 rad", 30, 0, 1.5);
1437  fHistTestEOP->GetXaxis()->SetTitle("E/p[c]");
1438  fHistTestEOP->GetYaxis()->SetTitle("Counts");
1439 
1440  fHistTestOGDPhi = new TH1F("fHistTestOGDPhi", "Original DPhi before periodicity correction", 100, -2*TMath::Pi(), 2*TMath::Pi());
1441  fHistTestOGDPhi->GetXaxis()->SetTitle("DPhi[rad]");
1442  fHistTestOGDPhi->GetYaxis()->SetTitle("Counts");
1443 
1444  fHistTestPt = new TH1F("fHistTestPt", "Pt distribution for associated particles nearly on top of tagged particle", 30, 0, 8);
1445  fHistTestPt->GetXaxis()->SetTitle("Pt[Gev/c]");
1446  fHistTestPt->GetYaxis()->SetTitle("Cts");
1447 
1448  fHistTestInvMassElecLike = new TH1F("fHistTestInvMassElecLike", "Invariant Mass distribution for associated electrons of like sign in |DPhi|<0.1rad", 30, 0, 8);
1449  fHistTestInvMassElecLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1450  fHistTestInvMassElecLike->GetYaxis()->SetTitle("Cts");
1451 
1452  fHistTestInvMassElecUnLike = new TH1F("fHistTestInvMassElecUnLike", "Invariant Mass distribution for associated electrons of unlike sign with |DPhi|<0.1rad", 30, 0, 8);
1453  fHistTestInvMassElecUnLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1454  fHistTestInvMassElecUnLike->GetYaxis()->SetTitle("Cts");
1455 
1456  fHistTestInvMassPionLike = new TH1F("fHistTestInvMassPionLike", "Invariant Mass distribution for associated pions with |DPhi|<0.1rad", 30, 0, 8);
1457  fHistTestInvMassPionLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1458  fHistTestInvMassPionLike->GetYaxis()->SetTitle("Cts");
1459 
1460  fHistTestInvMassPionUnLike = new TH1F("fHistTestInvMassPionUnLike", "Invariant Mass distribution for associated pions with |DPhi|<0.1rad", 30, 0, 8);
1461  fHistTestInvMassPionUnLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1462  fHistTestInvMassPionUnLike->GetYaxis()->SetTitle("Cts");
1463 
1464  //DPhi by dEdx for triggered particles 1-8 gev and assoc. particles >.3gev
1465  fHistTestDPhiSpeNoSec = new TH2F("fHistTestDPhiSpeNoSec", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev with no secondary tracks", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
1466  fHistTestDPhiSpeNoSec->GetXaxis()->SetTitle("Delta-Phi");
1467  fHistTestDPhiSpeNoSec->GetYaxis()->SetTitle("Species");
1468  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(1, "Unkown");
1469  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(2, "Electron");
1470  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(3, "Muon");
1471  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(4, "Pion");
1472  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(5, "Kaon");
1473  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(6, "Proton");
1474  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(7, "Deuteron");
1475  fHistTestDPhiSpeNoSec->GetZaxis()->SetTitle("Cts");
1476 
1477  //DPhi by track type to test for tpconly tracks for triggered particles 1-8 gev and assoc. particles >.3gev
1478  fHistTestDPhiType = new TH2F("fHistTestDPhiType", "Delta-Phi by track type for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 4, 0, 4);
1479  fHistTestDPhiType->GetXaxis()->SetTitle("Delta-Phi");
1480  fHistTestDPhiType->GetYaxis()->SetTitle("Track Type");
1481  fHistTestDPhiType->GetYaxis()->SetBinLabel(1, "Hybrid");
1482  fHistTestDPhiType->GetYaxis()->SetBinLabel(2, "Complementary");
1483  fHistTestDPhiType->GetYaxis()->SetBinLabel(3, "TPC Only");
1484  fHistTestDPhiType->GetZaxis()->SetTitle("Cts");
1485 
1486  //DPhi for candidate electrons 1-8 gev and assoc. particles >.3gev with secondaries
1487  fHistTestDPhi18Sec = new TH1F("fHistTestDPhi18Sec", "Delta-Phi for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1488  fHistTestDPhi18Sec->GetXaxis()->SetTitle("Delta-Phi");
1489  fHistTestDPhi18Sec->GetYaxis()->SetTitle("Cts");
1490 
1491  //DPhi for candidate electrons 1-8 gev and assoc. particles >.3gev without secondaries
1492  fHistTestDPhi18NoSec = new TH1F("fHistTestDPhi18NoSec", "Delta-Phi for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1493  fHistTestDPhi18NoSec->GetXaxis()->SetTitle("Delta-Phi");
1494  fHistTestDPhi18NoSec->GetYaxis()->SetTitle("Cts");
1495 
1496  //Add rejection plots to MB plots since it is the easiest place
1499  //samesies for the test plots
1500  fOutputMB->Add(fHistTestDCA);
1503  fOutputMB->Add(fHistTestEOP);
1504  fOutputMB->Add(fHistTestOGDPhi);
1505  fOutputMB->Add(fHistTestPt);
1514 
1516  fOutputMB->Add(fHistPtAssoc_MB);
1518  fOutputMB->Add(fHistPtTag_MB);
1521  fOutputMB->Add(fHistImpPar_MB);
1523  fOutputMB->Add(fHistNevents_MB);
1524  fOutputMB->Add(fHistPtSum_MB);
1527  fOutputMB->Add(fHistEtaPhi_MB);
1535  for(Int_t i=0; i<6;i++){
1536  fOutputMB->Add(fHistTPC_EMCTRD_MB[i]);
1537 
1538  fOutputMB->Add(fHistEMC_TPCTRD_MB[i]);
1539 
1540  fOutputMB->Add(fHistTRD_TPCEMC_MB[i]);
1541 
1542  }
1543  for(Int_t i=0; i<3;i++){
1544  fOutputMB->Add(fHistDPhi300_1_MB[i]);
1545  fOutputMB->Add(fHistDPhi1_2_MB[i]);
1546  fOutputMB->Add(fHistDPhi2_4_MB[i]);
1547  fOutputMB->Add(fHistDPhi4_8_MB[i]);
1549  fOutputMB->Add(fHistDPhiMix1_2_MB[i]);
1550  fOutputMB->Add(fHistDPhiMix2_4_MB[i]);
1551  fOutputMB->Add(fHistDPhiMix4_8_MB[i]);
1552  }
1553  fOutputMB->Add(fHistDPhi28_MB);
1558 
1577  for(Int_t i=0; i<6;i++){
1579 
1581 
1583 
1584  }
1585  for(Int_t i=0; i<3;i++){
1587  fOutputEMC7->Add(fHistDPhi1_2_EMC7[i]);
1588  fOutputEMC7->Add(fHistDPhi2_4_EMC7[i]);
1589  fOutputEMC7->Add(fHistDPhi4_8_EMC7[i]);
1594  }
1600 
1619  for(Int_t i=0; i<6;i++){
1621 
1623 
1625 
1626  }
1627  for(Int_t i=0; i<3;i++){
1636  }
1642 
1661  for(Int_t i=0; i<6;i++){
1663 
1665 
1667 
1668  }
1669  for(Int_t i=0; i<3;i++){
1678  }
1684 
1685  // NEW HISTO added to fOutput here
1686  PostData(1, fOutputMB);
1687  PostData(2, fOutputEMC7);
1688  PostData(3, fOutputEMCEGA);
1689  PostData(4, fOutputEMCJet);// Post data for ALL output slots >0 here, to get at least an empty histogram
1690 }
1691 
1692 //________________________________________________________________________
1694 {
1695  // Main loop
1696  // Called for each event
1697 
1698  //_______________________________Major event-level stuff____________________________________
1699  // Create pointer to reconstructed event
1700  AliVEvent *event = InputEvent();
1701  if (!event) { Printf("ERROR: Could not retrieve event"); return; }
1702 
1703  // create pointer to event
1704  AliAODEvent* aod = dynamic_cast<AliAODEvent*>(event);
1705  if (!aod) {
1706  AliError("Cannot get the AOD event");
1707  return;
1708  }
1709 
1710  // input handler
1711  const AliAnalysisManager* man(AliAnalysisManager::GetAnalysisManager());
1712  if (NULL == man) {
1713  AliWarning("AliAnalysisManager is not available");
1714  return;
1715  }
1716 
1717  AliInputEventHandler* inputHandler = (AliInputEventHandler*)man->GetInputEventHandler();
1718  if (!inputHandler) {
1719  AliWarning("AliInputEventHandler is not available");
1720  return;
1721  }
1722 
1723  UInt_t fSelectMask = inputHandler->IsEventSelected();
1724 
1725  Bool_t isSelected = fSelectMask & (AliVEvent::kEMC7 | AliVEvent::kEMCEJE | AliVEvent::kEMCEGA);
1726  if(!isSelected){
1727  AliWarning("This is not an EMCal triggered event");
1728  }
1729 
1730  MBtrg = fSelectMask & AliVEvent::kAnyINT;
1731  EMC7trg = fSelectMask & AliVEvent::kEMC7;
1732  EMCEGAtrg = fSelectMask & AliVEvent::kEMCEGA;
1733  EMCJettrg = fSelectMask & AliVEvent::kEMCEJE;
1734 
1736 
1737  Int_t elecIDs[1000];
1738  Int_t elecCnt=0;
1739 
1740  AliPIDResponse* fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
1741 
1742  if(!fPIDResponse){
1743  AliWarning("NULL PIDResponse");
1744  }
1745 
1746  TObjArray* trkArr = MakeTrkArr(aod);
1747  Bool_t delTrk = kTRUE;
1748 
1749  //__________________________End major event stuff_____________________________
1750 
1751 
1752  //Fill the histogram cataloguing # of events vs. events tagged
1753  if(MBtrg){
1754  fHistNevents_MB->Fill("Events",1);
1755  }
1756  switch(trigVal){
1757  case(EMC7):
1758  fHistNevents_EMC7->Fill("Events",1);
1759  break;
1760 
1761  case(EMCEGA):
1762  fHistNevents_EMCEGA->Fill("Events",1);
1763  break;
1764 
1765  case(EMCJE):
1766  fHistNevents_EMCJet->Fill("Events",1);
1767  break;
1768  }
1769 
1770  //Initialize energy variable and tagging flags
1771  Double_t PtSum=0;
1772  Double_t PtSumEMC=0;
1773  tagStrong=kFALSE;
1774  Bool_t tagEvt=kFALSE;
1775 
1776  //Initialize the # of tracks variable and the Eta Phi arrays
1777  Int_t ntracks=0;
1778  ntracks = aod->GetNumberOfTracks();
1779 
1780  std::vector<Double_t> Eta;
1781  std::vector<Double_t> Phi;
1782 
1783  fPool = fPoolMan->GetEventPool(ntracks, aod->GetPrimaryVertex()->GetZ());
1784 
1785  // Track loop for reconstructed event
1786  for(Int_t i = 0; i < ntracks; i++) {
1787 
1788  tagStrong=kFALSE;
1789  tagPhot=kFALSE;
1790  AliAODTrack* aodtrack = (AliAODTrack*)aod->GetTrack(i); // pointer to reconstructed to track
1791 
1792  if(!aodtrack) {
1793  AliError(Form("ERROR: Could not retrieve track %d",i));
1794  continue;
1795  }
1796 
1797  //Fill TPCOnly track eta-phi
1798 
1799  if(aodtrack->IsTPCOnly()){
1800  fHistEtaPhiTPCOnly_MB->Fill(aodtrack->Eta(),aodtrack->Phi());
1801  }
1802 
1803  //Do hybrid track cuts
1804  if(!aodtrack->IsHybridGlobalConstrainedGlobal()){continue;}
1805 
1806  //Add this tracks energy to the running total
1807  PtSum=PtSum+aodtrack->Pt();
1808  if(aodtrack->Eta()<.7&&aodtrack->Eta()>-.7&&aodtrack->Phi()>80&&aodtrack->Phi()<180){
1809  PtSumEMC=PtSumEMC+aodtrack->Pt();
1810  }
1811 
1812  //Fill the Eta Phi arrays with this tracks Eta and Phi
1813  Eta.push_back(aodtrack->Eta());
1814  Phi.push_back(aodtrack->Phi());
1815 
1816  if(MBtrg){
1817  fHistEtaPhi_MB->Fill(aodtrack->Eta(),aodtrack->Phi());
1818  }
1819  switch(trigVal){
1820  case(EMC7):
1821  fHistEtaPhi_EMC7->Fill(aodtrack->Eta(),aodtrack->Phi());
1822  break;
1823  case(EMCEGA):
1824  fHistEtaPhi_EMCEGA->Fill(aodtrack->Eta(),aodtrack->Phi());
1825  break;
1826  case(EMCJE):
1827  fHistEtaPhi_EMCJet->Fill(aodtrack->Eta(),aodtrack->Phi());
1828  break;
1829  }
1830  //do Cut level histograms
1831  if(MBtrg){
1832  if(aodtrack->GetTPCncls()>0){
1833  fHistTPCNClus_MB->Fill(aodtrack->GetTPCncls());
1834  }
1835  fHistITSNClus_MB->Fill(aodtrack->GetNcls(0));
1836  }
1837  switch(trigVal){
1838  case(EMC7):
1839  if(aodtrack->GetTPCncls()>0){
1840  fHistTPCNClus_EMC7->Fill(aodtrack->GetTPCncls());
1841  }
1842  fHistITSNClus_EMC7->Fill(aodtrack->GetNcls(0));
1843  break;
1844 
1845  case(EMCEGA):
1846  if(aodtrack->GetTPCncls()>0){
1847  fHistTPCNClus_EMCEGA->Fill(aodtrack->GetTPCncls());
1848  }
1849  fHistITSNClus_EMCEGA->Fill(aodtrack->GetNcls(0));
1850  break;
1851 
1852  case(EMCJE):
1853  if(aodtrack->GetTPCncls()>0){
1854  fHistTPCNClus_EMCJet->Fill(aodtrack->GetTPCncls());
1855  }
1856  fHistITSNClus_EMCJet->Fill(aodtrack->GetNcls(0));
1857  break;
1858  }
1859 
1860  //Impact parameter
1861  Float_t xy;
1862  Float_t z;
1863 
1864  xy=TMath::Sqrt(aodtrack->XAtDCA()*aodtrack->XAtDCA()+aodtrack->YAtDCA()*aodtrack->YAtDCA());
1865 
1866  if(MBtrg){
1867  fHistImpPar_MB->Fill(xy);
1868  }
1869  switch(trigVal){
1870  case(EMC7):
1871  fHistImpPar_EMC7->Fill(xy);
1872  break;
1873 
1874  case(EMCEGA):
1875  fHistImpPar_EMCEGA->Fill(xy);
1876  break;
1877 
1878  case(EMCJE):
1879  fHistImpPar_EMCJet->Fill(xy);
1880  break;
1881  }
1882 
1883  FillPhotoElecHistos(aod, aodtrack, fPIDResponse, i);
1884 
1885  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1886  //If the track doesn't pass the cuts, move on to the next one
1887  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1888  if(trackCutsStrong){
1889  if(!fTrackCutsStrong->AcceptVTrack((AliVTrack*)aodtrack) || aodtrack->GetTPCsignalN()<80){continue;}
1890  }else{
1891  if(!fTrackCutsWeak->AcceptVTrack((AliVTrack*)aodtrack) || aodtrack->GetTPCsignalN()<80){continue;}
1892  }
1893 
1894  FillPIDHistos(aod, aodtrack, fPIDResponse);//Fill PID histos and set "tagStrong" boolean if this track satisfies cuts
1895 
1896  //If the track made it through any 3 detector cuts
1897  if(tagStrong){
1898  tagEvt=kTRUE;//This event contains a candidate electron
1899  //Increment the candidate count and put track ID of candidate into array
1900 
1901  elecIDs[elecCnt]=i;
1902  elecCnt+=1;
1903 
1904  //Fill impact parameter plots
1905  if(MBtrg){
1906  fHistImpParTag_MB->Fill(xy);
1907  }
1908  switch(trigVal){
1909  case(EMC7):
1910  fHistImpParTag_EMC7->Fill(xy);
1911  break;
1912 
1913  case(EMCEGA):
1914  fHistImpParTag_EMCEGA->Fill(xy);
1915  break;
1916 
1917  case(EMCJE):
1918  fHistImpParTag_EMCJet->Fill(xy);
1919  break;
1920  }
1921 
1922  //Pt distribution
1923 
1924  if(MBtrg){
1925  fHistPtTag_MB->Fill(aodtrack->Pt());
1926  }
1927  switch(trigVal){
1928  case(EMC7):
1929  fHistPtTag_EMC7->Fill(aodtrack->Pt());
1930  break;
1931 
1932  case(EMCEGA):
1933  fHistPtTag_EMCEGA->Fill(aodtrack->Pt());
1934  break;
1935 
1936  case(EMCJE):
1937  fHistPtTag_EMCJet->Fill(aodtrack->Pt());
1938  break;
1939  }
1940  FillDPhiHistos(aod, aodtrack, i);//Fill DPhi histos
1941 
1942  if(tagPhot){
1943  if(MBtrg){
1944  fHistPhotoMismatch_MB->Fill(0);
1945  }
1946  switch(trigVal){
1947  case(EMC7):
1948  fHistPhotoMismatch_EMC7->Fill(0);
1949  break;
1950  case(EMCEGA):
1951  fHistPhotoMismatch_EMCEGA->Fill(0);
1952  break;
1953  case(EMCJE):
1954  fHistPhotoMismatch_EMCJet->Fill(0);
1955  break;
1956  }
1957  }
1958 
1959 
1960 
1961 
1962  if(!fPool){cout<<"No Pool for this event man\n"; continue;}
1963 
1964  fPool->PrintInfo();
1965  if(fPool->IsReady() ){
1966  FillMEDPhiHistos(aodtrack);
1967  }
1968  else{
1969  cout<<"Pool wasn't ready\n";
1970  }
1971  }//end if(tagStrong)
1972 
1973  }//end main track loop
1974  if(!fPool){
1975  cout<<"No pool exists, can't update it"<<'\n';
1976  }
1977  else{
1978  if(UseNonSignalEvents){
1979  if(trkArr){
1980  delTrk=kFALSE;
1981  fPool->UpdatePool(trkArr);
1982  }
1983  }else{
1984  if(tagEvt){
1985  if(trkArr){
1986  delTrk=kFALSE;
1987  fPool->UpdatePool(trkArr);
1988  }
1989  }
1990  }
1991  }
1992 
1993  //Call function to fill Region histos and pass it int array of IDs for identified electron tracks
1994  Int_t elecIDsSparse[elecCnt];
1995  for(Int_t i=0;i<elecCnt;i++){
1996  elecIDsSparse[i]=elecIDs[i];
1997  }
1998 
1999  //Fill Number of electrons plot
2000  fHistNElecPerEvent->Fill(elecCnt);
2001 
2002  //Fill the total pt sum histogram
2003  if(tagEvt){
2004  if(MBtrg){
2005  fHistPtSumTag_MB->Fill(PtSum);
2006  }
2007  switch(trigVal){
2008  case(EMC7):
2009  fHistPtSumTag_EMC7->Fill(PtSum);
2010  break;
2011  case(EMCEGA):
2012  fHistPtSumTag_EMCEGA->Fill(PtSum);
2013  break;
2014  case(EMCJE):
2015  fHistPtSumTag_EMCJet->Fill(PtSum);
2016  break;
2017  }
2018  }else{
2019  if(MBtrg){
2020  fHistPtSum_MB->Fill(PtSum);
2021  }
2022  switch(trigVal){
2023  case(EMC7):
2024  fHistPtSum_EMC7->Fill(PtSum);
2025  break;
2026  case(EMCEGA):
2027  fHistPtSum_EMCEGA->Fill(PtSum);
2028  break;
2029  case(EMCJE):
2030  fHistPtSum_EMCJet->Fill(PtSum);
2031  break;
2032  }
2033  }
2034 
2035  if(MBtrg){
2036  fHistPtSumEMC_MB->Fill(PtSumEMC);
2037  }
2038  switch(trigVal){
2039  case(EMC7):
2040  fHistPtSumEMC_EMC7->Fill(PtSumEMC);
2041  break;
2042  case(EMCEGA):
2043  fHistPtSumEMC_EMCEGA->Fill(PtSumEMC);
2044  break;
2045  case(EMCJE):
2046  fHistPtSumEMC_EMCJet->Fill(PtSumEMC);
2047  break;
2048  }
2049 
2050  //Fill Nevent histos
2051  if(tagEvt){
2052  if(MBtrg){
2053  fHistNevents_MB->Fill("Events containing candidates",1);
2054  }
2055  switch(trigVal){
2056  case(EMC7):
2057  fHistNevents_EMC7->Fill("Events containing candidates",1);
2058  break;
2059  case(EMCEGA):
2060  fHistNevents_EMCEGA->Fill("Events containing candidates",1);
2061  break;
2062  case(EMCJE):
2063  fHistNevents_EMCJet->Fill("Events containing candidates",1);
2064  break;
2065  }
2066  }
2067 
2068  //Fill the Eta Phi histograms
2069  if(tagEvt){
2070  for(Int_t i=0;i<Eta.size();i++){
2071  if(MBtrg){
2072  fHistEtaPhiTag_MB->Fill(Eta[i],Phi[i]);
2073  }
2074  switch(trigVal){
2075  case(EMC7):
2076  fHistEtaPhiTag_EMC7->Fill(Eta[i],Phi[i]);
2077  break;
2078  case(EMCEGA):
2079  fHistEtaPhiTag_EMCEGA->Fill(Eta[i],Phi[i]);
2080  break;
2081  case(EMCJE):
2082  fHistEtaPhiTag_EMCJet->Fill(Eta[i],Phi[i]);
2083  break;
2084  }
2085  }
2086  }
2087 
2088  if(trkArr&&delTrk){
2089  delete trkArr;
2090  }
2091 
2092 
2093 
2094  // NEW HISTO should be filled before this point, as PostData puts the
2095  // information for this iteration of the UserExec in the container
2096  PostData(1, fOutputMB);
2097  PostData(2, fOutputEMC7);
2098  PostData(3, fOutputEMCEGA);
2099  PostData(4, fOutputEMCJet);
2100 }
2101 
2102 void AliAnalysisTaskPSHFE::FillPIDHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse){
2103 
2104  if(!aodtrack){
2105  AliWarning("aodtrack is null, no point in doing PID");
2106  return;
2107  }
2108 
2109 
2110  Bool_t isPIDRej = kFALSE;
2111 
2112  //Fill TOF and TPC status variables
2113  AliPIDResponse::EDetPidStatus TOFStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF, aodtrack);
2114 
2115  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrack);
2116 
2117  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrack);
2118 
2119  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, aodtrack);
2120 
2121  //Check validity of PID, TODO: Add a rejection histogram
2122  if(TOFStatus!=AliPIDResponse::kDetPidOk){
2123  fHistPIDRejection->Fill(2);
2124  //isPIDRej=kTRUE;
2125  }
2126 
2127  if(TPCStatus!=AliPIDResponse::kDetPidOk){
2128  fHistPIDRejection->Fill(1);
2129  isPIDRej=kTRUE;
2130  }
2131 
2132  if(TRDStatus!=AliPIDResponse::kDetPidOk){
2133  fHistPIDRejection->Fill(3);
2134  isPIDRej=kTRUE;
2135  }
2136 
2137  if(EMCStatus!=AliPIDResponse::kDetPidOk){
2138  fHistPIDRejection->Fill(4);
2139  isPIDRej=kTRUE;
2140  }
2141 
2142 
2143  //Get the # of sigmas around an electron hypothesis for TOF and TPC
2144  Double_t nSigmaTOF;
2145  nSigmaTOF = fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kElectron);
2146 
2147  Double_t nSigmaTPC;
2148  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron);
2149 
2150  Double_t elecLikeTRD[1];
2151  if(fPIDResponse->ComputeTRDProbability(aodtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrack->GetTRDntrackletsPID()<4){
2152  fHistPIDRejection->Fill(3);
2153  isPIDRej=kTRUE;
2154  }
2155 
2156  if(isPIDRej){return;}
2157 
2158  //declare emcal cluster PID variables
2159  Double_t EOP=-1;
2160  Int_t caloId=aodtrack->GetEMCALcluster();
2161 
2162  if(caloId==-99999){
2163  return;
2164  }
2165 
2166  AliAODCaloCluster* tagEMCclus=aod->GetCaloCluster(caloId);
2167 
2168  if(tagEMCclus->E()>.5){
2169  EOP = tagEMCclus->E()/aodtrack->Pt();
2170  }
2171  else{
2172  return;
2173  }
2174 
2175 
2176 
2177  //=========================================================================================================================
2178  //PID cuts and histogram filling
2179  //=========================================================================================================================
2180 
2181  //Some Double arrays for pt ranges
2182  Double_t ptUpper[6] = {2, 3, 4, 5, 6, 1000000};
2183  Double_t ptLower[6] = {1, 2, 3, 4, 5, 6};
2184  Double_t TPCcut = 2;
2185  Double_t TOFcut = 2;
2186  Double_t TRDcut = .9;
2187  Double_t EMCcutLower[6] = {.85,.85,.85,.85,.85,.85};
2188  Double_t EMCcutHigher[6] = {1.3,1.3,1.3,1.3,1.3,1.3};
2189 
2190  for(Int_t i=0; i<6; i++){
2191  if(aodtrack->Pt()>ptLower[i]&&aodtrack->Pt()<ptUpper[i]){
2192 
2193  //TPC Plots
2194  //EMC+TRD cuts
2195  if(EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]&&elecLikeTRD[0]>TRDcut){
2196 
2197  if(MBtrg){
2198  fHistTPC_EMCTRD_MB[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2199  }
2200  switch(trigVal){
2201  case(EMC7):
2202  fHistTPC_EMCTRD_EMC7[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2203  break;
2204 
2205  case(EMCEGA):
2206  fHistTPC_EMCTRD_EMCEGA[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2207  break;
2208 
2209  case(EMCJE):
2210  fHistTPC_EMCTRD_EMCJet[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2211  break;
2212  }
2213  }
2214 
2215  //EMC Plots
2216 
2217  //TPC+TRD cuts
2218  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut){
2219 
2220  if(!applySSCuts){
2221  if(MBtrg){
2222  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
2223  }
2224  switch(trigVal){
2225  case(EMC7):
2226  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
2227  break;
2228 
2229  case(EMCEGA):
2230  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
2231  break;
2232 
2233  case(EMCJE):
2234  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
2235  break;
2236  }
2237  }else{
2238  if(MBtrg){
2239  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
2240  }
2241  switch(trigVal){
2242  case(EMC7):
2243  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
2244  break;
2245 
2246  case(EMCEGA):
2247  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
2248  break;
2249 
2250  case(EMCJE):
2251  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
2252  break;
2253  }
2254  }
2255  }
2256 
2257  //TRD Plots
2258 
2259  //TPC+EMC cuts
2260  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]){
2261 
2262  if(MBtrg){
2263  fHistTRD_TPCEMC_MB[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2264  }
2265  switch(trigVal){
2266  case(EMC7):
2267  fHistTRD_TPCEMC_EMC7[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2268  break;
2269 
2270  case(EMCEGA):
2271  fHistTRD_TPCEMC_EMCEGA[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2272  break;
2273 
2274  case(EMCJE):
2275  fHistTRD_TPCEMC_EMCJet[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2276  break;
2277  }
2278  }
2279  }
2280  }
2281  if(MBtrg){
2282  if(aodtrack->Pt()<2&&aodtrack->Pt()>1){
2283  if(nSigmaTPC<-2&&nSigmaTPC>-8){
2284  fHistEMC_Had_MB_1Gev->Fill(EOP);
2285  }
2286  }
2287  }
2288 
2289  if(applySSCuts){
2290 
2291  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15, M02=(0,.5), M20=(0,.3)
2292 
2293  if(aodtrack->Pt()<6){
2294  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]){
2295 
2296  tagStrong=kTRUE;
2297 
2298  }
2299 
2300  }
2301 
2302  else{
2303 
2304  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]){
2305 
2306  tagStrong=kTRUE;
2307 
2308  }
2309 
2310  }
2311 
2312  }else{//no sscuts
2313 
2314  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15
2315 
2316  if(aodtrack->Pt()<6){
2317  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]){
2318 
2319  tagStrong=kTRUE;
2320 
2321  }
2322 
2323  }
2324 
2325  else{
2326 
2327  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]){
2328 
2329  tagStrong=kTRUE;
2330 
2331  }
2332 
2333  }
2334 
2335  }
2336 
2337  /*//Check if any tracks pass all cuts
2338  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&nSigmaTOF<TOFcut&&nSigmaTOF>-TOFcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher&&EOP>EMCcutLower){
2339  tagAll=kTRUE;
2340  }*/
2341 
2342  //=========================================================================
2343  // End of PID stuff
2344  //=========================================================================
2345  PostData(1, fOutputMB);
2346  PostData(2, fOutputEMC7);
2347  PostData(3, fOutputEMCEGA);
2348  PostData(4, fOutputEMCJet);
2349  return;
2350 }
2351 
2352 void AliAnalysisTaskPSHFE::FillDPhiHistos(AliAODEvent *aod, AliAODTrack *aodtrack, Int_t i){
2353  //Run through all tracks in this
2354  Int_t ntracks = aod->GetNumberOfTracks();
2355  for(Int_t j = 0; j < ntracks; j++) {
2356 
2357  //Don't double count the tagged tracks
2358  if(i==j){continue;}
2359 
2360 
2361  AliAODTrack* aodtrackassoc = (AliAODTrack*)aod->GetTrack(j); // pointer to reconstructed to track
2362 
2363  if(!aodtrackassoc) {
2364  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
2365  continue;
2366  }
2367 
2368  //Do hybrid track cuts
2369  if(!aodtrackassoc->IsHybridGlobalConstrainedGlobal()&&!aodtrackassoc->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){continue;}
2370 
2371  //Pt distribution
2372  if(MBtrg){
2373  fHistPtAssoc_MB->Fill(aodtrackassoc->Pt());
2374  }
2375  switch(trigVal){
2376  case(EMC7):
2377  fHistPtAssoc_EMC7->Fill(aodtrackassoc->Pt());
2378  break;
2379 
2380  case(EMCEGA):
2381  fHistPtAssoc_EMCEGA->Fill(aodtrackassoc->Pt());
2382  break;
2383 
2384  case(EMCJE):
2385  fHistPtAssoc_EMCJet->Fill(aodtrackassoc->Pt());
2386  break;
2387  }
2388 
2389  //Fill Delta Phi variable and correct for periodicity
2390  Double_t DPhi=aodtrackassoc->Phi()-aodtrack->Phi();
2391 
2392  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
2393 
2394  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
2395 
2396  Double_t DEta=aodtrackassoc->Eta()-aodtrack->Eta();
2397 
2398 
2399  Int_t PID=0;
2400  cout<<"most probPID"<<AliAODTrack::kElectron<<":"<<aodtrackassoc->GetMostProbablePID()<<'\n';
2401  switch(aodtrackassoc->GetMostProbablePID()){
2402  case AliAODTrack::kElectron:
2403  PID=1;
2404  break;
2405  case AliAODTrack::kMuon:
2406  PID=2;
2407  break;
2408  case AliAODTrack::kPion:
2409  PID=3;
2410  break;
2411  case AliAODTrack::kKaon:
2412  PID=4;
2413  break;
2414  case AliAODTrack::kProton:
2415  PID=5;
2416  break;
2417  case AliAODTrack::kDeuteron:
2418  PID=6;
2419  break;
2420  case AliAODTrack::kUnknown:
2421  PID=0;
2422  break;
2423  }
2424 
2425  if(MBtrg){
2426  fHistDPhi18Spe_MB->Fill(DPhi, PID);
2427  }
2428  switch(trigVal){
2429  case(EMC7):
2430  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
2431  break;
2432  case(EMCEGA):
2433  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
2434  break;
2435  case(EMCJE):
2436  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
2437  break;
2438  }
2439 
2440  if(aodtrackassoc->GetType()==AliAODTrack::kPrimary){
2441 
2442  if(aodtrack->Pt()<8&&aodtrack->Pt()>1&&aodtrackassoc->Pt()>0.3)
2443  {
2444  fHistTestDPhi18NoSec->Fill(DPhi);
2445  }
2446 
2447  fHistTestDPhiSpeNoSec->Fill(DPhi, PID);
2448 
2449  }else{
2450  if(aodtrack->Pt()<8&&aodtrack->Pt()>1&&aodtrackassoc->Pt()>0.3)
2451  {
2452  fHistTestDPhi18Sec->Fill(DPhi);
2453  }
2454  }
2455 
2456 
2457 
2458  //Fill DPhi by Type here
2459  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()) fHistTestDPhiType->Fill(DPhi, 1);
2460 
2461  if((aodtrackassoc->IsGlobalConstrained())) fHistTestDPhiType->Fill(DPhi, 2);
2462 
2463  if((aodtrackassoc->IsTPCOnly())) fHistTestDPhiType->Fill(DPhi, 3);
2464 
2465 
2466  if(DPhi<0.1&&DPhi>-0.1&&DEta<0.1&&DEta>-0.1){
2467 
2468  fHistTestPt->Fill(aodtrackassoc->Pt());
2469  fHistTestOGDPhi->Fill(aodtrackassoc->Phi()-aodtrack->Phi());
2470  fHistTestDCA->Fill(aodtrackassoc->DCA());
2471  fHistTestTPCdEdx->Fill(aodtrackassoc->Pt(), aodtrackassoc->GetTPCsignal());
2472 
2473 
2474  Int_t partOneID = 0;
2475  Int_t partTwoID = 0;
2476 
2477  if(aodtrackassoc->GetMostProbablePID()==AliAODTrack::kElectron) partOneID=1;
2478 
2479  if(aodtrackassoc->GetMostProbablePID()==AliAODTrack::kPion) partOneID=2;
2480 
2481 
2482  for(Int_t k=0;k<ntracks;k++){
2483  if(i==k || j==k){continue;}
2484 
2485  AliAODTrack* aodtrackassoc2 = (AliAODTrack*)aod->GetTrack(k);
2486 
2487  if(aodtrackassoc2->GetMostProbablePID()==AliAODTrack::kElectron) partTwoID=1;
2488 
2489  if(aodtrackassoc2->GetMostProbablePID()==AliAODTrack::kPion) partTwoID=2;
2490 
2491  Double_t DPhi=aodtrackassoc2->Phi()-aodtrack->Phi();
2492 
2493  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
2494 
2495  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
2496 
2497  Double_t DEta=aodtrackassoc2->Eta()-aodtrack->Eta();
2498 
2499  Double_t ElecMass=.000511;
2500 
2501  Double_t PionMass=.139;
2502  //fill inv mass plot
2503 
2504  if(partOneID==1&&partTwoID==1&&aodtrackassoc->Charge()==aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0)
2505  {
2506  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
2507  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+ElecMass*ElecMass);
2508 
2509  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2510  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2511 
2512  Double_t InvMass=(assoc1+assoc2).M();
2513 
2514  fHistTestInvMassElecLike->Fill(InvMass);
2515  }
2516 
2517  if(partOneID==1&&partTwoID==1&&aodtrackassoc->Charge()!=aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0&&aodtrackassoc2->Charge()!=0)
2518  {
2519  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
2520  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+ElecMass*ElecMass);
2521 
2522  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2523  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2524 
2525  Double_t InvMass=(assoc1+assoc2).M();
2526 
2527  fHistTestInvMassElecUnLike->Fill(InvMass);
2528  }
2529 
2530  if(partOneID==2&&partTwoID==2&&aodtrackassoc->Charge()==aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0)
2531  {
2532  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+PionMass*PionMass);
2533  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+PionMass*PionMass);
2534 
2535  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2536  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2537 
2538  Double_t InvMass=(assoc1+assoc2).M();
2539 
2540  fHistTestInvMassPionLike->Fill(InvMass);
2541  }
2542 
2543  if(partOneID==2&&partTwoID==2&&aodtrackassoc->Charge()!=aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0&&aodtrackassoc2->Charge()!=0)
2544  {
2545  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+PionMass*PionMass);
2546  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+PionMass*PionMass);
2547 
2548  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2549  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2550 
2551  Double_t InvMass=(assoc1+assoc2).M();
2552 
2553  fHistTestInvMassPionUnLike->Fill(InvMass);
2554  }
2555 
2556 
2557 
2558  }
2559  //Fill other plots
2560  Int_t cid = aodtrackassoc->GetEMCALcluster();
2561  if(cid > 0){
2562  AliAODCaloCluster *aodcl = aod->GetCaloCluster(cid);
2563 
2564  fHistTestEMCEnergy->Fill(aodcl->E());
2565  fHistTestEOP->Fill(aodcl->E()/aodtrackassoc->Pt());
2566  }
2567  else{cout<<"No EMCal cluster for this anamolous Peak\n";}
2568 
2569 
2570 
2571 
2572  }
2573 
2574  if(PID==1||PID==2||PID==0){continue;}
2575 
2576  //candidate 1<pt<2
2577  if(aodtrack->Pt()>1&&aodtrack->Pt()<2){
2578 
2579 
2580 
2581  //300MeV
2582  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<1){
2583  if(MBtrg){
2584  fHistDPhi300_1_MB[0]->Fill(DPhi);
2585  }
2586  switch(trigVal){
2587  case(EMC7):
2588  fHistDPhi300_1_EMC7[0]->Fill(DPhi);
2589  break;
2590  case(EMCEGA):
2591  fHistDPhi300_1_EMCEGA[0]->Fill(DPhi);
2592  break;
2593  case(EMCJE):
2594  fHistDPhi300_1_EMCJet[0]->Fill(DPhi);
2595  break;
2596  }
2597  }
2598 
2599  //1GeV
2600  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
2601  if(MBtrg){
2602  fHistDPhi1_2_MB[0]->Fill(DPhi);
2603  }
2604  switch(trigVal){
2605  case(EMC7):
2606  fHistDPhi1_2_EMC7[0]->Fill(DPhi);
2607  break;
2608  case(EMCEGA):
2609  fHistDPhi1_2_EMCEGA[0]->Fill(DPhi);
2610  break;
2611  case(EMCJE):
2612  fHistDPhi1_2_EMCJet[0]->Fill(DPhi);
2613  break;
2614  }
2615  }
2616 
2617  //2GeV
2618  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<4){
2619  if(MBtrg){
2620  fHistDPhi2_4_MB[0]->Fill(DPhi);
2621  }
2622  switch(trigVal){
2623  case(EMC7):
2624  fHistDPhi2_4_EMC7[0]->Fill(DPhi);
2625  break;
2626  case(EMCEGA):
2627  fHistDPhi2_4_EMCEGA[0]->Fill(DPhi);
2628  break;
2629  case(EMCJE):
2630  fHistDPhi2_4_EMCJet[0]->Fill(DPhi);
2631  break;
2632  }
2633  }
2634 
2635  //4GeV
2636  if(aodtrackassoc->Pt()>4&&aodtrackassoc->Pt()<8){
2637  if(MBtrg){
2638  fHistDPhi4_8_MB[0]->Fill(DPhi);
2639  }
2640  switch(trigVal){
2641  case(EMC7):
2642  fHistDPhi4_8_EMC7[0]->Fill(DPhi);
2643  break;
2644  case(EMCEGA):
2645  fHistDPhi4_8_EMCEGA[0]->Fill(DPhi);
2646  break;
2647  case(EMCJE):
2648  fHistDPhi4_8_EMCJet[0]->Fill(DPhi);
2649  break;
2650  }
2651  }
2652 
2653 
2654  }
2655 
2656  //candidate 2<pt<4
2657  if(aodtrack->Pt()>2&&aodtrack->Pt()<4){
2658 
2659 
2660 
2661  //300MeV
2662  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<1){
2663  if(MBtrg){
2664  fHistDPhi300_1_MB[1]->Fill(DPhi);
2665  }
2666  switch(trigVal){
2667  case(EMC7):
2668  fHistDPhi300_1_EMC7[1]->Fill(DPhi);
2669  break;
2670  case(EMCEGA):
2671  fHistDPhi300_1_EMCEGA[1]->Fill(DPhi);
2672  break;
2673  case(EMCJE):
2674  fHistDPhi300_1_EMCJet[1]->Fill(DPhi);
2675  break;
2676  }
2677  }
2678 
2679  //1GeV
2680  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
2681  if(MBtrg){
2682  fHistDPhi1_2_MB[1]->Fill(DPhi);
2683  }
2684  switch(trigVal){
2685  case(EMC7):
2686  fHistDPhi1_2_EMC7[1]->Fill(DPhi);
2687  break;
2688  case(EMCEGA):
2689  fHistDPhi1_2_EMCEGA[1]->Fill(DPhi);
2690  break;
2691  case(EMCJE):
2692  fHistDPhi1_2_EMCJet[1]->Fill(DPhi);
2693  break;
2694  }
2695  }
2696 
2697  //2GeV
2698  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<4){
2699  if(MBtrg){
2700  fHistDPhi2_4_MB[1]->Fill(DPhi);
2701  fHistDPhi28_MB->Fill(DPhi);
2702  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
2703  }
2704  switch(trigVal){
2705  case(EMC7):
2706  fHistDPhi2_4_EMC7[1]->Fill(DPhi);
2707  fHistDPhi28_EMC7->Fill(DPhi);
2708  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
2709  break;
2710  case(EMCEGA):
2711  fHistDPhi2_4_EMCEGA[1]->Fill(DPhi);
2712  fHistDPhi28_EMCEGA->Fill(DPhi);
2713  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
2714  break;
2715  case(EMCJE):
2716  fHistDPhi2_4_EMCJet[1]->Fill(DPhi);
2717  fHistDPhi28_EMCJet->Fill(DPhi);
2718  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
2719  break;
2720  }
2721  }
2722 
2723  //4GeV
2724  if(aodtrackassoc->Pt()>4&&aodtrackassoc->Pt()<8){
2725  if(MBtrg){
2726  fHistDPhi4_8_MB[1]->Fill(DPhi);
2727  fHistDPhi28_MB->Fill(DPhi);
2728  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
2729  }
2730  switch(trigVal){
2731  case(EMC7):
2732  fHistDPhi4_8_EMC7[1]->Fill(DPhi);
2733  fHistDPhi28_EMC7->Fill(DPhi);
2734  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
2735  break;
2736  case(EMCEGA):
2737  fHistDPhi4_8_EMCEGA[1]->Fill(DPhi);
2738  fHistDPhi28_EMCEGA->Fill(DPhi);
2739  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
2740  break;
2741  case(EMCJE):
2742  fHistDPhi4_8_EMCJet[1]->Fill(DPhi);
2743  fHistDPhi28_EMCJet->Fill(DPhi);
2744  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
2745  break;
2746  }
2747  }
2748 
2749 
2750  }
2751 
2752  //candidate 4<pt<8
2753  if(aodtrack->Pt()>4&&aodtrack->Pt()<8){
2754 
2755 
2756 
2757  //300MeV
2758  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<1){
2759  if(MBtrg){
2760  fHistDPhi300_1_MB[2]->Fill(DPhi);
2761  }
2762  switch(trigVal){
2763  case(EMC7):
2764  fHistDPhi300_1_EMC7[2]->Fill(DPhi);
2765  break;
2766  case(EMCEGA):
2767  fHistDPhi300_1_EMCEGA[2]->Fill(DPhi);
2768  break;
2769  case(EMCJE):
2770  fHistDPhi300_1_EMCJet[2]->Fill(DPhi);
2771  break;
2772  }
2773  }
2774 
2775  //1GeV
2776  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
2777  if(MBtrg){
2778  fHistDPhi1_2_MB[2]->Fill(DPhi);
2779  }
2780  switch(trigVal){
2781  case(EMC7):
2782  fHistDPhi1_2_EMC7[2]->Fill(DPhi);
2783  break;
2784  case(EMCEGA):
2785  fHistDPhi1_2_EMCEGA[2]->Fill(DPhi);
2786  break;
2787  case(EMCJE):
2788  fHistDPhi1_2_EMCJet[2]->Fill(DPhi);
2789  break;
2790  }
2791  }
2792 
2793  //2GeV
2794  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<4){
2795  if(MBtrg){
2796  fHistDPhi2_4_MB[2]->Fill(DPhi);
2797  fHistDPhi28_MB->Fill(DPhi);
2798  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
2799  }
2800  switch(trigVal){
2801  case(EMC7):
2802  fHistDPhi2_4_EMC7[2]->Fill(DPhi);
2803  fHistDPhi28_EMC7->Fill(DPhi);
2804  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
2805  break;
2806  case(EMCEGA):
2807  fHistDPhi2_4_EMCEGA[2]->Fill(DPhi);
2808  fHistDPhi28_EMCEGA->Fill(DPhi);
2809  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
2810  break;
2811  case(EMCJE):
2812  fHistDPhi2_4_EMCJet[2]->Fill(DPhi);
2813  fHistDPhi28_EMCJet->Fill(DPhi);
2814  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
2815  break;
2816  }
2817  }
2818 
2819  //4GeV
2820  if(aodtrackassoc->Pt()>4&&aodtrackassoc->Pt()<8){
2821  if(MBtrg){
2822  fHistDPhi4_8_MB[2]->Fill(DPhi);
2823  fHistDPhi28_MB->Fill(DPhi);
2824  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
2825  }
2826  switch(trigVal){
2827  case(EMC7):
2828  fHistDPhi4_8_EMC7[2]->Fill(DPhi);
2829  fHistDPhi28_EMC7->Fill(DPhi);
2830  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
2831  break;
2832  case(EMCEGA):
2833  fHistDPhi4_8_EMCEGA[2]->Fill(DPhi);
2834  fHistDPhi28_EMCEGA->Fill(DPhi);
2835  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
2836  break;
2837  case(EMCJE):
2838  fHistDPhi4_8_EMCJet[2]->Fill(DPhi);
2839  fHistDPhi28_EMCJet->Fill(DPhi);
2840  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
2841  break;
2842  }
2843  }
2844 
2845 
2846  }
2847 
2848  }
2849  PostData(1, fOutputMB);
2850  PostData(2, fOutputEMC7);
2851  PostData(3, fOutputEMCEGA);
2852  PostData(4, fOutputEMCJet);
2853  return;
2854 }
2855 
2857  trackCutsStrong=trkCutBool;
2858 }
2859 
2861  applySSCuts=SSCutBool;
2862 }
2863 
2864 void AliAnalysisTaskPSHFE::FillPhotoElecHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse, Int_t i){
2865 
2866  if(!aodtrack){
2867  AliWarning("aodtrack is null, no point in doing Photonic Electron stuff");
2868  return;
2869  }
2870 
2871  Bool_t isElec=kFALSE;
2872  Double_t ElecMass=.0005109989;
2873  //Fill TOF and TPC status variables
2874  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrack);
2875 
2876  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrack);
2877 
2878  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, aodtrack);
2879 
2880  //Check validity of PID, TODO: Add a rejection histogram
2881  if(TPCStatus!=AliPIDResponse::kDetPidOk){
2882  return;
2883  }
2884 
2885  if(TRDStatus!=AliPIDResponse::kDetPidOk){
2886  return;
2887  }
2888 
2889  if(EMCStatus!=AliPIDResponse::kDetPidOk){
2890  return;
2891  }
2892 
2893 
2894  //Get the # of sigmas around an electron hypothesis for TOF and TPC
2895  Double_t nSigmaTPC;
2896  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron);
2897 
2898  Double_t elecLikeTRD[1];
2899  if(fPIDResponse->ComputeTRDProbability(aodtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrack->GetTRDntrackletsPID()<4){
2900  return;
2901  }
2902 
2903  //declare emcal cluster PID variables
2904  Double_t EOP=-1;
2905  Int_t caloId=aodtrack->GetEMCALcluster();
2906 
2907  if(caloId==-99999){
2908  return;
2909  }
2910 
2911  AliAODCaloCluster* tagEMCclus=aod->GetCaloCluster(caloId);
2912 
2913  EOP = tagEMCclus->E()/aodtrack->Pt();
2914 
2915  if((nSigmaTPC<2&&nSigmaTPC>-2)||(EOP<1.4&&EOP>.8)||(elecLikeTRD[0]>.8)){
2916  isElec=kTRUE;
2917  }
2918 
2919  if(!isElec){return;}
2920 
2921  Int_t ntracks=aod->GetNumberOfTracks();
2922 
2923  for(Int_t j = 0; j < ntracks; j++) {
2924 
2925  //Don't double count the tagged tracks
2926  if(i==j){continue;}
2927 
2928  AliAODTrack* aodtrackassoc = (AliAODTrack*)aod->GetTrack(j); // pointer to reconstructed to track
2929 
2930  if(!aodtrackassoc) {
2931  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
2932  continue;
2933  }
2934 
2935  //Do hybrid track cuts
2936  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
2937 
2938  Bool_t isElecToo=kFALSE;
2939 
2940  //Fill TOF and TPC status variables
2941  AliPIDResponse::EDetPidStatus TPCStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrackassoc);
2942 
2943  AliPIDResponse::EDetPidStatus TRDStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrackassoc);
2944 
2945  //Check validity of PID, TODO: Add a rejection histogram
2946  if(TPCStatusassoc!=AliPIDResponse::kDetPidOk){
2947  continue;
2948  }
2949 
2950  if(TRDStatusassoc!=AliPIDResponse::kDetPidOk){
2951  continue;
2952  }
2953 
2954 
2955  //Get the # of sigmas around an electron hypothesis for TOF and TPC
2956  Double_t nSigmaTPCassoc;
2957  nSigmaTPCassoc = fPIDResponse->NumberOfSigmasTPC(aodtrackassoc,AliPID::kElectron);
2958 
2959  Double_t elecLikeTRDassoc[1];
2960  if(fPIDResponse->ComputeTRDProbability(aodtrackassoc, AliPID::kElectron, elecLikeTRDassoc, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrackassoc->GetTRDntrackletsPID()<4){
2961  return;
2962  }
2963 
2964  if((nSigmaTPCassoc<2&&nSigmaTPCassoc>-2)||(elecLikeTRDassoc[0]>.8)){
2965  isElecToo=kTRUE;
2966  }
2967 
2968  if(!isElecToo){continue;}
2969 
2970  Double_t elecE1=TMath::Sqrt(aodtrack->P()*aodtrack->P()+ElecMass*ElecMass);
2971  Double_t elecE2=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
2972 
2973  TLorentzVector elec1(aodtrack->Px(), aodtrack->Py(), aodtrack->Pz(), elecE1);
2974  TLorentzVector elec2(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), elecE2);
2975 
2976  Double_t InvMass=(elec1+elec2).M();
2977  Double_t OpAng=elec1.Angle(elec2.Vect());
2978 
2979  if(aodtrack->Charge()==aodtrackassoc->Charge()&&aodtrack->Charge()!=0){
2980 
2981  if(MBtrg){
2982  fHistInvMassElecLike_MB->Fill(InvMass);
2983  fHistOpAngElecLike_MB->Fill(OpAng);
2984  }
2985  switch(trigVal){
2986  case(EMC7):
2987  fHistInvMassElecLike_EMC7->Fill(InvMass);
2988  fHistOpAngElecLike_EMC7->Fill(OpAng);
2989  break;
2990 
2991  case(EMCEGA):
2992  fHistInvMassElecLike_EMCEGA->Fill(InvMass);
2993  fHistOpAngElecLike_EMCEGA->Fill(OpAng);
2994  break;
2995 
2996  case(EMCJE):
2997  fHistInvMassElecLike_EMCJet->Fill(InvMass);
2998  fHistOpAngElecLike_EMCJet->Fill(OpAng);
2999  break;
3000  }
3001 
3002  }else if(aodtrack->Charge()!=aodtrackassoc->Charge()&&aodtrack->Charge()!=0&&aodtrackassoc->Charge()!=0){
3003  if(InvMass<0.1&&OpAng<0.1){tagPhot=kTRUE;}
3004  if(MBtrg){
3005  fHistInvMassElecUnLike_MB->Fill(InvMass);
3006  fHistOpAngElecUnLike_MB->Fill(OpAng);
3007  }
3008  switch(trigVal){
3009  case(EMC7):
3010  fHistInvMassElecUnLike_EMC7->Fill(InvMass);
3011  fHistOpAngElecUnLike_EMC7->Fill(OpAng);
3012  break;
3013 
3014  case(EMCEGA):
3015  fHistInvMassElecUnLike_EMCEGA->Fill(InvMass);
3016  fHistOpAngElecUnLike_EMCEGA->Fill(OpAng);
3017  break;
3018 
3019  case(EMCJE):
3020  fHistInvMassElecUnLike_EMCJet->Fill(InvMass);
3021  fHistOpAngElecUnLike_EMCJet->Fill(OpAng);
3022  break;
3023  }
3024  }
3025  }//end loop over tracks
3026 
3027  PostData(1, fOutputMB);
3028  PostData(2, fOutputEMC7);
3029  PostData(3, fOutputEMCEGA);
3030  PostData(4, fOutputEMCJet);
3031  return;
3032 }
3033 
3035 {
3036  if(!aod){AliWarning("Invalid AOD Event");}
3037  Int_t nTracks = aod->GetNumberOfTracks();
3038  TObjArray* accTracks = new TObjArray;
3039  accTracks->SetOwner();
3040 
3041  for(Int_t i=0;i<nTracks;i++){
3042  AliAODTrack *aodtrack = (AliAODTrack*)aod->GetTrack(i);
3043 
3044  if(!aodtrack){
3045  continue;
3046  }
3047 
3048  if(aodtrack->IsHybridGlobalConstrainedGlobal()){
3049  continue;
3050  }
3051  AliAODTrack* temp = new AliAODTrack(*aodtrack);
3052  accTracks->Add(temp);
3053  }
3054 
3055  return accTracks;
3056 }
3057 
3058 void AliAnalysisTaskPSHFE::FillMEDPhiHistos(AliAODTrack *aodtrack)
3059 {
3060  Int_t nEvents = fPool->GetCurrentNEvents();
3061 
3062  for(Int_t Ev=0;Ev<nEvents;Ev++){
3063 
3064  TObjArray *mixedTracks = fPool->GetEvent(Ev);
3065 
3066  Int_t nMixedTracks = mixedTracks->GetEntriesFast();
3067 
3068  for(Int_t j=0;j<nMixedTracks;j++){
3069  AliAODTrack* aodtrackassoc = (AliAODTrack*)mixedTracks->At(j); // pointer to reconstructed to track
3070 
3071  if(!aodtrackassoc) {
3072  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
3073  continue;
3074  }
3075 
3076  //Do hybrid track cuts
3077  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
3078 
3079  //Pt distribution
3080  if(MBtrg){
3081  fHistPtAssocMix_MB->Fill(aodtrackassoc->Pt());
3082  }
3083  switch(trigVal){
3084  case(EMC7):
3085  fHistPtAssocMix_EMC7->Fill(aodtrackassoc->Pt());
3086  break;
3087 
3088  case(EMCEGA):
3089  fHistPtAssocMix_EMCEGA->Fill(aodtrackassoc->Pt());
3090  break;
3091 
3092  case(EMCJE):
3093  fHistPtAssocMix_EMCJet->Fill(aodtrackassoc->Pt());
3094  break;
3095  }
3096 
3097  //Fill Delta Phi variable and correct for periodicity
3098  Double_t DPhi=aodtrackassoc->Phi()-aodtrack->Phi();
3099 
3100  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
3101 
3102  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
3103 
3104  Double_t DEta=aodtrackassoc->Eta()-aodtrack->Eta();
3105 
3106  //candidate 1<pt<2
3107  if(aodtrack->Pt()>1&&aodtrack->Pt()<2){
3108 
3109 
3110 
3111  //300MeV
3112  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<1){
3113  if(MBtrg){
3114  fHistDPhiMix300_1_MB[0]->Fill(DPhi);
3115  }
3116  switch(trigVal){
3117  case(EMC7):
3118  fHistDPhiMix300_1_EMC7[0]->Fill(DPhi);
3119  break;
3120  case(EMCEGA):
3121  fHistDPhiMix300_1_EMCEGA[0]->Fill(DPhi);
3122  break;
3123  case(EMCJE):
3124  fHistDPhiMix300_1_EMCJet[0]->Fill(DPhi);
3125  break;
3126  }
3127  }
3128 
3129  //1GeV
3130  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3131  if(MBtrg){
3132  fHistDPhiMix1_2_MB[0]->Fill(DPhi);
3133  }
3134  switch(trigVal){
3135  case(EMC7):
3136  fHistDPhiMix1_2_EMC7[0]->Fill(DPhi);
3137  break;
3138  case(EMCEGA):
3139  fHistDPhiMix1_2_EMCEGA[0]->Fill(DPhi);
3140  break;
3141  case(EMCJE):
3142  fHistDPhiMix1_2_EMCJet[0]->Fill(DPhi);
3143  break;
3144  }
3145  }
3146 
3147  //2GeV
3148  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<4){
3149  if(MBtrg){
3150  fHistDPhiMix2_4_MB[0]->Fill(DPhi);
3151  }
3152  switch(trigVal){
3153  case(EMC7):
3154  fHistDPhiMix2_4_EMC7[0]->Fill(DPhi);
3155  break;
3156  case(EMCEGA):
3157  fHistDPhiMix2_4_EMCEGA[0]->Fill(DPhi);
3158  break;
3159  case(EMCJE):
3160  fHistDPhiMix2_4_EMCJet[0]->Fill(DPhi);
3161  break;
3162  }
3163  }
3164 
3165  //4GeV
3166  if(aodtrackassoc->Pt()>4&&aodtrackassoc->Pt()<8){
3167  if(MBtrg){
3168  fHistDPhiMix4_8_MB[0]->Fill(DPhi);
3169  }
3170  switch(trigVal){
3171  case(EMC7):
3172  fHistDPhiMix4_8_EMC7[0]->Fill(DPhi);
3173  break;
3174  case(EMCEGA):
3175  fHistDPhiMix4_8_EMCEGA[0]->Fill(DPhi);
3176  break;
3177  case(EMCJE):
3178  fHistDPhiMix4_8_EMCJet[0]->Fill(DPhi);
3179  break;
3180  }
3181  }
3182 
3183 
3184  }
3185 
3186  //candidate 2<pt<4
3187  if(aodtrack->Pt()>2&&aodtrack->Pt()<4){
3188 
3189 
3190 
3191  //300MeV
3192  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<1){
3193  if(MBtrg){
3194  fHistDPhiMix300_1_MB[1]->Fill(DPhi);
3195  }
3196  switch(trigVal){
3197  case(EMC7):
3198  fHistDPhiMix300_1_EMC7[1]->Fill(DPhi);
3199  break;
3200  case(EMCEGA):
3201  fHistDPhiMix300_1_EMCEGA[1]->Fill(DPhi);
3202  break;
3203  case(EMCJE):
3204  fHistDPhiMix300_1_EMCJet[1]->Fill(DPhi);
3205  break;
3206  }
3207  }
3208 
3209  //1GeV
3210  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3211  if(MBtrg){
3212  fHistDPhiMix1_2_MB[1]->Fill(DPhi);
3213  }
3214  switch(trigVal){
3215  case(EMC7):
3216  fHistDPhiMix1_2_EMC7[1]->Fill(DPhi);
3217  break;
3218  case(EMCEGA):
3219  fHistDPhiMix1_2_EMCEGA[1]->Fill(DPhi);
3220  break;
3221  case(EMCJE):
3222  fHistDPhiMix1_2_EMCJet[1]->Fill(DPhi);
3223  break;
3224  }
3225  }
3226 
3227  //2GeV
3228  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<4){
3229  if(MBtrg){
3230  fHistDPhiMix2_4_MB[1]->Fill(DPhi);
3231  fHistDPhiMix28_MB->Fill(DPhi);
3232  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3233  }
3234  switch(trigVal){
3235  case(EMC7):
3236  fHistDPhiMix2_4_EMC7[1]->Fill(DPhi);
3237  fHistDPhiMix28_EMC7->Fill(DPhi);
3238  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3239  break;
3240  case(EMCEGA):
3241  fHistDPhiMix2_4_EMCEGA[1]->Fill(DPhi);
3242  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3243  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3244  break;
3245  case(EMCJE):
3246  fHistDPhiMix2_4_EMCJet[1]->Fill(DPhi);
3247  fHistDPhiMix28_EMCJet->Fill(DPhi);
3248  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3249  break;
3250  }
3251  }
3252 
3253  //4GeV
3254  if(aodtrackassoc->Pt()>4&&aodtrackassoc->Pt()<8){
3255  if(MBtrg){
3256  fHistDPhiMix4_8_MB[1]->Fill(DPhi);
3257  fHistDPhiMix28_MB->Fill(DPhi);
3258  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3259  }
3260  switch(trigVal){
3261  case(EMC7):
3262  fHistDPhiMix4_8_EMC7[1]->Fill(DPhi);
3263  fHistDPhiMix28_EMC7->Fill(DPhi);
3264  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3265  break;
3266  case(EMCEGA):
3267  fHistDPhiMix4_8_EMCEGA[1]->Fill(DPhi);
3268  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3269  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3270  break;
3271  case(EMCJE):
3272  fHistDPhiMix4_8_EMCJet[1]->Fill(DPhi);
3273  fHistDPhiMix28_EMCJet->Fill(DPhi);
3274  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3275  break;
3276  }
3277  }
3278 
3279 
3280  }
3281 
3282  //candidate 4<pt<8
3283  if(aodtrack->Pt()>4&&aodtrack->Pt()<8){
3284 
3285 
3286 
3287  //300MeV
3288  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<1){
3289  if(MBtrg){
3290  fHistDPhiMix300_1_MB[2]->Fill(DPhi);
3291  }
3292  switch(trigVal){
3293  case(EMC7):
3294  fHistDPhiMix300_1_EMC7[2]->Fill(DPhi);
3295  break;
3296  case(EMCEGA):
3297  fHistDPhiMix300_1_EMCEGA[2]->Fill(DPhi);
3298  break;
3299  case(EMCJE):
3300  fHistDPhiMix300_1_EMCJet[2]->Fill(DPhi);
3301  break;
3302  }
3303  }
3304 
3305  //1GeV
3306  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3307  if(MBtrg){
3308  fHistDPhiMix1_2_MB[2]->Fill(DPhi);
3309  }
3310  switch(trigVal){
3311  case(EMC7):
3312  fHistDPhiMix1_2_EMC7[2]->Fill(DPhi);
3313  break;
3314  case(EMCEGA):
3315  fHistDPhiMix1_2_EMCEGA[2]->Fill(DPhi);
3316  break;
3317  case(EMCJE):
3318  fHistDPhiMix1_2_EMCJet[2]->Fill(DPhi);
3319  break;
3320  }
3321  }
3322 
3323  //2GeV
3324  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<4){
3325  if(MBtrg){
3326  fHistDPhiMix2_4_MB[2]->Fill(DPhi);
3327  fHistDPhiMix28_MB->Fill(DPhi);
3328  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3329  }
3330  switch(trigVal){
3331  case(EMC7):
3332  fHistDPhiMix2_4_EMC7[2]->Fill(DPhi);
3333  fHistDPhiMix28_EMC7->Fill(DPhi);
3334  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3335  break;
3336  case(EMCEGA):
3337  fHistDPhiMix2_4_EMCEGA[2]->Fill(DPhi);
3338  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3339  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3340  break;
3341  case(EMCJE):
3342  fHistDPhiMix2_4_EMCJet[2]->Fill(DPhi);
3343  fHistDPhiMix28_EMCJet->Fill(DPhi);
3344  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3345  break;
3346  }
3347  }
3348 
3349  //4GeV
3350  if(aodtrackassoc->Pt()>4&&aodtrackassoc->Pt()<8){
3351  if(MBtrg){
3352  fHistDPhiMix4_8_MB[2]->Fill(DPhi);
3353  fHistDPhiMix28_MB->Fill(DPhi);
3354  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3355  }
3356  switch(trigVal){
3357  case(EMC7):
3358  fHistDPhiMix4_8_EMC7[2]->Fill(DPhi);
3359  fHistDPhiMix28_EMC7->Fill(DPhi);
3360  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3361  break;
3362  case(EMCEGA):
3363  fHistDPhiMix4_8_EMCEGA[2]->Fill(DPhi);
3364  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3365  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3366  break;
3367  case(EMCJE):
3368  fHistDPhiMix4_8_EMCJet[2]->Fill(DPhi);
3369  fHistDPhiMix28_EMCJet->Fill(DPhi);
3370  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3371  break;
3372  }
3373  }
3374 
3375 
3376  }
3377  }
3378  }
3379  PostData(1, fOutputMB);
3380  PostData(2, fOutputEMC7);
3381  PostData(3, fOutputEMCEGA);
3382  PostData(4, fOutputEMCJet);
3383  return;
3384 }
3385 
3386 //________________________________________________________________________
3388 {
3389 
3390 }
void FillPIDHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse)
double Double_t
Definition: External.C:58
Definition: External.C:236
void FillDPhiHistos(AliAODEvent *esd, AliAODTrack *aodtrack, Int_t i)
void FillPhotoElecHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse, Int_t i)
void InvMass(Int_t icalo, TString particle, TString fileName)
virtual void Terminate(Option_t *)
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
TObjArray * MakeTrkArr(AliAODEvent *aod)
Double_t nEvents
plot quality messages
AliEventPoolManager * fPoolMan
void SetElectronTrackCuts(Bool_t trkCutBool)
AliESDtrackCuts * fTrackCutsWeak
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
virtual void UserExec(Option_t *option)
virtual void UserCreateOutputObjects()
const char Option_t
Definition: External.C:48
void FillMEDPhiHistos(AliAODTrack *aodtrack)
bool Bool_t
Definition: External.C:53
void SetSSCutBool(Bool_t SSCutBool)
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
AliESDtrackCuts * fTrackCutsStrong