AliPhysics  b752f14 (b752f14)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskPSHFE.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 /* AliAnalysisTaskPSHFE.cxx
19  *
20  * Macro for analysis of heavy flavour electrons
21  * -Patrick Steffanic
22  */
23 #include "AliAnalysisTaskPSHFE.h"
24 
25  #include <iostream>
26  #include <fstream>
27  #include <vector>
28  #include "Riostream.h"
29  #include "TChain.h"
30  #include "TTree.h"
31  #include "TMath.h"
32  #include "TString.h"
33  #include "TH1F.h"
34  #include "TH2F.h"
35  #include "TCanvas.h"
36  #include "TList.h"
37  #include "TF1.h"
38  #include "TGraph.h"
39  #include "TSystem.h"
40 
41  #include "AliAnalysisTaskSE.h"
42  #include "AliAnalysisManager.h"
43  #include "AliStack.h"
44  #include "AliESDtrackCuts.h"
45  #include "AliAODTrack.h"
46  #include "AliAODCaloCluster.h"
47  #include "AliAODEvent.h"
48  #include "AliAODInputHandler.h"
49  #include "AliPID.h"
50  #include "AliPIDResponse.h"
51  #include "AliTRDPIDResponse.h"
52  #include "AliEventPoolManager.h"
53 
54  using std::cout;
55 using std::endl;
56 
57 
59 
60  //________________________________________________________________________
61  AliAnalysisTaskPSHFE::AliAnalysisTaskPSHFE() // All data members should be initialised here
63 fOutputMB(0),
64 fOutputEMC7(0),
65 fOutputEMCEGA(0),
66 fOutputEMCJet(0),
67 fTrackCutsStrong(0),
68 fTrackCutsWeak(0),
69 fPoolMan(0),
70 fPool(0),
71 EMC7trg(0),
72 EMCEGAtrg(0),
73 EMCJettrg(0),
74 MBtrg(0),
75 tagStrong(0),
76 tagPhot(0),
77 UseNonSignalEvents(0),
78 
79 fHistPIDRejection(0),
80 fHistNElecPerEvent(0),
81 fHistTestDCA(0),
82 fHistTestEMCEnergy(0),
83 fHistTestTPCdEdx(0),
84 fHistTestEOP(0),
85 fHistTestOGDPhi(0),
86 fHistTestPt(0),
87 fHistTestInvMassElecLike(0),
88 fHistTestInvMassElecUnLike(0),
89 fHistTestInvMassPionLike(0),
90 fHistTestInvMassPionUnLike(0),
91 fHistTestDPhiSpeNoSec(0),
92 fHistTestDPhi18Sec(0),
93 fHistTestDPhi18NoSec(0),
94 fHistTestDPhiType(0),
95 
96 fHistTPCNClus_MB(0),
97 fHistITSNClus_MB(0),
98 fHistImpPar_MB(0),
99 fHistImpParTag_MB(0),
100 fHistNevents_MB(0),
101 fHistPtSum_MB(0),
102 fHistPtSumTag_MB(0),
103 fHistPtSumEMC_MB(0),
104 fHistEtaPhi_MB(0),
105 fHistEtaPhiTag_MB(0),
106 fHistEtaPhiTPCOnly_MB(0),
107 fHistDPhi28_MB(0),
108 fHistDPhiDEta28_MB(0),
109 fHistDPhiMix28_MB(0),
110 fHistDPhiDEtaMix28_MB(0),
111 fHistEMC_Had_MB_1Gev(0),
112 fHistInvMassElecLike_MB(0),
113 fHistInvMassElecUnLike_MB(0),
114 fHistOpAngElecLike_MB(0),
115 fHistOpAngElecUnLike_MB(0),
116 fHistPtAssoc_MB(0),
117 fHistPtAssocMix_MB(0),
118 fHistPtTag_MB(0),
119 fHistPhotoMismatch_MB(0),
120 fHistDPhi18Spe_MB(0),
121 
122 fHistTPCNClus_EMC7(0),
123 fHistITSNClus_EMC7(0),
124 fHistImpPar_EMC7(0),
125 fHistImpParTag_EMC7(0),
126 fHistNevents_EMC7(0),
127 fHistPtSum_EMC7(0),
128 fHistPtSumTag_EMC7(0),
129 fHistPtSumEMC_EMC7(0),
130 fHistEtaPhi_EMC7(0),
131 fHistEtaPhiTag_EMC7(0),
132 fHistDPhi28_EMC7(0),
133 fHistDPhiDEta28_EMC7(0),
134 fHistDPhiMix28_EMC7(0),
135 fHistDPhiDEtaMix28_EMC7(0),
136 fHistInvMassElecLike_EMC7(0),
137 fHistInvMassElecUnLike_EMC7(0),
138 fHistOpAngElecLike_EMC7(0),
139 fHistOpAngElecUnLike_EMC7(0),
140 fHistPtAssoc_EMC7(0),
141 fHistPtAssocMix_EMC7(0),
142 fHistPtTag_EMC7(0),
143 fHistPhotoMismatch_EMC7(0),
144 fHistDPhi18Spe_EMC7(0),
145 
146 fHistTPCNClus_EMCEGA(0),
147 fHistITSNClus_EMCEGA(0),
148 fHistImpPar_EMCEGA(0),
149 fHistImpParTag_EMCEGA(0),
150 fHistNevents_EMCEGA(0),
151 fHistPtSum_EMCEGA(0),
152 fHistPtSumTag_EMCEGA(0),
153 fHistPtSumEMC_EMCEGA(0),
154 fHistEtaPhi_EMCEGA(0),
155 fHistEtaPhiTag_EMCEGA(0),
156 fHistDPhi28_EMCEGA(0),
157 fHistDPhiDEta28_EMCEGA(0),
158 fHistDPhiMix28_EMCEGA(0),
159 fHistDPhiDEtaMix28_EMCEGA(0),
160 fHistInvMassElecLike_EMCEGA(0),
161 fHistInvMassElecUnLike_EMCEGA(0),
162 fHistOpAngElecLike_EMCEGA(0),
163 fHistOpAngElecUnLike_EMCEGA(0),
164 fHistPtAssoc_EMCEGA(0),
165 fHistPtAssocMix_EMCEGA(0),
166 fHistPtTag_EMCEGA(0),
167 fHistPhotoMismatch_EMCEGA(0),
168 fHistDPhi18Spe_EMCEGA(0),
169 
170 fHistTPCNClus_EMCJet(0),
171 fHistITSNClus_EMCJet(0),
172 fHistImpPar_EMCJet(0),
173 fHistImpParTag_EMCJet(0),
174 fHistNevents_EMCJet(0),
175 fHistPtSum_EMCJet(0),
176 fHistPtSumTag_EMCJet(0),
177 fHistPtSumEMC_EMCJet(0),
178 fHistEtaPhi_EMCJet(0),
179 fHistEtaPhiTag_EMCJet(0),
180 fHistDPhi28_EMCJet(0),
181 fHistDPhiDEta28_EMCJet(0),
182 fHistDPhiMix28_EMCJet(0),
183 fHistDPhiDEtaMix28_EMCJet(0),
184 fHistInvMassElecLike_EMCJet(0),
185 fHistInvMassElecUnLike_EMCJet(0),
186 fHistOpAngElecLike_EMCJet(0),
187 fHistOpAngElecUnLike_EMCJet(0),
188 fHistPtAssoc_EMCJet(0),
189 fHistPtAssocMix_EMCJet(0),
190 fHistPtTag_EMCJet(0),
191 fHistPhotoMismatch_EMCJet(0),
192 fHistDPhi18Spe_EMCJet(0)
193 
194  // The last in the above list should not have a comma after it
195 {
196 
197  //Init the DPhi Plots here because they are stored in arrays
198  for(Int_t i=0; i<3; i++){
199  fHistDPhi300_500_MB[i]=0;
200  fHistDPhi500_800_MB[i]=0;
201  fHistDPhi800_1_MB[i]=0;
202  fHistDPhi1_2_MB[i]=0;
203  fHistDPhi2_3_MB[i]=0;
204  fHistDPhi3_4_MB[i]=0;
205  fHistDPhi4_MB[i]=0;
206 
207  fHistDPhi300_500_EMC7[i]=0;
208  fHistDPhi500_800_EMC7[i]=0;
209  fHistDPhi800_1_EMC7[i]=0;
210  fHistDPhi1_2_EMC7[i]=0;
211  fHistDPhi2_3_EMC7[i]=0;
212  fHistDPhi3_4_EMC7[i]=0;
213  fHistDPhi4_EMC7[i]=0;
214 
215  fHistDPhi300_500_EMCEGA[i]=0;
216  fHistDPhi500_800_EMCEGA[i]=0;
217  fHistDPhi800_1_EMCEGA[i]=0;
218  fHistDPhi1_2_EMCEGA[i]=0;
219  fHistDPhi2_3_EMCEGA[i]=0;
220  fHistDPhi3_4_EMCEGA[i]=0;
221  fHistDPhi4_EMCEGA[i]=0;
222 
223  fHistDPhi300_500_EMCJet[i]=0;
224  fHistDPhi500_800_EMCJet[i]=0;
225  fHistDPhi800_1_EMCJet[i]=0;
226  fHistDPhi1_2_EMCJet[i]=0;
227  fHistDPhi2_3_EMCJet[i]=0;
228  fHistDPhi3_4_EMCJet[i]=0;
229  fHistDPhi4_EMCJet[i]=0;
230 
231  //ME histos
232  fHistDPhiMix300_500_MB[i]=0;
233  fHistDPhiMix500_800_MB[i]=0;
234  fHistDPhiMix800_1_MB[i]=0;
235  fHistDPhiMix1_2_MB[i]=0;
236  fHistDPhiMix2_3_MB[i]=0;
237  fHistDPhiMix3_4_MB[i]=0;
238  fHistDPhiMix4_MB[i]=0;
239 
240  fHistDPhiMix300_500_EMC7[i]=0;
241  fHistDPhiMix500_800_EMC7[i]=0;
242  fHistDPhiMix800_1_EMC7[i]=0;
243  fHistDPhiMix1_2_EMC7[i]=0;
244  fHistDPhiMix2_3_EMC7[i]=0;
245  fHistDPhiMix3_4_EMC7[i]=0;
246  fHistDPhiMix4_EMC7[i]=0;
247 
248  fHistDPhiMix300_500_EMCEGA[i]=0;
249  fHistDPhiMix500_800_EMCEGA[i]=0;
250  fHistDPhiMix800_1_EMCEGA[i]=0;
251  fHistDPhiMix1_2_EMCEGA[i]=0;
252  fHistDPhiMix2_3_EMCEGA[i]=0;
253  fHistDPhiMix3_4_EMCEGA[i]=0;
254  fHistDPhiMix4_EMCEGA[i]=0;
255 
256  fHistDPhiMix300_500_EMCJet[i]=0;
257  fHistDPhiMix500_800_EMCJet[i]=0;
258  fHistDPhiMix800_1_EMCJet[i]=0;
259  fHistDPhiMix1_2_EMCJet[i]=0;
260  fHistDPhiMix2_3_EMCJet[i]=0;
261  fHistDPhiMix3_4_EMCJet[i]=0;
262  fHistDPhiMix4_EMCJet[i]=0;
263  }
264 
265  //Init PID Plots here since they are stored in Arrays
266  for(int i=0;i<6;i++){
267  //MB Plots
268  fHistTPC_EMCTRD_MB[i]=0;
269 
270  fHistEMC_TPCTRD_MB[i]=0;
271 
272  fHistTRD_TPCEMC_MB[i]=0;
273 
274  //EMC7 Plots
275  fHistTPC_EMCTRD_EMC7[i]=0;
276 
277  fHistEMC_TPCTRD_EMC7[i]=0;
278 
279  fHistTRD_TPCEMC_EMC7[i]=0;
280 
281  //EMCEGA Plots
282  fHistTPC_EMCTRD_EMCEGA[i]=0;
283 
284  fHistEMC_TPCTRD_EMCEGA[i]=0;
285 
286  fHistTRD_TPCEMC_EMCEGA[i]=0;
287 
288  //EMCJet Plots
289  fHistTPC_EMCTRD_EMCJet[i]=0;
290 
291  fHistEMC_TPCTRD_EMCJet[i]=0;
292 
293  fHistTRD_TPCEMC_EMCJet[i]=0;
294 
295  }
296 
297  // Dummy constructor ALWAYS needed for I/O.
298 }
299 
300 //________________________________________________________________________
301 AliAnalysisTaskPSHFE::AliAnalysisTaskPSHFE(const char *name) // All data members should be initialised here
302  :AliAnalysisTaskSE(name),
303 fOutputMB(0),
304 fOutputEMC7(0),
305 fOutputEMCEGA(0),
306 fOutputEMCJet(0),
307 fTrackCutsStrong(0),
308 fTrackCutsWeak(0),
309 fPoolMan(0),
310 fPool(0),
311 EMC7trg(0),
312 EMCEGAtrg(0),
313 EMCJettrg(0),
314 MBtrg(0),
315 tagStrong(0),
316 tagPhot(0),
317 UseNonSignalEvents(0),
318 
319 fHistPIDRejection(0),
320 fHistNElecPerEvent(0),
321 fHistTestDCA(0),
322 fHistTestEMCEnergy(0),
323 fHistTestTPCdEdx(0),
324 fHistTestEOP(0),
325 fHistTestOGDPhi(0),
326 fHistTestPt(0),
327 fHistTestInvMassElecLike(0),
328 fHistTestInvMassElecUnLike(0),
329 fHistTestInvMassPionLike(0),
330 fHistTestInvMassPionUnLike(0),
331 fHistTestDPhiSpeNoSec(0),
332 fHistTestDPhi18Sec(0),
333 fHistTestDPhi18NoSec(0),
334 fHistTestDPhiType(0),
335 
336 fHistTPCNClus_MB(0),
337 fHistITSNClus_MB(0),
338 fHistImpPar_MB(0),
339 fHistImpParTag_MB(0),
340 fHistNevents_MB(0),
341 fHistPtSum_MB(0),
342 fHistPtSumTag_MB(0),
343 fHistPtSumEMC_MB(0),
344 fHistEtaPhi_MB(0),
345 fHistEtaPhiTag_MB(0),
346 fHistEtaPhiTPCOnly_MB(0),
347 fHistDPhi28_MB(0),
348 fHistDPhiDEta28_MB(0),
349 fHistDPhiMix28_MB(0),
350 fHistDPhiDEtaMix28_MB(0),
351 fHistEMC_Had_MB_1Gev(0),
352 fHistInvMassElecLike_MB(0),
353 fHistInvMassElecUnLike_MB(0),
354 fHistOpAngElecLike_MB(0),
355 fHistOpAngElecUnLike_MB(0),
356 fHistPtAssoc_MB(0),
357 fHistPtAssocMix_MB(0),
358 fHistPtTag_MB(0),
359 fHistPhotoMismatch_MB(0),
360 fHistDPhi18Spe_MB(0),
361 
362 fHistTPCNClus_EMC7(0),
363 fHistITSNClus_EMC7(0),
364 fHistImpPar_EMC7(0),
365 fHistImpParTag_EMC7(0),
366 fHistNevents_EMC7(0),
367 fHistPtSum_EMC7(0),
368 fHistPtSumTag_EMC7(0),
369 fHistPtSumEMC_EMC7(0),
370 fHistEtaPhi_EMC7(0),
371 fHistEtaPhiTag_EMC7(0),
372 fHistDPhi28_EMC7(0),
373 fHistDPhiDEta28_EMC7(0),
374 fHistDPhiMix28_EMC7(0),
375 fHistDPhiDEtaMix28_EMC7(0),
376 fHistInvMassElecLike_EMC7(0),
377 fHistInvMassElecUnLike_EMC7(0),
378 fHistOpAngElecLike_EMC7(0),
379 fHistOpAngElecUnLike_EMC7(0),
380 fHistPtAssoc_EMC7(0),
381 fHistPtAssocMix_EMC7(0),
382 fHistPtTag_EMC7(0),
383 fHistPhotoMismatch_EMC7(0),
384 fHistDPhi18Spe_EMC7(0),
385 
386 fHistTPCNClus_EMCEGA(0),
387 fHistITSNClus_EMCEGA(0),
388 fHistImpPar_EMCEGA(0),
389 fHistImpParTag_EMCEGA(0),
390 fHistNevents_EMCEGA(0),
391 fHistPtSum_EMCEGA(0),
392 fHistPtSumTag_EMCEGA(0),
393 fHistPtSumEMC_EMCEGA(0),
394 fHistEtaPhi_EMCEGA(0),
395 fHistEtaPhiTag_EMCEGA(0),
396 fHistDPhi28_EMCEGA(0),
397 fHistDPhiDEta28_EMCEGA(0),
398 fHistDPhiMix28_EMCEGA(0),
399 fHistDPhiDEtaMix28_EMCEGA(0),
400 fHistInvMassElecLike_EMCEGA(0),
401 fHistInvMassElecUnLike_EMCEGA(0),
402 fHistOpAngElecLike_EMCEGA(0),
403 fHistOpAngElecUnLike_EMCEGA(0),
404 fHistPtAssoc_EMCEGA(0),
405 fHistPtAssocMix_EMCEGA(0),
406 fHistPtTag_EMCEGA(0),
407 fHistPhotoMismatch_EMCEGA(0),
408 fHistDPhi18Spe_EMCEGA(0),
409 
410 fHistTPCNClus_EMCJet(0),
411 fHistITSNClus_EMCJet(0),
412 fHistImpPar_EMCJet(0),
413 fHistImpParTag_EMCJet(0),
414 fHistNevents_EMCJet(0),
415 fHistPtSum_EMCJet(0),
416 fHistPtSumTag_EMCJet(0),
417 fHistPtSumEMC_EMCJet(0),
418 fHistEtaPhi_EMCJet(0),
419 fHistEtaPhiTag_EMCJet(0),
420 fHistDPhi28_EMCJet(0),
421 fHistDPhiDEta28_EMCJet(0),
422 fHistDPhiMix28_EMCJet(0),
423 fHistDPhiDEtaMix28_EMCJet(0),
424 fHistInvMassElecLike_EMCJet(0),
425 fHistInvMassElecUnLike_EMCJet(0),
426 fHistOpAngElecLike_EMCJet(0),
427 fHistOpAngElecUnLike_EMCJet(0),
428 fHistPtAssoc_EMCJet(0),
429 fHistPtAssocMix_EMCJet(0),
430 fHistPtTag_EMCJet(0),
431 fHistPhotoMismatch_EMCJet(0),
432 fHistDPhi18Spe_EMCJet(0)
433 
434  // The last in the above list should not have a comma after it
435 {
436  // Constructor
437  // Define input and output slots here (never in the dummy constructor)
438  // Input slot #0 works with a TChain - it is connected to the default input container
439  // Output slot #1 writes into a TH1 container
440 
441  for(Int_t i=0; i<3; i++){
442  fHistDPhi300_500_MB[i]=0;
443  fHistDPhi500_800_MB[i]=0;
444  fHistDPhi800_1_MB[i]=0;
445  fHistDPhi1_2_MB[i]=0;
446  fHistDPhi2_3_MB[i]=0;
447  fHistDPhi3_4_MB[i]=0;
448  fHistDPhi4_MB[i]=0;
449 
452  fHistDPhi800_1_EMC7[i]=0;
453  fHistDPhi1_2_EMC7[i]=0;
454  fHistDPhi2_3_EMC7[i]=0;
455  fHistDPhi3_4_EMC7[i]=0;
456  fHistDPhi4_EMC7[i]=0;
457 
461  fHistDPhi1_2_EMCEGA[i]=0;
462  fHistDPhi2_3_EMCEGA[i]=0;
463  fHistDPhi3_4_EMCEGA[i]=0;
464  fHistDPhi4_EMCEGA[i]=0;
465 
469  fHistDPhi1_2_EMCJet[i]=0;
470  fHistDPhi2_3_EMCJet[i]=0;
471  fHistDPhi3_4_EMCJet[i]=0;
472  fHistDPhi4_EMCJet[i]=0;
473 
474  //ME histos
478  fHistDPhiMix1_2_MB[i]=0;
479  fHistDPhiMix2_3_MB[i]=0;
480  fHistDPhiMix3_4_MB[i]=0;
481  fHistDPhiMix4_MB[i]=0;
482 
489  fHistDPhiMix4_EMC7[i]=0;
490 
498 
506  }
507 
508  //Init PID Plots here since they are stored in Arrays
509  for(Int_t i=0;i<6;i++){
510  //MB Plots
511  fHistTPC_EMCTRD_MB[i]=0;
512 
513  fHistEMC_TPCTRD_MB[i]=0;
514 
515  fHistTRD_TPCEMC_MB[i]=0;
516 
517  //EMC7 Plots
519 
521 
523 
524  //EMCEGA Plots
526 
528 
530 
531  //EMCJet Plots
533 
535 
537 
538  }
539 
540 
541  DefineOutput(1, TList::Class());//MB
542  DefineOutput(2, TList::Class());//EMC7
543  DefineOutput(3, TList::Class());//EMCEGA
544  DefineOutput(4, TList::Class());//EMCJet
545 }
546 
547 //________________________________________________________________________
549 {
550  // Destructor. Clean-up the output list, but not the histograms that are put inside
551  // (the list is owner and will clean-up these histograms). Protect in PROOF case.
552  for(Int_t i=0;i<3;i++){
553  delete fHistDPhi300_500_MB[i];
554  delete fHistDPhi500_800_MB[i];
555  delete fHistDPhi800_1_MB[i];
556  delete fHistDPhi1_2_MB[i];
557  delete fHistDPhi2_3_MB[i];
558  delete fHistDPhi3_4_MB[i];
559  delete fHistDPhi4_MB[i];
560 
561  delete fHistDPhi300_500_EMC7[i];
562  delete fHistDPhi500_800_EMC7[i];
563  delete fHistDPhi800_1_EMC7[i];
564  delete fHistDPhi1_2_EMC7[i];
565  delete fHistDPhi2_3_EMC7[i];
566  delete fHistDPhi3_4_EMC7[i];
567  delete fHistDPhi4_EMC7[i];
568 
569  delete fHistDPhi300_500_EMCEGA[i];
570  delete fHistDPhi500_800_EMCEGA[i];
571  delete fHistDPhi800_1_EMCEGA[i];
572  delete fHistDPhi1_2_EMCEGA[i];
573  delete fHistDPhi2_3_EMCEGA[i];
574  delete fHistDPhi3_4_EMCEGA[i];
575  delete fHistDPhi4_EMCEGA[i];
576 
577  delete fHistDPhi300_500_EMCJet[i];
578  delete fHistDPhi500_800_EMCJet[i];
579  delete fHistDPhi800_1_EMCJet[i];
580  delete fHistDPhi1_2_EMCJet[i];
581  delete fHistDPhi2_3_EMCJet[i];
582  delete fHistDPhi3_4_EMCJet[i];
583  delete fHistDPhi4_EMCJet[i];
584 
585  //ME histos
586  delete fHistDPhiMix300_500_MB[i];
587  delete fHistDPhiMix500_800_MB[i];
588  delete fHistDPhiMix800_1_MB[i];
589  delete fHistDPhiMix1_2_MB[i];
590  delete fHistDPhiMix2_3_MB[i];
591  delete fHistDPhiMix3_4_MB[i];
592  delete fHistDPhiMix4_MB[i];
593 
594  delete fHistDPhiMix300_500_EMC7[i];
595  delete fHistDPhiMix500_800_EMC7[i];
596  delete fHistDPhiMix800_1_EMC7[i];
597  delete fHistDPhiMix1_2_EMC7[i];
598  delete fHistDPhiMix2_3_EMC7[i];
599  delete fHistDPhiMix3_4_EMC7[i];
600  delete fHistDPhiMix4_EMC7[i];
601 
602  delete fHistDPhiMix300_500_EMCEGA[i];
603  delete fHistDPhiMix500_800_EMCEGA[i];
604  delete fHistDPhiMix800_1_EMCEGA[i];
605  delete fHistDPhiMix1_2_EMCEGA[i];
606  delete fHistDPhiMix2_3_EMCEGA[i];
607  delete fHistDPhiMix3_4_EMCEGA[i];
608  delete fHistDPhiMix4_EMCEGA[i];
609 
610  delete fHistDPhiMix300_500_EMCJet[i];
611  delete fHistDPhiMix500_800_EMCJet[i];
612  delete fHistDPhiMix800_1_EMCJet[i];
613  delete fHistDPhiMix1_2_EMCJet[i];
614  delete fHistDPhiMix2_3_EMCJet[i];
615  delete fHistDPhiMix3_4_EMCJet[i];
616  delete fHistDPhiMix4_EMCJet[i];
617  }
618 
619  //Init PID Plots here since they are stored in Arrays
620  for(Int_t i=0;i<6;i++){
621  //MB Plots
622  delete fHistTPC_EMCTRD_MB[i];
623 
624  delete fHistEMC_TPCTRD_MB[i];
625 
626  delete fHistTRD_TPCEMC_MB[i];
627 
628  //EMC7 Plots
629  delete fHistTPC_EMCTRD_EMC7[i];
630 
631  delete fHistEMC_TPCTRD_EMC7[i];
632 
633  delete fHistTRD_TPCEMC_EMC7[i];
634 
635  //EMCEGA Plots
636  delete fHistTPC_EMCTRD_EMCEGA[i];
637 
638  delete fHistEMC_TPCTRD_EMCEGA[i];
639 
640  delete fHistTRD_TPCEMC_EMCEGA[i];
641 
642  //EMCJet Plots
643  delete fHistTPC_EMCTRD_EMCJet[i];
644 
645  delete fHistEMC_TPCTRD_EMCJet[i];
646 
647  delete fHistTRD_TPCEMC_EMCJet[i];
648 
649  }
650 
651  delete fTrackCutsStrong;
652  delete fTrackCutsWeak;
653 }
654 
655 //________________________________________________________________________
657  // Create histograms
658  // Called once (on the worker node)
659 
660  fOutputMB = new TList();
661  OpenFile(1);
662  fOutputMB->SetOwner(); // IMPORTANT!
663  fOutputEMC7 = new TList();
664  OpenFile(2);
665  fOutputEMC7->SetOwner(); // IMPORTANT!
666  fOutputEMCEGA = new TList();
667  OpenFile(3);
668  fOutputEMCEGA->SetOwner(); // IMPORTANT!
669  fOutputEMCJet = new TList();
670  OpenFile(4);
671  fOutputEMCJet->SetOwner(); // IMPORTANT!
672 
673  //Initialize event pool stuff
674  Double_t vertexBins[5] = { -10, -4, 0, 4, 10 };
675  Int_t nZvtxBins = 4;
676  Double_t multBins[4] = {0, 200, 500, 1000};
677  Int_t nMultBins = 3;
678 
679  fPoolMan = new AliEventPoolManager(50, 50, nMultBins, multBins, nZvtxBins, vertexBins);
680  fPoolMan->Validate();
681 
682  //Some strings for histograms
683  TString ptRangesDPhi[3] = {"1-2Gev", "2-4Gev", "4-8Gev"};
684  TString ptRangesPID[6] = {"1-2GeV", "2-3GeV", "3-4GeV", "4-5GeV", "5-6GeV", ">6GeV"};
685  TString ptRangesRegion[4] = {"1-2Gev", "2-4Gev", "4-6Gev", ">6Gev"};
686 
687  //Strong cuts for heavy flavour
688  fTrackCutsStrong = new AliESDtrackCuts();
689  // TPC
690  fTrackCutsStrong->SetRequireTPCRefit(kTRUE);
691  // ITS
692  fTrackCutsStrong->SetRequireITSRefit(kTRUE);
693  // 7*(0.0026+0.0050/pt^1.01)
694  fTrackCutsStrong->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
695  fTrackCutsStrong->SetMaxDCAToVertexZ(2);
696  fTrackCutsStrong->SetDCAToVertex2D(kFALSE);
697  fTrackCutsStrong->SetRequireSigmaToVertex(kFALSE);
698  fTrackCutsStrong->SetMaxChi2PerClusterITS(36);
699  fTrackCutsStrong->SetMinNClustersTPC(120);
700  fTrackCutsStrong->SetMinNClustersITS(4);
701  fTrackCutsStrong->SetPtRange(1,10e10);
702  fTrackCutsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
703  fTrackCutsStrong->SetMaxChi2PerClusterTPC(2);
704  fTrackCutsStrong->SetMaxDCAToVertexXY(1);
705  fTrackCutsStrong->SetMaxDCAToVertexZ(2);
706  fTrackCutsStrong->SetEtaRange(-.6, .6);
707  fTrackCutsStrong->SetAcceptKinkDaughters(kFALSE);
708 
709  //Weak cuts for heavy flavour
710  fTrackCutsWeak = new AliESDtrackCuts();
711  // TPC
712  fTrackCutsWeak->SetRequireTPCRefit(kTRUE);
713  // ITS
714  fTrackCutsWeak->SetRequireITSRefit(kTRUE);
715  // 7*(0.0026+0.0050/pt^1.01)
716  fTrackCutsWeak->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
717  fTrackCutsWeak->SetMaxDCAToVertexZ(2);
718  fTrackCutsWeak->SetDCAToVertex2D(kFALSE);
719  fTrackCutsWeak->SetRequireSigmaToVertex(kFALSE);
720  fTrackCutsWeak->SetMaxChi2PerClusterITS(36);
721  fTrackCutsWeak->SetMinNClustersTPC(80);
722  fTrackCutsWeak->SetMinNClustersITS(3);
723  fTrackCutsWeak->SetPtRange(1,10e10);
724  fTrackCutsWeak->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
725  fTrackCutsWeak->SetMaxChi2PerClusterTPC(4);
726  //fTrackCutsWeak->SetMaxDCAToVertexXY(2);
727  //fTrackCutsWeak->SetMaxDCAToVertexZ(3);
728  fTrackCutsWeak->SetEtaRange(-.7, .7);
729  fTrackCutsWeak->SetAcceptKinkDaughters(kFALSE);
730 
731  // Create histograms
732 
733  //Photonic e mismatch histo
734 
735  fHistPhotoMismatch_MB = new TH1F("fHistPhotoMismatch_MB", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
736  fHistPhotoMismatch_MB->GetXaxis()->SetTitle("Electrons");
737  fHistPhotoMismatch_MB->GetYaxis()->SetTitle("Cts");
738 
739  fHistPhotoMismatch_EMC7 = new TH1F("fHistPhotoMismatch_EMC7", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
740  fHistPhotoMismatch_EMC7->GetXaxis()->SetTitle("Electrons");
741  fHistPhotoMismatch_EMC7->GetYaxis()->SetTitle("Cts");
742 
743  fHistPhotoMismatch_EMCEGA = new TH1F("fHistPhotoMismatch_EMCEGA", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
744  fHistPhotoMismatch_EMCEGA->GetXaxis()->SetTitle("Electrons");
745  fHistPhotoMismatch_EMCEGA->GetYaxis()->SetTitle("Cts");
746 
747  fHistPhotoMismatch_EMCJet = new TH1F("fHistPhotoMismatch_EMCJet", "Electrons identified as 'heavy flavour' that fall in photonic invariant mass and opening angle cuts", 2, 0, 1);
748  fHistPhotoMismatch_EMCJet->GetXaxis()->SetTitle("Electrons");
749  fHistPhotoMismatch_EMCJet->GetYaxis()->SetTitle("Cts");
750 
751  //Invariant mass histos
752 
753  fHistInvMassElecLike_MB = new TH1F("fHistInvMassElecLike_MB", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
754  fHistInvMassElecLike_MB->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
755  fHistInvMassElecLike_MB->GetYaxis()->SetTitle("Cts");
756 
757  fHistInvMassElecLike_EMC7 = new TH1F("fHistInvMassElecLike_EMC7", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
758  fHistInvMassElecLike_EMC7->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
759  fHistInvMassElecLike_EMC7->GetYaxis()->SetTitle("Cts");
760 
761  fHistInvMassElecLike_EMCEGA = new TH1F("fHistInvMassElecLike_EMCEGA", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
762  fHistInvMassElecLike_EMCEGA->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
763  fHistInvMassElecLike_EMCEGA->GetYaxis()->SetTitle("Cts");
764 
765  fHistInvMassElecLike_EMCJet = new TH1F("fHistInvMassElecLike_EMCJet", "Invariant mass for all like-signed electron pairs", 100, 0, .5);
766  fHistInvMassElecLike_EMCJet->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
767  fHistInvMassElecLike_EMCJet->GetYaxis()->SetTitle("Cts");
768 
769  fHistInvMassElecUnLike_MB = new TH1F("fHistInvMassElecUnLike_MB", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
770  fHistInvMassElecUnLike_MB->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
771  fHistInvMassElecUnLike_MB->GetYaxis()->SetTitle("Cts");
772 
773  fHistInvMassElecUnLike_EMC7 = new TH1F("fHistInvMassElecUnLike_EMC7", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
774  fHistInvMassElecUnLike_EMC7->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
775  fHistInvMassElecUnLike_EMC7->GetYaxis()->SetTitle("Cts");
776 
777  fHistInvMassElecUnLike_EMCEGA = new TH1F("fHistInvMassElecUnLike_EMCEGA", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
778  fHistInvMassElecUnLike_EMCEGA->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
779  fHistInvMassElecUnLike_EMCEGA->GetYaxis()->SetTitle("Cts");
780 
781  fHistInvMassElecUnLike_EMCJet = new TH1F("fHistInvMassElecUnLike_EMCJet", "Invariant mass for all unlike-signed electron pairs", 100, 0, .5);
782  fHistInvMassElecUnLike_EMCJet->GetXaxis()->SetTitle("Invariant Mass(Gev/c^2)");
783  fHistInvMassElecUnLike_EMCJet->GetYaxis()->SetTitle("Cts");
784 
785  //Opening Angle Histos
786 
787  fHistOpAngElecLike_MB = new TH1F("fHistOpAngElecLike_MB", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
788  fHistOpAngElecLike_MB->GetXaxis()->SetTitle("Opening Angle(rad)");
789  fHistOpAngElecLike_MB->GetYaxis()->SetTitle("Cts");
790 
791  fHistOpAngElecLike_EMC7 = new TH1F("fHistOpAngElecLike_EMC7", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
792  fHistOpAngElecLike_EMC7->GetXaxis()->SetTitle("Opening Angle(rad)");
793  fHistOpAngElecLike_EMC7->GetYaxis()->SetTitle("Cts");
794 
795  fHistOpAngElecLike_EMCEGA = new TH1F("fHistOpAngElecLike_EMCEGA", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
796  fHistOpAngElecLike_EMCEGA->GetXaxis()->SetTitle("Opening Angle(rad)");
797  fHistOpAngElecLike_EMCEGA->GetYaxis()->SetTitle("Cts");
798 
799  fHistOpAngElecLike_EMCJet = new TH1F("fHistOpAngElecLike_EMCJet", "Opening angle for all like-signed electron pairs", 100, 0, TMath::Pi());
800  fHistOpAngElecLike_EMCJet->GetXaxis()->SetTitle("Opening Angle(rad)");
801  fHistOpAngElecLike_EMCJet->GetYaxis()->SetTitle("Cts");
802 
803  fHistOpAngElecUnLike_MB = new TH1F("fHistOpAngElecUnLike_MB", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
804  fHistOpAngElecUnLike_MB->GetXaxis()->SetTitle("Opening Angle(rad)");
805  fHistOpAngElecUnLike_MB->GetYaxis()->SetTitle("Cts");
806 
807  fHistOpAngElecUnLike_EMC7 = new TH1F("fHistOpAngElecUnLike_EMC7", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
808  fHistOpAngElecUnLike_EMC7->GetXaxis()->SetTitle("Opening Angle(rad)");
809  fHistOpAngElecUnLike_EMC7->GetYaxis()->SetTitle("Cts");
810 
811  fHistOpAngElecUnLike_EMCEGA = new TH1F("fHistOpAngElecUnLike_EMCEGA", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
812  fHistOpAngElecUnLike_EMCEGA->GetXaxis()->SetTitle("Opening Angle(rad)");
813  fHistOpAngElecUnLike_EMCEGA->GetYaxis()->SetTitle("Cts");
814 
815  fHistOpAngElecUnLike_EMCJet = new TH1F("fHistOpAngElecUnLike_EMCJet", "Opening angle for all unlike-signed electron pairs", 100, 0, TMath::Pi());
816  fHistOpAngElecUnLike_EMCJet->GetXaxis()->SetTitle("Opening Angle(rad)");
817  fHistOpAngElecUnLike_EMCJet->GetYaxis()->SetTitle("Cts");
818 
819  //Rejection Histos
820 
821  fHistPIDRejection = new TH1F("fHistPIDRejection", "PID rejection counts for each detector.", 4, 1, 4);
822  fHistPIDRejection->GetXaxis()->SetTitle("Detector");
823  fHistPIDRejection->GetYaxis()->SetTitle("Cts");
824  fHistPIDRejection->GetXaxis()->SetBinLabel(1, "TPC");
825  fHistPIDRejection->GetXaxis()->SetBinLabel(2, "TOF");
826  fHistPIDRejection->GetXaxis()->SetBinLabel(3, "TRD");
827  fHistPIDRejection->GetXaxis()->SetBinLabel(4, "EMC");
828 
829  //Number of electrons per event histo
830  fHistNElecPerEvent = new TH1F("fHistNElecPerEvent", "Number of tagged electrons per event", 5, 1, 5);
831  fHistNElecPerEvent->GetXaxis()->SetTitle("Num. of Electrons");
832  fHistNElecPerEvent->GetYaxis()->SetTitle("Cts");
833 
834  //PID Plots
835 
836  //TPC PID Plots
837  for(Int_t i=0; i<6; i++){
838  //MB
839  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);
840  fHistTPC_EMCTRD_MB[i]->GetXaxis()->SetTitle("Pt");
841  fHistTPC_EMCTRD_MB[i]->GetYaxis()->SetTitle("nSigma");
842 
843  //EMC7
844  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);
845  fHistTPC_EMCTRD_EMC7[i]->GetXaxis()->SetTitle("Pt");
846  fHistTPC_EMCTRD_EMC7[i]->GetYaxis()->SetTitle("nSigma");
847 
848  //EMCEGA
849  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);
850  fHistTPC_EMCTRD_EMCEGA[i]->GetXaxis()->SetTitle("Pt");
851  fHistTPC_EMCTRD_EMCEGA[i]->GetYaxis()->SetTitle("nSigma");
852 
853  //EMCJet
854  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);
855  fHistTPC_EMCTRD_EMCJet[i]->GetXaxis()->SetTitle("Pt");
856  fHistTPC_EMCTRD_EMCJet[i]->GetYaxis()->SetTitle("nSigma");
857  }
858 
859  //EMC PID Plots
860  for(Int_t i=0; i<6; i++){
861  //MB
862  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);
863  fHistEMC_TPCTRD_MB[i]->GetXaxis()->SetTitle("E/p");
864  fHistEMC_TPCTRD_MB[i]->GetYaxis()->SetTitle("Cts");
865 
866  //EMC7
867  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);
868  fHistEMC_TPCTRD_EMC7[i]->GetXaxis()->SetTitle("E/p");
869  fHistEMC_TPCTRD_EMC7[i]->GetYaxis()->SetTitle("Cts");
870 
871  //EMCEGA
872  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);
873  fHistEMC_TPCTRD_EMCEGA[i]->GetXaxis()->SetTitle("E/p");
874  fHistEMC_TPCTRD_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
875 
876  //EMCJet
877  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);
878  fHistEMC_TPCTRD_EMCJet[i]->GetXaxis()->SetTitle("E/p");
879  fHistEMC_TPCTRD_EMCJet[i]->GetYaxis()->SetTitle("Cts");
880  }
881 
882  //TRD PID Plots
883  for(Int_t i=0; i<6; i++){
884  //MB
885  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);
886  fHistTRD_TPCEMC_MB[i]->GetXaxis()->SetTitle("Pt");
887  fHistTRD_TPCEMC_MB[i]->GetYaxis()->SetTitle("electron Likelihood");
888 
889  //EMC7
890  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);
891  fHistTRD_TPCEMC_EMC7[i]->GetXaxis()->SetTitle("Pt");
892  fHistTRD_TPCEMC_EMC7[i]->GetYaxis()->SetTitle("electron Likelihood");
893 
894  //EMCEGA
895  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);
896  fHistTRD_TPCEMC_EMCEGA[i]->GetXaxis()->SetTitle("Pt");
897  fHistTRD_TPCEMC_EMCEGA[i]->GetYaxis()->SetTitle("electron Likelihood");
898 
899  //EMCJet
900  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);
901  fHistTRD_TPCEMC_EMCJet[i]->GetXaxis()->SetTitle("Pt");
902  fHistTRD_TPCEMC_EMCJet[i]->GetYaxis()->SetTitle("electron Likelihood");
903  }
904 
905  //DPhi for candidate electrons 2-8 gev and assoc. particles >3gev
906  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);
907  fHistDPhi28_MB->GetXaxis()->SetTitle("Delta-Phi");
908  fHistDPhi28_MB->GetYaxis()->SetTitle("Cts");
909 
910  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);
911  fHistDPhi28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
912  fHistDPhi28_EMC7->GetYaxis()->SetTitle("Cts");
913 
914  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);
915  fHistDPhi28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
916  fHistDPhi28_EMCEGA->GetYaxis()->SetTitle("Cts");
917 
918  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);
919  fHistDPhi28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
920  fHistDPhi28_EMCJet->GetYaxis()->SetTitle("Cts");
921 
922  //DPhi by Eta for triggered particles 2-8 gev and assoc. particles >3gev
923  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);
924  fHistDPhiDEta28_MB->GetXaxis()->SetTitle("Delta-Phi");
925  fHistDPhiDEta28_MB->GetYaxis()->SetTitle("Delta-Eta");
926  fHistDPhiDEta28_MB->GetZaxis()->SetTitle("Cts");
927 
928  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);
929  fHistDPhiDEta28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
930  fHistDPhiDEta28_EMC7->GetYaxis()->SetTitle("Delta-Eta");
931  fHistDPhiDEta28_EMC7->GetZaxis()->SetTitle("Cts");
932 
933  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);
934  fHistDPhiDEta28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
935  fHistDPhiDEta28_EMCEGA->GetYaxis()->SetTitle("Delta-Eta");
936  fHistDPhiDEta28_EMCEGA->GetZaxis()->SetTitle("Cts");
937 
938  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);
939  fHistDPhiDEta28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
940  fHistDPhiDEta28_EMCJet->GetYaxis()->SetTitle("Delta-Eta");
941  fHistDPhiDEta28_EMCJet->GetZaxis()->SetTitle("Cts");
942 
943  //DPhi for candidate electrons 2-8 gev and assoc. particles >2Gev for Mixed Events
944  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);
945  fHistDPhiMix28_MB->GetXaxis()->SetTitle("Delta-Phi");
946  fHistDPhiMix28_MB->GetYaxis()->SetTitle("Cts");
947 
948  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);
949  fHistDPhiMix28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
950  fHistDPhiMix28_EMC7->GetYaxis()->SetTitle("Cts");
951 
952  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);
953  fHistDPhiMix28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
954  fHistDPhiMix28_EMCEGA->GetYaxis()->SetTitle("Cts");
955 
956  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);
957  fHistDPhiMix28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
958  fHistDPhiMix28_EMCJet->GetYaxis()->SetTitle("Cts");
959 
960  //DPhi by Eta for triggered particles 2-8 gev and assoc. particles >3gev
961  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);
962  fHistDPhiDEtaMix28_MB->GetXaxis()->SetTitle("Delta-Phi");
963  fHistDPhiDEtaMix28_MB->GetYaxis()->SetTitle("Delta-Eta");
964  fHistDPhiDEtaMix28_MB->GetZaxis()->SetTitle("Cts");
965 
966  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);
967  fHistDPhiDEtaMix28_EMC7->GetXaxis()->SetTitle("Delta-Phi");
968  fHistDPhiDEtaMix28_EMC7->GetYaxis()->SetTitle("Delta-Eta");
969  fHistDPhiDEtaMix28_EMC7->GetZaxis()->SetTitle("Cts");
970 
971  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);
972  fHistDPhiDEtaMix28_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
973  fHistDPhiDEtaMix28_EMCEGA->GetYaxis()->SetTitle("Delta-Eta");
974  fHistDPhiDEtaMix28_EMCEGA->GetZaxis()->SetTitle("Cts");
975 
976  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);
977  fHistDPhiDEtaMix28_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
978  fHistDPhiDEtaMix28_EMCJet->GetYaxis()->SetTitle("Delta-Eta");
979  fHistDPhiDEtaMix28_EMCJet->GetZaxis()->SetTitle("Cts");
980 
981  //DPhi by dEdx for triggered particles 2-8 gev and assoc. particles >2gev
982  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);
983  fHistDPhi18Spe_MB->GetXaxis()->SetTitle("Delta-Phi");
984  fHistDPhi18Spe_MB->GetYaxis()->SetTitle("Species");
985  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(1, "Unkown");
986  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(2, "Electron");
987  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(3, "Muon");
988  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(4, "Pion");
989  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(5, "Kaon");
990  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(6, "Proton");
991  fHistDPhi18Spe_MB->GetYaxis()->SetBinLabel(7, "Deuteron");
992  fHistDPhi18Spe_MB->GetZaxis()->SetTitle("Cts");
993 
994  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);
995  fHistDPhi18Spe_EMC7->GetXaxis()->SetTitle("Delta-Phi");
996  fHistDPhi18Spe_EMC7->GetYaxis()->SetTitle("Species");
997  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(1, "Unkown");
998  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(2, "Electron");
999  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(3, "Muon");
1000  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(4, "Pion");
1001  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(5, "Kaon");
1002  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(6, "Proton");
1003  fHistDPhi18Spe_EMC7->GetYaxis()->SetBinLabel(7, "Deuteron");
1004  fHistDPhi18Spe_EMC7->GetZaxis()->SetTitle("Cts");
1005 
1006  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);
1007  fHistDPhi18Spe_EMCEGA->GetXaxis()->SetTitle("Delta-Phi");
1008  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetTitle("Species");
1009  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(1, "Unkown");
1010  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(2, "Electron");
1011  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(3, "Muon");
1012  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(4, "Pion");
1013  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(5, "Kaon");
1014  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(6, "Proton");
1015  fHistDPhi18Spe_EMCEGA->GetYaxis()->SetBinLabel(7, "Deuteron");
1016  fHistDPhi18Spe_EMCEGA->GetZaxis()->SetTitle("Cts");
1017 
1018  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);
1019  fHistDPhi18Spe_EMCJet->GetXaxis()->SetTitle("Delta-Phi");
1020  fHistDPhi18Spe_EMCJet->GetYaxis()->SetTitle("Species");
1021  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(1, "Unkown");
1022  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(2, "Electron");
1023  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(3, "Muon");
1024  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(4, "Pion");
1025  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(5, "Kaon");
1026  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(6, "Proton");
1027  fHistDPhi18Spe_EMCJet->GetYaxis()->SetBinLabel(7, "Deuteron");
1028  fHistDPhi18Spe_EMCJet->GetZaxis()->SetTitle("Cts");
1029 
1030  // Delta Phi for tracks > 300MeV
1031  for(Int_t i=0; i<3; i++){
1032  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);
1033  fHistDPhi300_500_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1034  fHistDPhi300_500_MB[i]->GetYaxis()->SetTitle("Cts");
1035  }
1036 
1037  for(Int_t i=0; i<3; i++){
1038  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);
1039  fHistDPhi300_500_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1040  fHistDPhi300_500_EMC7[i]->GetYaxis()->SetTitle("Cts");
1041  }
1042 
1043  for(Int_t i=0; i<3; i++){
1044  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);
1045  fHistDPhi300_500_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1046  fHistDPhi300_500_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1047  }
1048 
1049  for(Int_t i=0; i<3; i++){
1050  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);
1051  fHistDPhi300_500_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1052  fHistDPhi300_500_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1053  }
1054 
1055  // Delta Phi for tracks > 500MeV
1056  for(Int_t i=0; i<3; i++){
1057  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);
1058  fHistDPhi500_800_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1059  fHistDPhi500_800_MB[i]->GetYaxis()->SetTitle("Cts");
1060  }
1061 
1062  for(Int_t i=0; i<3; i++){
1063  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);
1064  fHistDPhi500_800_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1065  fHistDPhi500_800_EMC7[i]->GetYaxis()->SetTitle("Cts");
1066  }
1067 
1068  for(Int_t i=0; i<3; i++){
1069  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);
1070  fHistDPhi500_800_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1071  fHistDPhi500_800_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1072  }
1073 
1074  for(Int_t i=0; i<3; i++){
1075  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);
1076  fHistDPhi500_800_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1077  fHistDPhi500_800_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1078  }
1079 
1080  // Delta Phi for tracks > 800MeV
1081  for(Int_t i=0; i<3; i++){
1082  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);
1083  fHistDPhi800_1_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1084  fHistDPhi800_1_MB[i]->GetYaxis()->SetTitle("Cts");
1085  }
1086 
1087  for(Int_t i=0; i<3; i++){
1088  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);
1089  fHistDPhi800_1_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1090  fHistDPhi800_1_EMC7[i]->GetYaxis()->SetTitle("Cts");
1091  }
1092 
1093  for(Int_t i=0; i<3; i++){
1094  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);
1095  fHistDPhi800_1_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1096  fHistDPhi800_1_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1097  }
1098 
1099  for(Int_t i=0; i<3; i++){
1100  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);
1101  fHistDPhi800_1_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1102  fHistDPhi800_1_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1103  }
1104 
1105  // Delta Phi for tracks > 1GeV
1106  for(Int_t i=0; i<3; i++){
1107  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);
1108  fHistDPhi1_2_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1109  fHistDPhi1_2_MB[i]->GetYaxis()->SetTitle("Cts");
1110  }
1111 
1112  for(Int_t i=0; i<3; i++){
1113  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);
1114  fHistDPhi1_2_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1115  fHistDPhi1_2_EMC7[i]->GetYaxis()->SetTitle("Cts");
1116  }
1117 
1118  for(Int_t i=0; i<3; i++){
1119  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);
1120  fHistDPhi1_2_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1121  fHistDPhi1_2_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1122  }
1123 
1124  for(Int_t i=0; i<3; i++){
1125  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);
1126  fHistDPhi1_2_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1127  fHistDPhi1_2_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1128  }
1129 
1130  // Delta Phi for tracks > 2GeV
1131  for(Int_t i=0; i<3; i++){
1132  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);
1133  fHistDPhi2_3_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1134  fHistDPhi2_3_MB[i]->GetYaxis()->SetTitle("Cts");
1135  }
1136 
1137  for(Int_t i=0; i<3; i++){
1138  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);
1139  fHistDPhi2_3_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1140  fHistDPhi2_3_EMC7[i]->GetYaxis()->SetTitle("Cts");
1141  }
1142 
1143  for(Int_t i=0; i<3; i++){
1144  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);
1145  fHistDPhi2_3_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1146  fHistDPhi2_3_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1147  }
1148 
1149  for(Int_t i=0; i<3; i++){
1150  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);
1151  fHistDPhi2_3_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1152  fHistDPhi2_3_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1153  }
1154 
1155  // Delta Phi for tracks > 3GeV
1156  for(Int_t i=0; i<3; i++){
1157  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);
1158  fHistDPhi3_4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1159  fHistDPhi3_4_MB[i]->GetYaxis()->SetTitle("Cts");
1160  }
1161 
1162  for(Int_t i=0; i<3; i++){
1163  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);
1164  fHistDPhi3_4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1165  fHistDPhi3_4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1166  }
1167 
1168  for(Int_t i=0; i<3; i++){
1169  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);
1170  fHistDPhi3_4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1171  fHistDPhi3_4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1172  }
1173 
1174  for(Int_t i=0; i<3; i++){
1175  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);
1176  fHistDPhi3_4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1177  fHistDPhi3_4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1178  }
1179 
1180  // Delta Phi for tracks > 5GeV
1181  for(Int_t i=0; i<3; i++){
1182  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);
1183  fHistDPhi4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1184  fHistDPhi4_MB[i]->GetYaxis()->SetTitle("Cts");
1185  }
1186 
1187  for(Int_t i=0; i<3; i++){
1188  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);
1189  fHistDPhi4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1190  fHistDPhi4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1191  }
1192 
1193  for(Int_t i=0; i<3; i++){
1194  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);
1195  fHistDPhi4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1196  fHistDPhi4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1197  }
1198 
1199  for(Int_t i=0; i<3; i++){
1200  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);
1201  fHistDPhi4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1202  fHistDPhi4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1203  }
1204 
1205  //Mixed Event DPhi plots
1206 
1207  // Delta Phi for tracks > 300MeV
1208  for(Int_t i=0; i<3; i++){
1209  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);
1210  fHistDPhiMix300_500_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1211  fHistDPhiMix300_500_MB[i]->GetYaxis()->SetTitle("Cts");
1212  }
1213 
1214  for(Int_t i=0; i<3; i++){
1215  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);
1216  fHistDPhiMix300_500_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1217  fHistDPhiMix300_500_EMC7[i]->GetYaxis()->SetTitle("Cts");
1218  }
1219 
1220  for(Int_t i=0; i<3; i++){
1221  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);
1222  fHistDPhiMix300_500_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1223  fHistDPhiMix300_500_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1224  }
1225 
1226  for(Int_t i=0; i<3; i++){
1227  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);
1228  fHistDPhiMix300_500_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1229  fHistDPhiMix300_500_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1230  }
1231 
1232  // Delta Phi for tracks > 500MeV
1233  for(Int_t i=0; i<3; i++){
1234  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);
1235  fHistDPhiMix500_800_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1236  fHistDPhiMix500_800_MB[i]->GetYaxis()->SetTitle("Cts");
1237  }
1238 
1239  for(Int_t i=0; i<3; i++){
1240  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);
1241  fHistDPhiMix500_800_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1242  fHistDPhiMix500_800_EMC7[i]->GetYaxis()->SetTitle("Cts");
1243  }
1244 
1245  for(Int_t i=0; i<3; i++){
1246  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);
1247  fHistDPhiMix500_800_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1248  fHistDPhiMix500_800_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1249  }
1250 
1251  for(Int_t i=0; i<3; i++){
1252  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);
1253  fHistDPhiMix500_800_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1254  fHistDPhiMix500_800_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1255  }
1256 
1257  // Delta Phi for tracks > 800MeV
1258  for(Int_t i=0; i<3; i++){
1259  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);
1260  fHistDPhiMix800_1_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1261  fHistDPhiMix800_1_MB[i]->GetYaxis()->SetTitle("Cts");
1262  }
1263 
1264  for(Int_t i=0; i<3; i++){
1265  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);
1266  fHistDPhiMix800_1_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1267  fHistDPhiMix800_1_EMC7[i]->GetYaxis()->SetTitle("Cts");
1268  }
1269 
1270  for(Int_t i=0; i<3; i++){
1271  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);
1272  fHistDPhiMix800_1_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1273  fHistDPhiMix800_1_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1274  }
1275 
1276  for(Int_t i=0; i<3; i++){
1277  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);
1278  fHistDPhiMix800_1_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1279  fHistDPhiMix800_1_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1280  }
1281 
1282  // Delta Phi for tracks > 1GeV
1283  for(Int_t i=0; i<3; i++){
1284  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);
1285  fHistDPhiMix1_2_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1286  fHistDPhiMix1_2_MB[i]->GetYaxis()->SetTitle("Cts");
1287  }
1288 
1289  for(Int_t i=0; i<3; i++){
1290  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);
1291  fHistDPhiMix1_2_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1292  fHistDPhiMix1_2_EMC7[i]->GetYaxis()->SetTitle("Cts");
1293  }
1294 
1295  for(Int_t i=0; i<3; i++){
1296  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);
1297  fHistDPhiMix1_2_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1298  fHistDPhiMix1_2_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1299  }
1300 
1301  for(Int_t i=0; i<3; i++){
1302  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);
1303  fHistDPhiMix1_2_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1304  fHistDPhiMix1_2_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1305  }
1306 
1307  // Delta Phi for tracks > 2GeV
1308  for(Int_t i=0; i<3; i++){
1309  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);
1310  fHistDPhiMix2_3_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1311  fHistDPhiMix2_3_MB[i]->GetYaxis()->SetTitle("Cts");
1312  }
1313 
1314  for(Int_t i=0; i<3; i++){
1315  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);
1316  fHistDPhiMix2_3_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1317  fHistDPhiMix2_3_EMC7[i]->GetYaxis()->SetTitle("Cts");
1318  }
1319 
1320  for(Int_t i=0; i<3; i++){
1321  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);
1322  fHistDPhiMix2_3_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1323  fHistDPhiMix2_3_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1324  }
1325 
1326  for(Int_t i=0; i<3; i++){
1327  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);
1328  fHistDPhiMix2_3_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1329  fHistDPhiMix2_3_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1330  }
1331 
1332  // Delta Phi for tracks > 3GeV
1333  for(Int_t i=0; i<3; i++){
1334  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);
1335  fHistDPhiMix3_4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1336  fHistDPhiMix3_4_MB[i]->GetYaxis()->SetTitle("Cts");
1337  }
1338 
1339  for(Int_t i=0; i<3; i++){
1340  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);
1341  fHistDPhiMix3_4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1342  fHistDPhiMix3_4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1343  }
1344 
1345  for(Int_t i=0; i<3; i++){
1346  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);
1347  fHistDPhiMix3_4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1348  fHistDPhiMix3_4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1349  }
1350 
1351  for(Int_t i=0; i<3; i++){
1352  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);
1353  fHistDPhiMix3_4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1354  fHistDPhiMix3_4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1355  }
1356 
1357  // Delta Phi for tracks > 5GeV
1358  for(Int_t i=0; i<3; i++){
1359  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);
1360  fHistDPhiMix4_MB[i]->GetXaxis()->SetTitle("Delta-Phi");
1361  fHistDPhiMix4_MB[i]->GetYaxis()->SetTitle("Cts");
1362  }
1363 
1364  for(Int_t i=0; i<3; i++){
1365  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);
1366  fHistDPhiMix4_EMC7[i]->GetXaxis()->SetTitle("Delta-Phi");
1367  fHistDPhiMix4_EMC7[i]->GetYaxis()->SetTitle("Cts");
1368  }
1369 
1370  for(Int_t i=0; i<3; i++){
1371  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);
1372  fHistDPhiMix4_EMCEGA[i]->GetXaxis()->SetTitle("Delta-Phi");
1373  fHistDPhiMix4_EMCEGA[i]->GetYaxis()->SetTitle("Cts");
1374  }
1375 
1376  for(Int_t i=0; i<3; i++){
1377  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);
1378  fHistDPhiMix4_EMCJet[i]->GetXaxis()->SetTitle("Delta-Phi");
1379  fHistDPhiMix4_EMCJet[i]->GetYaxis()->SetTitle("Cts");
1380  }
1381 
1382  //Hadron e/p plot
1383  fHistEMC_Had_MB_1Gev = new TH1F("fHistEMC_Had_MB_1Gev", "E/p for hadrons with Pt between 1-2Gev", 100, 0, 1.5);
1384  fHistEMC_Had_MB_1Gev->GetXaxis()->SetTitle("E/p");
1385  fHistEMC_Had_MB_1Gev->GetYaxis()->SetTitle("Cts");
1386 
1387  // Eta-Phi distribution for tagged events
1388  fHistEtaPhiTag_MB = new TH2F("fHistEtaPhiTag_MB", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1389  fHistEtaPhiTag_MB->GetXaxis()->SetTitle("Eta");
1390  fHistEtaPhiTag_MB->GetYaxis()->SetTitle("Phi");
1391 
1392  fHistEtaPhiTag_EMC7 = new TH2F("fHistEtaPhiTag_EMC7", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1393  fHistEtaPhiTag_EMC7->GetXaxis()->SetTitle("Eta");
1394  fHistEtaPhiTag_EMC7->GetYaxis()->SetTitle("Phi");
1395 
1396  fHistEtaPhiTag_EMCEGA = new TH2F("fHistEtaPhiTag_EMCEGA", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1397  fHistEtaPhiTag_EMCEGA->GetXaxis()->SetTitle("Eta");
1398  fHistEtaPhiTag_EMCEGA->GetYaxis()->SetTitle("Phi");
1399 
1400  fHistEtaPhiTag_EMCJet = new TH2F("fHistEtaPhiTag_EMCJet", "Eta-Phi distribution of tracks in tagged events", 100, -.9,.9,100,0,2*TMath::Pi());
1401  fHistEtaPhiTag_EMCJet->GetXaxis()->SetTitle("Eta");
1402  fHistEtaPhiTag_EMCJet->GetYaxis()->SetTitle("Phi");
1403 
1404  // Eta-Phi distribution
1405  fHistEtaPhi_MB = new TH2F("fHistEtaPhi_MB", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1406  fHistEtaPhi_MB->GetXaxis()->SetTitle("Eta");
1407  fHistEtaPhi_MB->GetYaxis()->SetTitle("Phi");
1408 
1409  fHistEtaPhi_EMC7 = new TH2F("fHistEtaPhi_EMC7", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1410  fHistEtaPhi_EMC7->GetXaxis()->SetTitle("Eta");
1411  fHistEtaPhi_EMC7->GetYaxis()->SetTitle("Phi");
1412 
1413  fHistEtaPhi_EMCEGA = new TH2F("fHistEtaPhi_EMCEGA", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1414  fHistEtaPhi_EMCEGA->GetXaxis()->SetTitle("Eta");
1415  fHistEtaPhi_EMCEGA->GetYaxis()->SetTitle("Phi");
1416 
1417  fHistEtaPhi_EMCJet = new TH2F("fHistEtaPhi_EMCJet", "Eta-Phi distribution of tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1418  fHistEtaPhi_EMCJet->GetXaxis()->SetTitle("Eta");
1419  fHistEtaPhi_EMCJet->GetYaxis()->SetTitle("Phi");
1420 
1421  fHistEtaPhiTPCOnly_MB = new TH2F("fHistEtaPhiTPCOnly_MB", "Eta-Phi distribution of TPC only tracks", 100, -.9,.9,100,0,2*TMath::Pi());
1422  fHistEtaPhiTPCOnly_MB->GetXaxis()->SetTitle("Eta");
1423  fHistEtaPhiTPCOnly_MB->GetYaxis()->SetTitle("Phi");
1424 
1425  // Energy per event histos
1426  fHistPtSum_MB = new TH1F("fHistPtSum_MB", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1427  fHistPtSum_MB->GetXaxis()->SetTitle("Pt Sum");
1428  fHistPtSum_MB->GetYaxis()->SetTitle("Cts");
1429 
1430  fHistPtSum_EMC7 = new TH1F("fHistPtSum_EMC7", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1431  fHistPtSum_EMC7->GetXaxis()->SetTitle("Pt Sum");
1432  fHistPtSum_EMC7->GetYaxis()->SetTitle("Cts");
1433 
1434  fHistPtSum_EMCEGA = new TH1F("fHistPtSum_EMCEGA", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1435  fHistPtSum_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1436  fHistPtSum_EMCEGA->GetYaxis()->SetTitle("Cts");
1437 
1438  fHistPtSum_EMCJet = new TH1F("fHistPtSum_EMCJet", "Pt sum for events w/o an electron candidate", 500, 0, 500);
1439  fHistPtSum_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1440  fHistPtSum_EMCJet->GetYaxis()->SetTitle("Cts");
1441 
1442  // Energy per tagged event histos
1443  fHistPtSumTag_MB = new TH1F("fHistPtSumTag_MB", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1444  fHistPtSumTag_MB->GetXaxis()->SetTitle("Pt Sum");
1445  fHistPtSumTag_MB->GetYaxis()->SetTitle("Cts");
1446 
1447  fHistPtSumTag_EMC7 = new TH1F("fHistPtSumTag_EMC7", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1448  fHistPtSumTag_EMC7->GetXaxis()->SetTitle("Pt Sum");
1449  fHistPtSumTag_EMC7->GetYaxis()->SetTitle("Cts");
1450 
1451  fHistPtSumTag_EMCEGA = new TH1F("fHistPtSumTag_EMCEGA", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1452  fHistPtSumTag_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1453  fHistPtSumTag_EMCEGA->GetYaxis()->SetTitle("Cts");
1454 
1455  fHistPtSumTag_EMCJet = new TH1F("fHistPtSumTag_EMCJet", "Pt sum for events w/ an electron candidate", 500, 0, 500);
1456  fHistPtSumTag_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1457  fHistPtSumTag_EMCJet->GetYaxis()->SetTitle("Cts");
1458 
1459  // Energy per event in EMC acceptance histos
1460  fHistPtSumEMC_MB = new TH1F("fHistPtSumEMC_MB", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1461  fHistPtSumEMC_MB->GetXaxis()->SetTitle("Pt Sum");
1462  fHistPtSumEMC_MB->GetYaxis()->SetTitle("Cts");
1463 
1464  fHistPtSumEMC_EMC7 = new TH1F("fHistPtSumEMC_EMC7", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1465  fHistPtSumEMC_EMC7->GetXaxis()->SetTitle("Pt Sum");
1466  fHistPtSumEMC_EMC7->GetYaxis()->SetTitle("Cts");
1467 
1468  fHistPtSumEMC_EMCEGA = new TH1F("fHistPtSumEMC_EMCEGA", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1469  fHistPtSumEMC_EMCEGA->GetXaxis()->SetTitle("Pt Sum");
1470  fHistPtSumEMC_EMCEGA->GetYaxis()->SetTitle("Cts");
1471 
1472  fHistPtSumEMC_EMCJet = new TH1F("fHistPtSumEMC_EMCJet", "Pt sum for events in EMCal acceptance", 500, 0, 500);
1473  fHistPtSumEMC_EMCJet->GetXaxis()->SetTitle("Pt Sum");
1474  fHistPtSumEMC_EMCJet->GetYaxis()->SetTitle("Cts");
1475 
1476  // Numbers of events
1477  fHistNevents_MB = new TH1F("fHistNevents_MB", "Number of events that have an 'electron'", 2,0,1);
1478  fHistNevents_MB->GetXaxis()->SetBinLabel(1,"Events");
1479  fHistNevents_MB->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1480  fHistNevents_MB->GetYaxis()->SetTitle("Cts");
1481 
1482  fHistNevents_EMC7 = new TH1F("fHistNevents_EMC7", "Number of events that have an 'electron'", 2,0,1);
1483  fHistNevents_EMC7->GetXaxis()->SetBinLabel(1,"Events");
1484  fHistNevents_EMC7->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1485  fHistNevents_EMC7->GetYaxis()->SetTitle("Cts");
1486 
1487  fHistNevents_EMCEGA = new TH1F("fHistNevents_EMCEGA", "Number of events that have an 'electron'", 2,0,1);
1488  fHistNevents_EMCEGA->GetXaxis()->SetBinLabel(1,"Events");
1489  fHistNevents_EMCEGA->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1490  fHistNevents_EMCEGA->GetYaxis()->SetTitle("Cts");
1491 
1492  fHistNevents_EMCJet = new TH1F("fHistNevents_EMCJet", "Number of events that have an 'electron'", 2,0,1);
1493  fHistNevents_EMCJet->GetXaxis()->SetBinLabel(1,"Events");
1494  fHistNevents_EMCJet->GetXaxis()->SetBinLabel(2,"Events containing candidates");
1495  fHistNevents_EMCJet->GetYaxis()->SetTitle("Cts");
1496 
1497  //Impact Parameter histos
1498  fHistImpPar_MB = new TH1F("fHistImpPar_MB", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1499  fHistImpPar_MB->GetXaxis()->SetTitle("Impact Parameter(cm)");
1500  fHistImpPar_MB->GetYaxis()->SetTitle("Count");
1501 
1502  fHistImpPar_EMC7 = new TH1F("fHistImpPar_EMC7", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1503  fHistImpPar_EMC7->GetXaxis()->SetTitle("Impact Parameter(cm)");
1504  fHistImpPar_EMC7->GetYaxis()->SetTitle("Count");
1505 
1506  fHistImpPar_EMCEGA = new TH1F("fHistImpPar_EMCEGA", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1507  fHistImpPar_EMCEGA->GetXaxis()->SetTitle("Impact Parameter(cm)");
1508  fHistImpPar_EMCEGA->GetYaxis()->SetTitle("Count");
1509 
1510  fHistImpPar_EMCJet = new TH1F("fHistImpPar_EMCJet", "Impact Parameter distribution in xy plane for all tracks", 100,-1, 1);
1511  fHistImpPar_EMCJet->GetXaxis()->SetTitle("Impact Parameter(cm)");
1512  fHistImpPar_EMCJet->GetYaxis()->SetTitle("Count");
1513 
1514  //Impact Parameter for tagged electrons histos
1515  fHistImpParTag_MB = new TH1F("fHistImpParTag_MB", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1516  fHistImpParTag_MB->GetXaxis()->SetTitle("Impact Parameter(cm)");
1517  fHistImpParTag_MB->GetYaxis()->SetTitle("Count");
1518 
1519  fHistImpParTag_EMC7 = new TH1F("fHistImpParTag_EMC7", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1520  fHistImpParTag_EMC7->GetXaxis()->SetTitle("Impact Parameter(cm)");
1521  fHistImpParTag_EMC7->GetYaxis()->SetTitle("Count");
1522 
1523  fHistImpParTag_EMCEGA = new TH1F("fHistImpParTag_EMCEGA", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1524  fHistImpParTag_EMCEGA->GetXaxis()->SetTitle("Impact Parameter(cm)");
1525  fHistImpParTag_EMCEGA->GetYaxis()->SetTitle("Count");
1526 
1527  fHistImpParTag_EMCJet = new TH1F("fHistImpParTag_EMCJet", "Impact Parameter distribution in xy plane for electron candidates", 100,-1, 1);
1528  fHistImpParTag_EMCJet->GetXaxis()->SetTitle("Impact Parameter(cm)");
1529  fHistImpParTag_EMCJet->GetYaxis()->SetTitle("Count");
1530 
1531  //Number of clusters per track in TPC
1532  fHistTPCNClus_MB = new TH1F("fHistTPCNClus_MB", "Number of Clusters per track in TPC", 159, 0, 159);
1533  fHistTPCNClus_MB->GetXaxis()->SetTitle("Number of TPC Clusters");
1534  fHistTPCNClus_MB->GetYaxis()->SetTitle("Number of Tracks");
1535 
1536  fHistTPCNClus_EMC7 = new TH1F("fHistTPCNClus_EMC7", "Number of Clusters per track in TPC", 159, 0, 159);
1537  fHistTPCNClus_EMC7->GetXaxis()->SetTitle("Number of TPC Clusters");
1538  fHistTPCNClus_EMC7->GetYaxis()->SetTitle("Number of Tracks");
1539 
1540  fHistTPCNClus_EMCEGA = new TH1F("fHistTPCNClus_EMCEGA", "Number of Clusters per track in TPC", 159, 0, 159);
1541  fHistTPCNClus_EMCEGA->GetXaxis()->SetTitle("Number of TPC Clusters");
1542  fHistTPCNClus_EMCEGA->GetYaxis()->SetTitle("Number of Tracks");
1543 
1544  fHistTPCNClus_EMCJet = new TH1F("fHistTPCNClus_EMCJet", "Number of Clusters per track in TPC", 159, 0, 159);
1545  fHistTPCNClus_EMCJet->GetXaxis()->SetTitle("Number of TPC Clusters");
1546  fHistTPCNClus_EMCJet->GetYaxis()->SetTitle("Number of Tracks");
1547 
1548  //Number of clusters per track in ITS
1549  fHistITSNClus_MB = new TH1F("fHistITSNClus_MB", "Number of Clusters per Track in ITS", 10, 0, 10);
1550  fHistITSNClus_MB->GetXaxis()->SetTitle("Number of ITS Clusters");
1551  fHistITSNClus_MB->GetYaxis()->SetTitle("Number of Tracks");
1552 
1553  fHistITSNClus_EMC7 = new TH1F("fHistITSNClus_EMC7", "Number of Clusters per Track in ITS", 10, 0, 10);
1554  fHistITSNClus_EMC7->GetXaxis()->SetTitle("Number of ITS Clusters");
1555  fHistITSNClus_EMC7->GetYaxis()->SetTitle("Number of Tracks");
1556 
1557  fHistITSNClus_EMCEGA = new TH1F("fHistITSNClus_EMCEGA", "Number of Clusters per Track in ITS", 10, 0, 10);
1558  fHistITSNClus_EMCEGA->GetXaxis()->SetTitle("Number of ITS Clusters");
1559  fHistITSNClus_EMCEGA->GetYaxis()->SetTitle("Number of Tracks");
1560 
1561  fHistITSNClus_EMCJet = new TH1F("fHistITSNClus_EMCJet", "Number of Clusters per Track in ITS", 10, 0, 10);
1562  fHistITSNClus_EMCJet->GetXaxis()->SetTitle("Number of ITS Clusters");
1563  fHistITSNClus_EMCJet->GetYaxis()->SetTitle("Number of Tracks");
1564 
1565  // Pt distribution of all tracks and tagged tracks
1566  fHistPtAssoc_MB = new TH1F("fHistPtAssoc_MB", "Pt distribution for associated tracks", 100,0, 15);
1567  fHistPtAssoc_MB->GetXaxis()->SetTitle("Pt(Gev)");
1568  fHistPtAssoc_MB->GetYaxis()->SetTitle("Count");
1569 
1570  fHistPtAssoc_EMC7 = new TH1F("fHistPtAssoc_EMC7", "Pt distribution for associated tracks", 100,0, 15);
1571  fHistPtAssoc_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1572  fHistPtAssoc_EMC7->GetYaxis()->SetTitle("Count");
1573 
1574  fHistPtAssoc_EMCEGA = new TH1F("fHistPtAssoc_EMCEGA", "Pt distribution for associated tracks", 100,0, 15);
1575  fHistPtAssoc_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1576  fHistPtAssoc_EMCEGA->GetYaxis()->SetTitle("Count");
1577 
1578  fHistPtAssoc_EMCJet = new TH1F("fHistPtAssoc_EMCJet", "Pt distribution for associated tracks", 100,0, 15);
1579  fHistPtAssoc_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1580  fHistPtAssoc_EMCJet->GetYaxis()->SetTitle("Count");
1581 
1582  // Pt distribution of all tracks for mixed events
1583  fHistPtAssocMix_MB = new TH1F("fHistPtAssocMix_MB", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1584  fHistPtAssocMix_MB->GetXaxis()->SetTitle("Pt(Gev)");
1585  fHistPtAssocMix_MB->GetYaxis()->SetTitle("Count");
1586 
1587  fHistPtAssocMix_EMC7 = new TH1F("fHistPtAssocMix_EMC7", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1588  fHistPtAssocMix_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1589  fHistPtAssocMix_EMC7->GetYaxis()->SetTitle("Count");
1590 
1591  fHistPtAssocMix_EMCEGA = new TH1F("fHistPtAssocMix_EMCEGA", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1592  fHistPtAssocMix_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1593  fHistPtAssocMix_EMCEGA->GetYaxis()->SetTitle("Count");
1594 
1595  fHistPtAssocMix_EMCJet = new TH1F("fHistPtAssocMix_EMCJet", "Pt distribution for associated tracks in mixed events", 100,0, 15);
1596  fHistPtAssocMix_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1597  fHistPtAssocMix_EMCJet->GetYaxis()->SetTitle("Count");
1598 
1599  //Impact Parameter for tagged electrons histos
1600  fHistPtTag_MB = new TH1F("fHistPtTag_MB", "Pt distribution for electron candidates", 100,0, 15);
1601  fHistPtTag_MB->GetXaxis()->SetTitle("Pt(Gev)");
1602  fHistPtTag_MB->GetYaxis()->SetTitle("Count");
1603 
1604  fHistPtTag_EMC7 = new TH1F("fHistPtTag_EMC7", "Pt distribution for electron candidates", 100,0, 15);
1605  fHistPtTag_EMC7->GetXaxis()->SetTitle("Pt(Gev)");
1606  fHistPtTag_EMC7->GetYaxis()->SetTitle("Count");
1607 
1608  fHistPtTag_EMCEGA = new TH1F("fHistPtTag_EMCEGA", "Pt distribution for electron candidates", 100,0, 15);
1609  fHistPtTag_EMCEGA->GetXaxis()->SetTitle("Pt(Gev)");
1610  fHistPtTag_EMCEGA->GetYaxis()->SetTitle("Count");
1611 
1612  fHistPtTag_EMCJet = new TH1F("fHistPtTag_EMCJet", "Pt distribution for electron candidates", 100,0, 15);
1613  fHistPtTag_EMCJet->GetXaxis()->SetTitle("Pt(Gev)");
1614  fHistPtTag_EMCJet->GetYaxis()->SetTitle("Count");
1615 
1616  //test histos
1617  fHistTestDCA = new TH1F("fHistTestDCA", "DCA distribution for all tracks with DPhi to any candidate electron <0.1 rad", 100,-15, 15);
1618  fHistTestDCA->GetXaxis()->SetTitle("DCA(cm)");
1619  fHistTestDCA->GetYaxis()->SetTitle("Count");
1620 
1621  fHistTestEMCEnergy = new TH1F("fHistTestEMCEnergy", "Energy from EMCal for all tracks with DPhi to any candidate electron <0.1 rad", 100, 0, 10);
1622  fHistTestEMCEnergy->GetXaxis()->SetTitle("EMC Energy[GeV]");
1623  fHistTestEMCEnergy->GetYaxis()->SetTitle("Counts");
1624 
1625  fHistTestTPCdEdx = new TH2F("fHistTestTPCdEdx", "TPC dE/dx for all tracks with DPhi to any candidate electron <0.1 rad", 100, 0,8, 300, -30, 180);
1626  fHistTestTPCdEdx->GetYaxis()->SetTitle("TPC dE/dx[a.u.]");
1627  fHistTestTPCdEdx->GetXaxis()->SetTitle("pT[GeV/c]");
1628 
1629  fHistTestEOP = new TH1F("fHistTestEOP", "E/p for all tracks with DPhi to any candidate electron <0.1 rad", 30, 0, 1.5);
1630  fHistTestEOP->GetXaxis()->SetTitle("E/p[c]");
1631  fHistTestEOP->GetYaxis()->SetTitle("Counts");
1632 
1633  fHistTestOGDPhi = new TH1F("fHistTestOGDPhi", "Original DPhi before periodicity correction", 100, -2*TMath::Pi(), 2*TMath::Pi());
1634  fHistTestOGDPhi->GetXaxis()->SetTitle("DPhi[rad]");
1635  fHistTestOGDPhi->GetYaxis()->SetTitle("Counts");
1636 
1637  fHistTestPt = new TH1F("fHistTestPt", "Pt distribution for associated particles nearly on top of tagged particle", 30, 0, 8);
1638  fHistTestPt->GetXaxis()->SetTitle("Pt[Gev/c]");
1639  fHistTestPt->GetYaxis()->SetTitle("Cts");
1640 
1641  fHistTestInvMassElecLike = new TH1F("fHistTestInvMassElecLike", "Invariant Mass distribution for associated electrons of like sign in |DPhi|<0.1rad", 30, 0, 8);
1642  fHistTestInvMassElecLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1643  fHistTestInvMassElecLike->GetYaxis()->SetTitle("Cts");
1644 
1645  fHistTestInvMassElecUnLike = new TH1F("fHistTestInvMassElecUnLike", "Invariant Mass distribution for associated electrons of unlike sign with |DPhi|<0.1rad", 30, 0, 8);
1646  fHistTestInvMassElecUnLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1647  fHistTestInvMassElecUnLike->GetYaxis()->SetTitle("Cts");
1648 
1649  fHistTestInvMassPionLike = new TH1F("fHistTestInvMassPionLike", "Invariant Mass distribution for associated pions with |DPhi|<0.1rad", 30, 0, 8);
1650  fHistTestInvMassPionLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1651  fHistTestInvMassPionLike->GetYaxis()->SetTitle("Cts");
1652 
1653  fHistTestInvMassPionUnLike = new TH1F("fHistTestInvMassPionUnLike", "Invariant Mass distribution for associated pions with |DPhi|<0.1rad", 30, 0, 8);
1654  fHistTestInvMassPionUnLike->GetXaxis()->SetTitle("Mass[Gev/c^2]");
1655  fHistTestInvMassPionUnLike->GetYaxis()->SetTitle("Cts");
1656 
1657  //DPhi by dEdx for triggered particles 1-8 gev and assoc. particles >.3gev
1658  fHistTestDPhiSpeNoSec = new TH2F("fHistTestDPhiSpeNoSec", "Delta-Phi by most probable species for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev with no secondary tracks", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 10, 0, 10);
1659  fHistTestDPhiSpeNoSec->GetXaxis()->SetTitle("Delta-Phi");
1660  fHistTestDPhiSpeNoSec->GetYaxis()->SetTitle("Species");
1661  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(1, "Unkown");
1662  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(2, "Electron");
1663  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(3, "Muon");
1664  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(4, "Pion");
1665  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(5, "Kaon");
1666  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(6, "Proton");
1667  fHistTestDPhiSpeNoSec->GetYaxis()->SetBinLabel(7, "Deuteron");
1668  fHistTestDPhiSpeNoSec->GetZaxis()->SetTitle("Cts");
1669 
1670  //DPhi by track type to test for tpconly tracks for triggered particles 1-8 gev and assoc. particles >.3gev
1671  fHistTestDPhiType = new TH2F("fHistTestDPhiType", "Delta-Phi by track type for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2, 4, 0, 4);
1672  fHistTestDPhiType->GetXaxis()->SetTitle("Delta-Phi");
1673  fHistTestDPhiType->GetYaxis()->SetTitle("Track Type");
1674  fHistTestDPhiType->GetYaxis()->SetBinLabel(1, "Hybrid");
1675  fHistTestDPhiType->GetYaxis()->SetBinLabel(2, "Complementary");
1676  fHistTestDPhiType->GetYaxis()->SetBinLabel(3, "TPC Only");
1677  fHistTestDPhiType->GetZaxis()->SetTitle("Cts");
1678 
1679  //DPhi for candidate electrons 1-8 gev and assoc. particles >.3gev with secondaries
1680  fHistTestDPhi18Sec = new TH1F("fHistTestDPhi18Sec", "Delta-Phi for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1681  fHistTestDPhi18Sec->GetXaxis()->SetTitle("Delta-Phi");
1682  fHistTestDPhi18Sec->GetYaxis()->SetTitle("Cts");
1683 
1684  //DPhi for candidate electrons 1-8 gev and assoc. particles >.3gev without secondaries
1685  fHistTestDPhi18NoSec = new TH1F("fHistTestDPhi18NoSec", "Delta-Phi for candidate electrons with 1<pt<8Gev and assoc. with pt>.3Gev", 100, -TMath::Pi()/2, 3*TMath::Pi()/2);
1686  fHistTestDPhi18NoSec->GetXaxis()->SetTitle("Delta-Phi");
1687  fHistTestDPhi18NoSec->GetYaxis()->SetTitle("Cts");
1688 
1689  //Add rejection plots to MB plots since it is the easiest place
1692  //samesies for the test plots
1693  fOutputMB->Add(fHistTestDCA);
1696  fOutputMB->Add(fHistTestEOP);
1697  fOutputMB->Add(fHistTestOGDPhi);
1698  fOutputMB->Add(fHistTestPt);
1707 
1709  fOutputMB->Add(fHistPtAssoc_MB);
1711  fOutputMB->Add(fHistPtTag_MB);
1714  fOutputMB->Add(fHistImpPar_MB);
1716  fOutputMB->Add(fHistNevents_MB);
1717  fOutputMB->Add(fHistPtSum_MB);
1720  fOutputMB->Add(fHistEtaPhi_MB);
1728  for(Int_t i=0; i<6;i++){
1729  fOutputMB->Add(fHistTPC_EMCTRD_MB[i]);
1730 
1731  fOutputMB->Add(fHistEMC_TPCTRD_MB[i]);
1732 
1733  fOutputMB->Add(fHistTRD_TPCEMC_MB[i]);
1734 
1735  }
1736  for(Int_t i=0; i<3;i++){
1737  fOutputMB->Add(fHistDPhi300_500_MB[i]);
1738  fOutputMB->Add(fHistDPhi500_800_MB[i]);
1739  fOutputMB->Add(fHistDPhi800_1_MB[i]);
1740  fOutputMB->Add(fHistDPhi1_2_MB[i]);
1741  fOutputMB->Add(fHistDPhi2_3_MB[i]);
1742  fOutputMB->Add(fHistDPhi3_4_MB[i]);
1743  fOutputMB->Add(fHistDPhi4_MB[i]);
1747  fOutputMB->Add(fHistDPhiMix1_2_MB[i]);
1748  fOutputMB->Add(fHistDPhiMix2_3_MB[i]);
1749  fOutputMB->Add(fHistDPhiMix3_4_MB[i]);
1750  fOutputMB->Add(fHistDPhiMix4_MB[i]);
1751  }
1752  fOutputMB->Add(fHistDPhi28_MB);
1757 
1776  for(Int_t i=0; i<6;i++){
1778 
1780 
1782 
1783  }
1784  for(Int_t i=0; i<3;i++){
1788  fOutputEMC7->Add(fHistDPhi1_2_EMC7[i]);
1789  fOutputEMC7->Add(fHistDPhi2_3_EMC7[i]);
1790  fOutputEMC7->Add(fHistDPhi3_4_EMC7[i]);
1791  fOutputEMC7->Add(fHistDPhi4_EMC7[i]);
1799  }
1805 
1824  for(Int_t i=0; i<6;i++){
1826 
1828 
1830 
1831  }
1832  for(Int_t i=0; i<3;i++){
1847  }
1853 
1872  for(Int_t i=0; i<6;i++){
1874 
1876 
1878 
1879  }
1880  for(Int_t i=0; i<3;i++){
1895  }
1901 
1902  // NEW HISTO added to fOutput here
1903  PostData(1, fOutputMB);
1904  PostData(2, fOutputEMC7);
1905  PostData(3, fOutputEMCEGA);
1906  PostData(4, fOutputEMCJet);// Post data for ALL output slots >0 here, to get at least an empty histogram
1907 }
1908 
1909 //________________________________________________________________________
1911 {
1912  // Main loop
1913  // Called for each event
1914 
1915  //_______________________________Major event-level stuff____________________________________
1916  // Create pointer to reconstructed event
1917  AliVEvent *event = InputEvent();
1918  if (!event) { Printf("ERROR: Could not retrieve event"); return; }
1919 
1920  // create pointer to event
1921  AliAODEvent* aod = dynamic_cast<AliAODEvent*>(event);
1922  if (!aod) {
1923  AliError("Cannot get the AOD event");
1924  return;
1925  }
1926 
1927  // input handler
1928  const AliAnalysisManager* man(AliAnalysisManager::GetAnalysisManager());
1929  if (NULL == man) {
1930  AliWarning("AliAnalysisManager is not available");
1931  return;
1932  }
1933 
1934  AliInputEventHandler* inputHandler = (AliInputEventHandler*)man->GetInputEventHandler();
1935  if (!inputHandler) {
1936  AliWarning("AliInputEventHandler is not available");
1937  return;
1938  }
1939 
1940  UInt_t fSelectMask = inputHandler->IsEventSelected();
1941 
1942  Bool_t isSelected = fSelectMask & (AliVEvent::kEMC7 | AliVEvent::kEMCEJE | AliVEvent::kEMCEGA);
1943  if(!isSelected){
1944  AliWarning("This is not an EMCal triggered event");
1945  }
1946 
1947  MBtrg = fSelectMask & AliVEvent::kAnyINT;
1948  EMC7trg = fSelectMask & AliVEvent::kEMC7;
1949  EMCEGAtrg = fSelectMask & AliVEvent::kEMCEGA;
1950  EMCJettrg = fSelectMask & AliVEvent::kEMCEJE;
1951 
1953 
1954  Int_t elecIDs[1000];
1955  Int_t elecCnt=0;
1956 
1957  AliPIDResponse* fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
1958 
1959  if(!fPIDResponse){
1960  AliWarning("NULL PIDResponse");
1961  }
1962 
1963  TObjArray* trkArr = MakeTrkArr(aod);
1964  Bool_t delTrk = kTRUE;
1965 
1966  //__________________________End major event stuff_____________________________
1967 
1968 
1969  //Fill the histogram cataloguing # of events vs. events tagged
1970  if(MBtrg){
1971  fHistNevents_MB->Fill("Events",1);
1972  }
1973  switch(trigVal){
1974  case(EMC7):
1975  fHistNevents_EMC7->Fill("Events",1);
1976  break;
1977 
1978  case(EMCEGA):
1979  fHistNevents_EMCEGA->Fill("Events",1);
1980  break;
1981 
1982  case(EMCJE):
1983  fHistNevents_EMCJet->Fill("Events",1);
1984  break;
1985  }
1986 
1987  //Initialize energy variable and tagging flags
1988  Double_t PtSum=0;
1989  Double_t PtSumEMC=0;
1990  tagStrong=kFALSE;
1991  Bool_t tagEvt=kFALSE;
1992 
1993  //Initialize the # of tracks variable and the Eta Phi arrays
1994  Int_t ntracks=0;
1995  ntracks = aod->GetNumberOfTracks();
1996 
1997  std::vector<Double_t> Eta;
1998  std::vector<Double_t> Phi;
1999 
2000  fPool = fPoolMan->GetEventPool(ntracks, aod->GetPrimaryVertex()->GetZ());
2001 
2002  // Track loop for reconstructed event
2003  for(Int_t i = 0; i < ntracks; i++) {
2004 
2005  tagStrong=kFALSE;
2006  tagPhot=kFALSE;
2007  AliAODTrack* aodtrack = (AliAODTrack*)aod->GetTrack(i); // pointer to reconstructed to track
2008 
2009  if(!aodtrack) {
2010  AliError(Form("ERROR: Could not retrieve track %d",i));
2011  continue;
2012  }
2013 
2014  //Fill TPCOnly track eta-phi
2015 
2016  if(aodtrack->IsTPCOnly()){
2017  fHistEtaPhiTPCOnly_MB->Fill(aodtrack->Eta(),aodtrack->Phi());
2018  }
2019 
2020  //Do hybrid track cuts
2021  if(!aodtrack->IsHybridGlobalConstrainedGlobal()){continue;}
2022 
2023  //Add this tracks energy to the running total
2024  PtSum=PtSum+aodtrack->Pt();
2025  if(aodtrack->Eta()<.7&&aodtrack->Eta()>-.7&&aodtrack->Phi()>80&&aodtrack->Phi()<180){
2026  PtSumEMC=PtSumEMC+aodtrack->Pt();
2027  }
2028 
2029  //Fill the Eta Phi arrays with this tracks Eta and Phi
2030  Eta.push_back(aodtrack->Eta());
2031  Phi.push_back(aodtrack->Phi());
2032 
2033  if(MBtrg){
2034  fHistEtaPhi_MB->Fill(aodtrack->Eta(),aodtrack->Phi());
2035  }
2036  switch(trigVal){
2037  case(EMC7):
2038  fHistEtaPhi_EMC7->Fill(aodtrack->Eta(),aodtrack->Phi());
2039  break;
2040  case(EMCEGA):
2041  fHistEtaPhi_EMCEGA->Fill(aodtrack->Eta(),aodtrack->Phi());
2042  break;
2043  case(EMCJE):
2044  fHistEtaPhi_EMCJet->Fill(aodtrack->Eta(),aodtrack->Phi());
2045  break;
2046  }
2047  //do Cut level histograms
2048  if(MBtrg){
2049  if(aodtrack->GetTPCncls()>0){
2050  fHistTPCNClus_MB->Fill(aodtrack->GetTPCncls());
2051  }
2052  fHistITSNClus_MB->Fill(aodtrack->GetNcls(0));
2053  }
2054  switch(trigVal){
2055  case(EMC7):
2056  if(aodtrack->GetTPCncls()>0){
2057  fHistTPCNClus_EMC7->Fill(aodtrack->GetTPCncls());
2058  }
2059  fHistITSNClus_EMC7->Fill(aodtrack->GetNcls(0));
2060  break;
2061 
2062  case(EMCEGA):
2063  if(aodtrack->GetTPCncls()>0){
2064  fHistTPCNClus_EMCEGA->Fill(aodtrack->GetTPCncls());
2065  }
2066  fHistITSNClus_EMCEGA->Fill(aodtrack->GetNcls(0));
2067  break;
2068 
2069  case(EMCJE):
2070  if(aodtrack->GetTPCncls()>0){
2071  fHistTPCNClus_EMCJet->Fill(aodtrack->GetTPCncls());
2072  }
2073  fHistITSNClus_EMCJet->Fill(aodtrack->GetNcls(0));
2074  break;
2075  }
2076 
2077  //Impact parameter
2078  Float_t xy;
2079  Float_t z;
2080 
2081  xy=TMath::Sqrt(aodtrack->XAtDCA()*aodtrack->XAtDCA()+aodtrack->YAtDCA()*aodtrack->YAtDCA());
2082 
2083  if(MBtrg){
2084  fHistImpPar_MB->Fill(xy);
2085  }
2086  switch(trigVal){
2087  case(EMC7):
2088  fHistImpPar_EMC7->Fill(xy);
2089  break;
2090 
2091  case(EMCEGA):
2092  fHistImpPar_EMCEGA->Fill(xy);
2093  break;
2094 
2095  case(EMCJE):
2096  fHistImpPar_EMCJet->Fill(xy);
2097  break;
2098  }
2099 
2100  FillPhotoElecHistos(aod, aodtrack, fPIDResponse, i);
2101 
2102  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2103  //If the track doesn't pass the cuts, move on to the next one
2104  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2105  if(trackCutsStrong){
2106  if(!fTrackCutsStrong->AcceptVTrack((AliVTrack*)aodtrack) || aodtrack->GetTPCsignalN()<80){continue;}
2107  }else{
2108  if(!fTrackCutsWeak->AcceptVTrack((AliVTrack*)aodtrack) || aodtrack->GetTPCsignalN()<80){continue;}
2109  }
2110 
2111  FillPIDHistos(aod, aodtrack, fPIDResponse);//Fill PID histos and set "tagStrong" boolean if this track satisfies cuts
2112 
2113  //If the track made it through any 3 detector cuts
2114  if(tagStrong){
2115  tagEvt=kTRUE;//This event contains a candidate electron
2116  //Increment the candidate count and put track ID of candidate into array
2117 
2118  elecIDs[elecCnt]=i;
2119  elecCnt+=1;
2120 
2121  //Fill impact parameter plots
2122  if(MBtrg){
2123  fHistImpParTag_MB->Fill(xy);
2124  }
2125  switch(trigVal){
2126  case(EMC7):
2127  fHistImpParTag_EMC7->Fill(xy);
2128  break;
2129 
2130  case(EMCEGA):
2131  fHistImpParTag_EMCEGA->Fill(xy);
2132  break;
2133 
2134  case(EMCJE):
2135  fHistImpParTag_EMCJet->Fill(xy);
2136  break;
2137  }
2138 
2139  //Pt distribution
2140 
2141  if(MBtrg){
2142  fHistPtTag_MB->Fill(aodtrack->Pt());
2143  }
2144  switch(trigVal){
2145  case(EMC7):
2146  fHistPtTag_EMC7->Fill(aodtrack->Pt());
2147  break;
2148 
2149  case(EMCEGA):
2150  fHistPtTag_EMCEGA->Fill(aodtrack->Pt());
2151  break;
2152 
2153  case(EMCJE):
2154  fHistPtTag_EMCJet->Fill(aodtrack->Pt());
2155  break;
2156  }
2157  FillDPhiHistos(aod, aodtrack, i);//Fill DPhi histos
2158 
2159  if(tagPhot){
2160  if(MBtrg){
2161  fHistPhotoMismatch_MB->Fill(0);
2162  }
2163  switch(trigVal){
2164  case(EMC7):
2165  fHistPhotoMismatch_EMC7->Fill(0);
2166  break;
2167  case(EMCEGA):
2168  fHistPhotoMismatch_EMCEGA->Fill(0);
2169  break;
2170  case(EMCJE):
2171  fHistPhotoMismatch_EMCJet->Fill(0);
2172  break;
2173  }
2174  }
2175 
2176 
2177 
2178 
2179  if(!fPool){cout<<"No Pool for this event man\n"; continue;}
2180 
2181  fPool->PrintInfo();
2182  if(fPool->IsReady() ){
2183  FillMEDPhiHistos(aodtrack);
2184  }
2185  else{
2186  cout<<"Pool wasn't ready\n";
2187  }
2188  }//end if(tagStrong)
2189 
2190  }//end main track loop
2191  if(!fPool){
2192  cout<<"No pool exists, can't update it"<<'\n';
2193  }
2194  else{
2195  if(UseNonSignalEvents){
2196  if(trkArr){
2197  delTrk=kFALSE;
2198  fPool->UpdatePool(trkArr);
2199  }
2200  }else{
2201  if(tagEvt){
2202  if(trkArr){
2203  delTrk=kFALSE;
2204  fPool->UpdatePool(trkArr);
2205  }
2206  }
2207  }
2208  }
2209 
2210  //Call function to fill Region histos and pass it int array of IDs for identified electron tracks
2211  Int_t elecIDsSparse[elecCnt];
2212  for(Int_t i=0;i<elecCnt;i++){
2213  elecIDsSparse[i]=elecIDs[i];
2214  }
2215 
2216  //Fill Number of electrons plot
2217  fHistNElecPerEvent->Fill(elecCnt);
2218 
2219  //Fill the total pt sum histogram
2220  if(tagEvt){
2221  if(MBtrg){
2222  fHistPtSumTag_MB->Fill(PtSum);
2223  }
2224  switch(trigVal){
2225  case(EMC7):
2226  fHistPtSumTag_EMC7->Fill(PtSum);
2227  break;
2228  case(EMCEGA):
2229  fHistPtSumTag_EMCEGA->Fill(PtSum);
2230  break;
2231  case(EMCJE):
2232  fHistPtSumTag_EMCJet->Fill(PtSum);
2233  break;
2234  }
2235  }else{
2236  if(MBtrg){
2237  fHistPtSum_MB->Fill(PtSum);
2238  }
2239  switch(trigVal){
2240  case(EMC7):
2241  fHistPtSum_EMC7->Fill(PtSum);
2242  break;
2243  case(EMCEGA):
2244  fHistPtSum_EMCEGA->Fill(PtSum);
2245  break;
2246  case(EMCJE):
2247  fHistPtSum_EMCJet->Fill(PtSum);
2248  break;
2249  }
2250  }
2251 
2252  if(MBtrg){
2253  fHistPtSumEMC_MB->Fill(PtSumEMC);
2254  }
2255  switch(trigVal){
2256  case(EMC7):
2257  fHistPtSumEMC_EMC7->Fill(PtSumEMC);
2258  break;
2259  case(EMCEGA):
2260  fHistPtSumEMC_EMCEGA->Fill(PtSumEMC);
2261  break;
2262  case(EMCJE):
2263  fHistPtSumEMC_EMCJet->Fill(PtSumEMC);
2264  break;
2265  }
2266 
2267  //Fill Nevent histos
2268  if(tagEvt){
2269  if(MBtrg){
2270  fHistNevents_MB->Fill("Events containing candidates",1);
2271  }
2272  switch(trigVal){
2273  case(EMC7):
2274  fHistNevents_EMC7->Fill("Events containing candidates",1);
2275  break;
2276  case(EMCEGA):
2277  fHistNevents_EMCEGA->Fill("Events containing candidates",1);
2278  break;
2279  case(EMCJE):
2280  fHistNevents_EMCJet->Fill("Events containing candidates",1);
2281  break;
2282  }
2283  }
2284 
2285  //Fill the Eta Phi histograms
2286  if(tagEvt){
2287  for(Int_t i=0;i<Eta.size();i++){
2288  if(MBtrg){
2289  fHistEtaPhiTag_MB->Fill(Eta[i],Phi[i]);
2290  }
2291  switch(trigVal){
2292  case(EMC7):
2293  fHistEtaPhiTag_EMC7->Fill(Eta[i],Phi[i]);
2294  break;
2295  case(EMCEGA):
2296  fHistEtaPhiTag_EMCEGA->Fill(Eta[i],Phi[i]);
2297  break;
2298  case(EMCJE):
2299  fHistEtaPhiTag_EMCJet->Fill(Eta[i],Phi[i]);
2300  break;
2301  }
2302  }
2303  }
2304 
2305  if(trkArr&&delTrk){
2306  delete trkArr;
2307  }
2308 
2309 
2310 
2311  // NEW HISTO should be filled before this point, as PostData puts the
2312  // information for this iteration of the UserExec in the container
2313  PostData(1, fOutputMB);
2314  PostData(2, fOutputEMC7);
2315  PostData(3, fOutputEMCEGA);
2316  PostData(4, fOutputEMCJet);
2317 }
2318 
2319 void AliAnalysisTaskPSHFE::FillPIDHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse){
2320 
2321  if(!aodtrack){
2322  AliWarning("aodtrack is null, no point in doing PID");
2323  return;
2324  }
2325 
2326 
2327  Bool_t isPIDRej = kFALSE;
2328 
2329  //Fill TOF and TPC status variables
2330  AliPIDResponse::EDetPidStatus TOFStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTOF, aodtrack);
2331 
2332  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrack);
2333 
2334  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrack);
2335 
2336  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, aodtrack);
2337 
2338  //Check validity of PID, TODO: Add a rejection histogram
2339  if(TOFStatus!=AliPIDResponse::kDetPidOk){
2340  fHistPIDRejection->Fill(2);
2341  //isPIDRej=kTRUE;
2342  }
2343 
2344  if(TPCStatus!=AliPIDResponse::kDetPidOk){
2345  fHistPIDRejection->Fill(1);
2346  isPIDRej=kTRUE;
2347  }
2348 
2349  if(TRDStatus!=AliPIDResponse::kDetPidOk){
2350  fHistPIDRejection->Fill(3);
2351  isPIDRej=kTRUE;
2352  }
2353 
2354  if(EMCStatus!=AliPIDResponse::kDetPidOk){
2355  fHistPIDRejection->Fill(4);
2356  isPIDRej=kTRUE;
2357  }
2358 
2359 
2360  //Get the # of sigmas around an electron hypothesis for TOF and TPC
2361  Double_t nSigmaTOF;
2362  nSigmaTOF = fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kElectron);
2363 
2364  Double_t nSigmaTPC;
2365  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron);
2366 
2367  Double_t elecLikeTRD[1];
2368  if(fPIDResponse->ComputeTRDProbability(aodtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrack->GetTRDntrackletsPID()<4){
2369  fHistPIDRejection->Fill(3);
2370  isPIDRej=kTRUE;
2371  }
2372 
2373  if(isPIDRej){return;}
2374 
2375  //declare emcal cluster PID variables
2376  Double_t EOP=-1;
2377  Int_t caloId=aodtrack->GetEMCALcluster();
2378 
2379  if(caloId==-99999){
2380  return;
2381  }
2382 
2383  AliAODCaloCluster* tagEMCclus=aod->GetCaloCluster(caloId);
2384 
2385  if(tagEMCclus->E()>.5){
2386  EOP = tagEMCclus->E()/aodtrack->Pt();
2387  }
2388  else{
2389  return;
2390  }
2391 
2392 
2393 
2394  //=========================================================================================================================
2395  //PID cuts and histogram filling
2396  //=========================================================================================================================
2397 
2398  //Some Double arrays for pt ranges
2399  Double_t ptUpper[6] = {2, 3, 4, 5, 6, 1000000};
2400  Double_t ptLower[6] = {1, 2, 3, 4, 5, 6};
2401  Double_t TPCcut = 2;
2402  Double_t TOFcut = 2;
2403  Double_t TRDcut = .9;
2404  Double_t EMCcutLower[6] = {.85,.85,.85,.85,.85,.85};
2405  Double_t EMCcutHigher[6] = {1.3,1.3,1.3,1.3,1.3,1.3};
2406 
2407  for(Int_t i=0; i<6; i++){
2408  if(aodtrack->Pt()>ptLower[i]&&aodtrack->Pt()<ptUpper[i]){
2409 
2410  //TPC Plots
2411  //EMC+TRD cuts
2412  if(EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]&&elecLikeTRD[0]>TRDcut){
2413 
2414  if(MBtrg){
2415  fHistTPC_EMCTRD_MB[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2416  }
2417  switch(trigVal){
2418  case(EMC7):
2419  fHistTPC_EMCTRD_EMC7[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2420  break;
2421 
2422  case(EMCEGA):
2423  fHistTPC_EMCTRD_EMCEGA[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2424  break;
2425 
2426  case(EMCJE):
2427  fHistTPC_EMCTRD_EMCJet[i]->Fill(aodtrack->Pt(), nSigmaTPC);
2428  break;
2429  }
2430  }
2431 
2432  //EMC Plots
2433 
2434  //TPC+TRD cuts
2435  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut){
2436 
2437  if(!applySSCuts){
2438  if(MBtrg){
2439  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
2440  }
2441  switch(trigVal){
2442  case(EMC7):
2443  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
2444  break;
2445 
2446  case(EMCEGA):
2447  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
2448  break;
2449 
2450  case(EMCJE):
2451  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
2452  break;
2453  }
2454  }else{
2455  if(MBtrg){
2456  fHistEMC_TPCTRD_MB[i]->Fill(EOP);
2457  }
2458  switch(trigVal){
2459  case(EMC7):
2460  fHistEMC_TPCTRD_EMC7[i]->Fill(EOP);
2461  break;
2462 
2463  case(EMCEGA):
2464  fHistEMC_TPCTRD_EMCEGA[i]->Fill(EOP);
2465  break;
2466 
2467  case(EMCJE):
2468  fHistEMC_TPCTRD_EMCJet[i]->Fill(EOP);
2469  break;
2470  }
2471  }
2472  }
2473 
2474  //TRD Plots
2475 
2476  //TPC+EMC cuts
2477  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&EOP<EMCcutHigher[i]&&EOP>EMCcutLower[i]){
2478 
2479  if(MBtrg){
2480  fHistTRD_TPCEMC_MB[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2481  }
2482  switch(trigVal){
2483  case(EMC7):
2484  fHistTRD_TPCEMC_EMC7[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2485  break;
2486 
2487  case(EMCEGA):
2488  fHistTRD_TPCEMC_EMCEGA[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2489  break;
2490 
2491  case(EMCJE):
2492  fHistTRD_TPCEMC_EMCJet[i]->Fill(aodtrack->Pt(), elecLikeTRD[0]);
2493  break;
2494  }
2495  }
2496  }
2497  }
2498  if(MBtrg){
2499  if(aodtrack->Pt()<2&&aodtrack->Pt()>1){
2500  if(nSigmaTPC<-2&&nSigmaTPC>-8){
2501  fHistEMC_Had_MB_1Gev->Fill(EOP);
2502  }
2503  }
2504  }
2505 
2506  if(applySSCuts){
2507 
2508  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15, M02=(0,.5), M20=(0,.3)
2509 
2510  if(aodtrack->Pt()<6){
2511  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]){
2512 
2513  tagStrong=kTRUE;
2514 
2515  }
2516 
2517  }
2518 
2519  else{
2520 
2521  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]){
2522 
2523  tagStrong=kTRUE;
2524 
2525  }
2526 
2527  }
2528 
2529  }else{//no sscuts
2530 
2531  //An electron candidate is one that passes TPC +-2Sig, TRD>.9, 0.85<E/p<1.15
2532 
2533  if(aodtrack->Pt()<6){
2534  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[0]&&EOP>EMCcutLower[0]){
2535 
2536  tagStrong=kTRUE;
2537 
2538  }
2539 
2540  }
2541 
2542  else{
2543 
2544  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher[5]&&EOP>EMCcutLower[5]){
2545 
2546  tagStrong=kTRUE;
2547 
2548  }
2549 
2550  }
2551 
2552  }
2553 
2554  /*//Check if any tracks pass all cuts
2555  if(nSigmaTPC<TPCcut&&nSigmaTPC>-TPCcut&&nSigmaTOF<TOFcut&&nSigmaTOF>-TOFcut&&elecLikeTRD[0]>TRDcut&&EOP<EMCcutHigher&&EOP>EMCcutLower){
2556  tagAll=kTRUE;
2557  }*/
2558 
2559  //=========================================================================
2560  // End of PID stuff
2561  //=========================================================================
2562  PostData(1, fOutputMB);
2563  PostData(2, fOutputEMC7);
2564  PostData(3, fOutputEMCEGA);
2565  PostData(4, fOutputEMCJet);
2566  return;
2567 }
2568 
2569 void AliAnalysisTaskPSHFE::FillDPhiHistos(AliAODEvent *aod, AliAODTrack *aodtrack, Int_t i){
2570  //Run through all tracks in this
2571  Int_t ntracks = aod->GetNumberOfTracks();
2572  for(Int_t j = 0; j < ntracks; j++) {
2573 
2574  //Don't double count the tagged tracks
2575  if(i==j){continue;}
2576 
2577 
2578  AliAODTrack* aodtrackassoc = (AliAODTrack*)aod->GetTrack(j); // pointer to reconstructed to track
2579 
2580  if(!aodtrackassoc) {
2581  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
2582  continue;
2583  }
2584 
2585  //Do hybrid track cuts
2586  if(!aodtrackassoc->IsHybridGlobalConstrainedGlobal()&&!aodtrackassoc->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){continue;}
2587 
2588  //Pt distribution
2589  if(MBtrg){
2590  fHistPtAssoc_MB->Fill(aodtrackassoc->Pt());
2591  }
2592  switch(trigVal){
2593  case(EMC7):
2594  fHistPtAssoc_EMC7->Fill(aodtrackassoc->Pt());
2595  break;
2596 
2597  case(EMCEGA):
2598  fHistPtAssoc_EMCEGA->Fill(aodtrackassoc->Pt());
2599  break;
2600 
2601  case(EMCJE):
2602  fHistPtAssoc_EMCJet->Fill(aodtrackassoc->Pt());
2603  break;
2604  }
2605 
2606  //Fill Delta Phi variable and correct for periodicity
2607  Double_t DPhi=aodtrackassoc->Phi()-aodtrack->Phi();
2608 
2609  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
2610 
2611  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
2612 
2613  Double_t DEta=aodtrackassoc->Eta()-aodtrack->Eta();
2614 
2615 
2616  Int_t PID=0;
2617  cout<<"most probPID"<<AliAODTrack::kElectron<<":"<<aodtrackassoc->GetMostProbablePID()<<'\n';
2618  switch(aodtrackassoc->GetMostProbablePID()){
2619  case AliAODTrack::kElectron:
2620  PID=1;
2621  break;
2622  case AliAODTrack::kMuon:
2623  PID=2;
2624  break;
2625  case AliAODTrack::kPion:
2626  PID=3;
2627  break;
2628  case AliAODTrack::kKaon:
2629  PID=4;
2630  break;
2631  case AliAODTrack::kProton:
2632  PID=5;
2633  break;
2634  case AliAODTrack::kDeuteron:
2635  PID=6;
2636  break;
2637  case AliAODTrack::kUnknown:
2638  PID=0;
2639  break;
2640  }
2641 
2642  if(MBtrg){
2643  fHistDPhi18Spe_MB->Fill(DPhi, PID);
2644  }
2645  switch(trigVal){
2646  case(EMC7):
2647  fHistDPhi18Spe_EMC7->Fill(DPhi, PID);
2648  break;
2649  case(EMCEGA):
2650  fHistDPhi18Spe_EMCEGA->Fill(DPhi, PID);
2651  break;
2652  case(EMCJE):
2653  fHistDPhi18Spe_EMCJet->Fill(DPhi, PID);
2654  break;
2655  }
2656 
2657  if(aodtrackassoc->GetType()==AliAODTrack::kPrimary){
2658 
2659  if(aodtrack->Pt()<8&&aodtrack->Pt()>1&&aodtrackassoc->Pt()>0.3)
2660  {
2661  fHistTestDPhi18NoSec->Fill(DPhi);
2662  }
2663 
2664  fHistTestDPhiSpeNoSec->Fill(DPhi, PID);
2665 
2666  }else{
2667  if(aodtrack->Pt()<8&&aodtrack->Pt()>1&&aodtrackassoc->Pt()>0.3)
2668  {
2669  fHistTestDPhi18Sec->Fill(DPhi);
2670  }
2671  }
2672 
2673 
2674 
2675  //Fill DPhi by Type here
2676  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()) fHistTestDPhiType->Fill(DPhi, 1);
2677 
2678  if((aodtrackassoc->IsGlobalConstrained())) fHistTestDPhiType->Fill(DPhi, 2);
2679 
2680  if((aodtrackassoc->IsTPCOnly())) fHistTestDPhiType->Fill(DPhi, 3);
2681 
2682 
2683  if(DPhi<0.1&&DPhi>-0.1&&DEta<0.1&&DEta>-0.1){
2684 
2685  fHistTestPt->Fill(aodtrackassoc->Pt());
2686  fHistTestOGDPhi->Fill(aodtrackassoc->Phi()-aodtrack->Phi());
2687  fHistTestDCA->Fill(aodtrackassoc->DCA());
2688  fHistTestTPCdEdx->Fill(aodtrackassoc->Pt(), aodtrackassoc->GetTPCsignal());
2689 
2690 
2691  Int_t partOneID = 0;
2692  Int_t partTwoID = 0;
2693 
2694  if(aodtrackassoc->GetMostProbablePID()==AliAODTrack::kElectron) partOneID=1;
2695 
2696  if(aodtrackassoc->GetMostProbablePID()==AliAODTrack::kPion) partOneID=2;
2697 
2698 
2699  for(Int_t k=0;k<ntracks;k++){
2700  if(i==k || j==k){continue;}
2701 
2702  AliAODTrack* aodtrackassoc2 = (AliAODTrack*)aod->GetTrack(k);
2703 
2704  if(aodtrackassoc2->GetMostProbablePID()==AliAODTrack::kElectron) partTwoID=1;
2705 
2706  if(aodtrackassoc2->GetMostProbablePID()==AliAODTrack::kPion) partTwoID=2;
2707 
2708  Double_t DPhi=aodtrackassoc2->Phi()-aodtrack->Phi();
2709 
2710  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
2711 
2712  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
2713 
2714  Double_t DEta=aodtrackassoc2->Eta()-aodtrack->Eta();
2715 
2716  Double_t ElecMass=.000511;
2717 
2718  Double_t PionMass=.139;
2719  //fill inv mass plot
2720 
2721  if(partOneID==1&&partTwoID==1&&aodtrackassoc->Charge()==aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0)
2722  {
2723  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
2724  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+ElecMass*ElecMass);
2725 
2726  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2727  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2728 
2729  Double_t InvMass=(assoc1+assoc2).M();
2730 
2731  fHistTestInvMassElecLike->Fill(InvMass);
2732  }
2733 
2734  if(partOneID==1&&partTwoID==1&&aodtrackassoc->Charge()!=aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0&&aodtrackassoc2->Charge()!=0)
2735  {
2736  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
2737  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+ElecMass*ElecMass);
2738 
2739  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2740  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2741 
2742  Double_t InvMass=(assoc1+assoc2).M();
2743 
2744  fHistTestInvMassElecUnLike->Fill(InvMass);
2745  }
2746 
2747  if(partOneID==2&&partTwoID==2&&aodtrackassoc->Charge()==aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0)
2748  {
2749  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+PionMass*PionMass);
2750  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+PionMass*PionMass);
2751 
2752  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2753  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2754 
2755  Double_t InvMass=(assoc1+assoc2).M();
2756 
2757  fHistTestInvMassPionLike->Fill(InvMass);
2758  }
2759 
2760  if(partOneID==2&&partTwoID==2&&aodtrackassoc->Charge()!=aodtrackassoc2->Charge()&&aodtrackassoc->Charge()!=0&&aodtrackassoc2->Charge()!=0)
2761  {
2762  Double_t assocE1=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+PionMass*PionMass);
2763  Double_t assocE2=TMath::Sqrt(aodtrackassoc2->P()*aodtrackassoc2->P()+PionMass*PionMass);
2764 
2765  TLorentzVector assoc1(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), assocE1);
2766  TLorentzVector assoc2(aodtrackassoc2->Px(), aodtrackassoc2->Py(), aodtrackassoc2->Pz(), assocE2);
2767 
2768  Double_t InvMass=(assoc1+assoc2).M();
2769 
2770  fHistTestInvMassPionUnLike->Fill(InvMass);
2771  }
2772 
2773 
2774 
2775  }
2776  //Fill other plots
2777  Int_t cid = aodtrackassoc->GetEMCALcluster();
2778  if(cid > 0){
2779  AliAODCaloCluster *aodcl = aod->GetCaloCluster(cid);
2780 
2781  fHistTestEMCEnergy->Fill(aodcl->E());
2782  fHistTestEOP->Fill(aodcl->E()/aodtrackassoc->Pt());
2783  }
2784  else{cout<<"No EMCal cluster for this anamolous Peak\n";}
2785 
2786 
2787 
2788 
2789  }
2790 
2791  if(PID==1||PID==2||PID==0){continue;}
2792 
2793  //candidate 1<pt<2
2794  if(aodtrack->Pt()>1&&aodtrack->Pt()<2){
2795 
2796  //300-500MeV
2797  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
2798  if(MBtrg){
2799  fHistDPhi300_500_MB[0]->Fill(DPhi);
2800  }
2801  switch(trigVal){
2802  case(EMC7):
2803  fHistDPhi300_500_EMC7[0]->Fill(DPhi);
2804  break;
2805  case(EMCEGA):
2806  fHistDPhi300_500_EMCEGA[0]->Fill(DPhi);
2807  break;
2808  case(EMCJE):
2809  fHistDPhi300_500_EMCJet[0]->Fill(DPhi);
2810  break;
2811  }
2812  }
2813 
2814  //500MeV
2815  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
2816  if(MBtrg){
2817  fHistDPhi500_800_MB[0]->Fill(DPhi);
2818  }
2819  switch(trigVal){
2820  case(EMC7):
2821  fHistDPhi500_800_EMC7[0]->Fill(DPhi);
2822  break;
2823  case(EMCEGA):
2824  fHistDPhi500_800_EMCEGA[0]->Fill(DPhi);
2825  break;
2826  case(EMCJE):
2827  fHistDPhi500_800_EMCJet[0]->Fill(DPhi);
2828  break;
2829  }
2830  }
2831 
2832  //800MeV
2833  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
2834  if(MBtrg){
2835  fHistDPhi800_1_MB[0]->Fill(DPhi);
2836  }
2837  switch(trigVal){
2838  case(EMC7):
2839  fHistDPhi800_1_EMC7[0]->Fill(DPhi);
2840  break;
2841  case(EMCEGA):
2842  fHistDPhi800_1_EMCEGA[0]->Fill(DPhi);
2843  break;
2844  case(EMCJE):
2845  fHistDPhi800_1_EMCJet[0]->Fill(DPhi);
2846  break;
2847  }
2848  }
2849 
2850  //1GeV
2851  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
2852  if(MBtrg){
2853  fHistDPhi1_2_MB[0]->Fill(DPhi);
2854  }
2855  switch(trigVal){
2856  case(EMC7):
2857  fHistDPhi1_2_EMC7[0]->Fill(DPhi);
2858  break;
2859  case(EMCEGA):
2860  fHistDPhi1_2_EMCEGA[0]->Fill(DPhi);
2861  break;
2862  case(EMCJE):
2863  fHistDPhi1_2_EMCJet[0]->Fill(DPhi);
2864  break;
2865  }
2866  }
2867 
2868  //2GeV
2869  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
2870  if(MBtrg){
2871  fHistDPhi2_3_MB[0]->Fill(DPhi);
2872  }
2873  switch(trigVal){
2874  case(EMC7):
2875  fHistDPhi2_3_EMC7[0]->Fill(DPhi);
2876  break;
2877  case(EMCEGA):
2878  fHistDPhi2_3_EMCEGA[0]->Fill(DPhi);
2879  break;
2880  case(EMCJE):
2881  fHistDPhi2_3_EMCJet[0]->Fill(DPhi);
2882  break;
2883  }
2884  }
2885 
2886  //3GeV
2887  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
2888  if(MBtrg){
2889  fHistDPhi3_4_MB[0]->Fill(DPhi);
2890  }
2891  switch(trigVal){
2892  case(EMC7):
2893  fHistDPhi3_4_EMC7[0]->Fill(DPhi);
2894  break;
2895  case(EMCEGA):
2896  fHistDPhi3_4_EMCEGA[0]->Fill(DPhi);
2897  break;
2898  case(EMCJE):
2899  fHistDPhi3_4_EMCJet[0]->Fill(DPhi);
2900  break;
2901  }
2902  }
2903 
2904  //5GeV
2905  if(aodtrackassoc->Pt()>4){
2906  if(MBtrg){
2907  fHistDPhi4_MB[0]->Fill(DPhi);
2908  }
2909  switch(trigVal){
2910  case(EMC7):
2911  fHistDPhi4_EMC7[0]->Fill(DPhi);
2912  break;
2913  case(EMCEGA):
2914  fHistDPhi4_EMCEGA[0]->Fill(DPhi);
2915  break;
2916  case(EMCJE):
2917  fHistDPhi4_EMCJet[0]->Fill(DPhi);
2918  break;
2919  }
2920  }
2921  }
2922 
2923  //candidate 2<pt<4
2924  if(aodtrack->Pt()>2&&aodtrack->Pt()<4){
2925 
2926  //300MeV
2927  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
2928  if(MBtrg){
2929  fHistDPhi300_500_MB[1]->Fill(DPhi);
2930  }
2931  switch(trigVal){
2932  case(EMC7):
2933  fHistDPhi300_500_EMC7[1]->Fill(DPhi);
2934  break;
2935  case(EMCEGA):
2936  fHistDPhi300_500_EMCEGA[1]->Fill(DPhi);
2937  break;
2938  case(EMCJE):
2939  fHistDPhi300_500_EMCJet[1]->Fill(DPhi);
2940  break;
2941  }
2942  }
2943 
2944  //500MeV
2945  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
2946  if(MBtrg){
2947  fHistDPhi500_800_MB[1]->Fill(DPhi);
2948  }
2949  switch(trigVal){
2950  case(EMC7):
2951  fHistDPhi500_800_EMC7[1]->Fill(DPhi);
2952  break;
2953  case(EMCEGA):
2954  fHistDPhi500_800_EMCEGA[1]->Fill(DPhi);
2955  break;
2956  case(EMCJE):
2957  fHistDPhi500_800_EMCJet[1]->Fill(DPhi);
2958  break;
2959  }
2960  }
2961 
2962  //800MeV
2963  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
2964  if(MBtrg){
2965  fHistDPhi800_1_MB[1]->Fill(DPhi);
2966  }
2967  switch(trigVal){
2968  case(EMC7):
2969  fHistDPhi800_1_EMC7[1]->Fill(DPhi);
2970  break;
2971  case(EMCEGA):
2972  fHistDPhi800_1_EMCEGA[1]->Fill(DPhi);
2973  break;
2974  case(EMCJE):
2975  fHistDPhi800_1_EMCJet[1]->Fill(DPhi);
2976  break;
2977  }
2978  }
2979 
2980  //1GeV
2981  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
2982  if(MBtrg){
2983  fHistDPhi1_2_MB[1]->Fill(DPhi);
2984  }
2985  switch(trigVal){
2986  case(EMC7):
2987  fHistDPhi1_2_EMC7[1]->Fill(DPhi);
2988  break;
2989  case(EMCEGA):
2990  fHistDPhi1_2_EMCEGA[1]->Fill(DPhi);
2991  break;
2992  case(EMCJE):
2993  fHistDPhi1_2_EMCJet[1]->Fill(DPhi);
2994  break;
2995  }
2996  }
2997 
2998  //2GeV
2999  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3000  if(MBtrg){
3001  fHistDPhi2_3_MB[1]->Fill(DPhi);
3002  fHistDPhi28_MB->Fill(DPhi);
3003  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3004  }
3005  switch(trigVal){
3006  case(EMC7):
3007  fHistDPhi2_3_EMC7[1]->Fill(DPhi);
3008  fHistDPhi28_EMC7->Fill(DPhi);
3009  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3010  break;
3011  case(EMCEGA):
3012  fHistDPhi2_3_EMCEGA[1]->Fill(DPhi);
3013  fHistDPhi28_EMCEGA->Fill(DPhi);
3014  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3015  break;
3016  case(EMCJE):
3017  fHistDPhi2_3_EMCJet[1]->Fill(DPhi);
3018  fHistDPhi28_EMCJet->Fill(DPhi);
3019  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3020  break;
3021  }
3022  }
3023 
3024  //3GeV
3025  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3026  if(MBtrg){
3027  fHistDPhi3_4_MB[1]->Fill(DPhi);
3028  fHistDPhi28_MB->Fill(DPhi);
3029  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3030  }
3031  switch(trigVal){
3032  case(EMC7):
3033  fHistDPhi3_4_EMC7[1]->Fill(DPhi);
3034  fHistDPhi28_EMC7->Fill(DPhi);
3035  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3036  break;
3037  case(EMCEGA):
3038  fHistDPhi3_4_EMCEGA[1]->Fill(DPhi);
3039  fHistDPhi28_EMCEGA->Fill(DPhi);
3040  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3041  break;
3042  case(EMCJE):
3043  fHistDPhi3_4_EMCJet[1]->Fill(DPhi);
3044  fHistDPhi28_EMCJet->Fill(DPhi);
3045  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3046  break;
3047  }
3048  }
3049 
3050  //5GeV
3051  if(aodtrackassoc->Pt()>4){
3052  if(MBtrg){
3053  fHistDPhi4_MB[1]->Fill(DPhi);
3054  fHistDPhi28_MB->Fill(DPhi);
3055  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3056  }
3057  switch(trigVal){
3058  case(EMC7):
3059  fHistDPhi4_EMC7[1]->Fill(DPhi);
3060  fHistDPhi28_EMC7->Fill(DPhi);
3061  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3062  break;
3063  case(EMCEGA):
3064  fHistDPhi4_EMCEGA[1]->Fill(DPhi);
3065  fHistDPhi28_EMCEGA->Fill(DPhi);
3066  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3067  break;
3068  case(EMCJE):
3069  fHistDPhi4_EMCJet[1]->Fill(DPhi);
3070  fHistDPhi28_EMCJet->Fill(DPhi);
3071  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3072  break;
3073  }
3074  }
3075  }
3076 
3077  //candidate 4<pt<8
3078  if(aodtrack->Pt()>4&&aodtrack->Pt()<8){
3079 
3080  //300MeV
3081  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
3082  if(MBtrg){
3083  fHistDPhi300_500_MB[2]->Fill(DPhi);
3084  }
3085  switch(trigVal){
3086  case(EMC7):
3087  fHistDPhi300_500_EMC7[2]->Fill(DPhi);
3088  break;
3089  case(EMCEGA):
3090  fHistDPhi300_500_EMCEGA[2]->Fill(DPhi);
3091  break;
3092  case(EMCJE):
3093  fHistDPhi300_500_EMCJet[2]->Fill(DPhi);
3094  break;
3095  }
3096  }
3097 
3098  //500MeV
3099  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
3100  if(MBtrg){
3101  fHistDPhi500_800_MB[2]->Fill(DPhi);
3102  }
3103  switch(trigVal){
3104  case(EMC7):
3105  fHistDPhi500_800_EMC7[2]->Fill(DPhi);
3106  break;
3107  case(EMCEGA):
3108  fHistDPhi500_800_EMCEGA[2]->Fill(DPhi);
3109  break;
3110  case(EMCJE):
3111  fHistDPhi500_800_EMCJet[2]->Fill(DPhi);
3112  break;
3113  }
3114  }
3115 
3116  //800MeV
3117  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
3118  if(MBtrg){
3119  fHistDPhi800_1_MB[2]->Fill(DPhi);
3120  }
3121  switch(trigVal){
3122  case(EMC7):
3123  fHistDPhi800_1_EMC7[2]->Fill(DPhi);
3124  break;
3125  case(EMCEGA):
3126  fHistDPhi800_1_EMCEGA[2]->Fill(DPhi);
3127  break;
3128  case(EMCJE):
3129  fHistDPhi800_1_EMCJet[2]->Fill(DPhi);
3130  break;
3131  }
3132  }
3133 
3134  //1GeV
3135  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3136  if(MBtrg){
3137  fHistDPhi1_2_MB[2]->Fill(DPhi);
3138  }
3139  switch(trigVal){
3140  case(EMC7):
3141  fHistDPhi1_2_EMC7[2]->Fill(DPhi);
3142  break;
3143  case(EMCEGA):
3144  fHistDPhi1_2_EMCEGA[2]->Fill(DPhi);
3145  break;
3146  case(EMCJE):
3147  fHistDPhi1_2_EMCJet[2]->Fill(DPhi);
3148  break;
3149  }
3150  }
3151 
3152  //2GeV
3153  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3154  if(MBtrg){
3155  fHistDPhi2_3_MB[2]->Fill(DPhi);
3156  fHistDPhi28_MB->Fill(DPhi);
3157  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3158  }
3159  switch(trigVal){
3160  case(EMC7):
3161  fHistDPhi2_3_EMC7[2]->Fill(DPhi);
3162  fHistDPhi28_EMC7->Fill(DPhi);
3163  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3164  break;
3165  case(EMCEGA):
3166  fHistDPhi2_3_EMCEGA[2]->Fill(DPhi);
3167  fHistDPhi28_EMCEGA->Fill(DPhi);
3168  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3169  break;
3170  case(EMCJE):
3171  fHistDPhi2_3_EMCJet[2]->Fill(DPhi);
3172  fHistDPhi28_EMCJet->Fill(DPhi);
3173  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3174  break;
3175  }
3176  }
3177 
3178  //3GeV
3179  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3180  if(MBtrg){
3181  fHistDPhi3_4_MB[2]->Fill(DPhi);
3182  fHistDPhi28_MB->Fill(DPhi);
3183  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3184  }
3185  switch(trigVal){
3186  case(EMC7):
3187  fHistDPhi3_4_EMC7[2]->Fill(DPhi);
3188  fHistDPhi28_EMC7->Fill(DPhi);
3189  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3190  break;
3191  case(EMCEGA):
3192  fHistDPhi3_4_EMCEGA[2]->Fill(DPhi);
3193  fHistDPhi28_EMCEGA->Fill(DPhi);
3194  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3195  break;
3196  case(EMCJE):
3197  fHistDPhi3_4_EMCJet[2]->Fill(DPhi);
3198  fHistDPhi28_EMCJet->Fill(DPhi);
3199  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3200  break;
3201  }
3202  }
3203 
3204  //5GeV
3205  if(aodtrackassoc->Pt()>4){
3206  if(MBtrg){
3207  fHistDPhi4_MB[2]->Fill(DPhi);
3208  fHistDPhi28_MB->Fill(DPhi);
3209  fHistDPhiDEta28_MB->Fill(DPhi, DEta);
3210  }
3211  switch(trigVal){
3212  case(EMC7):
3213  fHistDPhi4_EMC7[2]->Fill(DPhi);
3214  fHistDPhi28_EMC7->Fill(DPhi);
3215  fHistDPhiDEta28_EMC7->Fill(DPhi, DEta);
3216  break;
3217  case(EMCEGA):
3218  fHistDPhi4_EMCEGA[2]->Fill(DPhi);
3219  fHistDPhi28_EMCEGA->Fill(DPhi);
3220  fHistDPhiDEta28_EMCEGA->Fill(DPhi, DEta);
3221  break;
3222  case(EMCJE):
3223  fHistDPhi4_EMCJet[2]->Fill(DPhi);
3224  fHistDPhi28_EMCJet->Fill(DPhi);
3225  fHistDPhiDEta28_EMCJet->Fill(DPhi, DEta);
3226  break;
3227  }
3228  }
3229  }
3230 
3231  }
3232  PostData(1, fOutputMB);
3233  PostData(2, fOutputEMC7);
3234  PostData(3, fOutputEMCEGA);
3235  PostData(4, fOutputEMCJet);
3236  return;
3237 }
3238 
3240  trackCutsStrong=trkCutBool;
3241 }
3242 
3244  applySSCuts=SSCutBool;
3245 }
3246 
3247 void AliAnalysisTaskPSHFE::FillPhotoElecHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse, Int_t i){
3248 
3249  if(!aodtrack){
3250  AliWarning("aodtrack is null, no point in doing Photonic Electron stuff");
3251  return;
3252  }
3253 
3254  Bool_t isElec=kFALSE;
3255  Double_t ElecMass=.0005109989;
3256  //Fill TOF and TPC status variables
3257  AliPIDResponse::EDetPidStatus TPCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrack);
3258 
3259  AliPIDResponse::EDetPidStatus TRDStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrack);
3260 
3261  AliPIDResponse::EDetPidStatus EMCStatus=fPIDResponse->CheckPIDStatus(AliPIDResponse::kEMCAL, aodtrack);
3262 
3263  //Check validity of PID, TODO: Add a rejection histogram
3264  if(TPCStatus!=AliPIDResponse::kDetPidOk){
3265  return;
3266  }
3267 
3268  if(TRDStatus!=AliPIDResponse::kDetPidOk){
3269  return;
3270  }
3271 
3272  if(EMCStatus!=AliPIDResponse::kDetPidOk){
3273  return;
3274  }
3275 
3276 
3277  //Get the # of sigmas around an electron hypothesis for TOF and TPC
3278  Double_t nSigmaTPC;
3279  nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron);
3280 
3281  Double_t elecLikeTRD[1];
3282  if(fPIDResponse->ComputeTRDProbability(aodtrack, AliPID::kElectron, elecLikeTRD, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrack->GetTRDntrackletsPID()<4){
3283  return;
3284  }
3285 
3286  //declare emcal cluster PID variables
3287  Double_t EOP=-1;
3288  Int_t caloId=aodtrack->GetEMCALcluster();
3289 
3290  if(caloId==-99999){
3291  return;
3292  }
3293 
3294  AliAODCaloCluster* tagEMCclus=aod->GetCaloCluster(caloId);
3295 
3296  EOP = tagEMCclus->E()/aodtrack->Pt();
3297 
3298  if((nSigmaTPC<2&&nSigmaTPC>-2)||(EOP<1.4&&EOP>.8)||(elecLikeTRD[0]>.8)){
3299  isElec=kTRUE;
3300  }
3301 
3302  if(!isElec){return;}
3303 
3304  Int_t ntracks=aod->GetNumberOfTracks();
3305 
3306  for(Int_t j = 0; j < ntracks; j++) {
3307 
3308  //Don't double count the tagged tracks
3309  if(i==j){continue;}
3310 
3311  AliAODTrack* aodtrackassoc = (AliAODTrack*)aod->GetTrack(j); // pointer to reconstructed to track
3312 
3313  if(!aodtrackassoc) {
3314  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
3315  continue;
3316  }
3317 
3318  //Do hybrid track cuts
3319  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
3320 
3321  Bool_t isElecToo=kFALSE;
3322 
3323  //Fill TOF and TPC status variables
3324  AliPIDResponse::EDetPidStatus TPCStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTPC, aodtrackassoc);
3325 
3326  AliPIDResponse::EDetPidStatus TRDStatusassoc=fPIDResponse->CheckPIDStatus(AliPIDResponse::kTRD, aodtrackassoc);
3327 
3328  //Check validity of PID, TODO: Add a rejection histogram
3329  if(TPCStatusassoc!=AliPIDResponse::kDetPidOk){
3330  continue;
3331  }
3332 
3333  if(TRDStatusassoc!=AliPIDResponse::kDetPidOk){
3334  continue;
3335  }
3336 
3337 
3338  //Get the # of sigmas around an electron hypothesis for TOF and TPC
3339  Double_t nSigmaTPCassoc;
3340  nSigmaTPCassoc = fPIDResponse->NumberOfSigmasTPC(aodtrackassoc,AliPID::kElectron);
3341 
3342  Double_t elecLikeTRDassoc[1];
3343  if(fPIDResponse->ComputeTRDProbability(aodtrackassoc, AliPID::kElectron, elecLikeTRDassoc, AliTRDPIDResponse::kLQ2D) != AliPIDResponse::kDetPidOk || aodtrackassoc->GetTRDntrackletsPID()<4){
3344  return;
3345  }
3346 
3347  if((nSigmaTPCassoc<2&&nSigmaTPCassoc>-2)||(elecLikeTRDassoc[0]>.8)){
3348  isElecToo=kTRUE;
3349  }
3350 
3351  if(!isElecToo){continue;}
3352 
3353  Double_t elecE1=TMath::Sqrt(aodtrack->P()*aodtrack->P()+ElecMass*ElecMass);
3354  Double_t elecE2=TMath::Sqrt(aodtrackassoc->P()*aodtrackassoc->P()+ElecMass*ElecMass);
3355 
3356  TLorentzVector elec1(aodtrack->Px(), aodtrack->Py(), aodtrack->Pz(), elecE1);
3357  TLorentzVector elec2(aodtrackassoc->Px(), aodtrackassoc->Py(), aodtrackassoc->Pz(), elecE2);
3358 
3359  Double_t InvMass=(elec1+elec2).M();
3360  Double_t OpAng=elec1.Angle(elec2.Vect());
3361 
3362  if(aodtrack->Charge()==aodtrackassoc->Charge()&&aodtrack->Charge()!=0){
3363 
3364  if(MBtrg){
3365  fHistInvMassElecLike_MB->Fill(InvMass);
3366  fHistOpAngElecLike_MB->Fill(OpAng);
3367  }
3368  switch(trigVal){
3369  case(EMC7):
3370  fHistInvMassElecLike_EMC7->Fill(InvMass);
3371  fHistOpAngElecLike_EMC7->Fill(OpAng);
3372  break;
3373 
3374  case(EMCEGA):
3375  fHistInvMassElecLike_EMCEGA->Fill(InvMass);
3376  fHistOpAngElecLike_EMCEGA->Fill(OpAng);
3377  break;
3378 
3379  case(EMCJE):
3380  fHistInvMassElecLike_EMCJet->Fill(InvMass);
3381  fHistOpAngElecLike_EMCJet->Fill(OpAng);
3382  break;
3383  }
3384 
3385  }else if(aodtrack->Charge()!=aodtrackassoc->Charge()&&aodtrack->Charge()!=0&&aodtrackassoc->Charge()!=0){
3386  if(InvMass<0.1&&OpAng<0.1){tagPhot=kTRUE;}
3387  if(MBtrg){
3388  fHistInvMassElecUnLike_MB->Fill(InvMass);
3389  fHistOpAngElecUnLike_MB->Fill(OpAng);
3390  }
3391  switch(trigVal){
3392  case(EMC7):
3393  fHistInvMassElecUnLike_EMC7->Fill(InvMass);
3394  fHistOpAngElecUnLike_EMC7->Fill(OpAng);
3395  break;
3396 
3397  case(EMCEGA):
3398  fHistInvMassElecUnLike_EMCEGA->Fill(InvMass);
3399  fHistOpAngElecUnLike_EMCEGA->Fill(OpAng);
3400  break;
3401 
3402  case(EMCJE):
3403  fHistInvMassElecUnLike_EMCJet->Fill(InvMass);
3404  fHistOpAngElecUnLike_EMCJet->Fill(OpAng);
3405  break;
3406  }
3407  }
3408  }//end loop over tracks
3409 
3410  PostData(1, fOutputMB);
3411  PostData(2, fOutputEMC7);
3412  PostData(3, fOutputEMCEGA);
3413  PostData(4, fOutputEMCJet);
3414  return;
3415 }
3416 
3418 {
3419  if(!aod){AliWarning("Invalid AOD Event");}
3420  Int_t nTracks = aod->GetNumberOfTracks();
3421  TObjArray* accTracks = new TObjArray;
3422  accTracks->SetOwner();
3423 
3424  for(Int_t i=0;i<nTracks;i++){
3425  AliAODTrack *aodtrack = (AliAODTrack*)aod->GetTrack(i);
3426 
3427  if(!aodtrack){
3428  continue;
3429  }
3430 
3431  if(aodtrack->IsHybridGlobalConstrainedGlobal()){
3432  continue;
3433  }
3434  AliAODTrack* temp = new AliAODTrack(*aodtrack);
3435  accTracks->Add(temp);
3436  }
3437 
3438  return accTracks;
3439 }
3440 
3441 void AliAnalysisTaskPSHFE::FillMEDPhiHistos(AliAODTrack *aodtrack)
3442 {
3443  Int_t nEvents = fPool->GetCurrentNEvents();
3444 
3445  for(Int_t Ev=0;Ev<nEvents;Ev++){
3446 
3447  TObjArray *mixedTracks = fPool->GetEvent(Ev);
3448 
3449  Int_t nMixedTracks = mixedTracks->GetEntriesFast();
3450 
3451  for(Int_t j=0;j<nMixedTracks;j++){
3452  AliAODTrack* aodtrackassoc = (AliAODTrack*)mixedTracks->At(j); // pointer to reconstructed to track
3453 
3454  if(!aodtrackassoc) {
3455  AliError(Form("ERROR: Could not retrieve aodtrack %d",j));
3456  continue;
3457  }
3458 
3459  //Do hybrid track cuts
3460  if(aodtrackassoc->IsHybridGlobalConstrainedGlobal()){continue;}
3461 
3462  //Pt distribution
3463  if(MBtrg){
3464  fHistPtAssocMix_MB->Fill(aodtrackassoc->Pt());
3465  }
3466  switch(trigVal){
3467  case(EMC7):
3468  fHistPtAssocMix_EMC7->Fill(aodtrackassoc->Pt());
3469  break;
3470 
3471  case(EMCEGA):
3472  fHistPtAssocMix_EMCEGA->Fill(aodtrackassoc->Pt());
3473  break;
3474 
3475  case(EMCJE):
3476  fHistPtAssocMix_EMCJet->Fill(aodtrackassoc->Pt());
3477  break;
3478  }
3479 
3480  //Fill Delta Phi variable and correct for periodicity
3481  Double_t DPhi=aodtrackassoc->Phi()-aodtrack->Phi();
3482 
3483  if(DPhi<-TMath::Pi()/2){DPhi=TMath::Abs(2*TMath::Pi()+DPhi);}
3484 
3485  if(DPhi>3*TMath::Pi()/2){DPhi=-TMath::Abs(2*TMath::Pi()-DPhi);}
3486 
3487  Double_t DEta=aodtrackassoc->Eta()-aodtrack->Eta();
3488 
3489  //candidate 1<pt<2
3490  if(aodtrack->Pt()>1&&aodtrack->Pt()<2){
3491 
3492  //300-500MeV
3493  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
3494  if(MBtrg){
3495  fHistDPhiMix300_500_MB[0]->Fill(DPhi);
3496  }
3497  switch(trigVal){
3498  case(EMC7):
3499  fHistDPhiMix300_500_EMC7[0]->Fill(DPhi);
3500  break;
3501  case(EMCEGA):
3502  fHistDPhiMix300_500_EMCEGA[0]->Fill(DPhi);
3503  break;
3504  case(EMCJE):
3505  fHistDPhiMix300_500_EMCJet[0]->Fill(DPhi);
3506  break;
3507  }
3508  }
3509 
3510  //500MeV
3511  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
3512  if(MBtrg){
3513  fHistDPhiMix500_800_MB[0]->Fill(DPhi);
3514  }
3515  switch(trigVal){
3516  case(EMC7):
3517  fHistDPhiMix500_800_EMC7[0]->Fill(DPhi);
3518  break;
3519  case(EMCEGA):
3520  fHistDPhiMix500_800_EMCEGA[0]->Fill(DPhi);
3521  break;
3522  case(EMCJE):
3523  fHistDPhiMix500_800_EMCJet[0]->Fill(DPhi);
3524  break;
3525  }
3526  }
3527 
3528  //800MeV
3529  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
3530  if(MBtrg){
3531  fHistDPhiMix800_1_MB[0]->Fill(DPhi);
3532  }
3533  switch(trigVal){
3534  case(EMC7):
3535  fHistDPhiMix800_1_EMC7[0]->Fill(DPhi);
3536  break;
3537  case(EMCEGA):
3538  fHistDPhiMix800_1_EMCEGA[0]->Fill(DPhi);
3539  break;
3540  case(EMCJE):
3541  fHistDPhiMix800_1_EMCJet[0]->Fill(DPhi);
3542  break;
3543  }
3544  }
3545 
3546  //1GeV
3547  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3548  if(MBtrg){
3549  fHistDPhiMix1_2_MB[0]->Fill(DPhi);
3550  }
3551  switch(trigVal){
3552  case(EMC7):
3553  fHistDPhiMix1_2_EMC7[0]->Fill(DPhi);
3554  break;
3555  case(EMCEGA):
3556  fHistDPhiMix1_2_EMCEGA[0]->Fill(DPhi);
3557  break;
3558  case(EMCJE):
3559  fHistDPhiMix1_2_EMCJet[0]->Fill(DPhi);
3560  break;
3561  }
3562  }
3563 
3564  //2GeV
3565  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3566  if(MBtrg){
3567  fHistDPhiMix2_3_MB[0]->Fill(DPhi);
3568  }
3569  switch(trigVal){
3570  case(EMC7):
3571  fHistDPhiMix2_3_EMC7[0]->Fill(DPhi);
3572  break;
3573  case(EMCEGA):
3574  fHistDPhiMix2_3_EMCEGA[0]->Fill(DPhi);
3575  break;
3576  case(EMCJE):
3577  fHistDPhiMix2_3_EMCJet[0]->Fill(DPhi);
3578  break;
3579  }
3580  }
3581 
3582  //3GeV
3583  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3584  if(MBtrg){
3585  fHistDPhiMix3_4_MB[0]->Fill(DPhi);
3586  }
3587  switch(trigVal){
3588  case(EMC7):
3589  fHistDPhiMix3_4_EMC7[0]->Fill(DPhi);
3590  break;
3591  case(EMCEGA):
3592  fHistDPhiMix3_4_EMCEGA[0]->Fill(DPhi);
3593  break;
3594  case(EMCJE):
3595  fHistDPhiMix3_4_EMCJet[0]->Fill(DPhi);
3596  break;
3597  }
3598  }
3599 
3600  //5GeV
3601  if(aodtrackassoc->Pt()>4){
3602  if(MBtrg){
3603  fHistDPhiMix4_MB[0]->Fill(DPhi);
3604  }
3605  switch(trigVal){
3606  case(EMC7):
3607  fHistDPhiMix4_EMC7[0]->Fill(DPhi);
3608  break;
3609  case(EMCEGA):
3610  fHistDPhiMix4_EMCEGA[0]->Fill(DPhi);
3611  break;
3612  case(EMCJE):
3613  fHistDPhiMix4_EMCJet[0]->Fill(DPhi);
3614  break;
3615  }
3616  }
3617  }
3618 
3619  //candidate 2<pt<4
3620  if(aodtrack->Pt()>2&&aodtrack->Pt()<4){
3621 
3622  //300MeV
3623  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
3624  if(MBtrg){
3625  fHistDPhiMix300_500_MB[1]->Fill(DPhi);
3626  }
3627  switch(trigVal){
3628  case(EMC7):
3629  fHistDPhiMix300_500_EMC7[1]->Fill(DPhi);
3630  break;
3631  case(EMCEGA):
3632  fHistDPhiMix300_500_EMCEGA[1]->Fill(DPhi);
3633  break;
3634  case(EMCJE):
3635  fHistDPhiMix300_500_EMCJet[1]->Fill(DPhi);
3636  break;
3637  }
3638  }
3639 
3640  //500MeV
3641  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
3642  if(MBtrg){
3643  fHistDPhiMix500_800_MB[1]->Fill(DPhi);
3644  }
3645  switch(trigVal){
3646  case(EMC7):
3647  fHistDPhiMix500_800_EMC7[1]->Fill(DPhi);
3648  break;
3649  case(EMCEGA):
3650  fHistDPhiMix500_800_EMCEGA[1]->Fill(DPhi);
3651  break;
3652  case(EMCJE):
3653  fHistDPhiMix500_800_EMCJet[1]->Fill(DPhi);
3654  break;
3655  }
3656  }
3657 
3658  //800MeV
3659  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
3660  if(MBtrg){
3661  fHistDPhiMix800_1_MB[1]->Fill(DPhi);
3662  }
3663  switch(trigVal){
3664  case(EMC7):
3665  fHistDPhiMix800_1_EMC7[1]->Fill(DPhi);
3666  break;
3667  case(EMCEGA):
3668  fHistDPhiMix800_1_EMCEGA[1]->Fill(DPhi);
3669  break;
3670  case(EMCJE):
3671  fHistDPhiMix800_1_EMCJet[1]->Fill(DPhi);
3672  break;
3673  }
3674  }
3675 
3676  //1GeV
3677  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3678  if(MBtrg){
3679  fHistDPhiMix1_2_MB[1]->Fill(DPhi);
3680  }
3681  switch(trigVal){
3682  case(EMC7):
3683  fHistDPhiMix1_2_EMC7[1]->Fill(DPhi);
3684  break;
3685  case(EMCEGA):
3686  fHistDPhiMix1_2_EMCEGA[1]->Fill(DPhi);
3687  break;
3688  case(EMCJE):
3689  fHistDPhiMix1_2_EMCJet[1]->Fill(DPhi);
3690  break;
3691  }
3692  }
3693 
3694  //2GeV
3695  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3696  if(MBtrg){
3697  fHistDPhiMix2_3_MB[1]->Fill(DPhi);
3698  fHistDPhiMix28_MB->Fill(DPhi);
3699  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3700  }
3701  switch(trigVal){
3702  case(EMC7):
3703  fHistDPhiMix2_3_EMC7[1]->Fill(DPhi);
3704  fHistDPhiMix28_EMC7->Fill(DPhi);
3705  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3706  break;
3707  case(EMCEGA):
3708  fHistDPhiMix2_3_EMCEGA[1]->Fill(DPhi);
3709  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3710  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3711  break;
3712  case(EMCJE):
3713  fHistDPhiMix2_3_EMCJet[1]->Fill(DPhi);
3714  fHistDPhiMix28_EMCJet->Fill(DPhi);
3715  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3716  break;
3717  }
3718  }
3719 
3720  //3GeV
3721  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3722  if(MBtrg){
3723  fHistDPhiMix3_4_MB[1]->Fill(DPhi);
3724  fHistDPhiMix28_MB->Fill(DPhi);
3725  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3726  }
3727  switch(trigVal){
3728  case(EMC7):
3729  fHistDPhiMix3_4_EMC7[1]->Fill(DPhi);
3730  fHistDPhiMix28_EMC7->Fill(DPhi);
3731  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3732  break;
3733  case(EMCEGA):
3734  fHistDPhiMix3_4_EMCEGA[1]->Fill(DPhi);
3735  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3736  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3737  break;
3738  case(EMCJE):
3739  fHistDPhiMix3_4_EMCJet[1]->Fill(DPhi);
3740  fHistDPhiMix28_EMCJet->Fill(DPhi);
3741  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3742  break;
3743  }
3744  }
3745 
3746  //5GeV
3747  if(aodtrackassoc->Pt()>4){
3748  if(MBtrg){
3749  fHistDPhiMix4_MB[1]->Fill(DPhi);
3750  fHistDPhiMix28_MB->Fill(DPhi);
3751  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3752  }
3753  switch(trigVal){
3754  case(EMC7):
3755  fHistDPhiMix4_EMC7[1]->Fill(DPhi);
3756  fHistDPhiMix28_EMC7->Fill(DPhi);
3757  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3758  break;
3759  case(EMCEGA):
3760  fHistDPhiMix4_EMCEGA[1]->Fill(DPhi);
3761  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3762  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3763  break;
3764  case(EMCJE):
3765  fHistDPhiMix4_EMCJet[1]->Fill(DPhi);
3766  fHistDPhiMix28_EMCJet->Fill(DPhi);
3767  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3768  break;
3769  }
3770  }
3771  }
3772 
3773  //candidate 4<pt<8
3774  if(aodtrack->Pt()>4&&aodtrack->Pt()<8){
3775 
3776  //300MeV
3777  if(aodtrackassoc->Pt()>.3&&aodtrackassoc->Pt()<.5){
3778  if(MBtrg){
3779  fHistDPhiMix300_500_MB[2]->Fill(DPhi);
3780  }
3781  switch(trigVal){
3782  case(EMC7):
3783  fHistDPhiMix300_500_EMC7[2]->Fill(DPhi);
3784  break;
3785  case(EMCEGA):
3786  fHistDPhiMix300_500_EMCEGA[2]->Fill(DPhi);
3787  break;
3788  case(EMCJE):
3789  fHistDPhiMix300_500_EMCJet[2]->Fill(DPhi);
3790  break;
3791  }
3792  }
3793 
3794  //500MeV
3795  if(aodtrackassoc->Pt()>.5&&aodtrackassoc->Pt()<.8){
3796  if(MBtrg){
3797  fHistDPhiMix500_800_MB[2]->Fill(DPhi);
3798  }
3799  switch(trigVal){
3800  case(EMC7):
3801  fHistDPhiMix500_800_EMC7[2]->Fill(DPhi);
3802  break;
3803  case(EMCEGA):
3804  fHistDPhiMix500_800_EMCEGA[2]->Fill(DPhi);
3805  break;
3806  case(EMCJE):
3807  fHistDPhiMix500_800_EMCJet[2]->Fill(DPhi);
3808  break;
3809  }
3810  }
3811 
3812  //800MeV
3813  if(aodtrackassoc->Pt()>.8&&aodtrackassoc->Pt()<1){
3814  if(MBtrg){
3815  fHistDPhiMix800_1_MB[2]->Fill(DPhi);
3816  }
3817  switch(trigVal){
3818  case(EMC7):
3819  fHistDPhiMix800_1_EMC7[2]->Fill(DPhi);
3820  break;
3821  case(EMCEGA):
3822  fHistDPhiMix800_1_EMCEGA[2]->Fill(DPhi);
3823  break;
3824  case(EMCJE):
3825  fHistDPhiMix800_1_EMCJet[2]->Fill(DPhi);
3826  break;
3827  }
3828  }
3829 
3830  //1GeV
3831  if(aodtrackassoc->Pt()>1&&aodtrackassoc->Pt()<2){
3832  if(MBtrg){
3833  fHistDPhiMix1_2_MB[2]->Fill(DPhi);
3834  }
3835  switch(trigVal){
3836  case(EMC7):
3837  fHistDPhiMix1_2_EMC7[2]->Fill(DPhi);
3838  break;
3839  case(EMCEGA):
3840  fHistDPhiMix1_2_EMCEGA[2]->Fill(DPhi);
3841  break;
3842  case(EMCJE):
3843  fHistDPhiMix1_2_EMCJet[2]->Fill(DPhi);
3844  break;
3845  }
3846  }
3847 
3848  //2GeV
3849  if(aodtrackassoc->Pt()>2&&aodtrackassoc->Pt()<3){
3850  if(MBtrg){
3851  fHistDPhiMix2_3_MB[2]->Fill(DPhi);
3852  fHistDPhiMix28_MB->Fill(DPhi);
3853  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3854  }
3855  switch(trigVal){
3856  case(EMC7):
3857  fHistDPhiMix2_3_EMC7[2]->Fill(DPhi);
3858  fHistDPhiMix28_EMC7->Fill(DPhi);
3859  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3860  break;
3861  case(EMCEGA):
3862  fHistDPhiMix2_3_EMCEGA[2]->Fill(DPhi);
3863  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3864  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3865  break;
3866  case(EMCJE):
3867  fHistDPhiMix2_3_EMCJet[2]->Fill(DPhi);
3868  fHistDPhiMix28_EMCJet->Fill(DPhi);
3869  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3870  break;
3871  }
3872  }
3873 
3874  //3GeV
3875  if(aodtrackassoc->Pt()>3&&aodtrackassoc->Pt()<4){
3876  if(MBtrg){
3877  fHistDPhiMix3_4_MB[2]->Fill(DPhi);
3878  fHistDPhiMix28_MB->Fill(DPhi);
3879  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3880  }
3881  switch(trigVal){
3882  case(EMC7):
3883  fHistDPhiMix3_4_EMC7[2]->Fill(DPhi);
3884  fHistDPhiMix28_EMC7->Fill(DPhi);
3885  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3886  break;
3887  case(EMCEGA):
3888  fHistDPhiMix3_4_EMCEGA[2]->Fill(DPhi);
3889  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3890  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3891  break;
3892  case(EMCJE):
3893  fHistDPhiMix3_4_EMCJet[2]->Fill(DPhi);
3894  fHistDPhiMix28_EMCJet->Fill(DPhi);
3895  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3896  break;
3897  }
3898  }
3899 
3900  //5GeV
3901  if(aodtrackassoc->Pt()>4){
3902  if(MBtrg){
3903  fHistDPhiMix4_MB[2]->Fill(DPhi);
3904  fHistDPhiMix28_MB->Fill(DPhi);
3905  fHistDPhiDEtaMix28_MB->Fill(DPhi, DEta);
3906  }
3907  switch(trigVal){
3908  case(EMC7):
3909  fHistDPhiMix4_EMC7[2]->Fill(DPhi);
3910  fHistDPhiMix28_EMC7->Fill(DPhi);
3911  fHistDPhiDEtaMix28_EMC7->Fill(DPhi, DEta);
3912  break;
3913  case(EMCEGA):
3914  fHistDPhiMix4_EMCEGA[2]->Fill(DPhi);
3915  fHistDPhiMix28_EMCEGA->Fill(DPhi);
3916  fHistDPhiDEtaMix28_EMCEGA->Fill(DPhi, DEta);
3917  break;
3918  case(EMCJE):
3919  fHistDPhiMix4_EMCJet[2]->Fill(DPhi);
3920  fHistDPhiMix28_EMCJet->Fill(DPhi);
3921  fHistDPhiDEtaMix28_EMCJet->Fill(DPhi, DEta);
3922  break;
3923  }
3924  }
3925  }
3926  }
3927  }
3928  PostData(1, fOutputMB);
3929  PostData(2, fOutputEMC7);
3930  PostData(3, fOutputEMCEGA);
3931  PostData(4, fOutputEMCJet);
3932  return;
3933 }
3934 
3935 //________________________________________________________________________
3937 {
3938 
3939 }
void FillPIDHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse)
double Double_t
Definition: External.C:58
Definition: External.C:236
void FillDPhiHistos(AliAODEvent *esd, AliAODTrack *aodtrack, Int_t i)
void FillPhotoElecHistos(AliAODEvent *aod, AliAODTrack *aodtrack, AliPIDResponse *fPIDResponse, Int_t i)
virtual void Terminate(Option_t *)
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
TObjArray * MakeTrkArr(AliAODEvent *aod)
AliEventPoolManager * fPoolMan
void SetElectronTrackCuts(Bool_t trkCutBool)
AliESDtrackCuts * fTrackCutsWeak
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
ClassImp(AliAnalysisTaskPSHFE) AliAnalysisTaskPSHFE
Float_t nEvents[nProd]
Input train file.
virtual void UserExec(Option_t *option)
virtual void UserCreateOutputObjects()
const char Option_t
Definition: External.C:48
void FillMEDPhiHistos(AliAODTrack *aodtrack)
bool Bool_t
Definition: External.C:53
void SetSSCutBool(Bool_t SSCutBool)
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
AliESDtrackCuts * fTrackCutsStrong