AliPhysics  32b88a8 (32b88a8)
 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 
40 #include "AliAnalysisTaskSE.h"
41 #include "AliAnalysisManager.h"
42 #include "AliStack.h"
43 #include "AliESDtrackCuts.h"
44 #include "AliESDtrack.h"
45 #include "AliAODTrack.h"
46 #include "AliESDCaloCluster.h"
47 #include "AliAODCaloCluster.h"
48 #include "AliESDEvent.h"
49 #include "AliAODEvent.h"
50 #include "AliESDInputHandler.h"
51 #include "AliAODInputHandler.h"
52 #include "AliPID.h"
53 #include "AliPIDResponse.h"
54 #include "AliTRDPIDResponse.h"
55 #include "AliEventPoolManager.h"
56 
57 using std::cout;
58 using std::endl;
59 
60 
62 
63 //________________________________________________________________________
64 AliAnalysisTaskPSHFE::AliAnalysisTaskPSHFE() // All data members should be initialised here
66  fOutputMB(0),
67  fOutputEMC7(0),
68  fOutputEMCEGA(0),
69  fOutputEMCJet(0),
70  fTrackCutsStrong(0),
71  fTrackCutsWeak(0),
72  globaltrackCuts(0),
73  comptrackCuts(0),
74  fPoolMan(0),
75  fPool(0),
76  aodEv(0),
77  trkArr(0),
78  EMC7trg(0),
79  EMCEGAtrg(0),
80  EMCJettrg(0),
81  MBtrg(0),
82  tagStrong(0),
83  tagPhot(0),
84  UseNonSignalEvents(0),
85 
86  fHistPIDRejection(0),
87  fHistNElecPerEvent(0),
88 
89  fHistTPCNClus_MB(0),
90  fHistITSNClus_MB(0),
91  fHistTPCSig_MB(0),
92  fHistTPCSigCut_MB(0),
93  fHistImpPar_MB(0),
94  fHistImpParTag_MB(0),
95  fHistNevents_MB(0),
96  fHistPtSum_MB(0),
97  fHistPtSumTag_MB(0),
98  fHistPtSumEMC_MB(0),
99  fHistEtaPhi_MB(0),
100  fHistEtaPhiTag_MB(0),
101  fHistEtaPhiTPCOnly_MB(0),
102  fHistDPhi28_MB(0),
103  fHistDPhiDEta28_MB(0),
104  fHistDPhiMix28_MB(0),
105  fHistDPhiDEtaMix28_MB(0),
106  fHistEMC_Had_MB_1Gev(0),
107  fHistInvMassElecLike_MB(0),
108  fHistInvMassElecUnLike_MB(0),
109  fHistOpAngElecLike_MB(0),
110  fHistOpAngElecUnLike_MB(0),
111  fHistPtAssoc_MB(0),
112  fHistPtAssocMix_MB(0),
113  fHistPtTag_MB(0),
114  fHistPhotoMismatch_MB(0),
115  fHistDPhi18Spe_MB(0),
116 
117  fHistTPCNClus_EMC7(0),
118  fHistITSNClus_EMC7(0),
119  fHistTPCSig_EMC7(0),
120  fHistTPCSigCut_EMC7(0),
121  fHistImpPar_EMC7(0),
122  fHistImpParTag_EMC7(0),
123  fHistNevents_EMC7(0),
124  fHistPtSum_EMC7(0),
125  fHistPtSumTag_EMC7(0),
126  fHistPtSumEMC_EMC7(0),
127  fHistEtaPhi_EMC7(0),
128  fHistEtaPhiTag_EMC7(0),
129  fHistDPhi28_EMC7(0),
130  fHistDPhiDEta28_EMC7(0),
131  fHistDPhiMix28_EMC7(0),
132  fHistDPhiDEtaMix28_EMC7(0),
133  fHistInvMassElecLike_EMC7(0),
134  fHistInvMassElecUnLike_EMC7(0),
135  fHistOpAngElecLike_EMC7(0),
136  fHistOpAngElecUnLike_EMC7(0),
137  fHistPtAssoc_EMC7(0),
138  fHistPtAssocMix_EMC7(0),
139  fHistPtTag_EMC7(0),
140  fHistPhotoMismatch_EMC7(0),
141  fHistDPhi18Spe_EMC7(0),
142 
143  fHistTPCNClus_EMCEGA(0),
144  fHistITSNClus_EMCEGA(0),
145  fHistTPCSig_EMCEGA(0),
146  fHistTPCSigCut_EMCEGA(0),
147  fHistImpPar_EMCEGA(0),
148  fHistImpParTag_EMCEGA(0),
149  fHistNevents_EMCEGA(0),
150  fHistPtSum_EMCEGA(0),
151  fHistPtSumTag_EMCEGA(0),
152  fHistPtSumEMC_EMCEGA(0),
153  fHistEtaPhi_EMCEGA(0),
154  fHistEtaPhiTag_EMCEGA(0),
155  fHistDPhi28_EMCEGA(0),
156  fHistDPhiDEta28_EMCEGA(0),
157  fHistDPhiMix28_EMCEGA(0),
158  fHistDPhiDEtaMix28_EMCEGA(0),
159  fHistInvMassElecLike_EMCEGA(0),
160  fHistInvMassElecUnLike_EMCEGA(0),
161  fHistOpAngElecLike_EMCEGA(0),
162  fHistOpAngElecUnLike_EMCEGA(0),
163  fHistPtAssoc_EMCEGA(0),
164  fHistPtAssocMix_EMCEGA(0),
165  fHistPtTag_EMCEGA(0),
166  fHistPhotoMismatch_EMCEGA(0),
167  fHistDPhi18Spe_EMCEGA(0),
168 
169  fHistTPCNClus_EMCJet(0),
170  fHistITSNClus_EMCJet(0),
171  fHistTPCSig_EMCJet(0),
172  fHistTPCSigCut_EMCJet(0),
173  fHistImpPar_EMCJet(0),
174  fHistImpParTag_EMCJet(0),
175  fHistNevents_EMCJet(0),
176  fHistPtSum_EMCJet(0),
177  fHistPtSumTag_EMCJet(0),
178  fHistPtSumEMC_EMCJet(0),
179  fHistEtaPhi_EMCJet(0),
180  fHistEtaPhiTag_EMCJet(0),
181  fHistDPhi28_EMCJet(0),
182  fHistDPhiDEta28_EMCJet(0),
183  fHistDPhiMix28_EMCJet(0),
184  fHistDPhiDEtaMix28_EMCJet(0),
185  fHistInvMassElecLike_EMCJet(0),
186  fHistInvMassElecUnLike_EMCJet(0),
187  fHistOpAngElecLike_EMCJet(0),
188  fHistOpAngElecUnLike_EMCJet(0),
189  fHistPtAssoc_EMCJet(0),
190  fHistPtAssocMix_EMCJet(0),
191  fHistPtTag_EMCJet(0),
192  fHistPhotoMismatch_EMCJet(0),
193  fHistDPhi18Spe_EMCJet(0)
194 
195  // The last in the above list should not have a comma after it
196 {
197 
198  //Init the DPhi Plots here because they are stored in arrays
199  for(Int_t i=0; i<3; i++){
200  fHistDPhi300_500_MB[i]=0;
201  fHistDPhi500_800_MB[i]=0;
202  fHistDPhi800_1_MB[i]=0;
203  fHistDPhi1_2_MB[i]=0;
204  fHistDPhi2_3_MB[i]=0;
205  fHistDPhi3_4_MB[i]=0;
206  fHistDPhi4_MB[i]=0;
207 
208  fHistDPhi300_500_EMC7[i]=0;
209  fHistDPhi500_800_EMC7[i]=0;
210  fHistDPhi800_1_EMC7[i]=0;
211  fHistDPhi1_2_EMC7[i]=0;
212  fHistDPhi2_3_EMC7[i]=0;
213  fHistDPhi3_4_EMC7[i]=0;
214  fHistDPhi4_EMC7[i]=0;
215 
216  fHistDPhi300_500_EMCEGA[i]=0;
217  fHistDPhi500_800_EMCEGA[i]=0;
218  fHistDPhi800_1_EMCEGA[i]=0;
219  fHistDPhi1_2_EMCEGA[i]=0;
220  fHistDPhi2_3_EMCEGA[i]=0;
221  fHistDPhi3_4_EMCEGA[i]=0;
222  fHistDPhi4_EMCEGA[i]=0;
223 
224  fHistDPhi300_500_EMCJet[i]=0;
225  fHistDPhi500_800_EMCJet[i]=0;
226  fHistDPhi800_1_EMCJet[i]=0;
227  fHistDPhi1_2_EMCJet[i]=0;
228  fHistDPhi2_3_EMCJet[i]=0;
229  fHistDPhi3_4_EMCJet[i]=0;
230  fHistDPhi4_EMCJet[i]=0;
231 
232  //ME histos
233  fHistDPhiMix300_500_MB[i]=0;
234  fHistDPhiMix500_800_MB[i]=0;
235  fHistDPhiMix800_1_MB[i]=0;
236  fHistDPhiMix1_2_MB[i]=0;
237  fHistDPhiMix2_3_MB[i]=0;
238  fHistDPhiMix3_4_MB[i]=0;
239  fHistDPhiMix4_MB[i]=0;
240 
241  fHistDPhiMix300_500_EMC7[i]=0;
242  fHistDPhiMix500_800_EMC7[i]=0;
243  fHistDPhiMix800_1_EMC7[i]=0;
244  fHistDPhiMix1_2_EMC7[i]=0;
245  fHistDPhiMix2_3_EMC7[i]=0;
246  fHistDPhiMix3_4_EMC7[i]=0;
247  fHistDPhiMix4_EMC7[i]=0;
248 
249  fHistDPhiMix300_500_EMCEGA[i]=0;
250  fHistDPhiMix500_800_EMCEGA[i]=0;
251  fHistDPhiMix800_1_EMCEGA[i]=0;
252  fHistDPhiMix1_2_EMCEGA[i]=0;
253  fHistDPhiMix2_3_EMCEGA[i]=0;
254  fHistDPhiMix3_4_EMCEGA[i]=0;
255  fHistDPhiMix4_EMCEGA[i]=0;
256 
257  fHistDPhiMix300_500_EMCJet[i]=0;
258  fHistDPhiMix500_800_EMCJet[i]=0;
259  fHistDPhiMix800_1_EMCJet[i]=0;
260  fHistDPhiMix1_2_EMCJet[i]=0;
261  fHistDPhiMix2_3_EMCJet[i]=0;
262  fHistDPhiMix3_4_EMCJet[i]=0;
263  fHistDPhiMix4_EMCJet[i]=0;
264  }
265 
266  //Init PID Plots here since they are stored in Arrays
267  for(int i=0;i<6;i++){
268  //MB Plots
269  fHistTPC_EMCTRD_MB[i]=0;
270 
271  fHistEMC_TPCTRD_MB[i]=0;
272 
273  fHistTRD_TPCEMC_MB[i]=0;
274 
275  //EMC7 Plots
276  fHistTPC_EMCTRD_EMC7[i]=0;
277 
278  fHistEMC_TPCTRD_EMC7[i]=0;
279 
280  fHistTRD_TPCEMC_EMC7[i]=0;
281 
282  //EMCEGA Plots
283  fHistTPC_EMCTRD_EMCEGA[i]=0;
284 
285  fHistEMC_TPCTRD_EMCEGA[i]=0;
286 
287  fHistTRD_TPCEMC_EMCEGA[i]=0;
288 
289  //EMCJet Plots
290  fHistTPC_EMCTRD_EMCJet[i]=0;
291 
292  fHistEMC_TPCTRD_EMCJet[i]=0;
293 
294  fHistTRD_TPCEMC_EMCJet[i]=0;
295 
296  fHistM02_All_MB[i]=0;
297  fHistM02_Elec_MB[i]=0;
298  fHistM20_All_MB[i]=0;
299  fHistM20_Elec_MB[i]=0;
300 
301  fHistM02_All_EMC7[i]=0;
302  fHistM02_Elec_EMC7[i]=0;
303  fHistM20_All_EMC7[i]=0;
304  fHistM20_Elec_EMC7[i]=0;
305 
306  fHistM02_All_EMCEGA[i]=0;
307  fHistM02_Elec_EMCEGA[i]=0;
308  fHistM20_All_EMCEGA[i]=0;
309  fHistM20_Elec_EMCEGA[i]=0;
310 
311  fHistM02_All_EMCJet[i]=0;
312  fHistM02_Elec_EMCJet[i]=0;
313  fHistM20_All_EMCJet[i]=0;
314  fHistM20_Elec_EMCJet[i]=0;
315  }
316 
317  // Dummy constructor ALWAYS needed for I/O.
318 }
319 
320 //________________________________________________________________________
321 AliAnalysisTaskPSHFE::AliAnalysisTaskPSHFE(const char *name) // All data members should be initialised here
322  :AliAnalysisTaskSE(name),
323  fOutputMB(0),
324  fOutputEMC7(0),
325  fOutputEMCEGA(0),
326  fOutputEMCJet(0),
327  fTrackCutsStrong(0),
328  fTrackCutsWeak(0),
329  globaltrackCuts(0),
330  comptrackCuts(0),
331  fPoolMan(0),
332  fPool(0),
333  aodEv(0),
334  trkArr(0),
335  EMC7trg(0),
336  EMCEGAtrg(0),
337  EMCJettrg(0),
338  MBtrg(0),
339  tagStrong(0),
340  tagPhot(0),
341  UseNonSignalEvents(0),
342 
343  fHistPIDRejection(0),
344  fHistNElecPerEvent(0),
345 
346  fHistTPCNClus_MB(0),
347  fHistITSNClus_MB(0),
348  fHistTPCSig_MB(0),
349  fHistTPCSigCut_MB(0),
350  fHistImpPar_MB(0),
351  fHistImpParTag_MB(0),
352  fHistNevents_MB(0),
353  fHistPtSum_MB(0),
354  fHistPtSumTag_MB(0),
355  fHistPtSumEMC_MB(0),
356  fHistEtaPhi_MB(0),
357  fHistEtaPhiTag_MB(0),
358  fHistEtaPhiTPCOnly_MB(0),
359  fHistDPhi28_MB(0),
360  fHistDPhiDEta28_MB(0),
361  fHistDPhiMix28_MB(0),
362  fHistDPhiDEtaMix28_MB(0),
363  fHistEMC_Had_MB_1Gev(0),
364  fHistInvMassElecLike_MB(0),
365  fHistInvMassElecUnLike_MB(0),
366  fHistOpAngElecLike_MB(0),
367  fHistOpAngElecUnLike_MB(0),
368  fHistPtAssoc_MB(0),
369  fHistPtAssocMix_MB(0),
370  fHistPtTag_MB(0),
371  fHistPhotoMismatch_MB(0),
372  fHistDPhi18Spe_MB(0),
373 
374  fHistTPCNClus_EMC7(0),
375  fHistITSNClus_EMC7(0),
376  fHistTPCSig_EMC7(0),
377  fHistTPCSigCut_EMC7(0),
378  fHistImpPar_EMC7(0),
379  fHistImpParTag_EMC7(0),
380  fHistNevents_EMC7(0),
381  fHistPtSum_EMC7(0),
382  fHistPtSumTag_EMC7(0),
383  fHistPtSumEMC_EMC7(0),
384  fHistEtaPhi_EMC7(0),
385  fHistEtaPhiTag_EMC7(0),
386  fHistDPhi28_EMC7(0),
387  fHistDPhiDEta28_EMC7(0),
388  fHistDPhiMix28_EMC7(0),
389  fHistDPhiDEtaMix28_EMC7(0),
390  fHistInvMassElecLike_EMC7(0),
391  fHistInvMassElecUnLike_EMC7(0),
392  fHistOpAngElecLike_EMC7(0),
393  fHistOpAngElecUnLike_EMC7(0),
394  fHistPtAssoc_EMC7(0),
395  fHistPtAssocMix_EMC7(0),
396  fHistPtTag_EMC7(0),
397  fHistPhotoMismatch_EMC7(0),
398  fHistDPhi18Spe_EMC7(0),
399 
400  fHistTPCNClus_EMCEGA(0),
401  fHistITSNClus_EMCEGA(0),
402  fHistTPCSig_EMCEGA(0),
403  fHistTPCSigCut_EMCEGA(0),
404  fHistImpPar_EMCEGA(0),
405  fHistImpParTag_EMCEGA(0),
406  fHistNevents_EMCEGA(0),
407  fHistPtSum_EMCEGA(0),
408  fHistPtSumTag_EMCEGA(0),
409  fHistPtSumEMC_EMCEGA(0),
410  fHistEtaPhi_EMCEGA(0),
411  fHistEtaPhiTag_EMCEGA(0),
412  fHistDPhi28_EMCEGA(0),
413  fHistDPhiDEta28_EMCEGA(0),
414  fHistDPhiMix28_EMCEGA(0),
415  fHistDPhiDEtaMix28_EMCEGA(0),
416  fHistInvMassElecLike_EMCEGA(0),
417  fHistInvMassElecUnLike_EMCEGA(0),
418  fHistOpAngElecLike_EMCEGA(0),
419  fHistOpAngElecUnLike_EMCEGA(0),
420  fHistPtAssoc_EMCEGA(0),
421  fHistPtAssocMix_EMCEGA(0),
422  fHistPtTag_EMCEGA(0),
423  fHistPhotoMismatch_EMCEGA(0),
424  fHistDPhi18Spe_EMCEGA(0),
425 
426  fHistTPCNClus_EMCJet(0),
427  fHistITSNClus_EMCJet(0),
428  fHistTPCSig_EMCJet(0),
429  fHistTPCSigCut_EMCJet(0),
430  fHistImpPar_EMCJet(0),
431  fHistImpParTag_EMCJet(0),
432  fHistNevents_EMCJet(0),
433  fHistPtSum_EMCJet(0),
434  fHistPtSumTag_EMCJet(0),
435  fHistPtSumEMC_EMCJet(0),
436  fHistEtaPhi_EMCJet(0),
437  fHistEtaPhiTag_EMCJet(0),
438  fHistDPhi28_EMCJet(0),
439  fHistDPhiDEta28_EMCJet(0),
440  fHistDPhiMix28_EMCJet(0),
441  fHistDPhiDEtaMix28_EMCJet(0),
442  fHistInvMassElecLike_EMCJet(0),
443  fHistInvMassElecUnLike_EMCJet(0),
444  fHistOpAngElecLike_EMCJet(0),
445  fHistOpAngElecUnLike_EMCJet(0),
446  fHistPtAssoc_EMCJet(0),
447  fHistPtAssocMix_EMCJet(0),
448  fHistPtTag_EMCJet(0),
449  fHistPhotoMismatch_EMCJet(0),
450  fHistDPhi18Spe_EMCJet(0)
451 
452  // The last in the above list should not have a comma after it
453 {
454  // Constructor
455  // Define input and output slots here (never in the dummy constructor)
456  // Input slot #0 works with a TChain - it is connected to the default input container
457  // Output slot #1 writes into a TH1 container
458 
459  for(Int_t i=0; i<3; i++){
460  fHistDPhi300_500_MB[i]=0;
461  fHistDPhi500_800_MB[i]=0;
462  fHistDPhi800_1_MB[i]=0;
463  fHistDPhi1_2_MB[i]=0;
464  fHistDPhi2_3_MB[i]=0;
465  fHistDPhi3_4_MB[i]=0;
466  fHistDPhi4_MB[i]=0;
467 
470  fHistDPhi800_1_EMC7[i]=0;
471  fHistDPhi1_2_EMC7[i]=0;
472  fHistDPhi2_3_EMC7[i]=0;
473  fHistDPhi3_4_EMC7[i]=0;
474  fHistDPhi4_EMC7[i]=0;
475 
479  fHistDPhi1_2_EMCEGA[i]=0;
480  fHistDPhi2_3_EMCEGA[i]=0;
481  fHistDPhi3_4_EMCEGA[i]=0;
482  fHistDPhi4_EMCEGA[i]=0;
483 
487  fHistDPhi1_2_EMCJet[i]=0;
488  fHistDPhi2_3_EMCJet[i]=0;
489  fHistDPhi3_4_EMCJet[i]=0;
490  fHistDPhi4_EMCJet[i]=0;
491 
492  //ME histos
496  fHistDPhiMix1_2_MB[i]=0;
497  fHistDPhiMix2_3_MB[i]=0;
498  fHistDPhiMix3_4_MB[i]=0;
499  fHistDPhiMix4_MB[i]=0;
500 
507  fHistDPhiMix4_EMC7[i]=0;
508 
516 
524  }
525 
526  //Init PID Plots here since they are stored in Arrays
527  for(Int_t i=0;i<6;i++){
528  //MB Plots
529  fHistTPC_EMCTRD_MB[i]=0;
530 
531  fHistEMC_TPCTRD_MB[i]=0;
532 
533  fHistTRD_TPCEMC_MB[i]=0;
534 
535  //EMC7 Plots
537 
539 
541 
542  //EMCEGA Plots
544 
546 
548 
549  //EMCJet Plots
551 
553 
555 
556  fHistM02_All_MB[i]=0;
557  fHistM02_Elec_MB[i]=0;
558  fHistM20_All_MB[i]=0;
559  fHistM20_Elec_MB[i]=0;
560 
561  fHistM02_All_EMC7[i]=0;
562  fHistM02_Elec_EMC7[i]=0;
563  fHistM20_All_EMC7[i]=0;
564  fHistM20_Elec_EMC7[i]=0;
565 
566  fHistM02_All_EMCEGA[i]=0;
568  fHistM20_All_EMCEGA[i]=0;
570 
571  fHistM02_All_EMCJet[i]=0;
573  fHistM20_All_EMCJet[i]=0;
575  }
576 
577 
578  DefineOutput(1, TList::Class());//MB
579  DefineOutput(2, TList::Class());//EMC7
580  DefineOutput(3, TList::Class());//EMCEGA
581  DefineOutput(4, TList::Class());//EMCJet
582 }
583 
584 //________________________________________________________________________
586 {
587  // Destructor. Clean-up the output list, but not the histograms that are put inside
588  // (the list is owner and will clean-up these histograms). Protect in PROOF case.
589  for(Int_t i=0;i<3;i++){
590  delete fHistDPhi300_500_MB[i];
591  delete fHistDPhi500_800_MB[i];
592  delete fHistDPhi800_1_MB[i];
593  delete fHistDPhi1_2_MB[i];
594  delete fHistDPhi2_3_MB[i];
595  delete fHistDPhi3_4_MB[i];
596  delete fHistDPhi4_MB[i];
597 
598  delete fHistDPhi300_500_EMC7[i];
599  delete fHistDPhi500_800_EMC7[i];
600  delete fHistDPhi800_1_EMC7[i];
601  delete fHistDPhi1_2_EMC7[i];
602  delete fHistDPhi2_3_EMC7[i];
603  delete fHistDPhi3_4_EMC7[i];
604  delete fHistDPhi4_EMC7[i];
605 
606  delete fHistDPhi300_500_EMCEGA[i];
607  delete fHistDPhi500_800_EMCEGA[i];
608  delete fHistDPhi800_1_EMCEGA[i];
609  delete fHistDPhi1_2_EMCEGA[i];
610  delete fHistDPhi2_3_EMCEGA[i];
611  delete fHistDPhi3_4_EMCEGA[i];
612  delete fHistDPhi4_EMCEGA[i];
613 
614  delete fHistDPhi300_500_EMCJet[i];
615  delete fHistDPhi500_800_EMCJet[i];
616  delete fHistDPhi800_1_EMCJet[i];
617  delete fHistDPhi1_2_EMCJet[i];
618  delete fHistDPhi2_3_EMCJet[i];
619  delete fHistDPhi3_4_EMCJet[i];
620  delete fHistDPhi4_EMCJet[i];
621 
622  //ME histos
623  delete fHistDPhiMix300_500_MB[i];
624  delete fHistDPhiMix500_800_MB[i];
625  delete fHistDPhiMix800_1_MB[i];
626  delete fHistDPhiMix1_2_MB[i];
627  delete fHistDPhiMix2_3_MB[i];
628  delete fHistDPhiMix3_4_MB[i];
629  delete fHistDPhiMix4_MB[i];
630 
631  delete fHistDPhiMix300_500_EMC7[i];
632  delete fHistDPhiMix500_800_EMC7[i];
633  delete fHistDPhiMix800_1_EMC7[i];
634  delete fHistDPhiMix1_2_EMC7[i];
635  delete fHistDPhiMix2_3_EMC7[i];
636  delete fHistDPhiMix3_4_EMC7[i];
637  delete fHistDPhiMix4_EMC7[i];
638 
639  delete fHistDPhiMix300_500_EMCEGA[i];
640  delete fHistDPhiMix500_800_EMCEGA[i];
641  delete fHistDPhiMix800_1_EMCEGA[i];
642  delete fHistDPhiMix1_2_EMCEGA[i];
643  delete fHistDPhiMix2_3_EMCEGA[i];
644  delete fHistDPhiMix3_4_EMCEGA[i];
645  delete fHistDPhiMix4_EMCEGA[i];
646 
647  delete fHistDPhiMix300_500_EMCJet[i];
648  delete fHistDPhiMix500_800_EMCJet[i];
649  delete fHistDPhiMix800_1_EMCJet[i];
650  delete fHistDPhiMix1_2_EMCJet[i];
651  delete fHistDPhiMix2_3_EMCJet[i];
652  delete fHistDPhiMix3_4_EMCJet[i];
653  delete fHistDPhiMix4_EMCJet[i];
654  }
655 
656  //Init PID Plots here since they are stored in Arrays
657  for(Int_t i=0;i<6;i++){
658  //MB Plots
659  delete fHistTPC_EMCTRD_MB[i];
660 
661  delete fHistEMC_TPCTRD_MB[i];
662 
663  delete fHistTRD_TPCEMC_MB[i];
664 
665  //EMC7 Plots
666  delete fHistTPC_EMCTRD_EMC7[i];
667 
668  delete fHistEMC_TPCTRD_EMC7[i];
669 
670  delete fHistTRD_TPCEMC_EMC7[i];
671 
672  //EMCEGA Plots
673  delete fHistTPC_EMCTRD_EMCEGA[i];
674 
675  delete fHistEMC_TPCTRD_EMCEGA[i];
676 
677  delete fHistTRD_TPCEMC_EMCEGA[i];
678 
679  //EMCJet Plots
680  delete fHistTPC_EMCTRD_EMCJet[i];
681 
682  delete fHistEMC_TPCTRD_EMCJet[i];
683 
684  delete fHistTRD_TPCEMC_EMCJet[i];
685 
686  delete fHistM02_All_MB[i];
687  delete fHistM02_Elec_MB[i];
688  delete fHistM20_All_MB[i];
689  delete fHistM20_Elec_MB[i];
690 
691  delete fHistM02_All_EMC7[i];
692  delete fHistM02_Elec_EMC7[i];
693  delete fHistM20_All_EMC7[i];
694  delete fHistM20_Elec_EMC7[i];
695 
696  delete fHistM02_All_EMCEGA[i];
697  delete fHistM02_Elec_EMCEGA[i];
698  delete fHistM20_All_EMCEGA[i];
699  delete fHistM20_Elec_EMCEGA[i];
700 
701  delete fHistM02_All_EMCJet[i];
702  delete fHistM02_Elec_EMCJet[i];
703  delete fHistM20_All_EMCJet[i];
704  delete fHistM20_Elec_EMCJet[i];
705  }
706 
707  delete fTrackCutsStrong;
708  delete fTrackCutsWeak;
709 }
710 
711 //________________________________________________________________________
713  // Create histograms
714  // Called once (on the worker node)
715 
716  fOutputMB = new TList();
717  OpenFile(1);
718  fOutputMB->SetOwner(); // IMPORTANT!
719  fOutputEMC7 = new TList();
720  OpenFile(2);
721  fOutputEMC7->SetOwner(); // IMPORTANT!
722  fOutputEMCEGA = new TList();
723  OpenFile(3);
724  fOutputEMCEGA->SetOwner(); // IMPORTANT!
725  fOutputEMCJet = new TList();
726  OpenFile(4);
727  fOutputEMCJet->SetOwner(); // IMPORTANT!
728 
729  //Initialize event pool stuff
730  Double_t vertexBins[5] = { -10, -4, 0, 4, 10 };
731  Int_t nZvtxBins = 4;
732  Double_t multBins[4] = {0, 200, 500, 1000};
733  Int_t nMultBins = 3;
734 
735  fPoolMan = new AliEventPoolManager(50, 50, nMultBins, multBins, nZvtxBins, vertexBins);
736  fPoolMan->Validate();
737 
738  //Some strings for histograms
739  TString ptRangesDPhi[3] = {"1-2Gev", "2-4Gev", "4-8Gev"};
740  TString ptRangesPID[6] = {"1-2GeV", "2-3GeV", "3-4GeV", "4-5GeV", "5-6GeV", ">6GeV"};
741  TString ptRangesRegion[4] = {"1-2Gev", "2-4Gev", "4-6Gev", ">6Gev"};
742 
743  //Strong cuts for heavy flavour
744  fTrackCutsStrong = new AliESDtrackCuts();
745  // TPC
746  fTrackCutsStrong->SetRequireTPCRefit(kTRUE);
747  // ITS
748  fTrackCutsStrong->SetRequireITSRefit(kTRUE);
749  // 7*(0.0026+0.0050/pt^1.01)
750  fTrackCutsStrong->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
751  fTrackCutsStrong->SetMaxDCAToVertexZ(2);
752  fTrackCutsStrong->SetDCAToVertex2D(kFALSE);
753  fTrackCutsStrong->SetRequireSigmaToVertex(kFALSE);
754  fTrackCutsStrong->SetMaxChi2PerClusterITS(36);
755  fTrackCutsStrong->SetMinNClustersTPC(120);
756  fTrackCutsStrong->SetMinNClustersITS(4);
757  fTrackCutsStrong->SetPtRange(1,10e10);
758  fTrackCutsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
759  fTrackCutsStrong->SetMaxChi2PerClusterTPC(2);
760  fTrackCutsStrong->SetMaxDCAToVertexXY(1);
761  fTrackCutsStrong->SetMaxDCAToVertexZ(2);
762  fTrackCutsStrong->SetEtaRange(-.6, .6);
763  fTrackCutsStrong->SetAcceptKinkDaughters(kFALSE);
764 
765  //Weak cuts for heavy flavour
766  fTrackCutsWeak = new AliESDtrackCuts();
767  // TPC
768  fTrackCutsWeak->SetRequireTPCRefit(kTRUE);
769  // ITS
770  fTrackCutsWeak->SetRequireITSRefit(kTRUE);
771  // 7*(0.0026+0.0050/pt^1.01)
772  fTrackCutsWeak->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
773  fTrackCutsWeak->SetMaxDCAToVertexZ(2);
774  fTrackCutsWeak->SetDCAToVertex2D(kFALSE);
775  fTrackCutsWeak->SetRequireSigmaToVertex(kFALSE);
776  fTrackCutsWeak->SetMaxChi2PerClusterITS(36);
777  fTrackCutsWeak->SetMinNClustersTPC(80);
778  fTrackCutsWeak->SetMinNClustersITS(3);
779  fTrackCutsWeak->SetPtRange(1,10e10);
780  fTrackCutsWeak->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
781  fTrackCutsWeak->SetMaxChi2PerClusterTPC(4);
782  //fTrackCutsWeak->SetMaxDCAToVertexXY(2);
783  //fTrackCutsWeak->SetMaxDCAToVertexZ(3);
784  fTrackCutsWeak->SetEtaRange(-.7, .7);
785  fTrackCutsWeak->SetAcceptKinkDaughters(kFALSE);
786 
787  // Create histograms
788 
789  //Photonic e mismatch histo
790 
791  fHistPhotoMismatch_MB = new TH1F("fHistPhotoMismatch_MB", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
792  fHistPhotoMismatch_MB->GetXaxis()->SetTitle("Electrons");
793  fHistPhotoMismatch_MB->GetYaxis()->SetTitle("Cts");
794 
795  fHistPhotoMismatch_EMC7 = new TH1F("fHistPhotoMismatch_EMC7", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
796  fHistPhotoMismatch_EMC7->GetXaxis()->SetTitle("Electrons");
797  fHistPhotoMismatch_EMC7->GetYaxis()->SetTitle("Cts");
798 
799  fHistPhotoMismatch_EMCEGA = new TH1F("fHistPhotoMismatch_EMCEGA", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
800  fHistPhotoMismatch_EMCEGA->GetXaxis()->SetTitle("Electrons");
801  fHistPhotoMismatch_EMCEGA->GetYaxis()->SetTitle("Cts");
802 
803  fHistPhotoMismatch_EMCJet = new TH1F("fHistPhotoMismatch_EMCJet", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
804  fHistPhotoMismatch_EMCJet->GetXaxis()->SetTitle("Electrons");
805  fHistPhotoMismatch_EMCJet->GetYaxis()->SetTitle("Cts");
806 
807  //Invariant mass histos
808 
809  fHistInvMassElecLike_MB = new TH1F("fHistInvMassElecLike_MB", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
810  fHistInvMassElecLike_MB->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
811  fHistInvMassElecLike_MB->GetYaxis()->SetTitle("Cts");
812 
813  fHistInvMassElecLike_EMC7 = new TH1F("fHistInvMassElecLike_EMC7", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
814  fHistInvMassElecLike_EMC7->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
815  fHistInvMassElecLike_EMC7->GetYaxis()->SetTitle("Cts");
816 
817  fHistInvMassElecLike_EMCEGA = new TH1F("fHistInvMassElecLike_EMCEGA", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
818  fHistInvMassElecLike_EMCEGA->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
819  fHistInvMassElecLike_EMCEGA->GetYaxis()->SetTitle("Cts");
820 
821  fHistInvMassElecLike_EMCJet = new TH1F("fHistInvMassElecLike_EMCJet", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
822  fHistInvMassElecLike_EMCJet->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
823  fHistInvMassElecLike_EMCJet->GetYaxis()->SetTitle("Cts");
824 
825  fHistInvMassElecUnLike_MB = new TH1F("fHistInvMassElecUnLike_MB", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
826  fHistInvMassElecUnLike_MB->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
827  fHistInvMassElecUnLike_MB->GetYaxis()->SetTitle("Cts");
828 
829  fHistInvMassElecUnLike_EMC7 = new TH1F("fHistInvMassElecUnLike_EMC7", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
830  fHistInvMassElecUnLike_EMC7->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
831  fHistInvMassElecUnLike_EMC7->GetYaxis()->SetTitle("Cts");
832 
833  fHistInvMassElecUnLike_EMCEGA = new TH1F("fHistInvMassElecUnLike_EMCEGA", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
834  fHistInvMassElecUnLike_EMCEGA->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
835  fHistInvMassElecUnLike_EMCEGA->GetYaxis()->SetTitle("Cts");
836 
837  fHistInvMassElecUnLike_EMCJet = new TH1F("fHistInvMassElecUnLike_EMCJet", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
838  fHistInvMassElecUnLike_EMCJet->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
839  fHistInvMassElecUnLike_EMCJet->GetYaxis()->SetTitle("Cts");
840 
841  //Opening Angle Histos
842 
843  fHistOpAngElecLike_MB = new TH1F("fHistOpAngElecLike_MB", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
844  fHistOpAngElecLike_MB->GetXaxis()->SetTitle("Opening Angle(rad)");
845  fHistOpAngElecLike_MB->GetYaxis()->SetTitle("Cts");
846 
847  fHistOpAngElecLike_EMC7 = new TH1F("fHistOpAngElecLike_EMC7", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
848  fHistOpAngElecLike_EMC7->GetXaxis()->SetTitle("Opening Angle(rad)");
849  fHistOpAngElecLike_EMC7->GetYaxis()->SetTitle("Cts");
850 
851  fHistOpAngElecLike_EMCEGA = new TH1F("fHistOpAngElecLike_EMCEGA", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
852  fHistOpAngElecLike_EMCEGA->GetXaxis()->SetTitle("Opening Angle(rad)");
853  fHistOpAngElecLike_EMCEGA->GetYaxis()->SetTitle("Cts");
854 
855  fHistOpAngElecLike_EMCJet = new TH1F("fHistOpAngElecLike_EMCJet", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
856  fHistOpAngElecLike_EMCJet->GetXaxis()->SetTitle("Opening Angle(rad)");
857  fHistOpAngElecLike_EMCJet->GetYaxis()->SetTitle("Cts");
858 
859  fHistOpAngElecUnLike_MB = new TH1F("fHistOpAngElecUnLike_MB", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
860  fHistOpAngElecUnLike_MB->GetXaxis()->SetTitle("Opening Angle(rad)");
861  fHistOpAngElecUnLike_MB->GetYaxis()->SetTitle("Cts");
862 
863  fHistOpAngElecUnLike_EMC7 = new TH1F("fHistOpAngElecUnLike_EMC7", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
864  fHistOpAngElecUnLike_EMC7->GetXaxis()->SetTitle("Opening Angle(rad)");
865  fHistOpAngElecUnLike_EMC7->GetYaxis()->SetTitle("Cts");
866 
867  fHistOpAngElecUnLike_EMCEGA = new TH1F("fHistOpAngElecUnLike_EMCEGA", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
868  fHistOpAngElecUnLike_EMCEGA->GetXaxis()->SetTitle("Opening Angle(rad)");
869  fHistOpAngElecUnLike_EMCEGA->GetYaxis()->SetTitle("Cts");
870 
871  fHistOpAngElecUnLike_EMCJet = new TH1F("fHistOpAngElecUnLike_EMCJet", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
872  fHistOpAngElecUnLike_EMCJet->GetXaxis()->SetTitle("Opening Angle(rad)");
873  fHistOpAngElecUnLike_EMCJet->GetYaxis()->SetTitle("Cts");
874 
875  //Rejection Histos
876 
877  fHistPIDRejection = new TH1F("fHistPIDRejection", "PID rejection counts for each detector.", 4, 1, 4);
878  fHistPIDRejection->GetXaxis()->SetTitle("Detector");
879  fHistPIDRejection->GetYaxis()->SetTitle("Cts");
880  fHistPIDRejection->GetXaxis()->SetBinLabel(1, "TPC");
881  fHistPIDRejection->GetXaxis()->SetBinLabel(2, "TOF");
882  fHistPIDRejection->GetXaxis()->SetBinLabel(3, "TRD");
883  fHistPIDRejection->GetXaxis()->SetBinLabel(4, "EMC");
884 
885  //Number of electrons per event histo
886  fHistNElecPerEvent = new TH1F("fHistNElecPerEvent", "Number of tagged electrons per event", 5, 1, 5);
887  fHistNElecPerEvent->GetXaxis()->SetTitle("Num. of Electrons");
888  fHistNElecPerEvent->GetYaxis()->SetTitle("Cts");
889 
890  //PID Plots
891 
892  //TPC PID Plots
893  for(Int_t i=0; i<6; i++){
894  //MB
895  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);
896  fHistTPC_EMCTRD_MB[i]->GetXaxis()->SetTitle("Pt");
897  fHistTPC_EMCTRD_MB[i]->GetYaxis()->SetTitle("nSigma");
898 
899  //EMC7
900  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);
901  fHistTPC_EMCTRD_EMC7[i]->GetXaxis()->SetTitle("Pt");
902  fHistTPC_EMCTRD_EMC7[i]->GetYaxis()->SetTitle("nSigma");
903 
904  //EMCEGA
905  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);
906  fHistTPC_EMCTRD_EMCEGA[i]->GetXaxis()->SetTitle("Pt");
907  fHistTPC_EMCTRD_EMCEGA[i]->GetYaxis()->SetTitle("nSigma");
908 
909  //EMCJet
910  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);
911  fHistTPC_EMCTRD_EMCJet[i]->GetXaxis()->SetTitle("Pt");
912  fHistTPC_EMCTRD_EMCJet[i]->GetYaxis()->SetTitle("nSigma");
913  }
914 
915  //EMC PID Plots
916  for(Int_t i=0; i<6; i++){
917  //MB
918  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);
919  fHistEMC_TPCTRD_MB[i]->GetXaxis()->SetTitle("E/p");
920  fHistEMC_TPCTRD_MB[i]->GetYaxis()->SetTitle("Cts");
921 
922  //EMC7
923  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);
924  fHistEMC_TPCTRD_EMC7[i]->GetXaxis()->SetTitle("E/p");
925  fHistEMC_TPCTRD_EMC7[i]->GetYaxis()->SetTitle("Cts");
926 
927  //EMCEGA
928  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);
929  fHistEMC_TPCTRD_EMCEGA[i]->GetXaxis()->SetTitle("E/p");
930  fHistEMC_TPCTRD_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
931 
932  //EMCJet
933  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);
934  fHistEMC_TPCTRD_EMCJet[i]->GetXaxis()->SetTitle("E/p");
935  fHistEMC_TPCTRD_EMCJet[i]->GetYaxis()->SetTitle("Cts");
936  }
937 
938  //TRD PID Plots
939  for(Int_t i=0; i<6; i++){
940  //MB
941  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);
942  fHistTRD_TPCEMC_MB[i]->GetXaxis()->SetTitle("Pt");
943  fHistTRD_TPCEMC_MB[i]->GetYaxis()->SetTitle("electron Likelihood");
944 
945  //EMC7
946  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);
947  fHistTRD_TPCEMC_EMC7[i]->GetXaxis()->SetTitle("Pt");
948  fHistTRD_TPCEMC_EMC7[i]->GetYaxis()->SetTitle("electron Likelihood");
949 
950  //EMCEGA
951  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);
952  fHistTRD_TPCEMC_EMCEGA[i]->GetXaxis()->SetTitle("Pt");
953  fHistTRD_TPCEMC_EMCEGA[i]->GetYaxis()->SetTitle("electron Likelihood");
954 
955  //EMCJet
956  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);
957  fHistTRD_TPCEMC_EMCJet[i]->GetXaxis()->SetTitle("Pt");
958  fHistTRD_TPCEMC_EMCJet[i]->GetYaxis()->SetTitle("electron Likelihood");
959  }
960 
961  //EMC Shower Shape PID Plots
962  for(Int_t i=0; i<6; i++){
963  //MB
964  fHistM02_All_MB[i] = new TH2F(TString::Format("fHistM02_All_MB_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
965  fHistM02_All_MB[i]->GetXaxis()->SetTitle("M02");
966  fHistM02_All_MB[i]->GetYaxis()->SetTitle("E/p");
967 
968  fHistM20_All_MB[i] = new TH2F(TString::Format("fHistM20_All_MB_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
969  fHistM20_All_MB[i]->GetXaxis()->SetTitle("M20");
970  fHistM20_All_MB[i]->GetYaxis()->SetTitle("E/p");
971 
972  fHistM02_Elec_MB[i] = new TH2F(TString::Format("fHistM02_Elec_MB_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
973  fHistM02_Elec_MB[i]->GetXaxis()->SetTitle("M02");
974  fHistM02_Elec_MB[i]->GetYaxis()->SetTitle("E/p");
975 
976  fHistM20_Elec_MB[i] = new TH2F(TString::Format("fHistM20_Elec_MB_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
977  fHistM20_Elec_MB[i]->GetXaxis()->SetTitle("M20");
978  fHistM20_Elec_MB[i]->GetYaxis()->SetTitle("E/p");
979 
980  //EMC7
981  fHistM02_All_EMC7[i] = new TH2F(TString::Format("fHistM02_All_EMC7_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
982  fHistM02_All_EMC7[i]->GetXaxis()->SetTitle("M02");
983  fHistM02_All_EMC7[i]->GetYaxis()->SetTitle("E/p");
984 
985  fHistM20_All_EMC7[i] = new TH2F(TString::Format("fHistM20_All_EMC7_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
986  fHistM20_All_EMC7[i]->GetXaxis()->SetTitle("M20");
987  fHistM20_All_EMC7[i]->GetYaxis()->SetTitle("E/p");
988 
989  fHistM02_Elec_EMC7[i] = new TH2F(TString::Format("fHistM02_Elec_EMC7_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
990  fHistM02_Elec_EMC7[i]->GetXaxis()->SetTitle("M02");
991  fHistM02_Elec_EMC7[i]->GetYaxis()->SetTitle("E/p");
992 
993  fHistM20_Elec_EMC7[i] = new TH2F(TString::Format("fHistM20_Elec_EMC7_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
994  fHistM20_Elec_EMC7[i]->GetXaxis()->SetTitle("M20");
995  fHistM20_Elec_EMC7[i]->GetYaxis()->SetTitle("E/p");
996 
997  //EMCEGA
998  fHistM02_All_EMCEGA[i] = new TH2F(TString::Format("fHistM02_All_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
999  fHistM02_All_EMCEGA[i]->GetXaxis()->SetTitle("M02");
1000  fHistM02_All_EMCEGA[i]->GetYaxis()->SetTitle("E/p");
1001 
1002  fHistM20_All_EMCEGA[i] = new TH2F(TString::Format("fHistM20_All_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1003  fHistM20_All_EMCEGA[i]->GetXaxis()->SetTitle("M20");
1004  fHistM20_All_EMCEGA[i]->GetYaxis()->SetTitle("E/p");
1005 
1006  fHistM02_Elec_EMCEGA[i] = new TH2F(TString::Format("fHistM02_Elec_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1007  fHistM02_Elec_EMCEGA[i]->GetXaxis()->SetTitle("M02");
1008  fHistM02_Elec_EMCEGA[i]->GetYaxis()->SetTitle("E/p");
1009 
1010  fHistM20_Elec_EMCEGA[i] = new TH2F(TString::Format("fHistM20_Elec_EMCEGA_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1011  fHistM20_Elec_EMCEGA[i]->GetXaxis()->SetTitle("M20");
1012  fHistM20_Elec_EMCEGA[i]->GetYaxis()->SetTitle("E/p");
1013 
1014  //EMCJet
1015  fHistM02_All_EMCJet[i] = new TH2F(TString::Format("fHistM02_All_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1016  fHistM02_All_EMCJet[i]->GetXaxis()->SetTitle("M02");
1017  fHistM02_All_EMCJet[i]->GetYaxis()->SetTitle("E/p");
1018 
1019  fHistM20_All_EMCJet[i] = new TH2F(TString::Format("fHistM20_All_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for tracks with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1020  fHistM20_All_EMCJet[i]->GetXaxis()->SetTitle("M20");
1021  fHistM20_All_EMCJet[i]->GetYaxis()->SetTitle("E/p");
1022 
1023  fHistM02_Elec_EMCJet[i] = new TH2F(TString::Format("fHistM02_Elec_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M02(semi-major axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1024  fHistM02_Elec_EMCJet[i]->GetXaxis()->SetTitle("M02");
1025  fHistM02_Elec_EMCJet[i]->GetYaxis()->SetTitle("E/p");
1026 
1027  fHistM20_Elec_EMCJet[i] = new TH2F(TString::Format("fHistM20_Elec_EMCJet_%s",ptRangesPID[i].Data()), TString::Format("E/p vs M20(semi-minor axis) for electron candidates with Pt between %s",ptRangesPID[i].Data()), 100, 0, 1.5, 300, 0, 2);
1028  fHistM20_Elec_EMCJet[i]->GetXaxis()->SetTitle("M20");
1029  fHistM20_Elec_EMCJet[i]->GetYaxis()->SetTitle("E/p");
1030  }
1031 
1032  //DPhi for candidate electrons 2-8 gev and assoc. particles >3gev
1033  fHistDPhi28_MB = new TH1F("fHistDPhi28_MB", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1034  fHistDPhi28_MB->GetXaxis()->SetTitle("Delta-Phi");
1035  fHistDPhi28_MB->GetYaxis()->SetTitle("Cts");
1036 
1037  fHistDPhi28_EMC7 = new TH1F("fHistDPhi28_EMC7", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1038  fHistDPhi28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
1039  fHistDPhi28_EMC7->GetYaxis()->SetTitle("Cts");
1040 
1041  fHistDPhi28_EMCEGA = new TH1F("fHistDPhi28_EMCEGA", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1042  fHistDPhi28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
1043  fHistDPhi28_EMCEGA->GetYaxis()->SetTitle("Cts");
1044 
1045  fHistDPhi28_EMCJet = new TH1F("fHistDPhi28_EMCJet", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1046  fHistDPhi28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
1047  fHistDPhi28_EMCJet->GetYaxis()->SetTitle("Cts");
1048 
1049  //DPhi by Eta for triggered particles 2-8 gev and assoc. particles >3gev
1050  fHistDPhiDEta28_MB = new TH2F("fHistDPhiDEta28_MB", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1051  fHistDPhiDEta28_MB->GetXaxis()->SetTitle("Delta-Phi");
1052  fHistDPhiDEta28_MB->GetYaxis()->SetTitle("Delta-Eta");
1053  fHistDPhiDEta28_MB->GetZaxis()->SetTitle("Cts");
1054 
1055  fHistDPhiDEta28_EMC7 = new TH2F("fHistDPhiDEta28_EMC7", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1056  fHistDPhiDEta28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
1057  fHistDPhiDEta28_EMC7->GetYaxis()->SetTitle("Delta-Eta");
1058  fHistDPhiDEta28_EMC7->GetZaxis()->SetTitle("Cts");
1059 
1060  fHistDPhiDEta28_EMCEGA = new TH2F("fHistDPhiDEta28_EMCEGA", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1061  fHistDPhiDEta28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
1062  fHistDPhiDEta28_EMCEGA->GetYaxis()->SetTitle("Delta-Eta");
1063  fHistDPhiDEta28_EMCEGA->GetZaxis()->SetTitle("Cts");
1064 
1065  fHistDPhiDEta28_EMCJet = new TH2F("fHistDPhiDEta28_EMCJet", "Delta-Phi by Delta-Eta for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1066  fHistDPhiDEta28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
1067  fHistDPhiDEta28_EMCJet->GetYaxis()->SetTitle("Delta-Eta");
1068  fHistDPhiDEta28_EMCJet->GetZaxis()->SetTitle("Cts");
1069 
1070  //DPhi for candidate electrons 2-8 gev and assoc. particles >2Gev for Mixed Events
1071  fHistDPhiMix28_MB = new TH1F("fHistDPhiMix28_MB", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1072  fHistDPhiMix28_MB->GetXaxis()->SetTitle("Delta-Phi");
1073  fHistDPhiMix28_MB->GetYaxis()->SetTitle("Cts");
1074 
1075  fHistDPhiMix28_EMC7 = new TH1F("fHistDPhiMix28_EMC7", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1076  fHistDPhiMix28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
1077  fHistDPhiMix28_EMC7->GetYaxis()->SetTitle("Cts");
1078 
1079  fHistDPhiMix28_EMCEGA = new TH1F("fHistDPhiMix28_EMCEGA", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1080  fHistDPhiMix28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
1081  fHistDPhiMix28_EMCEGA->GetYaxis()->SetTitle("Cts");
1082 
1083  fHistDPhiMix28_EMCJet = new TH1F("fHistDPhiMix28_EMCJet", "Delta-Phi for candidate electrons with 2<pt<8Gev and assoc. with pt>2Gev for Mixed Events", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1084  fHistDPhiMix28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
1085  fHistDPhiMix28_EMCJet->GetYaxis()->SetTitle("Cts");
1086 
1087  //DPhi by Eta for triggered particles 2-8 gev and assoc. particles >3gev
1088  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", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1089  fHistDPhiDEtaMix28_MB->GetXaxis()->SetTitle("Delta-Phi");
1090  fHistDPhiDEtaMix28_MB->GetYaxis()->SetTitle("Delta-Eta");
1091  fHistDPhiDEtaMix28_MB->GetZaxis()->SetTitle("Cts");
1092 
1093  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", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1094  fHistDPhiDEtaMix28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
1095  fHistDPhiDEtaMix28_EMC7->GetYaxis()->SetTitle("Delta-Eta");
1096  fHistDPhiDEtaMix28_EMC7->GetZaxis()->SetTitle("Cts");
1097 
1098  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", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1099  fHistDPhiDEtaMix28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
1100  fHistDPhiDEtaMix28_EMCEGA->GetYaxis()->SetTitle("Delta-Eta");
1101  fHistDPhiDEtaMix28_EMCEGA->GetZaxis()->SetTitle("Cts");
1102 
1103  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", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 100, -0.9, 0.9);
1104  fHistDPhiDEtaMix28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
1105  fHistDPhiDEtaMix28_EMCJet->GetYaxis()->SetTitle("Delta-Eta");
1106  fHistDPhiDEtaMix28_EMCJet->GetZaxis()->SetTitle("Cts");
1107 
1108  //DPhi by dEdx for triggered particles 2-8 gev and assoc. particles >2gev
1109  fHistDPhi18Spe_MB = new TH2F("fHistDPhi18Spe_MB", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
1110  fHistDPhi18Spe_MB->GetXaxis()->SetTitle("Delta-Phi");
1111  fHistDPhi18Spe_MB->GetYaxis()->SetTitle("Species");
1112  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(0, "Unkown");
1113  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(1, "Electron");
1114  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(2, "Muon");
1115  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(3, "Pion");
1116  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(4, "Kaon");
1117  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(5, "Proton");
1118  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(6, "Deuteron");
1119  fHistDPhi18Spe_MB->GetZaxis()->SetTitle("Cts");
1120 
1121  fHistDPhi18Spe_EMC7 = new TH2F("fHistDPhi18Spe_EMC7", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
1122  fHistDPhi18Spe_EMC7->GetXaxis()->SetTitle("Delta-Phi");
1123  fHistDPhi18Spe_EMC7->GetYaxis()->SetTitle("Species");
1124  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(0, "Unkown");
1125  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(1, "Electron");
1126  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(2, "Muon");
1127  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(3, "Pion");
1128  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(4, "Kaon");
1129  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(5, "Proton");
1130  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(6, "Deuteron");
1131  fHistDPhi18Spe_EMC7->GetZaxis()->SetTitle("Cts");
1132 
1133  fHistDPhi18Spe_EMCEGA = new TH2F("fHistDPhi18Spe_EMCEGA", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
1134  fHistDPhi18Spe_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
1135  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetTitle("Species");
1136  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(0, "Unkown");
1137  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(1, "Electron");
1138  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(2, "Muon");
1139  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(3, "Pion");
1140  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(4, "Kaon");
1141  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(5, "Proton");
1142  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(6, "Deuteron");
1143  fHistDPhi18Spe_EMCEGA->GetZaxis()->SetTitle("Cts");
1144 
1145  fHistDPhi18Spe_EMCJet = new TH2F("fHistDPhi18Spe_EMCJet", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
1146  fHistDPhi18Spe_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
1147  fHistDPhi18Spe_EMCJet->GetYaxis()->SetTitle("Species");
1148  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(0, "Unkown");
1149  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(1, "Electron");
1150  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(2, "Muon");
1151  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(3, "Pion");
1152  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(4, "Kaon");
1153  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(5, "Proton");
1154  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(6, "Deuteron");
1155  fHistDPhi18Spe_EMCJet->GetZaxis()->SetTitle("Cts");
1156 
1157  // Delta Phi for tracks > 300MeV
1158  for(Int_t i=0; i<3; i++){
1159  fHistDPhi300_500_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-.5Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1160  fHistDPhi300_500_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1161  fHistDPhi300_500_MB[i]->GetYaxis()->SetTitle("Cts");
1162  }
1163 
1164  for(Int_t i=0; i<3; i++){
1165  fHistDPhi300_500_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-.5Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1166  fHistDPhi300_500_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1167  fHistDPhi300_500_EMC7[i]->GetYaxis()->SetTitle("Cts");
1168  }
1169 
1170  for(Int_t i=0; i<3; i++){
1171  fHistDPhi300_500_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-.5Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1172  fHistDPhi300_500_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1173  fHistDPhi300_500_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1174  }
1175 
1176  for(Int_t i=0; i<3; i++){
1177  fHistDPhi300_500_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.3-.5Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1178  fHistDPhi300_500_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1179  fHistDPhi300_500_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1180  }
1181 
1182  // Delta Phi for tracks > 500MeV
1183  for(Int_t i=0; i<3; i++){
1184  fHistDPhi500_800_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.5-.8Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1185  fHistDPhi500_800_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1186  fHistDPhi500_800_MB[i]->GetYaxis()->SetTitle("Cts");
1187  }
1188 
1189  for(Int_t i=0; i<3; i++){
1190  fHistDPhi500_800_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.5-.8Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1191  fHistDPhi500_800_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1192  fHistDPhi500_800_EMC7[i]->GetYaxis()->SetTitle("Cts");
1193  }
1194 
1195  for(Int_t i=0; i<3; i++){
1196  fHistDPhi500_800_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.5-.8Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1197  fHistDPhi500_800_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1198  fHistDPhi500_800_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1199  }
1200 
1201  for(Int_t i=0; i<3; i++){
1202  fHistDPhi500_800_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.5-.8Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1203  fHistDPhi500_800_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1204  fHistDPhi500_800_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1205  }
1206 
1207  // Delta Phi for tracks > 800MeV
1208  for(Int_t i=0; i<3; i++){
1209  fHistDPhi800_1_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.8-1Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1210  fHistDPhi800_1_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1211  fHistDPhi800_1_MB[i]->GetYaxis()->SetTitle("Cts");
1212  }
1213 
1214  for(Int_t i=0; i<3; i++){
1215  fHistDPhi800_1_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.8-1Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1216  fHistDPhi800_1_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1217  fHistDPhi800_1_EMC7[i]->GetYaxis()->SetTitle("Cts");
1218  }
1219 
1220  for(Int_t i=0; i<3; i++){
1221  fHistDPhi800_1_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.8-1Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1222  fHistDPhi800_1_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1223  fHistDPhi800_1_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1224  }
1225 
1226  for(Int_t i=0; i<3; i++){
1227  fHistDPhi800_1_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_.8-1Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1228  fHistDPhi800_1_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1229  fHistDPhi800_1_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1230  }
1231 
1232  // Delta Phi for tracks > 1GeV
1233  for(Int_t i=0; i<3; i++){
1234  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1235  fHistDPhi1_2_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1236  fHistDPhi1_2_MB[i]->GetYaxis()->SetTitle("Cts");
1237  }
1238 
1239  for(Int_t i=0; i<3; i++){
1240  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1241  fHistDPhi1_2_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1242  fHistDPhi1_2_EMC7[i]->GetYaxis()->SetTitle("Cts");
1243  }
1244 
1245  for(Int_t i=0; i<3; i++){
1246  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1247  fHistDPhi1_2_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1248  fHistDPhi1_2_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1249  }
1250 
1251  for(Int_t i=0; i<3; i++){
1252  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1253  fHistDPhi1_2_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1254  fHistDPhi1_2_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1255  }
1256 
1257  // Delta Phi for tracks > 2GeV
1258  for(Int_t i=0; i<3; i++){
1259  fHistDPhi2_3_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-3Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1260  fHistDPhi2_3_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1261  fHistDPhi2_3_MB[i]->GetYaxis()->SetTitle("Cts");
1262  }
1263 
1264  for(Int_t i=0; i<3; i++){
1265  fHistDPhi2_3_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-3Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1266  fHistDPhi2_3_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1267  fHistDPhi2_3_EMC7[i]->GetYaxis()->SetTitle("Cts");
1268  }
1269 
1270  for(Int_t i=0; i<3; i++){
1271  fHistDPhi2_3_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-3Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1272  fHistDPhi2_3_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1273  fHistDPhi2_3_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1274  }
1275 
1276  for(Int_t i=0; i<3; i++){
1277  fHistDPhi2_3_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_2-3Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1278  fHistDPhi2_3_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1279  fHistDPhi2_3_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1280  }
1281 
1282  // Delta Phi for tracks > 3GeV
1283  for(Int_t i=0; i<3; i++){
1284  fHistDPhi3_4_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_3-4Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1285  fHistDPhi3_4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1286  fHistDPhi3_4_MB[i]->GetYaxis()->SetTitle("Cts");
1287  }
1288 
1289  for(Int_t i=0; i<3; i++){
1290  fHistDPhi3_4_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_3-4Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1291  fHistDPhi3_4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1292  fHistDPhi3_4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1293  }
1294 
1295  for(Int_t i=0; i<3; i++){
1296  fHistDPhi3_4_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_3-4Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1297  fHistDPhi3_4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1298  fHistDPhi3_4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1299  }
1300 
1301  for(Int_t i=0; i<3; i++){
1302  fHistDPhi3_4_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_3-4Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1303  fHistDPhi3_4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1304  fHistDPhi3_4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1305  }
1306 
1307  // Delta Phi for tracks > 5GeV
1308  for(Int_t i=0; i<3; i++){
1309  fHistDPhi4_MB[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1310  fHistDPhi4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1311  fHistDPhi4_MB[i]->GetYaxis()->SetTitle("Cts");
1312  }
1313 
1314  for(Int_t i=0; i<3; i++){
1315  fHistDPhi4_EMC7[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1316  fHistDPhi4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1317  fHistDPhi4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1318  }
1319 
1320  for(Int_t i=0; i<3; i++){
1321  fHistDPhi4_EMCEGA[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1322  fHistDPhi4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1323  fHistDPhi4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1324  }
1325 
1326  for(Int_t i=0; i<3; i++){
1327  fHistDPhi4_EMCJet[i] = new TH1F(TString::Format("fHistDPhi_trig_%s_assoc_4Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1328  fHistDPhi4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1329  fHistDPhi4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1330  }
1331 
1332  //Mixed Event DPhi plots
1333 
1334  // Delta Phi for tracks > 300MeV
1335  for(Int_t i=0; i<3; i++){
1336  fHistDPhiMix300_500_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-.5Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1337  fHistDPhiMix300_500_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1338  fHistDPhiMix300_500_MB[i]->GetYaxis()->SetTitle("Cts");
1339  }
1340 
1341  for(Int_t i=0; i<3; i++){
1342  fHistDPhiMix300_500_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-.5Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1343  fHistDPhiMix300_500_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1344  fHistDPhiMix300_500_EMC7[i]->GetYaxis()->SetTitle("Cts");
1345  }
1346 
1347  for(Int_t i=0; i<3; i++){
1348  fHistDPhiMix300_500_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-.5Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1349  fHistDPhiMix300_500_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1350  fHistDPhiMix300_500_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1351  }
1352 
1353  for(Int_t i=0; i<3; i++){
1354  fHistDPhiMix300_500_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.3-.5Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .3Gev<pt<.5Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1355  fHistDPhiMix300_500_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1356  fHistDPhiMix300_500_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1357  }
1358 
1359  // Delta Phi for tracks > 500MeV
1360  for(Int_t i=0; i<3; i++){
1361  fHistDPhiMix500_800_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.5-.8Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1362  fHistDPhiMix500_800_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1363  fHistDPhiMix500_800_MB[i]->GetYaxis()->SetTitle("Cts");
1364  }
1365 
1366  for(Int_t i=0; i<3; i++){
1367  fHistDPhiMix500_800_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.5-.8Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1368  fHistDPhiMix500_800_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1369  fHistDPhiMix500_800_EMC7[i]->GetYaxis()->SetTitle("Cts");
1370  }
1371 
1372  for(Int_t i=0; i<3; i++){
1373  fHistDPhiMix500_800_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.5-.8Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1374  fHistDPhiMix500_800_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1375  fHistDPhiMix500_800_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1376  }
1377 
1378  for(Int_t i=0; i<3; i++){
1379  fHistDPhiMix500_800_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.5-.8Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .5Gev<pt<.8Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1380  fHistDPhiMix500_800_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1381  fHistDPhiMix500_800_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1382  }
1383 
1384  // Delta Phi for tracks > 800MeV
1385  for(Int_t i=0; i<3; i++){
1386  fHistDPhiMix800_1_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.8-1Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1387  fHistDPhiMix800_1_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1388  fHistDPhiMix800_1_MB[i]->GetYaxis()->SetTitle("Cts");
1389  }
1390 
1391  for(Int_t i=0; i<3; i++){
1392  fHistDPhiMix800_1_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.8-1Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1393  fHistDPhiMix800_1_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1394  fHistDPhiMix800_1_EMC7[i]->GetYaxis()->SetTitle("Cts");
1395  }
1396 
1397  for(Int_t i=0; i<3; i++){
1398  fHistDPhiMix800_1_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.8-1Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1399  fHistDPhiMix800_1_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1400  fHistDPhiMix800_1_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1401  }
1402 
1403  for(Int_t i=0; i<3; i++){
1404  fHistDPhiMix800_1_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_.8-1Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated .8Gev<pt<1Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1405  fHistDPhiMix800_1_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1406  fHistDPhiMix800_1_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1407  }
1408 
1409  // Delta Phi for tracks > 1GeV
1410  for(Int_t i=0; i<3; i++){
1411  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1412  fHistDPhiMix1_2_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1413  fHistDPhiMix1_2_MB[i]->GetYaxis()->SetTitle("Cts");
1414  }
1415 
1416  for(Int_t i=0; i<3; i++){
1417  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1418  fHistDPhiMix1_2_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1419  fHistDPhiMix1_2_EMC7[i]->GetYaxis()->SetTitle("Cts");
1420  }
1421 
1422  for(Int_t i=0; i<3; i++){
1423  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1424  fHistDPhiMix1_2_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1425  fHistDPhiMix1_2_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1426  }
1427 
1428  for(Int_t i=0; i<3; i++){
1429  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(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1430  fHistDPhiMix1_2_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1431  fHistDPhiMix1_2_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1432  }
1433 
1434  // Delta Phi for tracks > 2GeV
1435  for(Int_t i=0; i<3; i++){
1436  fHistDPhiMix2_3_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-3Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1437  fHistDPhiMix2_3_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1438  fHistDPhiMix2_3_MB[i]->GetYaxis()->SetTitle("Cts");
1439  }
1440 
1441  for(Int_t i=0; i<3; i++){
1442  fHistDPhiMix2_3_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-3Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1443  fHistDPhiMix2_3_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1444  fHistDPhiMix2_3_EMC7[i]->GetYaxis()->SetTitle("Cts");
1445  }
1446 
1447  for(Int_t i=0; i<3; i++){
1448  fHistDPhiMix2_3_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-3Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1449  fHistDPhiMix2_3_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1450  fHistDPhiMix2_3_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1451  }
1452 
1453  for(Int_t i=0; i<3; i++){
1454  fHistDPhiMix2_3_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_2-3Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 2Gev<pt<3Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1455  fHistDPhiMix2_3_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1456  fHistDPhiMix2_3_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1457  }
1458 
1459  // Delta Phi for tracks > 3GeV
1460  for(Int_t i=0; i<3; i++){
1461  fHistDPhiMix3_4_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_3-4Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1462  fHistDPhiMix3_4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1463  fHistDPhiMix3_4_MB[i]->GetYaxis()->SetTitle("Cts");
1464  }
1465 
1466  for(Int_t i=0; i<3; i++){
1467  fHistDPhiMix3_4_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_3-4Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1468  fHistDPhiMix3_4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1469  fHistDPhiMix3_4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1470  }
1471 
1472  for(Int_t i=0; i<3; i++){
1473  fHistDPhiMix3_4_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_3-4Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1474  fHistDPhiMix3_4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1475  fHistDPhiMix3_4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1476  }
1477 
1478  for(Int_t i=0; i<3; i++){
1479  fHistDPhiMix3_4_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_3-4Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated 3Gev<pt<4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1480  fHistDPhiMix3_4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1481  fHistDPhiMix3_4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1482  }
1483 
1484  // Delta Phi for tracks > 5GeV
1485  for(Int_t i=0; i<3; i++){
1486  fHistDPhiMix4_MB[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4Gev_MB",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1487  fHistDPhiMix4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1488  fHistDPhiMix4_MB[i]->GetYaxis()->SetTitle("Cts");
1489  }
1490 
1491  for(Int_t i=0; i<3; i++){
1492  fHistDPhiMix4_EMC7[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4Gev_EMC7",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1493  fHistDPhiMix4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1494  fHistDPhiMix4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1495  }
1496 
1497  for(Int_t i=0; i<3; i++){
1498  fHistDPhiMix4_EMCEGA[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4Gev_EMCEGA",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1499  fHistDPhiMix4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1500  fHistDPhiMix4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1501  }
1502 
1503  for(Int_t i=0; i<3; i++){
1504  fHistDPhiMix4_EMCJet[i] = new TH1F(TString::Format("fHistDPhiMix_trig_%s_assoc_4Gev_EMCJet",ptRangesDPhi[i].Data()).Data(), TString::Format("Delta-Phi for candidate electrons w/ pt=%s and Associated pt>4Gev for Mixed Events",ptRangesDPhi[i].Data()).Data(), 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1505  fHistDPhiMix4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1506  fHistDPhiMix4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1507  }
1508 
1509  //Hadron e/p plot
1510  fHistEMC_Had_MB_1Gev = new TH1F("fHistEMC_Had_MB_1Gev", "E/p for hadrons with Pt between 1-2Gev", 100, 0, 1.5);
1511  fHistEMC_Had_MB_1Gev->GetXaxis()->SetTitle("E/p");
1512  fHistEMC_Had_MB_1Gev->GetYaxis()->SetTitle("Cts");
1513 
1514  // Eta-Phi distribution for tagged events
1515  fHistEtaPhiTag_MB = new TH2F("fHistEtaPhiTag_MB", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1516  fHistEtaPhiTag_MB->GetXaxis()->SetTitle("Eta");
1517  fHistEtaPhiTag_MB->GetYaxis()->SetTitle("Phi");
1518 
1519  fHistEtaPhiTag_EMC7 = new TH2F("fHistEtaPhiTag_EMC7", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1520  fHistEtaPhiTag_EMC7->GetXaxis()->SetTitle("Eta");
1521  fHistEtaPhiTag_EMC7->GetYaxis()->SetTitle("Phi");
1522 
1523  fHistEtaPhiTag_EMCEGA = new TH2F("fHistEtaPhiTag_EMCEGA", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1524  fHistEtaPhiTag_EMCEGA->GetXaxis()->SetTitle("Eta");
1525  fHistEtaPhiTag_EMCEGA->GetYaxis()->SetTitle("Phi");
1526 
1527  fHistEtaPhiTag_EMCJet = new TH2F("fHistEtaPhiTag_EMCJet", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1528  fHistEtaPhiTag_EMCJet->GetXaxis()->SetTitle("Eta");
1529  fHistEtaPhiTag_EMCJet->GetYaxis()->SetTitle("Phi");
1530 
1531  // Eta-Phi distribution
1532  fHistEtaPhi_MB = new TH2F("fHistEtaPhi_MB", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1533  fHistEtaPhi_MB->GetXaxis()->SetTitle("Eta");
1534  fHistEtaPhi_MB->GetYaxis()->SetTitle("Phi");
1535 
1536  fHistEtaPhi_EMC7 = new TH2F("fHistEtaPhi_EMC7", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1537  fHistEtaPhi_EMC7->GetXaxis()->SetTitle("Eta");
1538  fHistEtaPhi_EMC7->GetYaxis()->SetTitle("Phi");
1539 
1540  fHistEtaPhi_EMCEGA = new TH2F("fHistEtaPhi_EMCEGA", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1541  fHistEtaPhi_EMCEGA->GetXaxis()->SetTitle("Eta");
1542  fHistEtaPhi_EMCEGA->GetYaxis()->SetTitle("Phi");
1543 
1544  fHistEtaPhi_EMCJet = new TH2F("fHistEtaPhi_EMCJet", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1545  fHistEtaPhi_EMCJet->GetXaxis()->SetTitle("Eta");
1546  fHistEtaPhi_EMCJet->GetYaxis()->SetTitle("Phi");
1547 
1548  fHistEtaPhiTPCOnly_MB = new TH2F("fHistEtaPhiTPCOnly_MB", "Eta-Phi distribution of TPC only tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1549  fHistEtaPhiTPCOnly_MB->GetXaxis()->SetTitle("Eta");
1550  fHistEtaPhiTPCOnly_MB->GetYaxis()->SetTitle("Phi");
1551 
1552  // Energy per event histos
1553  fHistPtSum_MB = new TH1F("fHistPtSum_MB", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1554  fHistPtSum_MB->GetXaxis()->SetTitle("Pt Sum");
1555  fHistPtSum_MB->GetYaxis()->SetTitle("Cts");
1556 
1557  fHistPtSum_EMC7 = new TH1F("fHistPtSum_EMC7", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1558  fHistPtSum_EMC7->GetXaxis()->SetTitle("Pt Sum");
1559  fHistPtSum_EMC7->GetYaxis()->SetTitle("Cts");
1560 
1561  fHistPtSum_EMCEGA = new TH1F("fHistPtSum_EMCEGA", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1562  fHistPtSum_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1563  fHistPtSum_EMCEGA->GetYaxis()->SetTitle("Cts");
1564 
1565  fHistPtSum_EMCJet = new TH1F("fHistPtSum_EMCJet", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1566  fHistPtSum_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1567  fHistPtSum_EMCJet->GetYaxis()->SetTitle("Cts");
1568 
1569  // Energy per tagged event histos
1570  fHistPtSumTag_MB = new TH1F("fHistPtSumTag_MB", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1571  fHistPtSumTag_MB->GetXaxis()->SetTitle("Pt Sum");
1572  fHistPtSumTag_MB->GetYaxis()->SetTitle("Cts");
1573 
1574  fHistPtSumTag_EMC7 = new TH1F("fHistPtSumTag_EMC7", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1575  fHistPtSumTag_EMC7->GetXaxis()->SetTitle("Pt Sum");
1576  fHistPtSumTag_EMC7->GetYaxis()->SetTitle("Cts");
1577 
1578  fHistPtSumTag_EMCEGA = new TH1F("fHistPtSumTag_EMCEGA", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1579  fHistPtSumTag_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1580  fHistPtSumTag_EMCEGA->GetYaxis()->SetTitle("Cts");
1581 
1582  fHistPtSumTag_EMCJet = new TH1F("fHistPtSumTag_EMCJet", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1583  fHistPtSumTag_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1584  fHistPtSumTag_EMCJet->GetYaxis()->SetTitle("Cts");
1585 
1586  // Energy per event in EMC acceptance histos
1587  fHistPtSumEMC_MB = new TH1F("fHistPtSumEMC_MB", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1588  fHistPtSumEMC_MB->GetXaxis()->SetTitle("Pt Sum");
1589  fHistPtSumEMC_MB->GetYaxis()->SetTitle("Cts");
1590 
1591  fHistPtSumEMC_EMC7 = new TH1F("fHistPtSumEMC_EMC7", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1592  fHistPtSumEMC_EMC7->GetXaxis()->SetTitle("Pt Sum");
1593  fHistPtSumEMC_EMC7->GetYaxis()->SetTitle("Cts");
1594 
1595  fHistPtSumEMC_EMCEGA = new TH1F("fHistPtSumEMC_EMCEGA", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1596  fHistPtSumEMC_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1597  fHistPtSumEMC_EMCEGA->GetYaxis()->SetTitle("Cts");
1598 
1599  fHistPtSumEMC_EMCJet = new TH1F("fHistPtSumEMC_EMCJet", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1600  fHistPtSumEMC_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1601  fHistPtSumEMC_EMCJet->GetYaxis()->SetTitle("Cts");
1602 
1603  // Numbers of events
1604  fHistNevents_MB = new TH1F("fHistNevents_MB", "Number of events that have an 'electron'", 2,0,1);
1605  fHistNevents_MB->GetXaxis()->SetBinLabel(1,"Events");
1606  fHistNevents_MB->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1607  fHistNevents_MB->GetYaxis()->SetTitle("Cts");
1608 
1609  fHistNevents_EMC7 = new TH1F("fHistNevents_EMC7", "Number of events that have an 'electron'", 2,0,1);
1610  fHistNevents_EMC7->GetXaxis()->SetBinLabel(1,"Events");
1611  fHistNevents_EMC7->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1612  fHistNevents_EMC7->GetYaxis()->SetTitle("Cts");
1613 
1614  fHistNevents_EMCEGA = new TH1F("fHistNevents_EMCEGA", "Number of events that have an 'electron'", 2,0,1);
1615  fHistNevents_EMCEGA->GetXaxis()->SetBinLabel(1,"Events");
1616  fHistNevents_EMCEGA->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1617  fHistNevents_EMCEGA->GetYaxis()->SetTitle("Cts");
1618 
1619  fHistNevents_EMCJet = new TH1F("fHistNevents_EMCJet", "Number of events that have an 'electron'", 2,0,1);
1620  fHistNevents_EMCJet->GetXaxis()->SetBinLabel(1,"Events");
1621  fHistNevents_EMCJet->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1622  fHistNevents_EMCJet->GetYaxis()->SetTitle("Cts");
1623 
1624  //TPC Sigma
1625  fHistTPCSig_MB = new TH1F("fHistTPCSig_MB", "dEdx Resolution in TPC", 100,0,100);
1626  fHistTPCSig_MB->GetXaxis()->SetTitle("Resolution");
1627  fHistTPCSig_MB->GetYaxis()->SetTitle("Count");
1628 
1629  fHistTPCSig_EMC7 = new TH1F("fHistTPCSig_EMC7", "dEdx Resolution in TPC", 100,0,100);
1630  fHistTPCSig_EMC7->GetXaxis()->SetTitle("Resolution");
1631  fHistTPCSig_EMC7->GetYaxis()->SetTitle("Count");
1632 
1633  fHistTPCSig_EMCEGA = new TH1F("fHistTPCSig_EMCEGA", "dEdx Resolution in TPC", 100,0,100);
1634  fHistTPCSig_EMCEGA->GetXaxis()->SetTitle("Resolution");
1635  fHistTPCSig_EMCEGA->GetYaxis()->SetTitle("Count");
1636 
1637  fHistTPCSig_EMCJet = new TH1F("fHistTPCSig_EMCJet", "dEdx Resolution in TPC", 100,0,100);
1638  fHistTPCSig_EMCJet->GetXaxis()->SetTitle("Resolution");
1639  fHistTPCSig_EMCJet->GetYaxis()->SetTitle("Count");
1640 
1641  //TPC Sigma after general cuts
1642  fHistTPCSigCut_MB = new TH1F("fHistTPCSigCut_MB", "dEdx Resolution in TPC for tracks that pass the basic track cuts", 100,0,100);
1643  fHistTPCSigCut_MB->GetXaxis()->SetTitle("Resolution");
1644  fHistTPCSigCut_MB->GetYaxis()->SetTitle("Count");
1645 
1646  fHistTPCSigCut_EMC7 = new TH1F("fHistTPCSigCut_EMC7", "dEdx Resolution in TPC for tracks that pass the basic track cuts", 100,0,100);
1647  fHistTPCSigCut_EMC7->GetXaxis()->SetTitle("Resolution");
1648  fHistTPCSigCut_EMC7->GetYaxis()->SetTitle("Count");
1649 
1650  fHistTPCSigCut_EMCEGA = new TH1F("fHistTPCSigCut_EMCEGA", "dEdx Resolution in TPC for tracks that pass the basic track cuts", 100,0,100);
1651  fHistTPCSigCut_EMCEGA->GetXaxis()->SetTitle("Resolution");
1652  fHistTPCSigCut_EMCEGA->GetYaxis()->SetTitle("Count");
1653 
1654  fHistTPCSigCut_EMCJet = new TH1F("fHistTPCSigCut_EMCJet", "dEdx Resolution in TPC for tracks that pass the basic track cuts", 100,0,100);
1655  fHistTPCSigCut_EMCJet->GetXaxis()->SetTitle("Resolution");
1656  fHistTPCSigCut_EMCJet->GetYaxis()->SetTitle("Count");
1657 
1658  //Impact Parameter histos
1659  fHistImpPar_MB = new TH1F("fHistImpPar_MB", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1660  fHistImpPar_MB->GetXaxis()->SetTitle("Impact Parameter(cm)");
1661  fHistImpPar_MB->GetYaxis()->SetTitle("Count");
1662 
1663  fHistImpPar_EMC7 = new TH1F("fHistImpPar_EMC7", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1664  fHistImpPar_EMC7->GetXaxis()->SetTitle("Impact Parameter(cm)");
1665  fHistImpPar_EMC7->GetYaxis()->SetTitle("Count");
1666 
1667  fHistImpPar_EMCEGA = new TH1F("fHistImpPar_EMCEGA", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1668  fHistImpPar_EMCEGA->GetXaxis()->SetTitle("Impact Parameter(cm)");
1669  fHistImpPar_EMCEGA->GetYaxis()->SetTitle("Count");
1670 
1671  fHistImpPar_EMCJet = new TH1F("fHistImpPar_EMCJet", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1672  fHistImpPar_EMCJet->GetXaxis()->SetTitle("Impact Parameter(cm)");
1673  fHistImpPar_EMCJet->GetYaxis()->SetTitle("Count");
1674 
1675  //Impact Parameter for tagged electrons histos
1676  fHistImpParTag_MB = new TH1F("fHistImpParTag_MB", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1677  fHistImpParTag_MB->GetXaxis()->SetTitle("Impact Parameter(cm)");
1678  fHistImpParTag_MB->GetYaxis()->SetTitle("Count");
1679 
1680  fHistImpParTag_EMC7 = new TH1F("fHistImpParTag_EMC7", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1681  fHistImpParTag_EMC7->GetXaxis()->SetTitle("Impact Parameter(cm)");
1682  fHistImpParTag_EMC7->GetYaxis()->SetTitle("Count");
1683 
1684  fHistImpParTag_EMCEGA = new TH1F("fHistImpParTag_EMCEGA", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1685  fHistImpParTag_EMCEGA->GetXaxis()->SetTitle("Impact Parameter(cm)");
1686  fHistImpParTag_EMCEGA->GetYaxis()->SetTitle("Count");
1687 
1688  fHistImpParTag_EMCJet = new TH1F("fHistImpParTag_EMCJet", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1689  fHistImpParTag_EMCJet->GetXaxis()->SetTitle("Impact Parameter(cm)");
1690  fHistImpParTag_EMCJet->GetYaxis()->SetTitle("Count");
1691 
1692  //Number of clusters per track in TPC
1693  fHistTPCNClus_MB = new TH1F("fHistTPCNClus_MB", "Number of Clusters per track in TPC", 159, 0, 159);
1694  fHistTPCNClus_MB->GetXaxis()->SetTitle("Number of TPC Clusters");
1695  fHistTPCNClus_MB->GetYaxis()->SetTitle("Number of Tracks");
1696 
1697  fHistTPCNClus_EMC7 = new TH1F("fHistTPCNClus_EMC7", "Number of Clusters per track in TPC", 159, 0, 159);
1698  fHistTPCNClus_EMC7->GetXaxis()->SetTitle("Number of TPC Clusters");
1699  fHistTPCNClus_EMC7->GetYaxis()->SetTitle("Number of Tracks");
1700 
1701  fHistTPCNClus_EMCEGA = new TH1F("fHistTPCNClus_EMCEGA", "Number of Clusters per track in TPC", 159, 0, 159);
1702  fHistTPCNClus_EMCEGA->GetXaxis()->SetTitle("Number of TPC Clusters");
1703  fHistTPCNClus_EMCEGA->GetYaxis()->SetTitle("Number of Tracks");
1704 
1705  fHistTPCNClus_EMCJet = new TH1F("fHistTPCNClus_EMCJet", "Number of Clusters per track in TPC", 159, 0, 159);
1706  fHistTPCNClus_EMCJet->GetXaxis()->SetTitle("Number of TPC Clusters");
1707  fHistTPCNClus_EMCJet->GetYaxis()->SetTitle("Number of Tracks");
1708 
1709  //Number of clusters per track in ITS
1710  fHistITSNClus_MB = new TH1F("fHistITSNClus_MB", "Number of Clusters per Track in ITS", 10, 0, 10);
1711  fHistITSNClus_MB->GetXaxis()->SetTitle("Number of ITS Clusters");
1712  fHistITSNClus_MB->GetYaxis()->SetTitle("Number of Tracks");
1713 
1714  fHistITSNClus_EMC7 = new TH1F("fHistITSNClus_EMC7", "Number of Clusters per Track in ITS", 10, 0, 10);
1715  fHistITSNClus_EMC7->GetXaxis()->SetTitle("Number of ITS Clusters");
1716  fHistITSNClus_EMC7->GetYaxis()->SetTitle("Number of Tracks");
1717 
1718  fHistITSNClus_EMCEGA = new TH1F("fHistITSNClus_EMCEGA", "Number of Clusters per Track in ITS", 10, 0, 10);
1719  fHistITSNClus_EMCEGA->GetXaxis()->SetTitle("Number of ITS Clusters");
1720  fHistITSNClus_EMCEGA->GetYaxis()->SetTitle("Number of Tracks");
1721 
1722  fHistITSNClus_EMCJet = new TH1F("fHistITSNClus_EMCJet", "Number of Clusters per Track in ITS", 10, 0, 10);
1723  fHistITSNClus_EMCJet->GetXaxis()->SetTitle("Number of ITS Clusters");
1724  fHistITSNClus_EMCJet->GetYaxis()->SetTitle("Number of Tracks");
1725 
1726  // Pt distribution of all tracks and tagged tracks
1727  fHistPtAssoc_MB = new TH1F("fHistPtAssoc_MB", "Pt distribution for associated tracks", 100,0, 15);
1728  fHistPtAssoc_MB->GetXaxis()->SetTitle("Pt(Gev)");
1729  fHistPtAssoc_MB->GetYaxis()->SetTitle("Count");
1730 
1731  fHistPtAssoc_EMC7 = new TH1F("fHistPtAssoc_EMC7", "Pt distribution for associated tracks", 100,0, 15);
1732  fHistPtAssoc_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1733  fHistPtAssoc_EMC7->GetYaxis()->SetTitle("Count");
1734 
1735  fHistPtAssoc_EMCEGA = new TH1F("fHistPtAssoc_EMCEGA", "Pt distribution for associated tracks", 100,0, 15);
1736  fHistPtAssoc_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1737  fHistPtAssoc_EMCEGA->GetYaxis()->SetTitle("Count");
1738 
1739  fHistPtAssoc_EMCJet = new TH1F("fHistPtAssoc_EMCJet", "Pt distribution for associated tracks", 100,0, 15);
1740  fHistPtAssoc_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1741  fHistPtAssoc_EMCJet->GetYaxis()->SetTitle("Count");
1742 
1743  // Pt distribution of all tracks for mixed events
1744  fHistPtAssocMix_MB = new TH1F("fHistPtAssocMix_MB", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1745  fHistPtAssocMix_MB->GetXaxis()->SetTitle("Pt(Gev)");
1746  fHistPtAssocMix_MB->GetYaxis()->SetTitle("Count");
1747 
1748  fHistPtAssocMix_EMC7 = new TH1F("fHistPtAssocMix_EMC7", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1749  fHistPtAssocMix_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1750  fHistPtAssocMix_EMC7->GetYaxis()->SetTitle("Count");
1751 
1752  fHistPtAssocMix_EMCEGA = new TH1F("fHistPtAssocMix_EMCEGA", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1753  fHistPtAssocMix_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1754  fHistPtAssocMix_EMCEGA->GetYaxis()->SetTitle("Count");
1755 
1756  fHistPtAssocMix_EMCJet = new TH1F("fHistPtAssocMix_EMCJet", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1757  fHistPtAssocMix_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1758  fHistPtAssocMix_EMCJet->GetYaxis()->SetTitle("Count");
1759 
1760  //Impact Parameter for tagged electrons histos
1761  fHistPtTag_MB = new TH1F("fHistPtTag_MB", "Pt distribution for electron candidates", 100,0, 15);
1762  fHistPtTag_MB->GetXaxis()->SetTitle("Pt(Gev)");
1763  fHistPtTag_MB->GetYaxis()->SetTitle("Count");
1764 
1765  fHistPtTag_EMC7 = new TH1F("fHistPtTag_EMC7", "Pt distribution for electron candidates", 100,0, 15);
1766  fHistPtTag_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1767  fHistPtTag_EMC7->GetYaxis()->SetTitle("Count");
1768 
1769  fHistPtTag_EMCEGA = new TH1F("fHistPtTag_EMCEGA", "Pt distribution for electron candidates", 100,0, 15);
1770  fHistPtTag_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1771  fHistPtTag_EMCEGA->GetYaxis()->SetTitle("Count");
1772 
1773  fHistPtTag_EMCJet = new TH1F("fHistPtTag_EMCJet", "Pt distribution for electron candidates", 100,0, 15);
1774  fHistPtTag_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1775  fHistPtTag_EMCJet->GetYaxis()->SetTitle("Count");
1776 
1777  //Add rejection plots to MB plots since it is the easiest place
1780 
1782  fOutputMB->Add(fHistPtAssoc_MB);
1784  fOutputMB->Add(fHistPtTag_MB);
1787  fOutputMB->Add(fHistTPCSig_MB);
1789  fOutputMB->Add(fHistImpPar_MB);
1791  fOutputMB->Add(fHistNevents_MB);
1792  fOutputMB->Add(fHistPtSum_MB);
1795  fOutputMB->Add(fHistEtaPhi_MB);
1803  for(Int_t i=0; i<6;i++){
1804  fOutputMB->Add(fHistTPC_EMCTRD_MB[i]);
1805 
1806  fOutputMB->Add(fHistEMC_TPCTRD_MB[i]);
1807 
1808  fOutputMB->Add(fHistTRD_TPCEMC_MB[i]);
1809 
1810  fOutputMB->Add(fHistM02_All_MB[i]);
1811  fOutputMB->Add(fHistM20_All_MB[i]);
1812  fOutputMB->Add(fHistM02_Elec_MB[i]);
1813  fOutputMB->Add(fHistM20_Elec_MB[i]);
1814  }
1815  for(Int_t i=0; i<3;i++){
1816  fOutputMB->Add(fHistDPhi300_500_MB[i]);
1817  fOutputMB->Add(fHistDPhi500_800_MB[i]);
1818  fOutputMB->Add(fHistDPhi800_1_MB[i]);
1819  fOutputMB->Add(fHistDPhi1_2_MB[i]);
1820  fOutputMB->Add(fHistDPhi2_3_MB[i]);
1821  fOutputMB->Add(fHistDPhi3_4_MB[i]);
1822  fOutputMB->Add(fHistDPhi4_MB[i]);
1826  fOutputMB->Add(fHistDPhiMix1_2_MB[i]);
1827  fOutputMB->Add(fHistDPhiMix2_3_MB[i]);
1828  fOutputMB->Add(fHistDPhiMix3_4_MB[i]);
1829  fOutputMB->Add(fHistDPhiMix4_MB[i]);
1830  }
1831  fOutputMB->Add(fHistDPhi28_MB);
1836 
1857  for(Int_t i=0; i<6;i++){
1859 
1861 
1863 
1864  fOutputEMC7->Add(fHistM02_All_EMC7[i]);
1865  fOutputEMC7->Add(fHistM20_All_EMC7[i]);
1868  }
1869  for(Int_t i=0; i<3;i++){
1873  fOutputEMC7->Add(fHistDPhi1_2_EMC7[i]);
1874  fOutputEMC7->Add(fHistDPhi2_3_EMC7[i]);
1875  fOutputEMC7->Add(fHistDPhi3_4_EMC7[i]);
1876  fOutputEMC7->Add(fHistDPhi4_EMC7[i]);
1884  }
1890 
1911  for(Int_t i=0; i<6;i++){
1913 
1915 
1917 
1922  }
1923  for(Int_t i=0; i<3;i++){
1938  }
1944 
1965  for(Int_t i=0; i<6;i++){
1967 
1969 
1971 
1976  }
1977  for(Int_t i=0; i<3;i++){
1992  }
1998 
1999  // NEW HISTO added to fOutput here
2000  PostData(1, fOutputMB);
2001  PostData(2, fOutputEMC7);
2002  PostData(3, fOutputEMCEGA);
2003  PostData(4, fOutputEMCJet);// Post data for ALL output slots >0 here, to get at least an empty histogram
2004 }
2005 
2006 //________________________________________________________________________
2008 {
2009  // Main loop
2010  // Called for each event
2011 
2012  //_______________________________Major event-level stuff____________________________________
2013  // Create pointer to reconstructed event
2014  AliVEvent *event = InputEvent();
2015  if (!event) { Printf("ERROR: Could not retrieve event"); return; }
2016 
2017  AliESDEvent* esd;
2018  // create pointer to event
2019  AliAODEvent* aod = dynamic_cast<AliAODEvent*>(event);
2020  if (!aod) {
2021  AliError("Cannot get the AOD event");
2022  return;
2023  }
2024  if(!aodEv){
2025  esd = dynamic_cast<AliESDEvent*>(event);
2026  cout<<"Made ESD Event\n";
2027  if (!esd) {
2028  AliError("Cannot get the ESD event");
2029  return;
2030  }
2031  }
2032 
2033  // input handler
2034  const AliAnalysisManager* man(AliAnalysisManager::GetAnalysisManager());
2035  if (NULL == man) {
2036  AliWarning("AliAnalysisManager is not available");
2037  return;
2038  }
2039 
2040  AliInputEventHandler* inputHandler = (AliInputEventHandler*)man->GetInputEventHandler();
2041  if (!inputHandler) {
2042  AliWarning("AliInputEventHandler is not available");
2043  return;
2044  }
2045  /*if(!aodEv){
2046  AliESDInputHandler* inputHandlerESD = dynamic_cast<AliESDInputHandler*>(man->GetInputEventHandler());
2047  if (!inputHandlerESD) {
2048  AliWarning("AliESDInputHandler is not available");
2049  return;
2050  }
2051  }else{
2052  AliAODInputHandler* inputHandlerAOD = (AliAODInputHandler*)(man->GetInputEventHandler());
2053  if (!inputHandlerAOD) {
2054  AliWarning("AliAODInputHandler is not available");
2055  return;
2056  }
2057  }*/
2058 
2059  UInt_t fSelectMask = inputHandler->IsEventSelected();
2060  /*if(!aodEv){
2061  UInt_t fSelectMask = inputHandler->IsEventSelected();
2062  }else{
2063  UInt_t fSelectMask = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
2064  } */
2065 
2066  Bool_t isSelected = fSelectMask & (AliVEvent::kEMC7 | AliVEvent::kEMCEJE | AliVEvent::kEMCEGA);
2067  if(!isSelected){
2068  AliWarning("This is not an EMCal triggered event");
2069  }
2070 
2071  MBtrg = fSelectMask & AliVEvent::kAnyINT;
2072  EMC7trg = fSelectMask & AliVEvent::kEMC7;
2073  EMCEGAtrg = fSelectMask & AliVEvent::kEMCEGA;
2074  EMCJettrg = fSelectMask & AliVEvent::kEMCEJE;
2075 
2076  Int_t elecIDs[1000];
2077  Int_t elecCnt=0;
2078 
2079  if(!aodEv){
2081  AliWarning("The hybrid track cuts are null");
2082  return;
2083  }
2084  }
2085 
2086  AliPIDResponse* fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
2087  /*if(!aodEv){
2088  AliPIDResponse* fPIDResponse = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetPIDResponse();
2089  }else{
2090  AliPIDResponse* fPIDResponse = (inputHandlerAOD)->GetPIDResponse();
2091  }*/
2092  if(!fPIDResponse){
2093  AliWarning("NULL PIDResponse");
2094  }
2095 
2096  if(aodEv){
2097  trkArr = MakeTrkArr(aod);
2098  }
2099  //__________________________End major event stuff_____________________________
2100 
2101 
2102  //Fill the histogram cataloguing # of events vs. events tagged
2103  if(MBtrg){
2104  fHistNevents_MB->Fill("Events",1);
2105  }
2106 
2107  if(EMC7trg){
2108  fHistNevents_EMC7->Fill("Events",1);
2109  }
2110 
2111  if(EMCEGAtrg){
2112  fHistNevents_EMCEGA->Fill("Events",1);
2113  }
2114 
2115  if(EMCJettrg){
2116  fHistNevents_EMCJet->Fill("Events",1);
2117  }
2118 
2119  //Initialize energy variable and tagging flags
2120  Double_t PtSum=0;
2121  Double_t PtSumEMC=0;
2122  tagStrong=kFALSE;
2123  Bool_t tagEvt=kFALSE;
2124 
2125  //Initialize the # of tracks variable and the Eta Phi arrays
2126  Int_t ntracks=0;
2127  ntracks = aod->GetNumberOfTracks();
2128  if(!aodEv){
2129  ntracks = esd->GetNumberOfTracks();
2130  }
2131 
2132  std::vector<Double_t> Eta;
2133  std::vector<Double_t> Phi;
2134 
2135  fPool = fPoolMan->GetEventPool(ntracks, aod->GetPrimaryVertex()->GetZ());
2136 
2137  // Track loop for reconstructed event
2138  for(Int_t i = 0; i < ntracks; i++) {
2139 
2140  tagStrong=kFALSE;
2141  tagPhot=kFALSE;
2142  AliESDtrack* esdtrack = 0;
2143  AliAODTrack* aodtrack = (AliAODTrack*)aod->GetTrack(i); // pointer to reconstructed to track
2144  if(!aodEv){
2145  esdtrack = (AliESDtrack*)esd->GetTrack(i); // pointer to reconstructed to track
2146  }
2147 
2148  if(!aodtrack) {
2149  AliError(Form("ERROR: Could not retrieve track %d",i));
2150  continue;
2151  }
2152 
2153  if(!aodEv){
2154  if(!esdtrack) {
2155  AliError(Form("ERROR: Could not retrieve track %d",i));
2156  continue;
2157  }
2158  }
2159 
2160  //Fill TPCOnly track eta-phi
2161 
2162  if(aodtrack->IsTPCOnly()){
2163  fHistEtaPhiTPCOnly_MB->Fill(aodtrack->Eta(),aodtrack->Phi());
2164  }
2165 
2166  if(!aodEv){
2167  if(AliESDtrackCuts::GetStandardTPCOnlyTrackCuts()->AcceptTrack(esdtrack)){
2168  fHistEtaPhiTPCOnly_MB->Fill(esdtrack->Eta(),esdtrack->Phi());
2169  }
2170  }
2171 
2172 
2173  //Do hybrid track cuts
2174  if(!aodtrack->IsHybridGlobalConstrainedGlobal()){continue;}
2175  if(!aodEv){
2176  if(!globaltrackCuts->AcceptTrack(esdtrack)&&!comptrackCuts->AcceptTrack(esdtrack)){continue;}
2177  }
2178 
2179  //Add this tracks energy to the running total
2180  PtSum=PtSum+aodtrack->Pt();
2181  if(aodtrack->Eta()<.7&&aodtrack->Eta()>-.7&&aodtrack->Phi()>80&&aodtrack->Phi()<180){
2182  PtSumEMC=PtSumEMC+aodtrack->Pt();
2183  }
2184 
2185  //Fill the Eta Phi arrays with this tracks Eta and Phi
2186  Eta.push_back(aodtrack->Eta());
2187  Phi.push_back(aodtrack->Phi());
2188 
2189  if(MBtrg){
2190  fHistEtaPhi_MB->Fill(aodtrack->Eta(),aodtrack->Phi());
2191  }
2192  if(EMC7trg){
2193  fHistEtaPhi_EMC7->Fill(aodtrack->Eta(),aodtrack->Phi());
2194  }
2195  if(EMCEGAtrg){
2196  fHistEtaPhi_EMCEGA->Fill(aodtrack->Eta(),aodtrack->Phi());
2197  }
2198  if(EMCJettrg){
2199  fHistEtaPhi_EMCJet->Fill(aodtrack->Eta(),aodtrack->Phi());
2200  }
2201 
2202  //do Cut level histograms
2203  if(MBtrg){
2204  if(aodtrack->GetTPCncls()>0){
2205  fHistTPCNClus_MB->Fill(aodtrack->GetTPCncls());
2206  }
2207  fHistITSNClus_MB->Fill(aodtrack->GetNcls(0));
2208  }
2209 
2210  if(EMC7trg){
2211  if(aodtrack->GetTPCncls()>0){
2212  fHistTPCNClus_EMC7->Fill(aodtrack->GetTPCncls());
2213  }
2214  fHistITSNClus_EMC7->Fill(aodtrack->GetNcls(0));
2215  }
2216 
2217  if(EMCEGAtrg){
2218  if(aodtrack->GetTPCncls()>0){
2219  fHistTPCNClus_EMCEGA->Fill(aodtrack->GetTPCncls());
2220  }
2221  fHistITSNClus_EMCEGA->Fill(aodtrack->GetNcls(0));
2222  }
2223 
2224  if(EMCJettrg){
2225  if(aodtrack->GetTPCncls()>0){
2226  fHistTPCNClus_EMCJet->Fill(aodtrack->GetTPCncls());
2227  }
2228  fHistITSNClus_EMCJet->Fill(aodtrack->GetNcls(0));
2229  }
2230 
2231  if(!aodEv){
2232  //Add this tracks energy to the running total
2233  PtSum=PtSum+esdtrack->Pt();
2234 
2235  //Fill the Eta Phi arrays with this tracks Eta and Phi
2236  Eta.push_back(esdtrack->Eta());
2237  Phi.push_back(esdtrack->Phi());
2238 
2239  if(MBtrg){
2240  fHistEtaPhi_MB->Fill(esdtrack->Eta(),esdtrack->Phi());
2241  }
2242  if(EMC7trg){
2243  fHistEtaPhi_EMC7->Fill(esdtrack->Eta(),esdtrack->Phi());
2244  }
2245  if(EMCEGAtrg){
2246  fHistEtaPhi_EMCEGA->Fill(esdtrack->Eta(),esdtrack->Phi());
2247  }
2248  if(EMCJettrg){
2249  fHistEtaPhi_EMCJet->Fill(esdtrack->Eta(),esdtrack->Phi());
2250  }
2251 
2252  //do Cut level histograms
2253  if(MBtrg){
2254  if(esdtrack->GetTPCncls()>0){
2255  fHistTPCNClus_MB->Fill(esdtrack->GetTPCncls());
2256  }
2257  fHistITSNClus_MB->Fill(esdtrack->GetNcls(0));
2258  }
2259 
2260  if(EMC7trg){
2261  if(esdtrack->GetTPCncls()>0){
2262  fHistTPCNClus_EMC7->Fill(esdtrack->GetTPCncls());
2263  }
2264  fHistITSNClus_EMC7->Fill(esdtrack->GetNcls(0));
2265  }
2266 
2267  if(EMCEGAtrg){
2268  if(esdtrack->GetTPCncls()>0){
2269  fHistTPCNClus_EMCEGA->Fill(esdtrack->GetTPCncls());
2270  }
2271  fHistITSNClus_EMCEGA->Fill(esdtrack->GetNcls(0));
2272  }
2273 
2274  if(EMCJettrg){
2275  if(esdtrack->GetTPCncls()>0){
2276  fHistTPCNClus_EMCJet->Fill(esdtrack->GetTPCncls());
2277  }
2278  fHistITSNClus_EMCJet->Fill(esdtrack->GetNcls(0));
2279  }
2280  }
2281 
2282 
2283  //Fill histogram for TPC resolution
2284  if(!aodEv){
2285  if(MBtrg){
2286  fHistTPCSig_MB->Fill(esdtrack->GetTPCsignalSigma());
2287  }
2288 
2289  if(EMC7trg){
2290  fHistTPCSig_EMC7->Fill(esdtrack->GetTPCsignalSigma());
2291  }
2292 
2293  if(EMCEGAtrg){
2294  fHistTPCSig_EMCEGA->Fill(esdtrack->GetTPCsignalSigma());
2295  }
2296 
2297  if(EMCJettrg){
2298  fHistTPCSig_EMCJet->Fill(esdtrack->GetTPCsignalSigma());
2299  }
2300  }
2301 
2302  //Impact parameter
2303  Float_t xy;
2304  Float_t z;
2305 
2306  xy=TMath::Sqrt(aodtrack->XAtDCA()*aodtrack->XAtDCA()+aodtrack->YAtDCA()*aodtrack->YAtDCA());
2307 
2308  if(!aodEv){
2309  esdtrack->GetImpactParameters(xy, z);
2310  }
2311 
2312  if(MBtrg){
2313  fHistImpPar_MB->Fill(xy);
2314  }
2315 
2316  if(EMC7trg){
2317  fHistImpPar_EMC7->Fill(xy);
2318  }
2319 
2320  if(EMCEGAtrg){
2321  fHistImpPar_EMCEGA->Fill(xy);
2322  }
2323 
2324  if(EMCJettrg){
2325  fHistImpPar_EMCJet->Fill(xy);
2326  }
2327 
2328  FillPhotoElecHistos(aod, aodtrack, fPIDResponse, i);
2329 
2330  if(!aodEv){
2331  FillPhotoElecHistos(esd, esdtrack, fPIDResponse, i);
2332  }
2333 
2334  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2335  //If the track doesn't pass the cuts, move on to the next one
2336  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2337  if(trackCutsStrong){
2338  if(!fTrackCutsStrong->AcceptVTrack((AliVTrack*)aodtrack) || aodtrack->GetTPCsignalN()<80){continue;}
2339  }else{
2340  if(!fTrackCutsWeak->AcceptVTrack((AliVTrack*)aodtrack) || aodtrack->GetTPCsignalN()<80){continue;}
2341  }
2342 
2343  if(!aodEv){
2344  if(trackCutsStrong){
2345  if(!fTrackCutsStrong->AcceptTrack(esdtrack) || esdtrack->GetTPCsignalN()<80){continue;}
2346  }else{
2347  if(!fTrackCutsWeak->AcceptTrack(esdtrack) || esdtrack->GetTPCsignalN()<80){continue;}
2348  }
2349  }
2350 
2351 
2352 
2353  //Fill histogram for TPC resolution
2354  if(!aodEv){
2355  if(MBtrg){
2356  fHistTPCSigCut_MB->Fill(esdtrack->GetTPCsignalSigma());
2357  }
2358 
2359  if(EMC7trg){
2360  fHistTPCSigCut_EMC7->Fill(esdtrack->GetTPCsignalSigma());
2361  }
2362 
2363  if(EMCEGAtrg){
2364  fHistTPCSigCut_EMCEGA->Fill(esdtrack->GetTPCsignalSigma());
2365  }
2366 
2367  if(EMCJettrg){
2368  fHistTPCSigCut_EMCJet->Fill(esdtrack->GetTPCsignalSigma());
2369  }
2370  }
2371 
2372  FillPIDHistos(aod, aodtrack, fPIDResponse);//Fill PID histos and set "tagStrong" boolean if this track satisfies cuts
2373 
2374  if(!aodEv){
2375  FillPIDHistos(esd, esdtrack, fPIDResponse);//Fill PID histos and set "tagStrong" boolean if this track satisfies cuts
2376  }
2377 
2378  //If the track made it through any 3 detector cuts
2379  if(tagStrong){
2380  tagEvt=kTRUE;//This event contains a candidate electron
2381  //Increment the candidate count and put track ID of candidate into array
2382 
2383  elecIDs[elecCnt]=i;
2384  elecCnt+=1;
2385 
2386  //Fill impact parameter plots
2387  if(MBtrg){
2388  fHistImpParTag_MB->Fill(xy);
2389  }
2390 
2391  if(EMC7trg){
2392  fHistImpParTag_EMC7->Fill(xy);
2393  }
2394 
2395  if(EMCEGAtrg){
2396  fHistImpParTag_EMCEGA->Fill(xy);
2397  }
2398 
2399  if(EMCJettrg){
2400  fHistImpParTag_EMCJet->Fill(xy);
2401  }
2402 
2403  //Pt distribution
2404 
2405  if(MBtrg){
2406  fHistPtTag_MB->Fill(aodtrack->Pt());
2407  }
2408 
2409  if(EMC7trg){
2410  fHistPtTag_EMC7->Fill(aodtrack->Pt());
2411  }
2412 
2413  if(EMCEGAtrg){
2414  fHistPtTag_EMCEGA->Fill(aodtrack->Pt());
2415  }
2416 
2417  if(EMCJettrg){
2418  fHistPtTag_EMCJet->Fill(aodtrack->Pt());
2419  }
2420 
2421  if(!aodEv){
2422  if(MBtrg){
2423  fHistPtTag_MB->Fill(esdtrack->Pt());
2424  }
2425 
2426  if(EMC7trg){
2427  fHistPtTag_EMC7->Fill(esdtrack->Pt());
2428  }
2429 
2430  if(EMCEGAtrg){
2431  fHistPtTag_EMCEGA->Fill(esdtrack->Pt());
2432  }
2433 
2434  if(EMCJettrg){
2435  fHistPtTag_EMCJet->Fill(esdtrack->Pt());
2436  }
2437  }
2438 
2439  FillDPhiHistos(aod, aodtrack, i);//Fill DPhi histos
2440 
2441  if(!aodEv){
2442  FillDPhiHistos(esd, esdtrack, i);//Fill DPhi histos
2443  }
2444 
2445  if(tagPhot){
2446  if(MBtrg){
2447  fHistPhotoMismatch_MB->Fill(0);
2448  }
2449  if(EMC7trg){
2450  fHistPhotoMismatch_EMC7->Fill(0);
2451  }
2452  if(EMCEGAtrg){
2453  fHistPhotoMismatch_EMCEGA->Fill(0);
2454  }
2455  if(EMCJettrg){
2456  fHistPhotoMismatch_EMCJet->Fill(0);
2457  }
2458  }
2459 
2460 
2461 
2462 
2463  if(!fPool){cout<<"No Pool for this event man\n"; continue;}
2464 
2465  fPool->PrintInfo();
2466  if(fPool->IsReady() ){
2467  FillMEDPhiHistos(aodtrack);
2468  }
2469  else{
2470  cout<<"Pool wasn't ready\n";
2471  }
2472  }//end if(tagStrong)
2473 
2474  }//end main track loop
2475  if(!fPool){
2476  cout<<"No pool exists, can't update it"<<'\n';
2477  }
2478  else{
2479  if(UseNonSignalEvents){
2480  fPool->UpdatePool(trkArr);
2481  }else{
2482  if(tagEvt){
2483  fPool->UpdatePool(trkArr);
2484  }
2485  }
2486  }
2487 
2488  //Call function to fill Region histos and pass it int array of IDs for identified electron tracks
2489  Int_t elecIDsSparse[elecCnt];
2490  for(Int_t i=0;i<elecCnt;i++){
2491  elecIDsSparse[i]=elecIDs[i];
2492  }
2493 
2494  //Fill Number of electrons plot
2495  fHistNElecPerEvent->Fill(elecCnt);
2496 
2497  //Fill the total pt sum histogram
2498  if(tagEvt){
2499  if(MBtrg){
2500  fHistPtSumTag_MB->Fill(PtSum);
2501  }
2502  if(EMC7trg){
2503  fHistPtSumTag_EMC7->Fill(PtSum);
2504  }
2505  if(EMCEGAtrg){
2506  fHistPtSumTag_EMCEGA->Fill(PtSum);
2507  }
2508  if(EMCJettrg){
2509  fHistPtSumTag_EMCJet->Fill(PtSum);
2510  }
2511  }else{
2512  if(MBtrg){
2513  fHistPtSum_MB->Fill(PtSum);
2514  }
2515  if(EMC7trg){
2516  fHistPtSum_EMC7->Fill(PtSum);
2517  }
2518  if(EMCEGAtrg){
2519  fHistPtSum_EMCEGA->Fill(PtSum);
2520  }
2521  if(EMCJettrg){
2522  fHistPtSum_EMCJet->Fill(PtSum);
2523  }
2524  }
2525 
2526  if(MBtrg){
2527  fHistPtSumEMC_MB->Fill(PtSumEMC);
2528  }
2529  if(EMC7trg){
2530  fHistPtSumEMC_EMC7->Fill(PtSumEMC);
2531  }
2532  if(EMCEGAtrg){
2533  fHistPtSumEMC_EMCEGA->Fill(PtSumEMC);
2534  }
2535  if(EMCJettrg){
2536  fHistPtSumEMC_EMCJet->Fill(PtSumEMC);
2537  }
2538 
2539  //Fill Nevent histos
2540  if(tagEvt){
2541  if(MBtrg){
2542  fHistNevents_MB->Fill("Events containing candidates",1);
2543  }
2544  if(EMC7trg){
2545  fHistNevents_EMC7->Fill("Events containing candidates",1);
2546  }
2547  if(EMCEGAtrg){
2548  fHistNevents_EMCEGA->Fill("Events containing candidates",1);
2549  }
2550  if(EMCJettrg){
2551  fHistNevents_EMCJet->Fill("Events containing candidates",1);
2552  }
2553  }
2554 
2555  //Fill the Eta Phi histograms
2556  if(tagEvt){
2557  for(Int_t i=0;i<Eta.size();i++){
2558  if(MBtrg){
2559  fHistEtaPhiTag_MB->Fill(Eta[i],Phi[i]);
2560  }
2561  if(EMC7trg){
2562  fHistEtaPhiTag_EMC7->Fill(Eta[i],Phi[i]);
2563  }
2564  if(EMCEGAtrg){
2565  fHistEtaPhiTag_EMCEGA->Fill(Eta[i],Phi[i]);
2566  }
2567  if(EMCJettrg){
2568  fHistEtaPhiTag_EMCJet->Fill(Eta[i],Phi[i]);
2569  }
2570  }
2571  }
2572 
2573 
2574 
2575  // NEW HISTO should be filled before this point, as PostData puts the
2576  // information for this iteration of the UserExec in the container
2577  PostData(1, fOutputMB);
2578  PostData(2, fOutputEMC7);
2579  PostData(3, fOutputEMCEGA);
2580  PostData(4, fOutputEMCJet);
2581 }
2582 
2583 void AliAnalysisTaskPSHFE::FillPIDHistos(AliESDEvent *esd, AliESDtrack *esdtrack, AliPIDResponse *fPIDResponse){
2584 
2585  if(!esdtrack){
2586  AliWarning("esdtrack is null, no point in doing PID");
2587  return;
2588  }
2589 
2590 
2591  Bool_t isPIDRej = kFALSE;
2592 
2593  //Fill TOF and TPC status variables
2594  AliPIDResponse::EDetPidStatus TOFStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF, esdtrack);
2595 
2596  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, esdtrack);
2597 
2598  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, esdtrack);
2599 
2600  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, esdtrack);
2601 
2602  //Check validity of PID, TODO: Add a rejection histogram
2603  if(TOFStatus!=AliPIDResponse::kDetPidOk){
2604  fHistPIDRejection->Fill(2);
2605  //isPIDRej=kTRUE;
2606  }
2607 
2608  if(TPCStatus!=AliPIDResponse::kDetPidOk){
2609  fHistPIDRejection->Fill(1);
2610  isPIDRej=kTRUE;
2611  }
2612 
2613  if(TRDStatus!=AliPIDResponse::kDetPidOk){
2614  fHistPIDRejection->Fill(3);
2615  isPIDRej=kTRUE;
2616  }
2617 
2618  if(EMCStatus!=AliPIDResponse::kDetPidOk){
2619  fHistPIDRejection->Fill(4);
2620  isPIDRej=kTRUE;
2621  }
2622 
2623 
2624  //Get the # of sigmas around an electron hypothesis for TOF and TPC
2625  Double_t nSigmaTOF;
2626  nSigmaTOF = fPIDResponse->NumberOfSigmasTOF(esdtrack,AliPID::kElectron);
2627 
2628  Double_t nSigmaTPC;
2629  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(esdtrack,AliPID::kElectron);
2630 
2631  Double_t elecLikeTRD[1];
2632  if(fPIDResponse->ComputeTRDProbability(esdtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || esdtrack->GetTRDntrackletsPID()<4){
2633  fHistPIDRejection->Fill(3);
2634  isPIDRej=kTRUE;
2635  }
2636 
2637  if(isPIDRej){return;}
2638 
2639  //declare emcal cluster PID variables
2640  Double_t EOP=-1;
2641  Double_t M02=-1;
2642  Double_t M20=-1;
2643  Int_t caloId=esdtrack->GetEMCALcluster();
2644 
2645  if(caloId==-99999){
2646  return;
2647  }
2648 
2649  AliESDCaloCluster* tagEMCclus=esd->GetCaloCluster(caloId);
2650 
2651  if(tagEMCclus->E()>.5){
2652  EOP = tagEMCclus->E()/esdtrack->Pt();
2653  M02 = tagEMCclus->GetM02();
2654  M20 = tagEMCclus->GetM20();
2655  }
2656  else{
2657  return;
2658  }
2659 
2660 
2661 
2662  //=========================================================================================================================
2663  //PID cuts and histogram filling
2664  //=========================================================================================================================
2665 
2666  //Some Double arrays for pt ranges
2667  Double_t ptUpper[6] = {2, 3, 4, 5, 6, 1000000};
2668  Double_t ptLower[6] = {1, 2, 3, 4, 5, 6};
2669  Double_t TPCcut = 2;
2670  Double_t TOFcut = 2;
2671  Double_t TRDcut = .9;
2672  Double_t EMCcutLower[6] = {.85,.85,.85,.85,.85,.95};
2673  Double_t EMCcutHigher[6] = {1.15,1.15,1.15,1.15,1.15,1.25};
2674 
2675  for(Int_t i=0; i<6; i++){
2676  if(esdtrack->Pt()>ptLower[i]&&esdtrack->Pt()<ptUpper[i]){
2677 
2678  //Fill general shower shape plots
2679  if(MBtrg){
2680  fHistM02_All_MB[i]->Fill(M02, EOP);
2681  fHistM20_All_MB[i]->Fill(M20, EOP);
2682  }
2683 
2684  if(EMC7trg){
2685  fHistM02_All_EMC7[i]->Fill(M02, EOP);
2686  fHistM20_All_EMC7[i]->Fill(M20, EOP);
2687  }
2688 
2689  if(EMCEGAtrg){
2690  fHistM02_All_EMCEGA[i]->Fill(M02, EOP);
2691  fHistM20_All_EMCEGA[i]->Fill(M20, EOP);
2692  }
2693 
2694  if(EMCJettrg){
2695  fHistM02_All_EMCJet[i]->Fill(M02, EOP);
2696  fHistM20_All_EMCJet[i]->Fill(M20, EOP);
2697  }
2698 
2699  //TPC Plots
2700  //EMC+TRD cuts
2701  if(EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]&&elecLikeTRD[0]>TRDcut){
2702 
2703  if(MBtrg){
2704  fHistTPC_EMCTRD_MB[i]->Fill(esdtrack->Pt(), nSigmaTPC);
2705  }
2706 
2707  if(EMC7trg){
2708  fHistTPC_EMCTRD_EMC7[i]->Fill(esdtrack->Pt(), nSigmaTPC);
2709  }
2710 
2711  if(EMCEGAtrg){
2712  fHistTPC_EMCTRD_EMCEGA[i]->Fill(esdtrack->Pt(), nSigmaTPC);
2713  }
2714 
2715  if(EMCJettrg){
2716  fHistTPC_EMCTRD_EMCJet[i]->Fill(esdtrack->Pt(), nSigmaTPC);
2717  }
2718  }
2719 
2720  //EMC Plots
2721 
2722  //TPC+TRD cuts
2723  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut){
2724 
2725  if(!applySSCuts){
2726  if(MBtrg){
2727  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
2728  }
2729 
2730  if(EMC7trg){
2731  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
2732  }
2733 
2734  if(EMCEGAtrg){
2735  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
2736  }
2737 
2738  if(EMCJettrg){
2739  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
2740  }
2741  }else{
2742  if(M02<.5&&M02>0&&M20<.3&&M20>0){
2743  if(MBtrg){
2744  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
2745  }
2746 
2747  if(EMC7trg){
2748  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
2749  }
2750 
2751  if(EMCEGAtrg){
2752  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
2753  }
2754 
2755  if(EMCJettrg){
2756  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
2757  }
2758  }
2759  }
2760 
2761  //Fill the shower shape plots here also
2762  if(MBtrg){
2763  fHistM02_Elec_MB[i]->Fill(M02, EOP);
2764  fHistM20_Elec_MB[i]->Fill(M20, EOP);
2765  }
2766 
2767  if(EMC7trg){
2768  fHistM02_Elec_EMC7[i]->Fill(M02, EOP);
2769  fHistM20_Elec_EMC7[i]->Fill(M20, EOP);
2770  }
2771 
2772  if(EMCEGAtrg){
2773  fHistM02_Elec_EMCEGA[i]->Fill(M02, EOP);
2774  fHistM20_Elec_EMCEGA[i]->Fill(M20, EOP);
2775  }
2776 
2777  if(EMCJettrg){
2778  fHistM02_Elec_EMCJet[i]->Fill(M02, EOP);
2779  fHistM20_Elec_EMCJet[i]->Fill(M20, EOP);
2780  }
2781  }
2782 
2783  //TRD Plots
2784 
2785  //TPC+EMC cuts
2786  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]){
2787 
2788  if(MBtrg){
2789  fHistTRD_TPCEMC_MB[i]->Fill(esdtrack->Pt(), elecLikeTRD[0]);
2790  }
2791 
2792  if(EMC7trg){
2793  fHistTRD_TPCEMC_EMC7[i]->Fill(esdtrack->Pt(), elecLikeTRD[0]);
2794  }
2795 
2796  if(EMCEGAtrg){
2797  fHistTRD_TPCEMC_EMCEGA[i]->Fill(esdtrack->Pt(), elecLikeTRD[0]);
2798  }
2799 
2800  if(EMCJettrg){
2801  fHistTRD_TPCEMC_EMCJet[i]->Fill(esdtrack->Pt(), elecLikeTRD[0]);
2802  }
2803  }
2804  }
2805  }
2806  if(MBtrg){
2807  if(esdtrack->Pt()<2&&esdtrack->Pt()>1){
2808  if(nSigmaTPC<-2&&nSigmaTPC>-8){
2809  fHistEMC_Had_MB_1Gev->Fill(EOP);
2810  }
2811  }
2812  }
2813 
2814  if(applySSCuts){
2815 
2816  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15, M02=(0,.5), M20=(0,.3)
2817 
2818  if(esdtrack->Pt()<6){
2819  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]&&M02<.5&&M02>0&&M20<.3&&M20>0){
2820 
2821  tagStrong=kTRUE;
2822 
2823  }
2824 
2825  }
2826 
2827  else{
2828 
2829  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]&&M02<.5&&M02>0&&M20<.3&&M20>0){
2830 
2831  tagStrong=kTRUE;
2832 
2833  }
2834 
2835  }
2836 
2837  }else{//no sscuts
2838 
2839  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15
2840 
2841  if(esdtrack->Pt()<6){
2842  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]){
2843 
2844  tagStrong=kTRUE;
2845 
2846  }
2847 
2848  }
2849 
2850  else{
2851 
2852  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]){
2853 
2854  tagStrong=kTRUE;
2855 
2856  }
2857 
2858  }
2859 
2860  }
2861 
2862  /*//Check if any tracks pass all cuts
2863  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&nSigmaTOF<TOFcut&&nSigmaTOF>-TOFcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher&&EOP>EMCcutLower){
2864  tagAll=kTRUE;
2865  }*/
2866 
2867  //=========================================================================
2868  // End of PID stuff
2869  //=========================================================================
2870  PostData(1, fOutputMB);
2871  PostData(2, fOutputEMC7);
2872  PostData(3, fOutputEMCEGA);
2873  PostData(4, fOutputEMCJet);
2874  return;
2875 }
2876 
2877 void AliAnalysisTaskPSHFE::FillPIDHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse){
2878 
2879  if(!aodtrack){
2880  AliWarning("aodtrack is null, no point in doing PID");
2881  return;
2882  }
2883 
2884 
2885  Bool_t isPIDRej = kFALSE;
2886 
2887  //Fill TOF and TPC status variables
2888  AliPIDResponse::EDetPidStatus TOFStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF, aodtrack);
2889 
2890  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrack);
2891 
2892  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrack);
2893 
2894  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, aodtrack);
2895 
2896  //Check validity of PID, TODO: Add a rejection histogram
2897  if(TOFStatus!=AliPIDResponse::kDetPidOk){
2898  fHistPIDRejection->Fill(2);
2899  //isPIDRej=kTRUE;
2900  }
2901 
2902  if(TPCStatus!=AliPIDResponse::kDetPidOk){
2903  fHistPIDRejection->Fill(1);
2904  isPIDRej=kTRUE;
2905  }
2906 
2907  if(TRDStatus!=AliPIDResponse::kDetPidOk){
2908  fHistPIDRejection->Fill(3);
2909  isPIDRej=kTRUE;
2910  }
2911 
2912  if(EMCStatus!=AliPIDResponse::kDetPidOk){
2913  fHistPIDRejection->Fill(4);
2914  isPIDRej=kTRUE;
2915  }
2916 
2917 
2918  //Get the # of sigmas around an electron hypothesis for TOF and TPC
2919  Double_t nSigmaTOF;
2920  nSigmaTOF = fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kElectron);
2921 
2922  Double_t nSigmaTPC;
2923  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron);
2924 
2925  Double_t elecLikeTRD[1];
2926  if(fPIDResponse->ComputeTRDProbability(aodtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrack->GetTRDntrackletsPID()<4){
2927  fHistPIDRejection->Fill(3);
2928  isPIDRej=kTRUE;
2929  }
2930 
2931  if(isPIDRej){return;}
2932 
2933  //declare emcal cluster PID variables
2934  Double_t EOP=-1;
2935  Double_t M02=-1;
2936  Double_t M20=-1;
2937  Int_t caloId=aodtrack->GetEMCALcluster();
2938 
2939  if(caloId==-99999){
2940  return;
2941  }
2942 
2943  AliAODCaloCluster* tagEMCclus=aod->GetCaloCluster(caloId);
2944 
2945  if(tagEMCclus->E()>.5){
2946  EOP = tagEMCclus->E()/aodtrack->Pt();
2947  M02 = tagEMCclus->GetM02();
2948  M20 = tagEMCclus->GetM20();
2949  }
2950  else{
2951  return;
2952  }
2953 
2954 
2955 
2956  //=========================================================================================================================
2957  //PID cuts and histogram filling
2958  //=========================================================================================================================
2959 
2960  //Some Double arrays for pt ranges
2961  Double_t ptUpper[6] = {2, 3, 4, 5, 6, 1000000};
2962  Double_t ptLower[6] = {1, 2, 3, 4, 5, 6};
2963  Double_t TPCcut = 2;
2964  Double_t TOFcut = 2;
2965  Double_t TRDcut = .9;
2966  Double_t EMCcutLower[6] = {.85,.85,.85,.85,.85,.85};
2967  Double_t EMCcutHigher[6] = {1.3,1.3,1.3,1.3,1.3,1.3};
2968 
2969  for(Int_t i=0; i<6; i++){
2970  if(aodtrack->Pt()>ptLower[i]&&aodtrack->Pt()<ptUpper[i]){
2971 
2972  //Fill general shower shape plots
2973  if(MBtrg){
2974  fHistM02_All_MB[i]->Fill(M02, EOP);
2975  fHistM20_All_MB[i]->Fill(M20, EOP);
2976  }
2977 
2978  if(EMC7trg){
2979  fHistM02_All_EMC7[i]->Fill(M02, EOP);
2980  fHistM20_All_EMC7[i]->Fill(M20, EOP);
2981  }
2982 
2983  if(EMCEGAtrg){
2984  fHistM02_All_EMCEGA[i]->Fill(M02, EOP);
2985  fHistM20_All_EMCEGA[i]->Fill(M20, EOP);
2986  }
2987 
2988  if(EMCJettrg){
2989  fHistM02_All_EMCJet[i]->Fill(M02, EOP);
2990  fHistM20_All_EMCJet[i]->Fill(M20, EOP);
2991  }
2992 
2993  //TPC Plots
2994  //EMC+TRD cuts
2995  if(EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]&&elecLikeTRD[0]>TRDcut){
2996 
2997  if(MBtrg){
2998  fHistTPC_EMCTRD_MB[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2999  }
3000 
3001  if(EMC7trg){
3002  fHistTPC_EMCTRD_EMC7[i]->Fill(aodtrack->Pt(), nSigmaTPC);
3003  }
3004 
3005  if(EMCEGAtrg){
3006  fHistTPC_EMCTRD_EMCEGA[i]->Fill(aodtrack->Pt(), nSigmaTPC);
3007  }
3008 
3009  if(EMCJettrg){
3010  fHistTPC_EMCTRD_EMCJet[i]->Fill(aodtrack->Pt(), nSigmaTPC);
3011  }
3012  }
3013 
3014  //EMC Plots
3015 
3016  //TPC+TRD cuts
3017  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut){
3018 
3019  if(!applySSCuts){
3020  if(MBtrg){
3021  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
3022  }
3023 
3024  if(EMC7trg){
3025  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
3026  }
3027 
3028  if(EMCEGAtrg){
3029  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
3030  }
3031 
3032  if(EMCJettrg){
3033  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
3034  }
3035  }else{
3036  if(M02<.5&&M02>0&&M20<.3&&M20>0){
3037  if(MBtrg){
3038  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
3039  }
3040 
3041  if(EMC7trg){
3042  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
3043  }
3044 
3045  if(EMCEGAtrg){
3046  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
3047  }
3048 
3049  if(EMCJettrg){
3050  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
3051  }
3052  }
3053  }
3054 
3055  //Fill the shower shape plots here also
3056  if(MBtrg){
3057  fHistM02_Elec_MB[i]->Fill(M02, EOP);
3058  fHistM20_Elec_MB[i]->Fill(M20, EOP);
3059  }
3060 
3061  if(EMC7trg){
3062  fHistM02_Elec_EMC7[i]->Fill(M02, EOP);
3063  fHistM20_Elec_EMC7[i]->Fill(M20, EOP);
3064  }
3065 
3066  if(EMCEGAtrg){
3067  fHistM02_Elec_EMCEGA[i]->Fill(M02, EOP);
3068  fHistM20_Elec_EMCEGA[i]->Fill(M20, EOP);
3069  }
3070 
3071  if(EMCJettrg){
3072  fHistM02_Elec_EMCJet[i]->Fill(M02, EOP);
3073  fHistM20_Elec_EMCJet[i]->Fill(M20, EOP);
3074  }
3075  }
3076 
3077  //TRD Plots
3078 
3079  //TPC+EMC cuts
3080  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]){
3081 
3082  if(MBtrg){
3083  fHistTRD_TPCEMC_MB[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
3084  }
3085 
3086  if(EMC7trg){
3087  fHistTRD_TPCEMC_EMC7[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
3088  }
3089 
3090  if(EMCEGAtrg){
3091  fHistTRD_TPCEMC_EMCEGA[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
3092  }
3093 
3094  if(EMCJettrg){
3095  fHistTRD_TPCEMC_EMCJet[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
3096  }
3097  }
3098  }
3099  }
3100  if(MBtrg){
3101  if(aodtrack->Pt()<2&&aodtrack->Pt()>1){
3102  if(nSigmaTPC<-2&&nSigmaTPC>-8){
3103  fHistEMC_Had_MB_1Gev->Fill(EOP);
3104  }
3105  }
3106  }
3107 
3108  if(applySSCuts){
3109 
3110  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15, M02=(0,.5), M20=(0,.3)
3111 
3112  if(aodtrack->Pt()<6){
3113  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]&&M02<.5&&M02>0&&M20<.3&&M20>0){
3114 
3115  tagStrong=kTRUE;
3116 
3117  }
3118 
3119  }
3120 
3121  else{
3122 
3123  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]&&M02<.5&&M02>0&&M20<.3&&M20>0){
3124 
3125  tagStrong=kTRUE;
3126 
3127  }
3128 
3129  }
3130 
3131  }else{//no sscuts
3132 
3133  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15
3134 
3135  if(aodtrack->Pt()<6){
3136  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]){
3137 
3138  tagStrong=kTRUE;
3139 
3140  }
3141 
3142  }
3143 
3144  else{
3145 
3146  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]){
3147 
3148  tagStrong=kTRUE;
3149 
3150  }
3151 
3152  }
3153 
3154  }
3155 
3156  /*//Check if any tracks pass all cuts
3157  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&nSigmaTOF<TOFcut&&nSigmaTOF>-TOFcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher&&EOP>EMCcutLower){
3158  tagAll=kTRUE;
3159  }*/
3160 
3161  //=========================================================================
3162  // End of PID stuff
3163  //=========================================================================
3164  PostData(1, fOutputMB);
3165  PostData(2, fOutputEMC7);
3166  PostData(3, fOutputEMCEGA);
3167  PostData(4, fOutputEMCJet);
3168  return;
3169 }
3170 
3171 void AliAnalysisTaskPSHFE::FillDPhiHistos(AliESDEvent *esd, AliESDtrack *esdtrack, Int_t i){
3172  //Run through all tracks in this
3173  Int_t ntracks = esd->GetNumberOfTracks();
3174  for(Int_t j = 0; j < ntracks; j++) {
3175 
3176  //Don't double count the tagged tracks
3177  if(i==j){continue;}
3178 
3179 
3180  AliESDtrack* esdtrackassoc = (AliESDtrack*)esd->GetTrack(j); // pointer to reconstructed to track
3181 
3182  if(!esdtrackassoc) {
3183  AliError(Form("ERROR: Could not retrieve esdtrack %d",j));
3184  continue;
3185  }
3186 
3187  //Do hybrid track cuts
3188  if(!globaltrackCuts->AcceptTrack(esdtrackassoc)&&!comptrackCuts->AcceptTrack(esdtrackassoc)){continue;}
3189 
3190  //Pt distribution
3191  if(MBtrg){
3192  fHistPtAssoc_MB->Fill(esdtrackassoc->Pt());
3193  }
3194 
3195  if(EMC7trg){
3196  fHistPtAssoc_EMC7->Fill(esdtrackassoc->Pt());
3197  }
3198 
3199  if(EMCEGAtrg){
3200  fHistPtAssoc_EMCEGA->Fill(esdtrackassoc->Pt());
3201  }
3202 
3203  if(EMCJettrg){
3204  fHistPtAssoc_EMCJet->Fill(esdtrackassoc->Pt());
3205  }
3206 
3207  //Fill Delta Phi variable and correct for periodicity
3208  Double_t DPhi=esdtrackassoc->Phi()-esdtrack->Phi();
3209 
3210  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
3211 
3212  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
3213 
3214  Double_t DEta=esdtrackassoc->Eta()-esdtrack->Eta();
3215 
3216  //candidate 1<pt<2
3217  if(esdtrack->Pt()>1&&esdtrack->Pt()<2){
3218 
3219  //300-500MeV
3220  if(esdtrackassoc->Pt()>.3&&esdtrackassoc->Pt()<.5){
3221  if(MBtrg){
3222  fHistDPhi300_500_MB[0]->Fill(DPhi);
3223  }
3224  if(EMC7trg){
3225  fHistDPhi300_500_EMC7[0]->Fill(DPhi);
3226  }
3227  if(EMCEGAtrg){
3228  fHistDPhi300_500_EMCEGA[0]->Fill(DPhi);
3229  }
3230  if(EMCJettrg){
3231  fHistDPhi300_500_EMCJet[0]->Fill(DPhi);
3232  }
3233  }
3234 
3235  //500MeV
3236  if(esdtrackassoc->Pt()>.5&&esdtrackassoc->Pt()<.8){
3237  if(MBtrg){
3238  fHistDPhi500_800_MB[0]->Fill(DPhi);
3239  }
3240  if(EMC7trg){
3241  fHistDPhi500_800_EMC7[0]->Fill(DPhi);
3242  }
3243  if(EMCEGAtrg){
3244  fHistDPhi500_800_EMCEGA[0]->Fill(DPhi);
3245  }
3246  if(EMCJettrg){
3247  fHistDPhi500_800_EMCJet[0]->Fill(DPhi);
3248  }
3249  }
3250 
3251  //800MeV
3252  if(esdtrackassoc->Pt()>.8&&esdtrackassoc->Pt()<1){
3253  if(MBtrg){
3254  fHistDPhi800_1_MB[0]->Fill(DPhi);
3255  }
3256  if(EMC7trg){
3257  fHistDPhi800_1_EMC7[0]->Fill(DPhi);
3258  }
3259  if(EMCEGAtrg){
3260  fHistDPhi800_1_EMCEGA[0]->Fill(DPhi);
3261  }
3262  if(EMCJettrg){
3263  fHistDPhi800_1_EMCJet[0]->Fill(DPhi);
3264  }
3265  }
3266 
3267  //1GeV
3268  if(esdtrackassoc->Pt()>1&&esdtrackassoc->Pt()<2){
3269  if(MBtrg){
3270  fHistDPhi1_2_MB[0]->Fill(DPhi);
3271  }
3272  if(EMC7trg){
3273  fHistDPhi1_2_EMC7[0]->Fill(DPhi);
3274  }
3275  if(EMCEGAtrg){
3276  fHistDPhi1_2_EMCEGA[0]->Fill(DPhi);
3277  }
3278  if(EMCJettrg){
3279  fHistDPhi1_2_EMCJet[0]->Fill(DPhi);
3280  }
3281  }
3282 
3283  //2GeV
3284  if(esdtrackassoc->Pt()>2&&esdtrackassoc->Pt()<3){
3285  if(MBtrg){
3286  fHistDPhi2_3_MB[0]->Fill(DPhi);
3287  }
3288  if(EMC7trg){
3289  fHistDPhi2_3_EMC7[0]->Fill(DPhi);
3290  }
3291  if(EMCEGAtrg){
3292  fHistDPhi2_3_EMCEGA[0]->Fill(DPhi);
3293  }
3294  if(EMCJettrg){
3295  fHistDPhi2_3_EMCJet[0]->Fill(DPhi);
3296  }
3297  }
3298 
3299  //3GeV
3300  if(esdtrackassoc->Pt()>3&&esdtrackassoc->Pt()<4){
3301  if(MBtrg){
3302  fHistDPhi3_4_MB[0]->Fill(DPhi);
3303  }
3304  if(EMC7trg){
3305  fHistDPhi3_4_EMC7[0]->Fill(DPhi);
3306  }
3307  if(EMCEGAtrg){
3308  fHistDPhi3_4_EMCEGA[0]->Fill(DPhi);
3309  }
3310  if(EMCJettrg){
3311  fHistDPhi3_4_EMCJet[0]->Fill(DPhi);
3312  }
3313  }
3314 
3315  //5GeV
3316  if(esdtrackassoc->Pt()>4){
3317  if(MBtrg){
3318  fHistDPhi4_MB[0]->Fill(DPhi);
3319  }
3320  if(EMC7trg){
3321  fHistDPhi4_EMC7[0]->Fill(DPhi);
3322  }
3323  if(EMCEGAtrg){
3324  fHistDPhi4_EMCEGA[0]->Fill(DPhi);
3325  }
3326  if(EMCJettrg){
3327  fHistDPhi4_EMCJet[0]->Fill(DPhi);
3328  }
3329  }
3330  }
3331 
3332  //candidate 2<pt<4
3333  if(esdtrack->Pt()>2&&esdtrack->Pt()<4){
3334 
3335  //300MeV
3336  if(esdtrackassoc->Pt()>.3&&esdtrackassoc->Pt()<.5){
3337  if(MBtrg){
3338  fHistDPhi300_500_MB[1]->Fill(DPhi);
3339  }
3340  if(EMC7trg){
3341  fHistDPhi300_500_EMC7[1]->Fill(DPhi);
3342  }
3343  if(EMCEGAtrg){
3344  fHistDPhi300_500_EMCEGA[1]->Fill(DPhi);
3345  }
3346  if(EMCJettrg){
3347  fHistDPhi300_500_EMCJet[1]->Fill(DPhi);
3348  }
3349  }
3350 
3351  //500MeV
3352  if(esdtrackassoc->Pt()>.5&&esdtrackassoc->Pt()<.8){
3353  if(MBtrg){
3354  fHistDPhi500_800_MB[1]->Fill(DPhi);
3355  }
3356  if(EMC7trg){
3357  fHistDPhi500_800_EMC7[1]->Fill(DPhi);
3358  }
3359  if(EMCEGAtrg){
3360  fHistDPhi500_800_EMCEGA[1]->Fill(DPhi);
3361  }
3362  if(EMCJettrg){
3363  fHistDPhi500_800_EMCJet[1]->Fill(DPhi);
3364  }
3365  }
3366 
3367  //800MeV
3368  if(esdtrackassoc->Pt()>.8&&esdtrackassoc->Pt()<1){
3369  if(MBtrg){
3370  fHistDPhi800_1_MB[1]->Fill(DPhi);
3371  }
3372  if(EMC7trg){
3373  fHistDPhi800_1_EMC7[1]->Fill(DPhi);
3374  }
3375  if(EMCEGAtrg){
3376  fHistDPhi800_1_EMCEGA[1]->Fill(DPhi);
3377  }
3378  if(EMCJettrg){
3379  fHistDPhi800_1_EMCJet[1]->Fill(DPhi);
3380  }
3381  }
3382 
3383  //1GeV
3384  if(esdtrackassoc->Pt()>1&&esdtrackassoc->Pt()<2){
3385  if(MBtrg){
3386  fHistDPhi1_2_MB[1]->Fill(DPhi);
3387  }
3388  if(EMC7trg){
3389  fHistDPhi1_2_EMC7[1]->Fill(DPhi);
3390  }
3391  if(EMCEGAtrg){
3392  fHistDPhi1_2_EMCEGA[1]->Fill(DPhi);
3393  }
3394  if(EMCJettrg){
3395  fHistDPhi1_2_EMCJet[1]->Fill(DPhi);
3396  }
3397  }
3398 
3399  //2GeV
3400  if(esdtrackassoc->Pt()>2&&esdtrackassoc->Pt()<3){
3401  if(MBtrg){
3402  fHistDPhi2_3_MB[1]->Fill(DPhi);
3403  fHistDPhi28_MB->Fill(DPhi);
3404  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3405  fHistDPhi18Spe_MB->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3406  }
3407  if(EMC7trg){
3408  fHistDPhi2_3_EMC7[1]->Fill(DPhi);
3409  fHistDPhi28_EMC7->Fill(DPhi);
3410  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3411  fHistDPhi18Spe_EMC7->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3412  }
3413  if(EMCEGAtrg){
3414  fHistDPhi2_3_EMCEGA[1]->Fill(DPhi);
3415  fHistDPhi28_EMCEGA->Fill(DPhi);
3416  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3417  fHistDPhi18Spe_EMCEGA->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3418  }
3419  if(EMCJettrg){
3420  fHistDPhi2_3_EMCJet[1]->Fill(DPhi);
3421  fHistDPhi28_EMCJet->Fill(DPhi);
3422  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3423  fHistDPhi18Spe_EMCJet->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3424  }
3425  }
3426 
3427  //3GeV
3428  if(esdtrackassoc->Pt()>3&&esdtrackassoc->Pt()<4){
3429  if(MBtrg){
3430  fHistDPhi3_4_MB[1]->Fill(DPhi);
3431  fHistDPhi28_MB->Fill(DPhi);
3432  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3433  fHistDPhi18Spe_MB->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3434  }
3435  if(EMC7trg){
3436  fHistDPhi3_4_EMC7[1]->Fill(DPhi);
3437  fHistDPhi28_EMC7->Fill(DPhi);
3438  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3439  fHistDPhi18Spe_EMC7->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3440  }
3441  if(EMCEGAtrg){
3442  fHistDPhi3_4_EMCEGA[1]->Fill(DPhi);
3443  fHistDPhi28_EMCEGA->Fill(DPhi);
3444  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3445  fHistDPhi18Spe_EMCEGA->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3446  }
3447  if(EMCJettrg){
3448  fHistDPhi3_4_EMCJet[1]->Fill(DPhi);
3449  fHistDPhi28_EMCJet->Fill(DPhi);
3450  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3451  fHistDPhi18Spe_EMCJet->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3452  }
3453  }
3454 
3455  //5GeV
3456  if(esdtrackassoc->Pt()>4){
3457  if(MBtrg){
3458  fHistDPhi4_MB[1]->Fill(DPhi);
3459  fHistDPhi28_MB->Fill(DPhi);
3460  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3461  fHistDPhi18Spe_MB->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3462  }
3463  if(EMC7trg){
3464  fHistDPhi4_EMC7[1]->Fill(DPhi);
3465  fHistDPhi28_EMC7->Fill(DPhi);
3466  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3467  fHistDPhi18Spe_EMC7->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3468  }
3469  if(EMCEGAtrg){
3470  fHistDPhi4_EMCEGA[1]->Fill(DPhi);
3471  fHistDPhi28_EMCEGA->Fill(DPhi);
3472  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3473  fHistDPhi18Spe_EMCEGA->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3474  }
3475  if(EMCJettrg){
3476  fHistDPhi4_EMCJet[1]->Fill(DPhi);
3477  fHistDPhi28_EMCJet->Fill(DPhi);
3478  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3479  fHistDPhi18Spe_EMCJet->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3480  }
3481  }
3482  }
3483 
3484  //candidate 4<pt<8
3485  if(esdtrack->Pt()>4&&esdtrack->Pt()<8){
3486 
3487  //300MeV
3488  if(esdtrackassoc->Pt()>.3&&esdtrackassoc->Pt()<.5){
3489  if(MBtrg){
3490  fHistDPhi300_500_MB[2]->Fill(DPhi);
3491  }
3492  if(EMC7trg){
3493  fHistDPhi300_500_EMC7[2]->Fill(DPhi);
3494  }
3495  if(EMCEGAtrg){
3496  fHistDPhi300_500_EMCEGA[2]->Fill(DPhi);
3497  }
3498  if(EMCJettrg){
3499  fHistDPhi300_500_EMCJet[2]->Fill(DPhi);
3500  }
3501  }
3502 
3503  //500MeV
3504  if(esdtrackassoc->Pt()>.5&&esdtrackassoc->Pt()<.8){
3505  if(MBtrg){
3506  fHistDPhi500_800_MB[2]->Fill(DPhi);
3507  }
3508  if(EMC7trg){
3509  fHistDPhi500_800_EMC7[2]->Fill(DPhi);
3510  }
3511  if(EMCEGAtrg){
3512  fHistDPhi500_800_EMCEGA[2]->Fill(DPhi);
3513  }
3514  if(EMCJettrg){
3515  fHistDPhi500_800_EMCJet[2]->Fill(DPhi);
3516  }
3517  }
3518 
3519  //800MeV
3520  if(esdtrackassoc->Pt()>.8&&esdtrackassoc->Pt()<1){
3521  if(MBtrg){
3522  fHistDPhi800_1_MB[2]->Fill(DPhi);
3523  }
3524  if(EMC7trg){
3525  fHistDPhi800_1_EMC7[2]->Fill(DPhi);
3526  }
3527  if(EMCEGAtrg){
3528  fHistDPhi800_1_EMCEGA[2]->Fill(DPhi);
3529  }
3530  if(EMCJettrg){
3531  fHistDPhi800_1_EMCJet[2]->Fill(DPhi);
3532  }
3533  }
3534 
3535  //1GeV
3536  if(esdtrackassoc->Pt()>1&&esdtrackassoc->Pt()<2){
3537  if(MBtrg){
3538  fHistDPhi1_2_MB[2]->Fill(DPhi);
3539  }
3540  if(EMC7trg){
3541  fHistDPhi1_2_EMC7[2]->Fill(DPhi);
3542  }
3543  if(EMCEGAtrg){
3544  fHistDPhi1_2_EMCEGA[2]->Fill(DPhi);
3545  }
3546  if(EMCJettrg){
3547  fHistDPhi1_2_EMCJet[2]->Fill(DPhi);
3548  }
3549  }
3550 
3551  //2GeV
3552  if(esdtrackassoc->Pt()>2&&esdtrackassoc->Pt()<3){
3553  if(MBtrg){
3554  fHistDPhi2_3_MB[2]->Fill(DPhi);
3555  fHistDPhi28_MB->Fill(DPhi);
3556  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3557  fHistDPhi18Spe_MB->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3558  }
3559  if(EMC7trg){
3560  fHistDPhi2_3_EMC7[2]->Fill(DPhi);
3561  fHistDPhi28_EMC7->Fill(DPhi);
3562  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3563  fHistDPhi18Spe_EMC7->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3564  }
3565  if(EMCEGAtrg){
3566  fHistDPhi2_3_EMCEGA[2]->Fill(DPhi);
3567  fHistDPhi28_EMCEGA->Fill(DPhi);
3568  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3569  fHistDPhi18Spe_EMCEGA->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3570  }
3571  if(EMCJettrg){
3572  fHistDPhi2_3_EMCJet[2]->Fill(DPhi);
3573  fHistDPhi28_EMCJet->Fill(DPhi);
3574  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3575  fHistDPhi18Spe_EMCJet->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3576  }
3577  }
3578 
3579  //3GeV
3580  if(esdtrackassoc->Pt()>3&&esdtrackassoc->Pt()<4){
3581  if(MBtrg){
3582  fHistDPhi3_4_MB[2]->Fill(DPhi);
3583  fHistDPhi28_MB->Fill(DPhi);
3584  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3585  fHistDPhi18Spe_MB->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3586  }
3587  if(EMC7trg){
3588  fHistDPhi3_4_EMC7[2]->Fill(DPhi);
3589  fHistDPhi28_EMC7->Fill(DPhi);
3590  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3591  fHistDPhi18Spe_EMC7->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3592  }
3593  if(EMCEGAtrg){
3594  fHistDPhi3_4_EMCEGA[2]->Fill(DPhi);
3595  fHistDPhi28_EMCEGA->Fill(DPhi);
3596  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3597  fHistDPhi18Spe_EMCEGA->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3598  }
3599  if(EMCJettrg){
3600  fHistDPhi3_4_EMCJet[2]->Fill(DPhi);
3601  fHistDPhi28_EMCJet->Fill(DPhi);
3602  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3603  fHistDPhi18Spe_EMCJet->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3604  }
3605  }
3606 
3607  //5GeV
3608  if(esdtrackassoc->Pt()>4){
3609  if(MBtrg){
3610  fHistDPhi4_MB[2]->Fill(DPhi);
3611  fHistDPhi28_MB->Fill(DPhi);
3612  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3613  fHistDPhi18Spe_MB->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3614  }
3615  if(EMC7trg){
3616  fHistDPhi4_EMC7[2]->Fill(DPhi);
3617  fHistDPhi28_EMC7->Fill(DPhi);
3618  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3619  fHistDPhi18Spe_EMC7->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3620  }
3621  if(EMCEGAtrg){
3622  fHistDPhi4_EMCEGA[2]->Fill(DPhi);
3623  fHistDPhi28_EMCEGA->Fill(DPhi);
3624  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3625  fHistDPhi18Spe_EMCEGA->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3626  }
3627  if(EMCJettrg){
3628  fHistDPhi4_EMCJet[2]->Fill(DPhi);
3629  fHistDPhi28_EMCJet->Fill(DPhi);
3630  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3631  fHistDPhi18Spe_EMCJet->Fill(DPhi, esdtrackassoc->GetTPCsignal());
3632  }
3633  }
3634  }
3635 
3636  }
3637  PostData(1, fOutputMB);
3638  PostData(2, fOutputEMC7);
3639  PostData(3, fOutputEMCEGA);
3640  PostData(4, fOutputEMCJet);
3641  return;
3642 }
3643 
3644 void AliAnalysisTaskPSHFE::FillDPhiHistos(AliAODEvent *aod, AliAODTrack *aodtrack, Int_t i){
3645  //Run through all tracks in this
3646  Int_t ntracks = aod->GetNumberOfTracks();
3647  for(Int_t j = 0; j < ntracks; j++) {
3648 
3649  //Don't double count the tagged tracks
3650  if(i==j){continue;}
3651 
3652 
3653  AliAODTrack* aodtrackassoc = (AliAODTrack*)aod->GetTrack(j); // pointer to reconstructed to track
3654 
3655  if(!aodtrackassoc) {
3656  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
3657  continue;
3658  }
3659 
3660  //Do hybrid track cuts
3661  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
3662 
3663  //Pt distribution
3664  if(MBtrg){
3665  fHistPtAssoc_MB->Fill(aodtrackassoc->Pt());
3666  }
3667 
3668  if(EMC7trg){
3669  fHistPtAssoc_EMC7->Fill(aodtrackassoc->Pt());
3670  }
3671 
3672  if(EMCEGAtrg){
3673  fHistPtAssoc_EMCEGA->Fill(aodtrackassoc->Pt());
3674  }
3675 
3676  if(EMCJettrg){
3677  fHistPtAssoc_EMCJet->Fill(aodtrackassoc->Pt());
3678  }
3679 
3680  //Fill Delta Phi variable and correct for periodicity
3681  Double_t DPhi=aodtrackassoc->Phi()-aodtrack->Phi();
3682 
3683  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
3684 
3685  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
3686 
3687  Double_t DEta=aodtrackassoc->Eta()-aodtrack->Eta();
3688 
3689  Int_t PID=0;
3690  cout<<"most probPID"<<AliAODTrack::kElectron<<":"<<aodtrackassoc->GetMostProbablePID()<<'\n';
3691  switch(aodtrackassoc->GetMostProbablePID()){
3692  case AliAODTrack::kElectron:
3693  PID=1;
3694  break;
3695  case AliAODTrack::kMuon:
3696  PID=2;
3697  break;
3698  case AliAODTrack::kPion:
3699  PID=3;
3700  break;
3701  case AliAODTrack::kKaon:
3702  PID=4;
3703  break;
3704  case AliAODTrack::kProton:
3705  PID=5;
3706  break;
3707  case AliAODTrack::kDeuteron:
3708  PID=6;
3709  break;
3710  case AliAODTrack::kUnknown:
3711  PID=0;
3712  break;
3713  }
3714 
3715  //candidate 1<pt<2
3716  if(aodtrack->Pt()>1&&aodtrack->Pt()<2){
3717 
3718  //300-500MeV
3719  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
3720  if(MBtrg){
3721  fHistDPhi300_500_MB[0]->Fill(DPhi);
3722  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3723  }
3724  if(EMC7trg){
3725  fHistDPhi300_500_EMC7[0]->Fill(DPhi);
3726  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3727  }
3728  if(EMCEGAtrg){
3729  fHistDPhi300_500_EMCEGA[0]->Fill(DPhi);
3730  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3731  }
3732  if(EMCJettrg){
3733  fHistDPhi300_500_EMCJet[0]->Fill(DPhi);
3734  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3735  }
3736  }
3737 
3738  //500MeV
3739  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
3740  if(MBtrg){
3741  fHistDPhi500_800_MB[0]->Fill(DPhi);
3742  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3743  }
3744  if(EMC7trg){
3745  fHistDPhi500_800_EMC7[0]->Fill(DPhi);
3746  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3747  }
3748  if(EMCEGAtrg){
3749  fHistDPhi500_800_EMCEGA[0]->Fill(DPhi);
3750  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3751  }
3752  if(EMCJettrg){
3753  fHistDPhi500_800_EMCJet[0]->Fill(DPhi);
3754  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3755  }
3756  }
3757 
3758  //800MeV
3759  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
3760  if(MBtrg){
3761  fHistDPhi800_1_MB[0]->Fill(DPhi);
3762  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3763  }
3764  if(EMC7trg){
3765  fHistDPhi800_1_EMC7[0]->Fill(DPhi);
3766  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3767  }
3768  if(EMCEGAtrg){
3769  fHistDPhi800_1_EMCEGA[0]->Fill(DPhi);
3770  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3771  }
3772  if(EMCJettrg){
3773  fHistDPhi800_1_EMCJet[0]->Fill(DPhi);
3774  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3775  }
3776  }
3777 
3778  //1GeV
3779  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3780  if(MBtrg){
3781  fHistDPhi1_2_MB[0]->Fill(DPhi);
3782  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3783  }
3784  if(EMC7trg){
3785  fHistDPhi1_2_EMC7[0]->Fill(DPhi);
3786  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3787  }
3788  if(EMCEGAtrg){
3789  fHistDPhi1_2_EMCEGA[0]->Fill(DPhi);
3790  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3791  }
3792  if(EMCJettrg){
3793  fHistDPhi1_2_EMCJet[0]->Fill(DPhi);
3794  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3795  }
3796  }
3797 
3798  //2GeV
3799  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3800  if(MBtrg){
3801  fHistDPhi2_3_MB[0]->Fill(DPhi);
3802  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3803  }
3804  if(EMC7trg){
3805  fHistDPhi2_3_EMC7[0]->Fill(DPhi);
3806  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3807  }
3808  if(EMCEGAtrg){
3809  fHistDPhi2_3_EMCEGA[0]->Fill(DPhi);
3810  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3811  }
3812  if(EMCJettrg){
3813  fHistDPhi2_3_EMCJet[0]->Fill(DPhi);
3814  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3815  }
3816  }
3817 
3818  //3GeV
3819  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3820  if(MBtrg){
3821  fHistDPhi3_4_MB[0]->Fill(DPhi);
3822  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3823  }
3824  if(EMC7trg){
3825  fHistDPhi3_4_EMC7[0]->Fill(DPhi);
3826  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3827  }
3828  if(EMCEGAtrg){
3829  fHistDPhi3_4_EMCEGA[0]->Fill(DPhi);
3830  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3831  }
3832  if(EMCJettrg){
3833  fHistDPhi3_4_EMCJet[0]->Fill(DPhi);
3834  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3835  }
3836  }
3837 
3838  //5GeV
3839  if(aodtrackassoc->Pt()>4){
3840  if(MBtrg){
3841  fHistDPhi4_MB[0]->Fill(DPhi);
3842  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3843  }
3844  if(EMC7trg){
3845  fHistDPhi4_EMC7[0]->Fill(DPhi);
3846  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3847  }
3848  if(EMCEGAtrg){
3849  fHistDPhi4_EMCEGA[0]->Fill(DPhi);
3850  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3851  }
3852  if(EMCJettrg){
3853  fHistDPhi4_EMCJet[0]->Fill(DPhi);
3854  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3855  }
3856  }
3857  }
3858 
3859  //candidate 2<pt<4
3860  if(aodtrack->Pt()>2&&aodtrack->Pt()<4){
3861 
3862  //300MeV
3863  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
3864  if(MBtrg){
3865  fHistDPhi300_500_MB[1]->Fill(DPhi);
3866  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3867  }
3868  if(EMC7trg){
3869  fHistDPhi300_500_EMC7[1]->Fill(DPhi);
3870  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3871  }
3872  if(EMCEGAtrg){
3873  fHistDPhi300_500_EMCEGA[1]->Fill(DPhi);
3874  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3875  }
3876  if(EMCJettrg){
3877  fHistDPhi300_500_EMCJet[1]->Fill(DPhi);
3878  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3879  }
3880  }
3881 
3882  //500MeV
3883  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
3884  if(MBtrg){
3885  fHistDPhi500_800_MB[1]->Fill(DPhi);
3886  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3887  }
3888  if(EMC7trg){
3889  fHistDPhi500_800_EMC7[1]->Fill(DPhi);
3890  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3891  }
3892  if(EMCEGAtrg){
3893  fHistDPhi500_800_EMCEGA[1]->Fill(DPhi);
3894  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3895  }
3896  if(EMCJettrg){
3897  fHistDPhi500_800_EMCJet[1]->Fill(DPhi);
3898  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3899  }
3900  }
3901 
3902  //800MeV
3903  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
3904  if(MBtrg){
3905  fHistDPhi800_1_MB[1]->Fill(DPhi);
3906  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3907  }
3908  if(EMC7trg){
3909  fHistDPhi800_1_EMC7[1]->Fill(DPhi);
3910  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3911  }
3912  if(EMCEGAtrg){
3913  fHistDPhi800_1_EMCEGA[1]->Fill(DPhi);
3914  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3915  }
3916  if(EMCJettrg){
3917  fHistDPhi800_1_EMCJet[1]->Fill(DPhi);
3918  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3919  }
3920  }
3921 
3922  //1GeV
3923  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3924  if(MBtrg){
3925  fHistDPhi1_2_MB[1]->Fill(DPhi);
3926  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3927  }
3928  if(EMC7trg){
3929  fHistDPhi1_2_EMC7[1]->Fill(DPhi);
3930  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3931  }
3932  if(EMCEGAtrg){
3933  fHistDPhi1_2_EMCEGA[1]->Fill(DPhi);
3934  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3935  }
3936  if(EMCJettrg){
3937  fHistDPhi1_2_EMCJet[1]->Fill(DPhi);
3938  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3939  }
3940  }
3941 
3942  //2GeV
3943  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3944  if(MBtrg){
3945  fHistDPhi2_3_MB[1]->Fill(DPhi);
3946  fHistDPhi28_MB->Fill(DPhi);
3947  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3948  fHistDPhi18Spe_MB->Fill(DPhi, PID);
3949  }
3950  if(EMC7trg){
3951  fHistDPhi2_3_EMC7[1]->Fill(DPhi);
3952  fHistDPhi28_EMC7->Fill(DPhi);
3953  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3954  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3955  }
3956  if(EMCEGAtrg){
3957  fHistDPhi2_3_EMCEGA[1]->Fill(DPhi);
3958  fHistDPhi28_EMCEGA->Fill(DPhi);
3959  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3960  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3961  }
3962  if(EMCJettrg){
3963  fHistDPhi2_3_EMCJet[1]->Fill(DPhi);
3964  fHistDPhi28_EMCJet->Fill(DPhi);
3965  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3966  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3967  }
3968  }
3969 
3970  //3GeV
3971  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3972  if(MBtrg){
3973  fHistDPhi3_4_MB[1]->Fill(DPhi);
3974  fHistDPhi28_MB->Fill(DPhi);
3975  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3976  fHistDPhi18Spe_MB->Fill(DPhi,PID);
3977  }
3978  if(EMC7trg){
3979  fHistDPhi3_4_EMC7[1]->Fill(DPhi);
3980  fHistDPhi28_EMC7->Fill(DPhi);
3981  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3982  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
3983  }
3984  if(EMCEGAtrg){
3985  fHistDPhi3_4_EMCEGA[1]->Fill(DPhi);
3986  fHistDPhi28_EMCEGA->Fill(DPhi);
3987  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3988  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
3989  }
3990  if(EMCJettrg){
3991  fHistDPhi3_4_EMCJet[1]->Fill(DPhi);
3992  fHistDPhi28_EMCJet->Fill(DPhi);
3993  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3994  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
3995  }
3996  }
3997 
3998  //5GeV
3999  if(aodtrackassoc->Pt()>4){
4000  if(MBtrg){
4001  fHistDPhi4_MB[1]->Fill(DPhi);
4002  fHistDPhi28_MB->Fill(DPhi);
4003  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
4004  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4005  }
4006  if(EMC7trg){
4007  fHistDPhi4_EMC7[1]->Fill(DPhi);
4008  fHistDPhi28_EMC7->Fill(DPhi);
4009  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
4010  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4011  }
4012  if(EMCEGAtrg){
4013  fHistDPhi4_EMCEGA[1]->Fill(DPhi);
4014  fHistDPhi28_EMCEGA->Fill(DPhi);
4015  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
4016  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4017  }
4018  if(EMCJettrg){
4019  fHistDPhi4_EMCJet[1]->Fill(DPhi);
4020  fHistDPhi28_EMCJet->Fill(DPhi);
4021  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
4022  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4023  }
4024  }
4025  }
4026 
4027  //candidate 4<pt<8
4028  if(aodtrack->Pt()>4&&aodtrack->Pt()<8){
4029 
4030  //300MeV
4031  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
4032  if(MBtrg){
4033  fHistDPhi300_500_MB[2]->Fill(DPhi);
4034  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4035  }
4036  if(EMC7trg){
4037  fHistDPhi300_500_EMC7[2]->Fill(DPhi);
4038  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4039  }
4040  if(EMCEGAtrg){
4041  fHistDPhi300_500_EMCEGA[2]->Fill(DPhi);
4042  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4043  }
4044  if(EMCJettrg){
4045  fHistDPhi300_500_EMCJet[2]->Fill(DPhi);
4046  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4047  }
4048  }
4049 
4050  //500MeV
4051  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
4052  if(MBtrg){
4053  fHistDPhi500_800_MB[2]->Fill(DPhi);
4054  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4055  }
4056  if(EMC7trg){
4057  fHistDPhi500_800_EMC7[2]->Fill(DPhi);
4058  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4059  }
4060  if(EMCEGAtrg){
4061  fHistDPhi500_800_EMCEGA[2]->Fill(DPhi);
4062  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4063  }
4064  if(EMCJettrg){
4065  fHistDPhi500_800_EMCJet[2]->Fill(DPhi);
4066  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4067  }
4068  }
4069 
4070  //800MeV
4071  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
4072  if(MBtrg){
4073  fHistDPhi800_1_MB[2]->Fill(DPhi);
4074  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4075  }
4076  if(EMC7trg){
4077  fHistDPhi800_1_EMC7[2]->Fill(DPhi);
4078  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4079  }
4080  if(EMCEGAtrg){
4081  fHistDPhi800_1_EMCEGA[2]->Fill(DPhi);
4082  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4083  }
4084  if(EMCJettrg){
4085  fHistDPhi800_1_EMCJet[2]->Fill(DPhi);
4086  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4087  }
4088  }
4089 
4090  //1GeV
4091  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
4092  if(MBtrg){
4093  fHistDPhi1_2_MB[2]->Fill(DPhi);
4094  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4095  }
4096  if(EMC7trg){
4097  fHistDPhi1_2_EMC7[2]->Fill(DPhi);
4098  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4099  }
4100  if(EMCEGAtrg){
4101  fHistDPhi1_2_EMCEGA[2]->Fill(DPhi);
4102  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4103  }
4104  if(EMCJettrg){
4105  fHistDPhi1_2_EMCJet[2]->Fill(DPhi);
4106  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4107  }
4108  }
4109 
4110  //2GeV
4111  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
4112  if(MBtrg){
4113  fHistDPhi2_3_MB[2]->Fill(DPhi);
4114  fHistDPhi28_MB->Fill(DPhi);
4115  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
4116  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4117  }
4118  if(EMC7trg){
4119  fHistDPhi2_3_EMC7[2]->Fill(DPhi);
4120  fHistDPhi28_EMC7->Fill(DPhi);
4121  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
4122  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4123  }
4124  if(EMCEGAtrg){
4125  fHistDPhi2_3_EMCEGA[2]->Fill(DPhi);
4126  fHistDPhi28_EMCEGA->Fill(DPhi);
4127  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
4128  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4129  }
4130  if(EMCJettrg){
4131  fHistDPhi2_3_EMCJet[2]->Fill(DPhi);
4132  fHistDPhi28_EMCJet->Fill(DPhi);
4133  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
4134  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4135  }
4136  }
4137 
4138  //3GeV
4139  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
4140  if(MBtrg){
4141  fHistDPhi3_4_MB[2]->Fill(DPhi);
4142  fHistDPhi28_MB->Fill(DPhi);
4143  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
4144  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4145  }
4146  if(EMC7trg){
4147  fHistDPhi3_4_EMC7[2]->Fill(DPhi);
4148  fHistDPhi28_EMC7->Fill(DPhi);
4149  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
4150  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4151  }
4152  if(EMCEGAtrg){
4153  fHistDPhi3_4_EMCEGA[2]->Fill(DPhi);
4154  fHistDPhi28_EMCEGA->Fill(DPhi);
4155  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
4156  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4157  }
4158  if(EMCJettrg){
4159  fHistDPhi3_4_EMCJet[2]->Fill(DPhi);
4160  fHistDPhi28_EMCJet->Fill(DPhi);
4161  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
4162  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4163  }
4164  }
4165 
4166  //5GeV
4167  if(aodtrackassoc->Pt()>4){
4168  if(MBtrg){
4169  fHistDPhi4_MB[2]->Fill(DPhi);
4170  fHistDPhi28_MB->Fill(DPhi);
4171  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
4172  fHistDPhi18Spe_MB->Fill(DPhi, PID);
4173  }
4174  if(EMC7trg){
4175  fHistDPhi4_EMC7[2]->Fill(DPhi);
4176  fHistDPhi28_EMC7->Fill(DPhi);
4177  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
4178  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
4179  }
4180  if(EMCEGAtrg){
4181  fHistDPhi4_EMCEGA[2]->Fill(DPhi);
4182  fHistDPhi28_EMCEGA->Fill(DPhi);
4183  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
4184  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
4185  }
4186  if(EMCJettrg){
4187  fHistDPhi4_EMCJet[2]->Fill(DPhi);
4188  fHistDPhi28_EMCJet->Fill(DPhi);
4189  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
4190  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
4191  }
4192  }
4193  }
4194 
4195  }
4196  PostData(1, fOutputMB);
4197  PostData(2, fOutputEMC7);
4198  PostData(3, fOutputEMCEGA);
4199  PostData(4, fOutputEMCJet);
4200  return;
4201 }
4202 
4203 void AliAnalysisTaskPSHFE::SetTrackCuts(AliESDtrackCuts *gtrkCuts, AliESDtrackCuts *ctrkCuts){
4204  cout<<"assigning hybrid track cuts \n";
4205  globaltrackCuts=gtrkCuts;
4206  comptrackCuts=ctrkCuts;
4207 }
4208 
4210  trackCutsStrong=trkCutBool;
4211 }
4212 
4214  applySSCuts=SSCutBool;
4215 }
4216 
4217 void AliAnalysisTaskPSHFE::FillPhotoElecHistos(AliESDEvent *esd, AliESDtrack *esdtrack, AliPIDResponse *fPIDResponse, Int_t i){
4218 
4219  if(!esdtrack){
4220  AliWarning("esdtrack is null, no point in doing Photonic Electron stuff");
4221  return;
4222  }
4223 
4224  Bool_t isElec=kFALSE;
4225  Double_t ElecMass=.0005109989;
4226  //Fill TOF and TPC status variables
4227  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, esdtrack);
4228 
4229  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, esdtrack);
4230 
4231  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, esdtrack);
4232 
4233  //Check validity of PID, TODO: Add a rejection histogram
4234  if(TPCStatus!=AliPIDResponse::kDetPidOk){
4235  return;
4236  }
4237 
4238  if(TRDStatus!=AliPIDResponse::kDetPidOk){
4239  return;
4240  }
4241 
4242  if(EMCStatus!=AliPIDResponse::kDetPidOk){
4243  return;
4244  }
4245 
4246 
4247  //Get the # of sigmas around an electron hypothesis for TOF and TPC
4248  Double_t nSigmaTPC;
4249  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(esdtrack,AliPID::kElectron);
4250 
4251  Double_t elecLikeTRD[1];
4252  if(fPIDResponse->ComputeTRDProbability(esdtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || esdtrack->GetTRDntrackletsPID()<4){
4253  return;
4254  }
4255 
4256  //declare emcal cluster PID variables
4257  Double_t EOP=-1;
4258  Int_t caloId=esdtrack->GetEMCALcluster();
4259 
4260  if(caloId==-99999){
4261  return;
4262  }
4263 
4264  AliESDCaloCluster* tagEMCclus=esd->GetCaloCluster(caloId);
4265 
4266  EOP = tagEMCclus->E()/esdtrack->Pt();
4267 
4268  if((nSigmaTPC<2&&nSigmaTPC>-2)||(EOP<1.4&&EOP>.8)||(elecLikeTRD[0]>.8)){
4269  isElec=kTRUE;
4270  }
4271 
4272  if(!isElec){return;}
4273 
4274  Int_t ntracks=esd->GetNumberOfTracks();
4275 
4276  for(Int_t j = 0; j < ntracks; j++) {
4277 
4278  //Don't double count the tagged tracks
4279  if(i==j){continue;}
4280 
4281  AliESDtrack* esdtrackassoc = (AliESDtrack*)esd->GetTrack(j); // pointer to reconstructed to track
4282 
4283  if(!esdtrackassoc) {
4284  AliError(Form("ERROR: Could not retrieve esdtrack %d",j));
4285  continue;
4286  }
4287 
4288  //Do hybrid track cuts
4289  if(!globaltrackCuts->AcceptTrack(esdtrackassoc)&&!comptrackCuts->AcceptTrack(esdtrackassoc)){continue;}
4290 
4291  Bool_t isElecToo=kFALSE;
4292 
4293  //Fill TOF and TPC status variables
4294  AliPIDResponse::EDetPidStatus TPCStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, esdtrackassoc);
4295 
4296  AliPIDResponse::EDetPidStatus TRDStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, esdtrackassoc);
4297 
4298  //Check validity of PID, TODO: Add a rejection histogram
4299  if(TPCStatusassoc!=AliPIDResponse::kDetPidOk){
4300  continue;
4301  }
4302 
4303  if(TRDStatusassoc!=AliPIDResponse::kDetPidOk){
4304  continue;
4305  }
4306 
4307 
4308  //Get the # of sigmas around an electron hypothesis for TOF and TPC
4309  Double_t nSigmaTPCassoc;
4310  nSigmaTPCassoc = fPIDResponse->NumberOfSigmasTPC(esdtrackassoc,AliPID::kElectron);
4311 
4312  Double_t elecLikeTRDassoc[1];
4313  if(fPIDResponse->ComputeTRDProbability(esdtrackassoc, AliPID::kElectron, elecLikeTRDassoc, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || esdtrackassoc->GetTRDntrackletsPID()<4){
4314  return;
4315  }
4316 
4317  if((nSigmaTPCassoc<2&&nSigmaTPCassoc>-2)||(elecLikeTRDassoc[0]>.8)){
4318  isElecToo=kTRUE;
4319  }
4320 
4321  if(!isElecToo){continue;}
4322 
4323  Double_t elecE1=TMath::Sqrt(esdtrack->P()*esdtrack->P()+ElecMass*ElecMass);
4324  Double_t elecE2=TMath::Sqrt(esdtrackassoc->P()*esdtrackassoc->P()+ElecMass*ElecMass);
4325 
4326  TLorentzVector elec1(esdtrack->Px(), esdtrack->Py(), esdtrack->Pz(), elecE1);
4327  TLorentzVector elec2(esdtrackassoc->Px(), esdtrackassoc->Py(), esdtrackassoc->Pz(), elecE2);
4328 
4329  Double_t InvMass=(elec1+elec2).M();
4330  Double_t OpAng=elec1.Angle(elec2.Vect());
4331 
4332  if(esdtrack->GetSign()==esdtrackassoc->GetSign()){
4333 
4334  if(MBtrg){
4335  fHistInvMassElecLike_MB->Fill(InvMass);
4336  fHistOpAngElecLike_MB->Fill(OpAng);
4337  }
4338 
4339  if(EMC7trg){
4340  fHistInvMassElecLike_EMC7->Fill(InvMass);
4341  fHistOpAngElecLike_EMC7->Fill(OpAng);
4342  }
4343 
4344  if(EMCEGAtrg){
4345  fHistInvMassElecLike_EMCEGA->Fill(InvMass);
4346  fHistOpAngElecLike_EMCEGA->Fill(OpAng);
4347  }
4348 
4349  if(EMCJettrg){
4350  fHistInvMassElecLike_EMCJet->Fill(InvMass);
4351  fHistOpAngElecLike_EMCJet->Fill(OpAng);
4352  }
4353 
4354  }else{
4355  if(InvMass<0.1&&OpAng<0.1){tagPhot=kTRUE;}
4356  if(MBtrg){
4357  fHistInvMassElecUnLike_MB->Fill(InvMass);
4358  fHistOpAngElecUnLike_MB->Fill(OpAng);
4359  }
4360 
4361  if(EMC7trg){
4362  fHistInvMassElecUnLike_EMC7->Fill(InvMass);
4363  fHistOpAngElecUnLike_EMC7->Fill(OpAng);
4364  }
4365 
4366  if(EMCEGAtrg){
4367  fHistInvMassElecUnLike_EMCEGA->Fill(InvMass);
4368  fHistOpAngElecUnLike_EMCEGA->Fill(OpAng);
4369  }
4370 
4371  if(EMCJettrg){
4372  fHistInvMassElecUnLike_EMCJet->Fill(InvMass);
4373  fHistOpAngElecUnLike_EMCJet->Fill(OpAng);
4374  }
4375  }
4376  }//end loop over tracks
4377 
4378  PostData(1, fOutputMB);
4379  PostData(2, fOutputEMC7);
4380  PostData(3, fOutputEMCEGA);
4381  PostData(4, fOutputEMCJet);
4382  return;
4383 }
4384 
4385 void AliAnalysisTaskPSHFE::FillPhotoElecHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse, Int_t i){
4386 
4387  if(!aodtrack){
4388  AliWarning("aodtrack is null, no point in doing Photonic Electron stuff");
4389  return;
4390  }
4391 
4392  Bool_t isElec=kFALSE;
4393  Double_t ElecMass=.0005109989;
4394  //Fill TOF and TPC status variables
4395  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrack);
4396 
4397  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrack);
4398 
4399  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, aodtrack);
4400 
4401  //Check validity of PID, TODO: Add a rejection histogram
4402  if(TPCStatus!=AliPIDResponse::kDetPidOk){
4403  return;
4404  }
4405 
4406  if(TRDStatus!=AliPIDResponse::kDetPidOk){
4407  return;
4408  }
4409 
4410  if(EMCStatus!=AliPIDResponse::kDetPidOk){
4411  return;
4412  }
4413 
4414 
4415  //Get the # of sigmas around an electron hypothesis for TOF and TPC
4416  Double_t nSigmaTPC;
4417  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron);
4418 
4419  Double_t elecLikeTRD[1];
4420  if(fPIDResponse->ComputeTRDProbability(aodtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrack->GetTRDntrackletsPID()<4){
4421  return;
4422  }
4423 
4424  //declare emcal cluster PID variables
4425  Double_t EOP=-1;
4426  Int_t caloId=aodtrack->GetEMCALcluster();
4427 
4428  if(caloId==-99999){
4429  return;
4430  }
4431 
4432  AliAODCaloCluster* tagEMCclus=aod->GetCaloCluster(caloId);
4433 
4434  EOP = tagEMCclus->E()/aodtrack->Pt();
4435 
4436  if((nSigmaTPC<2&&nSigmaTPC>-2)||(EOP<1.4&&EOP>.8)||(elecLikeTRD[0]>.8)){
4437  isElec=kTRUE;
4438  }
4439 
4440  if(!isElec){return;}
4441 
4442  Int_t ntracks=aod->GetNumberOfTracks();
4443 
4444  for(Int_t j = 0; j < ntracks; j++) {
4445 
4446  //Don't double count the tagged tracks
4447  if(i==j){continue;}
4448 
4449  AliAODTrack* aodtrackassoc = (AliAODTrack*)aod->GetTrack(j); // pointer to reconstructed to track
4450 
4451  if(!aodtrackassoc) {
4452  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
4453  continue;
4454  }
4455 
4456  //Do hybrid track cuts
4457  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
4458 
4459  Bool_t isElecToo=kFALSE;
4460 
4461  //Fill TOF and TPC status variables
4462  AliPIDResponse::EDetPidStatus TPCStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrackassoc);
4463 
4464  AliPIDResponse::EDetPidStatus TRDStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrackassoc);
4465 
4466  //Check validity of PID, TODO: Add a rejection histogram
4467  if(TPCStatusassoc!=AliPIDResponse::kDetPidOk){
4468  continue;
4469  }
4470 
4471  if(TRDStatusassoc!=AliPIDResponse::kDetPidOk){
4472  continue;
4473  }
4474 
4475 
4476  //Get the # of sigmas around an electron hypothesis for TOF and TPC
4477  Double_t nSigmaTPCassoc;
4478  nSigmaTPCassoc = fPIDResponse->NumberOfSigmasTPC(aodtrackassoc,AliPID::kElectron);
4479 
4480  Double_t elecLikeTRDassoc[1];
4481  if(fPIDResponse->ComputeTRDProbability(aodtrackassoc, AliPID::kElectron, elecLikeTRDassoc, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrackassoc->GetTRDntrackletsPID()<4){
4482  return;
4483  }
4484 
4485  if((nSigmaTPCassoc<2&&nSigmaTPCassoc>-2)||(elecLikeTRDassoc[0]>.8)){
4486  isElecToo=kTRUE;
4487  }
4488 
4489  if(!isElecToo){continue;}
4490 
4491  Double_t elecE1=TMath::Sqrt(aodtrack->P()*aodtrack->P()+ElecMass*ElecMass);
4492  Double_t elecE2=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
4493 
4494  TLorentzVector elec1(aodtrack->Px(), aodtrack->Py(), aodtrack->Pz(), elecE1);
4495  TLorentzVector elec2(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), elecE2);
4496 
4497  Double_t InvMass=(elec1+elec2).M();
4498  Double_t OpAng=elec1.Angle(elec2.Vect());
4499 
4500  if(aodtrack->GetSign()==aodtrackassoc->GetSign()){
4501 
4502  if(MBtrg){
4503  fHistInvMassElecLike_MB->Fill(InvMass);
4504  fHistOpAngElecLike_MB->Fill(OpAng);
4505  }
4506 
4507  if(EMC7trg){
4508  fHistInvMassElecLike_EMC7->Fill(InvMass);
4509  fHistOpAngElecLike_EMC7->Fill(OpAng);
4510  }
4511 
4512  if(EMCEGAtrg){
4513  fHistInvMassElecLike_EMCEGA->Fill(InvMass);
4514  fHistOpAngElecLike_EMCEGA->Fill(OpAng);
4515  }
4516 
4517  if(EMCJettrg){
4518  fHistInvMassElecLike_EMCJet->Fill(InvMass);
4519  fHistOpAngElecLike_EMCJet->Fill(OpAng);
4520  }
4521 
4522  }else{
4523  if(InvMass<0.1&&OpAng<0.1){tagPhot=kTRUE;}
4524  if(MBtrg){
4525  fHistInvMassElecUnLike_MB->Fill(InvMass);
4526  fHistOpAngElecUnLike_MB->Fill(OpAng);
4527  }
4528 
4529  if(EMC7trg){
4530  fHistInvMassElecUnLike_EMC7->Fill(InvMass);
4531  fHistOpAngElecUnLike_EMC7->Fill(OpAng);
4532  }
4533 
4534  if(EMCEGAtrg){
4535  fHistInvMassElecUnLike_EMCEGA->Fill(InvMass);
4536  fHistOpAngElecUnLike_EMCEGA->Fill(OpAng);
4537  }
4538 
4539  if(EMCJettrg){
4540  fHistInvMassElecUnLike_EMCJet->Fill(InvMass);
4541  fHistOpAngElecUnLike_EMCJet->Fill(OpAng);
4542  }
4543  }
4544  }//end loop over tracks
4545 
4546  PostData(1, fOutputMB);
4547  PostData(2, fOutputEMC7);
4548  PostData(3, fOutputEMCEGA);
4549  PostData(4, fOutputEMCJet);
4550  return;
4551 }
4552 
4554 {
4555  if(!aod){AliWarning("Invalid AOD Event");}
4556  Int_t nTracks = aod->GetNumberOfTracks();
4557  TObjArray* accTracks = new TObjArray;
4558 
4559  for(Int_t i=0;i<nTracks;i++){
4560  AliAODTrack *aodtrack = (AliAODTrack*)aod->GetTrack(i);
4561 
4562  if(!aodtrack){
4563  continue;
4564  }
4565 
4566  if(aodtrack->IsHybridGlobalConstrainedGlobal()){
4567  continue;
4568  }
4569 
4570  accTracks->Add(new AliAODTrack(*aodtrack));
4571  }
4572 
4573  return accTracks;
4574 }
4575 
4576 void AliAnalysisTaskPSHFE::FillMEDPhiHistos(AliAODTrack *aodtrack)
4577 {
4578  Int_t nEvents = fPool->GetCurrentNEvents();
4579 
4580  for(Int_t Ev=0;Ev<nEvents;Ev++){
4581 
4582  TObjArray *mixedTracks = fPool->GetEvent(Ev);
4583 
4584  Int_t nMixedTracks = mixedTracks->GetEntriesFast();
4585 
4586  for(Int_t j=0;j<nMixedTracks;j++){
4587  AliAODTrack* aodtrackassoc = (AliAODTrack*)mixedTracks->At(j); // pointer to reconstructed to track
4588 
4589  if(!aodtrackassoc) {
4590  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
4591  continue;
4592  }
4593 
4594  //Do hybrid track cuts
4595  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
4596 
4597  //Pt distribution
4598  if(MBtrg){
4599  fHistPtAssocMix_MB->Fill(aodtrackassoc->Pt());
4600  }
4601 
4602  if(EMC7trg){
4603  fHistPtAssocMix_EMC7->Fill(aodtrackassoc->Pt());
4604  }
4605 
4606  if(EMCEGAtrg){
4607  fHistPtAssocMix_EMCEGA->Fill(aodtrackassoc->Pt());
4608  }
4609 
4610  if(EMCJettrg){
4611  fHistPtAssocMix_EMCJet->Fill(aodtrackassoc->Pt());
4612  }
4613 
4614  //Fill Delta Phi variable and correct for periodicity
4615  Double_t DPhi=aodtrackassoc->Phi()-aodtrack->Phi();
4616 
4617  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
4618 
4619  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
4620 
4621  Double_t DEta=aodtrackassoc->Eta()-aodtrack->Eta();
4622 
4623  //candidate 1<pt<2
4624  if(aodtrack->Pt()>1&&aodtrack->Pt()<2){
4625 
4626  //300-500MeV
4627  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
4628  if(MBtrg){
4629  fHistDPhiMix300_500_MB[0]->Fill(DPhi);
4630  }
4631  if(EMC7trg){
4632  fHistDPhiMix300_500_EMC7[0]->Fill(DPhi);
4633  }
4634  if(EMCEGAtrg){
4635  fHistDPhiMix300_500_EMCEGA[0]->Fill(DPhi);
4636  }
4637  if(EMCJettrg){
4638  fHistDPhiMix300_500_EMCJet[0]->Fill(DPhi);
4639  }
4640  }
4641 
4642  //500MeV
4643  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
4644  if(MBtrg){
4645  fHistDPhiMix500_800_MB[0]->Fill(DPhi);
4646  }
4647  if(EMC7trg){
4648  fHistDPhiMix500_800_EMC7[0]->Fill(DPhi);
4649  }
4650  if(EMCEGAtrg){
4651  fHistDPhiMix500_800_EMCEGA[0]->Fill(DPhi);
4652  }
4653  if(EMCJettrg){
4654  fHistDPhiMix500_800_EMCJet[0]->Fill(DPhi);
4655  }
4656  }
4657 
4658  //800MeV
4659  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
4660  if(MBtrg){
4661  fHistDPhiMix800_1_MB[0]->Fill(DPhi);
4662  }
4663  if(EMC7trg){
4664  fHistDPhiMix800_1_EMC7[0]->Fill(DPhi);
4665  }
4666  if(EMCEGAtrg){
4667  fHistDPhiMix800_1_EMCEGA[0]->Fill(DPhi);
4668  }
4669  if(EMCJettrg){
4670  fHistDPhiMix800_1_EMCJet[0]->Fill(DPhi);
4671  }
4672  }
4673 
4674  //1GeV
4675  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
4676  if(MBtrg){
4677  fHistDPhiMix1_2_MB[0]->Fill(DPhi);
4678  }
4679  if(EMC7trg){
4680  fHistDPhiMix1_2_EMC7[0]->Fill(DPhi);
4681  }
4682  if(EMCEGAtrg){
4683  fHistDPhiMix1_2_EMCEGA[0]->Fill(DPhi);
4684  }
4685  if(EMCJettrg){
4686  fHistDPhiMix1_2_EMCJet[0]->Fill(DPhi);
4687  }
4688  }
4689 
4690  //2GeV
4691  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
4692  if(MBtrg){
4693  fHistDPhiMix2_3_MB[0]->Fill(DPhi);
4694  }
4695  if(EMC7trg){
4696  fHistDPhiMix2_3_EMC7[0]->Fill(DPhi);
4697  }
4698  if(EMCEGAtrg){
4699  fHistDPhiMix2_3_EMCEGA[0]->Fill(DPhi);
4700  }
4701  if(EMCJettrg){
4702  fHistDPhiMix2_3_EMCJet[0]->Fill(DPhi);
4703  }
4704  }
4705 
4706  //3GeV
4707  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
4708  if(MBtrg){
4709  fHistDPhiMix3_4_MB[0]->Fill(DPhi);
4710  }
4711  if(EMC7trg){
4712  fHistDPhiMix3_4_EMC7[0]->Fill(DPhi);
4713  }
4714  if(EMCEGAtrg){
4715  fHistDPhiMix3_4_EMCEGA[0]->Fill(DPhi);
4716  }
4717  if(EMCJettrg){
4718  fHistDPhiMix3_4_EMCJet[0]->Fill(DPhi);
4719  }
4720  }
4721 
4722  //5GeV
4723  if(aodtrackassoc->Pt()>4){
4724  if(MBtrg){
4725  fHistDPhiMix4_MB[0]->Fill(DPhi);
4726  }
4727  if(EMC7trg){
4728  fHistDPhiMix4_EMC7[0]->Fill(DPhi);
4729  }
4730  if(EMCEGAtrg){
4731  fHistDPhiMix4_EMCEGA[0]->Fill(DPhi);
4732  }
4733  if(EMCJettrg){
4734  fHistDPhiMix4_EMCJet[0]->Fill(DPhi);
4735  }
4736  }
4737  }
4738 
4739  //candidate 2<pt<4
4740  if(aodtrack->Pt()>2&&aodtrack->Pt()<4){
4741 
4742  //300MeV
4743  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
4744  if(MBtrg){
4745  fHistDPhiMix300_500_MB[1]->Fill(DPhi);
4746  }
4747  if(EMC7trg){
4748  fHistDPhiMix300_500_EMC7[1]->Fill(DPhi);
4749  }
4750  if(EMCEGAtrg){
4751  fHistDPhiMix300_500_EMCEGA[1]->Fill(DPhi);
4752  }
4753  if(EMCJettrg){
4754  fHistDPhiMix300_500_EMCJet[1]->Fill(DPhi);
4755  }
4756  }
4757 
4758  //500MeV
4759  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
4760  if(MBtrg){
4761  fHistDPhiMix500_800_MB[1]->Fill(DPhi);
4762  }
4763  if(EMC7trg){
4764  fHistDPhiMix500_800_EMC7[1]->Fill(DPhi);
4765  }
4766  if(EMCEGAtrg){
4767  fHistDPhiMix500_800_EMCEGA[1]->Fill(DPhi);
4768  }
4769  if(EMCJettrg){
4770  fHistDPhiMix500_800_EMCJet[1]->Fill(DPhi);
4771  }
4772  }
4773 
4774  //800MeV
4775  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
4776  if(MBtrg){
4777  fHistDPhiMix800_1_MB[1]->Fill(DPhi);
4778  }
4779  if(EMC7trg){
4780  fHistDPhiMix800_1_EMC7[1]->Fill(DPhi);
4781  }
4782  if(EMCEGAtrg){
4783  fHistDPhiMix800_1_EMCEGA[1]->Fill(DPhi);
4784  }
4785  if(EMCJettrg){
4786  fHistDPhiMix800_1_EMCJet[1]->Fill(DPhi);
4787  }
4788  }
4789 
4790  //1GeV
4791  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
4792  if(MBtrg){
4793  fHistDPhiMix1_2_MB[1]->Fill(DPhi);
4794  }
4795  if(EMC7trg){
4796  fHistDPhiMix1_2_EMC7[1]->Fill(DPhi);
4797  }
4798  if(EMCEGAtrg){
4799  fHistDPhiMix1_2_EMCEGA[1]->Fill(DPhi);
4800  }
4801  if(EMCJettrg){
4802  fHistDPhiMix1_2_EMCJet[1]->Fill(DPhi);
4803  }
4804  }
4805 
4806  //2GeV
4807  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
4808  if(MBtrg){
4809  fHistDPhiMix2_3_MB[1]->Fill(DPhi);
4810  fHistDPhiMix28_MB->Fill(DPhi);
4811  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
4812  }
4813  if(EMC7trg){
4814  fHistDPhiMix2_3_EMC7[1]->Fill(DPhi);
4815  fHistDPhiMix28_EMC7->Fill(DPhi);
4816  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
4817  }
4818  if(EMCEGAtrg){
4819  fHistDPhiMix2_3_EMCEGA[1]->Fill(DPhi);
4820  fHistDPhiMix28_EMCEGA->Fill(DPhi);
4821  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
4822  }
4823  if(EMCJettrg){
4824  fHistDPhiMix2_3_EMCJet[1]->Fill(DPhi);
4825  fHistDPhiMix28_EMCJet->Fill(DPhi);
4826  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
4827  }
4828  }
4829 
4830  //3GeV
4831  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
4832  if(MBtrg){
4833  fHistDPhiMix3_4_MB[1]->Fill(DPhi);
4834  fHistDPhiMix28_MB->Fill(DPhi);
4835  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
4836  }
4837  if(EMC7trg){
4838  fHistDPhiMix3_4_EMC7[1]->Fill(DPhi);
4839  fHistDPhiMix28_EMC7->Fill(DPhi);
4840  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
4841  }
4842  if(EMCEGAtrg){
4843  fHistDPhiMix3_4_EMCEGA[1]->Fill(DPhi);
4844  fHistDPhiMix28_EMCEGA->Fill(DPhi);
4845  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
4846  }
4847  if(EMCJettrg){
4848  fHistDPhiMix3_4_EMCJet[1]->Fill(DPhi);
4849  fHistDPhiMix28_EMCJet->Fill(DPhi);
4850  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
4851  }
4852  }
4853 
4854  //5GeV
4855  if(aodtrackassoc->Pt()>4){
4856  if(MBtrg){
4857  fHistDPhiMix4_MB[1]->Fill(DPhi);
4858  fHistDPhiMix28_MB->Fill(DPhi);
4859  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
4860  }
4861  if(EMC7trg){
4862  fHistDPhiMix4_EMC7[1]->Fill(DPhi);
4863  fHistDPhiMix28_EMC7->Fill(DPhi);
4864  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
4865  }
4866  if(EMCEGAtrg){
4867  fHistDPhiMix4_EMCEGA[1]->Fill(DPhi);
4868  fHistDPhiMix28_EMCEGA->Fill(DPhi);
4869  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
4870  }
4871  if(EMCJettrg){
4872  fHistDPhiMix4_EMCJet[1]->Fill(DPhi);
4873  fHistDPhiMix28_EMCJet->Fill(DPhi);
4874  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
4875  }
4876  }
4877  }
4878 
4879  //candidate 4<pt<8
4880  if(aodtrack->Pt()>4&&aodtrack->Pt()<8){
4881 
4882  //300MeV
4883  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
4884  if(MBtrg){
4885  fHistDPhiMix300_500_MB[2]->Fill(DPhi);
4886  }
4887  if(EMC7trg){
4888  fHistDPhiMix300_500_EMC7[2]->Fill(DPhi);
4889  }
4890  if(EMCEGAtrg){
4891  fHistDPhiMix300_500_EMCEGA[2]->Fill(DPhi);
4892  }
4893  if(EMCJettrg){
4894  fHistDPhiMix300_500_EMCJet[2]->Fill(DPhi);
4895  }
4896  }
4897 
4898  //500MeV
4899  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
4900  if(MBtrg){
4901  fHistDPhiMix500_800_MB[2]->Fill(DPhi);
4902  }
4903  if(EMC7trg){
4904  fHistDPhiMix500_800_EMC7[2]->Fill(DPhi);
4905  }
4906  if(EMCEGAtrg){
4907  fHistDPhiMix500_800_EMCEGA[2]->Fill(DPhi);
4908  }
4909  if(EMCJettrg){
4910  fHistDPhiMix500_800_EMCJet[2]->Fill(DPhi);
4911  }
4912  }
4913 
4914  //800MeV
4915  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
4916  if(MBtrg){
4917  fHistDPhiMix800_1_MB[2]->Fill(DPhi);
4918  }
4919  if(EMC7trg){
4920  fHistDPhiMix800_1_EMC7[2]->Fill(DPhi);
4921  }
4922  if(EMCEGAtrg){
4923  fHistDPhiMix800_1_EMCEGA[2]->Fill(DPhi);
4924  }
4925  if(EMCJettrg){
4926  fHistDPhiMix800_1_EMCJet[2]->Fill(DPhi);
4927  }
4928  }
4929 
4930  //1GeV
4931  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
4932  if(MBtrg){
4933  fHistDPhiMix1_2_MB[2]->Fill(DPhi);
4934  }
4935  if(EMC7trg){
4936  fHistDPhiMix1_2_EMC7[2]->Fill(DPhi);
4937  }
4938  if(EMCEGAtrg){
4939  fHistDPhiMix1_2_EMCEGA[2]->Fill(DPhi);
4940  }
4941  if(EMCJettrg){
4942  fHistDPhiMix1_2_EMCJet[2]->Fill(DPhi);
4943  }
4944  }
4945 
4946  //2GeV
4947  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
4948  if(MBtrg){
4949  fHistDPhiMix2_3_MB[2]->Fill(DPhi);
4950  fHistDPhiMix28_MB->Fill(DPhi);
4951  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
4952  }
4953  if(EMC7trg){
4954  fHistDPhiMix2_3_EMC7[2]->Fill(DPhi);
4955  fHistDPhiMix28_EMC7->Fill(DPhi);
4956  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
4957  }
4958  if(EMCEGAtrg){
4959  fHistDPhiMix2_3_EMCEGA[2]->Fill(DPhi);
4960  fHistDPhiMix28_EMCEGA->Fill(DPhi);
4961  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
4962  }
4963  if(EMCJettrg){
4964  fHistDPhiMix2_3_EMCJet[2]->Fill(DPhi);
4965  fHistDPhiMix28_EMCJet->Fill(DPhi);
4966  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
4967  }
4968  }
4969 
4970  //3GeV
4971  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
4972  if(MBtrg){
4973  fHistDPhiMix3_4_MB[2]->Fill(DPhi);
4974  fHistDPhiMix28_MB->Fill(DPhi);
4975  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
4976  }
4977  if(EMC7trg){
4978  fHistDPhiMix3_4_EMC7[2]->Fill(DPhi);
4979  fHistDPhiMix28_EMC7->Fill(DPhi);
4980  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
4981  }
4982  if(EMCEGAtrg){
4983  fHistDPhiMix3_4_EMCEGA[2]->Fill(DPhi);
4984  fHistDPhiMix28_EMCEGA->Fill(DPhi);
4985  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
4986  }
4987  if(EMCJettrg){
4988  fHistDPhiMix3_4_EMCJet[2]->Fill(DPhi);
4989  fHistDPhiMix28_EMCJet->Fill(DPhi);
4990  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
4991  }
4992  }
4993 
4994  //5GeV
4995  if(aodtrackassoc->Pt()>4){
4996  if(MBtrg){
4997  fHistDPhiMix4_MB[2]->Fill(DPhi);
4998  fHistDPhiMix28_MB->Fill(DPhi);
4999  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
5000  }
5001  if(EMC7trg){
5002  fHistDPhiMix4_EMC7[2]->Fill(DPhi);
5003  fHistDPhiMix28_EMC7->Fill(DPhi);
5004  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
5005  }
5006  if(EMCEGAtrg){
5007  fHistDPhiMix4_EMCEGA[2]->Fill(DPhi);
5008  fHistDPhiMix28_EMCEGA->Fill(DPhi);
5009  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
5010  }
5011  if(EMCJettrg){
5012  fHistDPhiMix4_EMCJet[2]->Fill(DPhi);
5013  fHistDPhiMix28_EMCJet->Fill(DPhi);
5014  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
5015  }
5016  }
5017  }
5018  }
5019  }
5020  PostData(1, fOutputMB);
5021  PostData(2, fOutputEMC7);
5022  PostData(3, fOutputEMCEGA);
5023  PostData(4, fOutputEMCJet);
5024  return;
5025 }
5026 
5027 //________________________________________________________________________
5029 {
5030 
5031 }
double Double_t
Definition: External.C:58
Definition: External.C:236
virtual void Terminate(Option_t *)