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