AliPhysics  d3874b5 (d3874b5)
AliAnalysisTaskConvCaloCalibration.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2020, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: Friederike Bock, Joshua König *
5  * Version 1.0 *
6  * *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //----------------------------------------------------------------
19 // Class used to do analysis on conversion photons + calo photons
20 //----------------------------------------------------------------
22 #include "TChain.h"
23 #include "TTree.h"
24 #include "TBranch.h"
25 #include "TFile.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TH3F.h"
29 #include "THnSparse.h"
30 #include "TCanvas.h"
31 #include "TNtuple.h"
32 #include "AliAnalysisTask.h"
33 #include "AliAnalysisManager.h"
34 #include "AliESDEvent.h"
35 #include "AliESDInputHandler.h"
36 #include "AliMCEventHandler.h"
37 #include "AliMCEvent.h"
38 #include "AliMCParticle.h"
39 #include "AliCentrality.h"
40 #include "AliESDVZERO.h"
41 #include "AliESDpid.h"
43 #include "AliVParticle.h"
44 #include "AliESDtrack.h"
45 #include "AliESDtrackCuts.h"
46 #include "AliKFVertex.h"
47 #include "AliGenCocktailEventHeader.h"
49 #include "AliAODMCParticle.h"
50 #include "AliAODMCHeader.h"
51 #include "AliEventplane.h"
53 #include "AliAODEvent.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDEvent.h"
56 #include "AliESDInputHandler.h"
57 #include "AliInputEventHandler.h"
58 #include "AliCaloTrackMatcher.h"
59 #include <vector>
60 #include <map>
61 
63 
64 //________________________________________________________________________
66  fRandom(0),
67  fV0Reader(NULL),
68  fBGHandler(NULL),
69  fBGHandlerRP(NULL),
70  fBGClusHandler(NULL),
71  fBGClusHandlerRP(NULL),
72  fInputEvent(NULL),
73  fMCEvent(NULL),
74  fEventCuts(NULL),
75  fConversionCuts(NULL),
76  fCaloPhotonCuts(NULL),
77  fMesonCuts(NULL),
78  fGeomEMCAL(NULL),
79  fCutFolder(NULL),
80  fESDList(NULL),
81  fBackList(NULL),
82  fMotherList(NULL),
83  fOutputContainer(NULL),
84  fGammaCandidates(NULL),
85  fClusterCandidates(NULL),
86  fEventCutArray(NULL),
87  fCutArray(NULL),
88  fClusterCutArray(NULL),
89  fMesonCutArray(NULL),
90  fReaderGammas(NULL),
91  fV0ReaderName("V0ReaderV1"),
92  fCorrTaskSetting(""),
93  fFileNameBroken(NULL),
94  fSparseMotherInvMassPtZM(NULL),
95  fSparseMotherBackInvMassPtZM(NULL),
96  fTreeBrokenFiles(NULL),
97  fHistoMotherInvMassPt(NULL),
98  fHistoMotherMatchedInvMassPt(NULL),
99  fHistoMotherBackInvMassPt(NULL),
100  fHistoMotherMesonPtY(NULL),
101  fHistoMotherMesonPtAlpha(NULL),
102  fHistoMotherMesonPtOpenAngle(NULL),
103  fHistoMotherMesonConvPhotonEtaPhi(NULL),
104  fHistoSPDClusterTrackletBackground(NULL),
105  fHistoMotherInvMassECalibSM(NULL),
106  fHistoMotherBackInvMassECalibSM(NULL),
107  fHistoMotherInvMassECalib(NULL),
108  fHistoMotherBackInvMassECalib(NULL),
109  fProfileEtaShift(NULL),
110  fProfileJetJetXSection(NULL),
111  // fHistoMCHeaders(NULL),
112  fHistoConvGammaPt(NULL),
113  fHistoClusGammaPt(NULL),
114  fHistoClusGammaE(NULL),
115  fHistoClusGammaPtSM(NULL),
116  fHistoClusGammaESM(NULL),
117  fHistoClusOverlapHeadersGammaPt(NULL),
118  fHistoClusAllHeadersGammaPt(NULL),
119  fHistoClusRejectedHeadersGammaPt(NULL),
120  fHistoMotherInvMassRejected(NULL),
121  fHistoNEvents(NULL),
122  fHistoNEventsWOWeight(NULL),
123  fHistoNGoodESDTracks(NULL),
124  fHistoVertexZ(NULL),
125  fHistoVertexX(NULL),
126  fHistoVertexY(NULL),
127  fHistoNGammaConvCandidates(NULL),
128  fHistoNGammaCaloCandidates(NULL),
129  fHistoNV0Tracks(NULL),
130  fHistoJetJetNTrials(NULL),
131  fUnsmearedPx(NULL),
132  fUnsmearedPy(NULL),
133  fUnsmearedPz(NULL),
134  fUnsmearedE(NULL),
135  fMesonInvMassWindow(NULL),
136  fMCEventPos(NULL),
137  fMCEventNeg(NULL),
138  fESDArrayPos(NULL),
139  fESDArrayNeg(NULL),
140  fEventPlaneAngle(-100),
141  fMesonInvMassMin(0),
142  fMesonInvMassMax(0),
143  fMesonInvMassNBins(0),
144  fWeightJetJetMC(1),
145  fNGammaCandidates(0),
146  fnCuts(0),
147  fiCut(0),
148  fIsHeavyIon(0),
149  fMesonRecoMode(-1),
150  fMesonType(-1),
151  fMesonPDG(0),
152  fDoMesonQA(0),
153  fDoPhotonQA(0),
154  fDoClusterQA(0),
155  fIsMC(0),
156  fnModules(20),
157  fMoveParticleAccordingToVertex(kTRUE),
158  fDoLightOutput(kFALSE),
159  fIsFromDesiredHeader(kTRUE),
160  fIsOverlappingWithOtherHeader(kFALSE),
161  fDoTHnSparse(kTRUE),
162  fSetPlotHistsExtQA(kFALSE),
163  fDoConvGammaShowerShapeTree(kFALSE),
164  fEnableSortForClusMC(kFALSE),
165  fDoPrimaryTrackMatching(kFALSE),
166  fDoInvMassShowerShapeTree(kFALSE),
167  fAllowOverlapHeaders(kTRUE),
168  fEnableClusterCutsForTrigger(kFALSE)
169 {
170 
171 }
172 
173 //________________________________________________________________________
175  AliAnalysisTaskSE(name),
176  fRandom(0),
177  fV0Reader(NULL),
178  fBGHandler(NULL),
179  fBGHandlerRP(NULL),
180  fBGClusHandler(NULL),
181  fBGClusHandlerRP(NULL),
182  fInputEvent(NULL),
183  fMCEvent(NULL),
184  fEventCuts(NULL),
185  fConversionCuts(NULL),
186  fCaloPhotonCuts(NULL),
187  fMesonCuts(NULL),
188  fGeomEMCAL(NULL),
189  fCutFolder(NULL),
190  fESDList(NULL),
191  fBackList(NULL),
192  fMotherList(NULL),
193  fOutputContainer(NULL),
194  fGammaCandidates(NULL),
195  fClusterCandidates(NULL),
196  fEventCutArray(NULL),
197  fCutArray(NULL),
198  fClusterCutArray(NULL),
199  fMesonCutArray(NULL),
200  fReaderGammas(NULL),
201  fV0ReaderName("V0ReaderV1"),
202  fCorrTaskSetting(""),
203  fFileNameBroken(NULL),
204  fSparseMotherInvMassPtZM(NULL),
205  fSparseMotherBackInvMassPtZM(NULL),
206  fTreeBrokenFiles(NULL),
207  fHistoMotherInvMassPt(NULL),
208  fHistoMotherMatchedInvMassPt(NULL),
209  fHistoMotherBackInvMassPt(NULL),
210  fHistoMotherMesonPtY(NULL),
211  fHistoMotherMesonPtAlpha(NULL),
212  fHistoMotherMesonPtOpenAngle(NULL),
213  fHistoMotherMesonConvPhotonEtaPhi(NULL),
214  fHistoSPDClusterTrackletBackground(NULL),
215  fHistoMotherInvMassECalibSM(NULL),
216  fHistoMotherBackInvMassECalibSM(NULL),
217  fHistoMotherInvMassECalib(NULL),
218  fHistoMotherBackInvMassECalib(NULL),
219  fProfileEtaShift(NULL),
220  fProfileJetJetXSection(NULL),
221  // fHistoMCHeaders(NULL),
222  fHistoConvGammaPt(NULL),
223  fHistoClusGammaPt(NULL),
224  fHistoClusGammaE(NULL),
225  fHistoClusGammaPtSM(NULL),
226  fHistoClusGammaESM(NULL),
227  fHistoClusOverlapHeadersGammaPt(NULL),
228  fHistoClusAllHeadersGammaPt(NULL),
229  fHistoClusRejectedHeadersGammaPt(NULL),
230  fHistoMotherInvMassRejected(NULL),
231  fHistoNEvents(NULL),
232  fHistoNEventsWOWeight(NULL),
233  fHistoNGoodESDTracks(NULL),
234  fHistoVertexZ(NULL),
235  fHistoVertexX(NULL),
236  fHistoVertexY(NULL),
237  fHistoNGammaConvCandidates(NULL),
238  fHistoNGammaCaloCandidates(NULL),
239  fHistoNV0Tracks(NULL),
240  fHistoJetJetNTrials(NULL),
241  fUnsmearedPx(NULL),
242  fUnsmearedPy(NULL),
243  fUnsmearedPz(NULL),
244  fUnsmearedE(NULL),
245  fMesonInvMassWindow(NULL),
246  fMCEventPos(NULL),
247  fMCEventNeg(NULL),
248  fESDArrayPos(NULL),
249  fESDArrayNeg(NULL),
250  fEventPlaneAngle(-100),
251  fMesonInvMassMin(0),
252  fMesonInvMassMax(0),
253  fMesonInvMassNBins(0),
254  fWeightJetJetMC(1),
255  fNGammaCandidates(0),
256  fnCuts(0),
257  fiCut(0),
258  fIsHeavyIon(0),
259  fMesonRecoMode(-1),
260  fMesonType(-1),
261  fMesonPDG(0),
262  fDoMesonQA(0),
263  fDoPhotonQA(0),
264  fDoClusterQA(0),
265  fIsMC(0),
266  fnModules(20),
267  fMoveParticleAccordingToVertex(kTRUE),
268  fDoLightOutput(kFALSE),
269  fIsFromDesiredHeader(kTRUE),
270  fIsOverlappingWithOtherHeader(kFALSE),
271  fDoTHnSparse(kTRUE),
272  fSetPlotHistsExtQA(kFALSE),
273  fDoConvGammaShowerShapeTree(kFALSE),
274  fEnableSortForClusMC(kFALSE),
275  fDoPrimaryTrackMatching(kFALSE),
276  fDoInvMassShowerShapeTree(kFALSE),
277  fAllowOverlapHeaders(kTRUE),
278  fEnableClusterCutsForTrigger(kFALSE)
279 {
280  // Define output slots here
281  DefineOutput(1, TList::Class());
282 }
283 
285 {
286  if(fGammaCandidates){
287  delete fGammaCandidates;
288  fGammaCandidates = 0x0;
289  }
290  if(fClusterCandidates){
291  delete fClusterCandidates;
292  fClusterCandidates = 0x0;
293  }
294  if(fBGHandler){
295  delete[] fBGHandler;
296  fBGHandler = 0x0;
297  }
298  if(fBGHandlerRP){
299  delete[] fBGHandlerRP;
300  fBGHandlerRP = 0x0;
301  }
302  if(fBGClusHandler){
303  delete[] fBGClusHandler;
304  fBGClusHandler = 0x0;
305  }
306  if(fBGClusHandlerRP){
307  delete[] fBGClusHandlerRP;
308  fBGClusHandlerRP = 0x0;
309  }
310 }
311 //___________________________________________________________
313 
314  const Int_t nDim = 4;
315  Int_t nBins[nDim] = {800,300,7,4};
316  Double_t xMin[nDim] = {0,0, 0,0};
317  Double_t xMax[nDim] = {0.8,30,7,4};
318 
319  if(fDoTHnSparse){
320  fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
321  fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
322  }
323 
326 
329 
330  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
331  if (((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
332  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
333  TString cutstringConvGamma = "";
334  TString cutstringCaloGamma = "";
335  if (fMesonRecoMode < 2) cutstringConvGamma = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber();
336  if (fMesonRecoMode > 0 || fEnableClusterCutsForTrigger ) cutstringCaloGamma = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
337  TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
338 
339  TString fullCutString = "";
340  if (fMesonRecoMode == 0) fullCutString = Form("%i_%s_%s_%s",fMesonRecoMode, cutstringEvent.Data(), cutstringConvGamma.Data(), cutstringMeson.Data());
341  else if (fMesonRecoMode == 1) fullCutString = Form("%i_%s_%s_%s_%s",fMesonRecoMode, cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(), cutstringMeson.Data());
342  else if (fMesonRecoMode == 2) fullCutString = Form("%i_%s_%s_%s",fMesonRecoMode, cutstringEvent.Data(), cutstringCaloGamma.Data(), cutstringMeson.Data());
343 
344  Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1));
345  Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1));
346  Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1));
347 
348  if( collisionSystem == 1 || collisionSystem == 2 ||
349  collisionSystem == 5 || collisionSystem == 8 ||
350  collisionSystem == 9){
351  centMin = centMin*10;
352  centMax = centMax*10;
353  if(centMax ==0 && centMax!=centMin) centMax=100;
354  }else if(collisionSystem == 3 || collisionSystem == 6){
355  centMin = centMin*5;
356  centMax = centMax*5;
357  }else if(collisionSystem == 4 || collisionSystem == 7){
358  centMin = ((centMin*5)+45);
359  centMax = ((centMax*5)+45);
360  }
361 
362  if(fDoTHnSparse){
363  fBackList[iCut] = new TList();
364  fBackList[iCut]->SetName(Form("%s Back histograms",fullCutString.Data()));
365  fBackList[iCut]->SetOwner(kTRUE);
366  fCutFolder[iCut]->Add(fBackList[iCut]);
367 
368  fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m", "Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
369  fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
370 
371  fMotherList[iCut] = new TList();
372  fMotherList[iCut]->SetName(Form("%s Mother histograms",fullCutString.Data()));
373  fMotherList[iCut]->SetOwner(kTRUE);
374  fCutFolder[iCut]->Add(fMotherList[iCut]);
375 
376  fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m", "Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
377  fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]);
378  }
379 
380  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
381  fBGHandler[iCut] = new AliGammaConversionAODBGHandler( collisionSystem,centMin,centMax,
382  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
383  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
384  2,8,5);
385  fBGClusHandler[iCut] = new AliGammaConversionAODBGHandler( collisionSystem,centMin,centMax,
386  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
387  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
388  2,8,5);
389  fBGHandlerRP[iCut] = NULL;
390  }else{
392  ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(),
393  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents());
395  ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(),
396  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents());
397  fBGHandler[iCut] = NULL;
398  }
399  }
400  }
401 }
402 
403 //________________________________________________________________________
405 
406  fV0Reader = (AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data());
407  if(!fV0Reader){printf("Error: No V0 Reader");return;}// GetV0Reader
408  if (fIsMC == 2){
409  fDoClusterQA = 0;
410  fDoTHnSparse = kFALSE;
411  } else if (fIsMC == 3){
412  fDoTHnSparse = kFALSE;
413  }
414 
415  if (fMesonRecoMode == 2)
417 
418  // Create histograms
419  if(fOutputContainer != NULL){
420  delete fOutputContainer;
421  fOutputContainer = NULL;
422  }
423  if(fOutputContainer == NULL){
424  fOutputContainer = new TList();
425  fOutputContainer->SetOwner(kTRUE);
426  }
427 
428  // Array of current cut's gammas
429  fGammaCandidates = new TList();
430  fClusterCandidates = new TList();
431  fClusterCandidates->SetOwner(kTRUE);
432 
433  fCutFolder = new TList*[fnCuts];
434  fESDList = new TList*[fnCuts];
435 
436  if(fDoTHnSparse){
437  fBackList = new TList*[fnCuts];
438  fMotherList = new TList*[fnCuts];
439  }
440 
441  fHistoNEvents = new TH1F*[fnCuts];
442  if (fIsMC > 1){
443  fHistoNEventsWOWeight = new TH1F*[fnCuts];
444  }
445  if (fIsMC == 2){
446  fProfileJetJetXSection = new TProfile*[fnCuts];
447  fHistoJetJetNTrials = new TH1F*[fnCuts];
448  }
449  fHistoNGoodESDTracks = new TH1F*[fnCuts];
450  fHistoVertexZ = new TH1F*[fnCuts];
451  if(!fDoLightOutput){
452  fHistoVertexX = new TH1F*[fnCuts];
453  fHistoVertexY = new TH1F*[fnCuts];
454  }
455  if (fMesonRecoMode < 2) fHistoNGammaConvCandidates = new TH1F*[fnCuts];
456  if(fIsHeavyIon==2) fProfileEtaShift = new TProfile*[fnCuts];
457  if(!fDoLightOutput){
459  fHistoNV0Tracks = new TH1F*[fnCuts];
460  if (fMesonRecoMode < 2)
461  fHistoConvGammaPt = new TH1F*[fnCuts];
462  }
463 
465 
466  fHistoNGammaCaloCandidates = new TH1F*[fnCuts];
467  fHistoClusGammaPt = new TH1F*[fnCuts];
468  fHistoClusGammaE = new TH1F*[fnCuts];
469  fHistoClusGammaPtSM = new TH1F**[fnCuts];
470  fHistoClusGammaESM = new TH1F**[fnCuts];
471  for(Int_t icuts = 0; icuts < fnCuts; icuts++){
472  fHistoClusGammaPtSM[icuts] = new TH1F*[fnModules];
473  fHistoClusGammaESM[icuts] = new TH1F*[fnModules];
474  }
475  }
476 
478  fHistoMotherInvMassRejected = new TH1F*[fnCuts];
482  for(Int_t icuts = 0; icuts < fnCuts; icuts++){
485  }
488  if(!fDoLightOutput && fMesonRecoMode == 1){
490  }
491  if (fDoMesonQA > 0){
496  }
497 
498  fMesonInvMassWindow = new Double_t[2];
499  if (fMesonType < 0 || fMesonType > 2){
500  if(!fV0Reader){printf("Error: No V0 Reader");return;}// GetV0Reader
501  } else if (fMesonType == 0){ // pi0 case 134.9770 ± 0.0005 MeV
502  fMesonPDG = 111;
503  fMesonInvMassMin = 0.;
504  fMesonInvMassMax = 0.300;
505  fMesonInvMassNBins = 300;
506  fMesonInvMassWindow[0] = 0.05;
507  fMesonInvMassWindow[1] = 0.17;
508  } else if (fMesonType == 1){ // eta case 547.862 ± 0.017 MeV
509  fMesonPDG = 221;
510  fMesonInvMassMin = 0.300;
511  fMesonInvMassMax = 0.800;
512  fMesonInvMassNBins = 500;
513  fMesonInvMassWindow[0] = 0.45;
514  fMesonInvMassWindow[1] = 0.65;
515  } else if (fMesonType == 2){ // eta' case 957.78 ± 0.06 MeV
516  fMesonPDG = 331;
517  fMesonInvMassMin = 0.700;
518  fMesonInvMassMax = 1.200;
519  fMesonInvMassNBins = 500;
520  fMesonInvMassWindow[0] = 0.85;
521  fMesonInvMassWindow[1] = 1.05;
522  }
523  // set common binning in pT for mesons and photons
524  Int_t nBinsPt = 200;
525  Float_t binWidthPt = 0.1;
526  Float_t minPt = 0;
527  Float_t maxPt = 20;
528  Int_t nBinsQAPt = 170;
529  Float_t maxQAPt = 20;
530  Int_t nBinsClusterPt = 500;
531  Float_t maxClusterPt = 50;
532  Double_t *arrPtBinning = new Double_t[1200];
533  Double_t *arrQAPtBinning = new Double_t[1200];
534  Double_t *arrClusPtBinning = new Double_t[1200];
535  // Set special pt binning for pp 13TeV, pPb 8TeV
536  if ( ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k13TeV ||
539  if(fMesonRecoMode < 2){
540  nBinsPt = 235;
541  minPt = 0;
542  maxPt = 50;
543  binWidthPt = 0.05;
544  for(Int_t i=0; i<nBinsPt+1;i++){
545  if (i < 1) arrPtBinning[i] = 0.3*i;
546  else if(i<55) arrPtBinning[i] = 0.3+0.05*(i-1);
547  else if(i<125) arrPtBinning[i] = 3.+0.1*(i-55);
548  else if(i<185) arrPtBinning[i] = 10.+0.25*(i-125);
549  else if(i<235) arrPtBinning[i] = 25.+0.5*(i-185);
550  else arrPtBinning[i] = maxPt;
551  }
552  nBinsQAPt = 221;
553  maxQAPt = 50;
554  for(Int_t i=0; i<nBinsQAPt+1;i++){
555  if(i<60) arrQAPtBinning[i] = 0.05*i;
556  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
557  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
558  else if(i<210) arrQAPtBinning[i] = 20.+0.5*(i-170);
559  else if(i<221) arrQAPtBinning[i] = 40.+1.0*(i-210);
560  else arrQAPtBinning[i] = maxQAPt;
561  }
562  nBinsClusterPt = 351;
563  maxClusterPt = 50;
564  for(Int_t i=0; i<nBinsClusterPt+1;i++){
565  if (i < 1) arrClusPtBinning[i] = 0.3*i;
566  else if(i<55) arrClusPtBinning[i] = 0.3+0.05*(i-1);
567  else if(i<125) arrClusPtBinning[i] = 3.+0.1*(i-55);
568  else if(i<155) arrClusPtBinning[i] = 10.+0.2*(i-125);
569  else if(i<211) arrClusPtBinning[i] = 16.+0.25*(i-155);
570  else if(i<251) arrClusPtBinning[i] = 30.+0.5*(i-211);
571  else arrClusPtBinning[i] = maxClusterPt;
572  }
573 
574  } else if(fMesonRecoMode == 2){
575  nBinsPt = 165;
576  minPt = 0;
577  maxPt = 20;
578  binWidthPt = 0.05;
579  for(Int_t i=0; i<nBinsPt+1;i++){
580  if (i < 1) arrPtBinning[i] = 0.3*i;
581  else if(i<55) arrPtBinning[i] = 0.3+0.05*(i-1);
582  else if(i<125) arrPtBinning[i] = 3.+0.1*(i-55);
583  else if(i<165) arrPtBinning[i] = 10.+0.25*(i-125);
584  else arrPtBinning[i] = maxPt;
585  }
586  nBinsQAPt = 210;
587  maxQAPt = 20;
588  for(Int_t i=0; i<nBinsQAPt+1;i++){
589  if(i<60) arrQAPtBinning[i] = 0.05*i;
590  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
591  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
592  else arrQAPtBinning[i] = maxQAPt;
593  }
594  nBinsClusterPt = 171;
595  maxClusterPt = 20;
596  for(Int_t i=0; i<nBinsClusterPt+1;i++){
597  if (i < 1) arrClusPtBinning[i] = 0.3*i;
598  else if(i<55) arrClusPtBinning[i] = 0.3+0.05*(i-1);
599  else if(i<125) arrClusPtBinning[i] = 3.+0.1*(i-55);
600  else if(i<155) arrClusPtBinning[i] = 10.+0.2*(i-125);
601  else if(i<171) arrClusPtBinning[i] = 16.+0.25*(i-155);
602  else arrClusPtBinning[i] = maxClusterPt;
603  }
604  }
605 
606  // default binning
607  } else {
608  nBinsPt = 235;
609  minPt = 0;
610  maxPt = 50;
611  binWidthPt = 0.05;
612  for(Int_t i=0; i<nBinsPt+1;i++){
613  if (i < 1) arrPtBinning[i] = 0.3*i;
614  else if(i<55) arrPtBinning[i] = 0.3+0.05*(i-1);
615  else if(i<125) arrPtBinning[i] = 3.+0.1*(i-55);
616  else if(i<185) arrPtBinning[i] = 10.+0.25*(i-125);
617  else if(i<235) arrPtBinning[i] = 25.+0.5*(i-185);
618  else arrPtBinning[i] = maxPt;
619  }
620  nBinsQAPt = 221;
621  maxQAPt = 50;
622  for(Int_t i=0; i<nBinsQAPt+1;i++){
623  if(i<60) arrQAPtBinning[i] = 0.05*i;
624  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
625  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
626  else if(i<210) arrQAPtBinning[i] = 20.+0.5*(i-170);
627  else if(i<221) arrQAPtBinning[i] = 40.+1.0*(i-210);
628  else arrQAPtBinning[i] = maxQAPt;
629  }
630  nBinsClusterPt = 351;
631  maxClusterPt = 50;
632  for(Int_t i=0; i<nBinsClusterPt+1;i++){
633  if (i < 1) arrClusPtBinning[i] = 0.3*i;
634  else if(i<55) arrClusPtBinning[i] = 0.3+0.05*(i-1);
635  else if(i<125) arrClusPtBinning[i] = 3.+0.1*(i-55);
636  else if(i<155) arrClusPtBinning[i] = 10.+0.2*(i-125);
637  else if(i<211) arrClusPtBinning[i] = 16.+0.25*(i-155);
638  else if(i<251) arrClusPtBinning[i] = 30.+0.5*(i-211);
639  else arrClusPtBinning[i] = maxClusterPt;
640  }
641  }
642 
643  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
644  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
645  TString cutstringConvGamma = "";
646  TString cutstringCaloGamma = "";
647  if (fMesonRecoMode < 2) cutstringConvGamma = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber();
648  if (fMesonRecoMode > 0 || fEnableClusterCutsForTrigger) cutstringCaloGamma = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
649  TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
650 
651  TString fullCutString = "";
652  if (fMesonRecoMode == 0) fullCutString = Form("%i_%s_%s_%s",fMesonRecoMode, cutstringEvent.Data(), cutstringConvGamma.Data(), cutstringMeson.Data());
653  else if (fMesonRecoMode == 1) fullCutString = Form("%i_%s_%s_%s_%s",fMesonRecoMode, cutstringEvent.Data(),cutstringConvGamma.Data(),cutstringCaloGamma.Data(), cutstringMeson.Data());
654  else if (fMesonRecoMode == 2) fullCutString = Form("%i_%s_%s_%s",fMesonRecoMode, cutstringEvent.Data(), cutstringCaloGamma.Data(), cutstringMeson.Data());
655 
656  fCutFolder[iCut] = new TList();
657  fCutFolder[iCut]->SetName(Form("Cut Number %s",fullCutString.Data()));
658  fCutFolder[iCut]->SetOwner(kTRUE);
659  fOutputContainer->Add(fCutFolder[iCut]);
660  fESDList[iCut] = new TList();
661  fESDList[iCut]->SetName(Form("%s ESD histograms",fullCutString.Data()));
662  fESDList[iCut]->SetOwner(kTRUE);
663  fCutFolder[iCut]->Add(fESDList[iCut]);
664 
665  fHistoNEvents[iCut] = new TH1F("NEvents", "NEvents", 14, -0.5, 13.5);
666  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
667  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
668  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
669  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
670  TString TriggerNames = "Not Trigger: ";
671  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
672  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
673  }else {
674  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
675  }
676  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
677  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
678  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
679  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
680  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
681  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
682  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
683  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
684  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
685  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
686  fESDList[iCut]->Add(fHistoNEvents[iCut]);
687 
688  if (fIsMC > 1){
689  fHistoNEventsWOWeight[iCut] = new TH1F("NEventsWOWeight", "NEventsWOWeight", 14, -0.5, 13.5);
690  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
691  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
692  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
693  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
694  TString TriggerNames = "Not Trigger: ";
695  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
696  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
697  }else {
698  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
699  }
700  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
701  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
702  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
703  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
704  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
705  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
706  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
707  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
708  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
709  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
710  fESDList[iCut]->Add(fHistoNEventsWOWeight[iCut]);
711  }
712 
713  if (fIsMC == 2){
714  fProfileJetJetXSection[iCut] = new TProfile("XSection", "XSection", 1, -0.5, 0.5);
715  fESDList[iCut]->Add(fProfileJetJetXSection[iCut]);
716  fHistoJetJetNTrials[iCut] = new TH1F("NTrials", "#sum{NTrials}", 1, 0, 1);
717  fHistoJetJetNTrials[iCut]->GetXaxis()->SetBinLabel(1,"#sum{NTrials}");
718  fESDList[iCut]->Add(fHistoJetJetNTrials[iCut]);
719  }
720 
721  if(fIsHeavyIon == 1)
722  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks; # TPC tracks", 4000, 0, 4000);
723  else if(fIsHeavyIon == 2)
724  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks; # TPC tracks", 400, 0, 400);
725  else
726  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks; # TPC tracks", 200, 0, 200);
727  fESDList[iCut]->Add(fHistoNGoodESDTracks[iCut]);
728 
729  fHistoVertexZ[iCut] = new TH1F("VertexZ", "VertexZ", 200, -10, 10);
730  fESDList[iCut]->Add(fHistoVertexZ[iCut]);
731  if(!fDoLightOutput){
732  fHistoVertexX[iCut] = new TH1F("VertexX", "VertexX", 100, -5, 5);
733  fESDList[iCut]->Add(fHistoVertexX[iCut]);
734  fHistoVertexY[iCut] = new TH1F("VertexY", "VertexY", 100, -5, 5);
735  fESDList[iCut]->Add(fHistoVertexY[iCut]);
736  }
737 
738  if (fMesonRecoMode < 2){
739  if(fIsHeavyIon == 1)
740  fHistoNGammaConvCandidates[iCut] = new TH1F("GammaConvCandidates", "GammaConvCandidates; # accepted #gamma_{conv}", 100, 0, 100);
741  else if(fIsHeavyIon == 2)
742  fHistoNGammaConvCandidates[iCut] = new TH1F("GammaConvCandidates", "GammaConvCandidates; # accepted #gamma_{conv}", 50, 0, 50);
743  else
744  fHistoNGammaConvCandidates[iCut] = new TH1F("GammaConvCandidates", "GammaConvCandidates; # accepted #gamma_{conv}", 50, 0, 50);
745  fESDList[iCut]->Add(fHistoNGammaConvCandidates[iCut]);
746  }
747  if (fMesonRecoMode > 0){ //if (fMesonRecoMode > 0 || fEnableClusterCutsForTrigger){
748  if(fIsHeavyIon == 1)
749  fHistoNGammaCaloCandidates[iCut] = new TH1F("GammaCaloCandidates", "GammaCaloCandidates; # accepted #gamma_{conv}", 100, 0, 100);
750  else if(fIsHeavyIon == 2)
751  fHistoNGammaCaloCandidates[iCut] = new TH1F("GammaCaloCandidates", "GammaCaloCandidates; # accepted #gamma_{conv}", 50, 0, 50);
752  else
753  fHistoNGammaCaloCandidates[iCut] = new TH1F("GammaCaloCandidates", "GammaCaloCandidates; # accepted #gamma_{conv}", 50, 0, 50);
754  fESDList[iCut]->Add(fHistoNGammaCaloCandidates[iCut]);
755 
756  }
757 
758  if(!fDoLightOutput){
759  fHistoSPDClusterTrackletBackground[iCut] = new TH2F("SPD tracklets vs SPD clusters", "SPD tracklets vs SPD clusters", 100, 0, 200, 250, 0, 1000);
761 
762  if(fIsHeavyIon == 1)
763  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity; VZERO amp [arb. units]", 30000, 0, 30000);
764  else if(fIsHeavyIon == 2)
765  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity; VZERO amp [arb. units]", 2500, 0, 2500);
766  else
767  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity; VZERO amp [arb. units]", 1500, 0, 1500);
768  fESDList[iCut]->Add(fHistoNV0Tracks[iCut]);
769 
770  if (fMesonRecoMode < 2){
771  fHistoConvGammaPt[iCut] = new TH1F("ESD_ConvGamma_Pt", "ESD_ConvGamma_Pt; p_{T,conv}(GeV/c)", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
772  fESDList[iCut]->Add(fHistoConvGammaPt[iCut]);
773  }
775  fHistoClusGammaPt[iCut] = new TH1F("ClusGamma_Pt", "ClusGamma_Pt; p_{T,clus} (GeV/c)", nBinsClusterPt, arrClusPtBinning);
776  fESDList[iCut]->Add(fHistoClusGammaPt[iCut]);
777  fHistoClusGammaE[iCut] = new TH1F("ClusGamma_E", "ClusGamma_E; E_{clus} (GeV)", nBinsClusterPt, arrClusPtBinning);
778  fESDList[iCut]->Add(fHistoClusGammaE[iCut]);
779  }
780  }
781 
782  if(fIsHeavyIon == 2){
783  fProfileEtaShift[iCut] = new TProfile("Eta Shift", "Eta Shift", 1, -0.5, 0.5);
784  fESDList[iCut]->Add(fProfileEtaShift[iCut]);
785  }
786 
787  if (fIsMC > 1){
788  fHistoNEvents[iCut]->Sumw2();
789  fHistoNGoodESDTracks[iCut]->Sumw2();
790  fHistoVertexZ[iCut]->Sumw2();
791  if (fMesonRecoMode < 2) fHistoNGammaConvCandidates[iCut]->Sumw2();
793  if(!fDoLightOutput){
794  fHistoVertexX[iCut]->Sumw2();
795  fHistoVertexY[iCut]->Sumw2();
796  fHistoSPDClusterTrackletBackground[iCut]->Sumw2();
797  fHistoNV0Tracks[iCut]->Sumw2();
798  if (fMesonRecoMode < 2)
799  fHistoConvGammaPt[iCut]->Sumw2();
801  if (fHistoClusGammaPt[iCut]) fHistoClusGammaPt[iCut]->Sumw2();
802  if (fHistoClusGammaE[iCut]) fHistoClusGammaE[iCut]->Sumw2();
806  }
807  }
808  }
809 
810  for(Int_t iModules = 0; iModules < fnModules; iModules++ ){
811  fHistoMotherInvMassECalibSM[iCut][iModules] = new TH2F(Form("ESD_Mother_InvMass_E_Calib_SM%i",iModules), Form("ESD_Mother_InvMass_E_Calib_SM%i",iModules), fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
812  fHistoMotherInvMassECalibSM[iCut][iModules]->SetXTitle("M_{inv} (GeV/c^{2})");
813  fHistoMotherInvMassECalibSM[iCut][iModules]->SetYTitle("E_{cluster}(GeV)");
814  fESDList[iCut]->Add(fHistoMotherInvMassECalibSM[iCut][iModules]);
815  fHistoMotherBackInvMassECalibSM[iCut][iModules] = new TH2F(Form("ESD_Back_InvMass_E_Calib_SM%i",iModules), Form("ESD_Back_InvMass_E_Calib_SM%i",iModules), fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
816  fHistoMotherBackInvMassECalibSM[iCut][iModules]->SetXTitle("M_{inv} (GeV/c^{2})");
817  fHistoMotherBackInvMassECalibSM[iCut][iModules]->SetYTitle("E_{cluster}(GeV)");
818  fESDList[iCut]->Add(fHistoMotherBackInvMassECalibSM[iCut][iModules]);
819 
820  fHistoClusGammaPtSM[iCut][iModules] = new TH1F(Form("ClusGamma_Pt_SM%i",iModules), Form("ClusGamma_Pt_SM%i; p_{T,clus} (GeV/c)",iModules), nBinsClusterPt, arrClusPtBinning);
821  fESDList[iCut]->Add(fHistoClusGammaPtSM[iCut][iModules]);
822  fHistoClusGammaESM[iCut][iModules] = new TH1F(Form("ClusGamma_E_SM%i",iModules), Form("ClusGamma_E_SM%i; p_{T,clus} (GeV/c)",iModules), nBinsClusterPt, arrClusPtBinning);
823  fESDList[iCut]->Add(fHistoClusGammaESM[iCut][iModules]);
824  }
825 
826  fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_E_Calib", "ESD_Mother_InvMass_E_Calib", fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
827  fHistoMotherInvMassECalib[iCut]->SetXTitle("M_{inv} (GeV/c^{2})");
828  fHistoMotherInvMassECalib[iCut]->SetYTitle("E_{cluster}(GeV)");
829  fESDList[iCut]->Add(fHistoMotherInvMassECalib[iCut]);
830  fHistoMotherBackInvMassECalib[iCut] = new TH2F("ESD_Back_InvMass_E_Calib", "ESD_Back_InvMass_E_Calib", fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
831  fHistoMotherBackInvMassECalib[iCut]->SetXTitle("M_{inv} (GeV/c^{2})");
832  fHistoMotherBackInvMassECalib[iCut]->SetYTitle("E_{cluster}(GeV)");
833  fESDList[iCut]->Add(fHistoMotherBackInvMassECalib[iCut]);
834 
835 
836  fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt", "ESD_Mother_InvMass_Pt; M_{inv} (GeV/c^{2}); p_{T,pair} (GeV/c)",
837  fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
838  fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]);
839  fHistoMotherInvMassRejected[iCut] = new TH1F("ESD_Mother_InvMassRejected", "ESD_Mother_InvMassRejected; M_{inv} (GeV/c^{2})",
840  1200, 0, 1.2);
841  fESDList[iCut]->Add(fHistoMotherInvMassRejected[iCut]);
842 
843 
844 
845  if(!fDoLightOutput){
846  if (fMesonRecoMode == 1){
847  fHistoMotherMatchedInvMassPt[iCut] = new TH2F("ESD_MotherMatched_InvMass_Pt", "ESD_MotherMatched_InvMass_Pt; M_{inv} (GeV/c^{2}) matched conv e^{+/-}to cluster; p_{T,pair} (GeV/c)",
848  fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
849  fESDList[iCut]->Add(fHistoMotherMatchedInvMassPt[iCut]);
850  }
851  }
852 
853  fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt", "ESD_Background_InvMass_Pt; M_{inv, mxed}(GeV/c^{2}); p_{T,BG pair} (GeV/c)",
854  fMesonInvMassNBins, fMesonInvMassMin, fMesonInvMassMax, nBinsPt, arrPtBinning);
855  fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]);
856 
857  if (fIsMC > 1){
858  fHistoMotherInvMassPt[iCut]->Sumw2();
859  fHistoMotherBackInvMassPt[iCut]->Sumw2();
861  }
862 
863  if (fDoMesonQA > 0 ){
864  fHistoMotherMesonPtY[iCut] = new TH2F("ESD_MotherMeson_Pt_Y", "ESD_MotherMeson_Pt_Y; p_{T, meson cand} (GeV/c); y_{meson cand}",
865  nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
866  fESDList[iCut]->Add(fHistoMotherMesonPtY[iCut]);
867  fHistoMotherMesonPtAlpha[iCut] = new TH2F("ESD_MotherMeson_Pt_Alpha", "ESD_MotherMeson_Pt_Alpha; p_{T, meson cand} (GeV/c); #alpha_{meson cand}",
868  nBinsQAPt, arrQAPtBinning, 200, -1, 1);
869  fESDList[iCut]->Add(fHistoMotherMesonPtAlpha[iCut]);
870  fHistoMotherMesonPtOpenAngle[iCut] = new TH2F("ESD_MotherMeson_Pt_OpenAngle", "ESD_MotherMeson_Pt_OpenAngle; p_{T, meson cand} (GeV/c); #theta_{meson cand}",
871  nBinsQAPt, arrQAPtBinning, 100, 0, 1);
872  fESDList[iCut]->Add(fHistoMotherMesonPtOpenAngle[iCut]);
873  fHistoMotherMesonConvPhotonEtaPhi[iCut] = new TH2F("ESD_MotherMesonConvPhoton_Eta_Phi", "ConvPhoton under meson peak; #phi_{#gamma_{conv}}(rad); #eta_{#gamma_{conv}}",
874  600, 0, 2*TMath::Pi(), 200, -1, 1);
876  if (fIsMC > 1){
877  fHistoMotherMesonPtY[iCut]->Sumw2();
878  fHistoMotherMesonPtAlpha[iCut]->Sumw2();
879  fHistoMotherMesonPtOpenAngle[iCut]->Sumw2();
880  fHistoMotherMesonConvPhotonEtaPhi[iCut]->Sumw2();
881  }
882  }
883  }
884 
885  InitBack(); // Init Background Handler
886 
887 
888  if(fV0Reader)
890  if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
891  fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
892  if(fV0Reader)
894  if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
895  fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
896 
900 
901  for(Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
902  AliCaloTrackMatcher* temp = (AliCaloTrackMatcher*) (AliAnalysisManager::GetAnalysisManager()->GetTask(Form("CaloTrackMatcher_%i",iMatcherTask)));
903  if(temp) fOutputContainer->Add(temp->GetCaloTrackMatcherHistograms());
904  }
905 
906 //********************************************************************************************************//
907 //***************************** NOT NEEDED FOR CALIBRATION??? ****************************************//
908 //********************************************************************************************************//
909  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
910  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
911  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
912  fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
913  }
914  if (fMesonRecoMode < 2){
915  if(!((AliConversionPhotonCuts*)fCutArray->At(iCut))) continue;
916  if(((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutHistograms()){
917  fCutFolder[iCut]->Add(((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutHistograms());
918  }
919  }
921  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
922  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){
923  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms());
924  }
925  if(fSetPlotHistsExtQA){
926  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
927  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms()){
928  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms());
929  }
930  }
931  }
932  if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
933  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
934  fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
935  }
936  }
937 
938 
939  PostData(1, fOutputContainer);
940 }
941 //_____________________________________________________________________________
943 
944  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
945  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod && ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum() != AliConvEventCuts::kNoPeriod){
946  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnumExplicit(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum());
947  } else if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod ){
948  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnum(fV0Reader->GetPeriodName());
949  }
950 
951  if(fIsHeavyIon == 2){
952  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){
953  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
954  continue; // No Eta Shift requested, continue
955  }
956  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
957  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod();
958  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
959  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
960  continue;
961  } else{
962  printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
963  (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
964  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
965  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
966  }
967  }
968  }
969 
970  return kTRUE;
971 }
972 //_____________________________________________________________________________
974  //
975  // Called for each event
976  //
977  fInputEvent = InputEvent();
978 
979  if(fIsMC > 0) fMCEvent = MCEvent();
980 
981  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
982  if(fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2;// incomplete event
983  // Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 or because it is incomplete => abort processing of this event/file
984  if(eventQuality == 2 || eventQuality == 3){
985  // write out name of broken file for first event
986 
987  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
988  fHistoNEvents[iCut]->Fill(eventQuality);
989  }
990  return;
991  }
992 // if(fInputEvent->IsA()==AliAODEvent::Class()){
993 // fInputEvent->InitMagneticField();
994 // }
995  fReaderGammas = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut
996 
997  // ------------------- BeginEvent ----------------------------
998  AliEventplane *EventPlane = fInputEvent->GetEventplane();
999  if(fIsHeavyIon ==1)fEventPlaneAngle = EventPlane->GetEventplane("V0",fInputEvent,2);
1000  else fEventPlaneAngle=0.0;
1001 
1002  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
1003 
1004  fiCut = iCut;
1005  Bool_t isRunningEMCALrelAna = kFALSE;
1007  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetClusterType() == 1) isRunningEMCALrelAna = kTRUE;
1008  }
1009 
1010  Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon,isRunningEMCALrelAna);
1011 
1012  Bool_t triggered = kTRUE;
1013 
1014  if(eventNotAccepted!= 0){
1015  // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
1016  fHistoNEvents[iCut]->Fill(eventNotAccepted, fWeightJetJetMC); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
1017  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventNotAccepted);
1018  // if (eventNotAccepted==3 && fIsMC > 0){
1019  // triggered = kFALSE;
1020  // }else {
1021  continue;
1022  // }
1023  }
1024  if(eventQuality != 0){// Event Not Accepted
1025  // cout << "event rejected due to: " <<eventQuality << endl;
1026  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC);
1027  continue;
1028  }
1029 
1030  if (triggered==kTRUE){
1031  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
1032  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
1033 
1035  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
1036  if(!fDoLightOutput){
1037  fHistoVertexX[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetX(), fWeightJetJetMC);
1038  fHistoVertexY[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetY(), fWeightJetJetMC);
1039  fHistoSPDClusterTrackletBackground[iCut]->Fill(fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),(fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)),fWeightJetJetMC);
1040  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2) fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A(), fWeightJetJetMC);
1041  else fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C(), fWeightJetJetMC);
1042  }
1043  }
1044 
1045 
1046  if (triggered==kFALSE) continue;
1047  // it is in the loop to have the same conversion cut string (used also for MC stuff that should be same for V0 and Cluster)
1048  if (fMesonRecoMode > 0 || fEnableClusterCutsForTrigger) // process calo clusters
1049  ProcessClusters();
1050  if (fMesonRecoMode < 2) // Process this cuts gammas
1052  if (fMesonRecoMode < 2) fHistoNGammaConvCandidates[iCut]->Fill(fGammaCandidates->GetEntries(),fWeightJetJetMC);
1054 
1055 
1056  // check gamma gamma pairs and veto if necessary
1057  if (!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetAcceptMassFlag())
1058  SetPhotonVeto();
1059 
1060  CalculateMesonCandidates(); // Combine Gammas from conversion and from calo
1061  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
1062  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
1063  CalculateBackground(); // Combinatorial Background
1064  UpdateEventByEventData(); // Store Event for mixed Events
1065  } else{
1066  CalculateBackgroundRP(); // Combinatorial Background
1067  fBGHandlerRP[iCut]->AddEvent(fGammaCandidates,fInputEvent); // Store Event for mixed Events
1068  fBGClusHandlerRP[iCut]->AddEvent(fClusterCandidates,fInputEvent); // Store Event for mixed Events
1069  }
1070  }
1071 
1072  fGammaCandidates->Clear(); // delete this cuts good gammas
1073  fClusterCandidates->Clear(); // delete cluster candidates
1074  }
1075 
1076  // if(fIsMC>0 && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled()) && fMesonRecoMode < 2){
1077  // RelabelAODPhotonCandidates(kFALSE); // Back to ESDMC Label
1078  // fV0Reader->RelabelAODs(kFALSE);
1079  // }
1080 
1081  PostData(1, fOutputContainer);
1082 }
1083 
1084 //________________________________________________________________________
1086  Int_t nclus = 0;
1087  TClonesArray * arrClustersProcess = NULL;
1088  if(!fCorrTaskSetting.CompareTo("")){
1089  nclus = fInputEvent->GetNumberOfCaloClusters();
1090  } else {
1091  arrClustersProcess = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
1092  if(!arrClustersProcess)
1093  AliFatal(Form("%sClustersBranch was not found in AliAnalysisTaskConvCaloCalibration! Check the correction framework settings!",fCorrTaskSetting.Data()));
1094  nclus = arrClustersProcess->GetEntries();
1095  }
1096 
1097  // cout << nclus << endl;
1098 
1099  if(nclus == 0) return;
1100 
1101  // plotting histograms on cell/tower level, only if extendedMatchAndQA > 1
1102  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FillHistogramsExtendedQA(fInputEvent,fIsMC);
1103 
1104  // match tracks to clusters
1105  if(fDoPrimaryTrackMatching) ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchTracksToClusters(fInputEvent,fWeightJetJetMC,kFALSE);
1106  // vertex
1107  Double_t vertex[3] = {0,0,0};
1108  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1109 
1110  // Loop over EMCal clusters
1111  for(Int_t i = 0; i < nclus; i++){
1112  AliVCluster* clus = NULL;
1113  if(fInputEvent->IsA()==AliESDEvent::Class()){
1114  if(arrClustersProcess)
1115  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
1116  else
1117  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
1118  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
1119  if(arrClustersProcess)
1120  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
1121  else
1122  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
1123  }
1124 
1125  if (!clus) continue;
1126  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC,fWeightJetJetMC,i)){
1127  delete clus;
1128  continue;
1129  }
1130  // TLorentzvector with cluster
1131  TLorentzVector clusterVector;
1132  clus->GetMomentum(clusterVector,vertex);
1133 
1134  TLorentzVector* tmpvec = new TLorentzVector();
1135  tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1136 
1137  // convert to AODConversionPhoton
1138  AliAODConversionPhoton *PhotonCandidate = new AliAODConversionPhoton(tmpvec);
1139  if(!PhotonCandidate){ delete clus; delete tmpvec; continue;}
1140 
1141  // Flag Photon as CaloPhoton
1142  PhotonCandidate->SetIsCaloPhoton();
1143  PhotonCandidate->SetCaloClusterRef((Long_t)i);
1144  PhotonCandidate->SetLeadingCellID(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent));
1145 
1146 
1147  fIsFromDesiredHeader = kTRUE;
1150  fHistoClusGammaPt[fiCut]->Fill(PhotonCandidate->Pt(),fWeightJetJetMC);
1151  fHistoClusGammaE[fiCut]->Fill(PhotonCandidate->E(),fWeightJetJetMC);
1152  if(PhotonCandidate->GetIsCaloPhoton()){
1153  fGeomEMCAL = AliEMCALGeometry::GetInstance();
1154  Int_t SMNumber = fGeomEMCAL->GetSuperModuleNumber(PhotonCandidate->GetLeadingCellID());
1155  if(SMNumber >= 0 && SMNumber < 20){
1156  fHistoClusGammaPtSM[fiCut][fGeomEMCAL->GetSuperModuleNumber(PhotonCandidate->GetLeadingCellID())]->Fill(PhotonCandidate->Pt(),fWeightJetJetMC);
1157  fHistoClusGammaESM[fiCut][fGeomEMCAL->GetSuperModuleNumber(PhotonCandidate->GetLeadingCellID())]->Fill(PhotonCandidate->E(),fWeightJetJetMC);
1158  }
1159  }
1160  fClusterCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas
1161  }else{
1162  delete PhotonCandidate;
1163  }
1164  delete clus;
1165  delete tmpvec;
1166  }
1167 }
1168 
1169 //________________________________________________________________________
1171 
1172  Int_t nV0 = 0;
1173  TList *GammaCandidatesStepOne = new TList();
1174  TList *GammaCandidatesStepTwo = new TList();
1175  // Loop over Photon Candidates allocated by ReaderV1
1176  for(Int_t i = 0; i < fReaderGammas->GetEntriesFast(); i++){
1177  AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(i);
1178  if(!PhotonCandidate) continue;
1179  fIsFromDesiredHeader = kTRUE;
1180  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fInputEvent)) continue;
1181  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(PhotonCandidate->GetPhotonPhi(),fEventPlaneAngle)) continue;
1182  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut() &&
1183  !((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){
1184  fGammaCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas
1185 
1187  if(!fDoLightOutput) fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt(),fWeightJetJetMC);
1188  }
1189  }else if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one
1190  ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0);
1191  nV0++;
1192  GammaCandidatesStepOne->Add(PhotonCandidate);
1193  }else if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut() &&
1194  ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two
1195  GammaCandidatesStepTwo->Add(PhotonCandidate);
1196  }
1197  }
1198 
1199  if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){
1200  for(Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){
1201  AliAODConversionPhoton *PhotonCandidate= (AliAODConversionPhoton*) GammaCandidatesStepOne->At(i);
1202  if(!PhotonCandidate) continue;
1203  fIsFromDesiredHeader = kTRUE;
1204  // if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
1205  // Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCEvent, fInputEvent);
1206  // Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCEvent, fInputEvent);
1207  // if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromDesiredHeader = kFALSE;
1208  // }
1209  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GammaCandidatesStepOne->GetEntries())) continue;
1210  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed
1211  fGammaCandidates->Add(PhotonCandidate);
1213  if(!fDoLightOutput) fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt(),fWeightJetJetMC);
1214  }
1215  } else GammaCandidatesStepTwo->Add(PhotonCandidate); // Close v0s cut enabled -> add to list two
1216  }
1217  }
1218 
1219  if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){
1220  for(Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
1221  AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GammaCandidatesStepTwo->At(i);
1222  if(!PhotonCandidate) continue;
1223  fIsFromDesiredHeader = kTRUE;
1224  if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
1225  Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCEvent, fInputEvent);
1226  Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCEvent, fInputEvent);
1227  if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromDesiredHeader = kFALSE;
1228  }
1229  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GammaCandidatesStepTwo,i)) continue;
1230  fGammaCandidates->Add(PhotonCandidate); // Add gamma to current cut TList
1232  if(!fDoLightOutput) fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt(),fWeightJetJetMC);
1233  }
1234  }
1235  }
1236 
1237  delete GammaCandidatesStepOne;
1238  GammaCandidatesStepOne = 0x0;
1239  delete GammaCandidatesStepTwo;
1240  GammaCandidatesStepTwo = 0x0;
1241 
1242 }
1243 
1244 
1245 //________________________________________________________________________
1246 // function to reject photons in specific invariant mass window
1247 //________________________________________________________________________
1249  TClonesArray * arrClustersMesonCand = NULL;
1250  if(fCorrTaskSetting.CompareTo("") && fMesonRecoMode > 0)
1251  arrClustersMesonCand = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
1252 
1253  if (fMesonRecoMode == 0){
1254  if(fGammaCandidates->GetEntries()>1){
1255  for(Int_t firstGammaIndex=0;firstGammaIndex<fGammaCandidates->GetEntries()-1;firstGammaIndex++){
1256  AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(firstGammaIndex));
1257  if (gamma0==NULL) continue;
1258  for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fGammaCandidates->GetEntries();secondGammaIndex++){
1259  AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(secondGammaIndex));
1260  //Check for same Electron ID
1261  if (gamma1==NULL) continue;
1262  if(gamma0->GetTrackLabelPositive() == gamma1->GetTrackLabelPositive() ||
1263  gamma0->GetTrackLabelNegative() == gamma1->GetTrackLabelNegative() ||
1264  gamma0->GetTrackLabelNegative() == gamma1->GetTrackLabelPositive() ||
1265  gamma0->GetTrackLabelPositive() == gamma1->GetTrackLabelNegative() ) continue;
1266 
1267  AliAODConversionMother *mesonCand = new AliAODConversionMother(gamma0,gamma1);
1268  mesonCand->SetLabels(firstGammaIndex,secondGammaIndex);
1269  mesonCand->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
1270 
1271  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesonCand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
1272  if (!(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedByMassCut(mesonCand, 0))){
1273  gamma0->SetUseForMesonPair(kFALSE);
1274  gamma1->SetUseForMesonPair(kFALSE);
1275  fHistoMotherInvMassRejected[fiCut]->Fill(mesonCand->M());
1276  }
1277  }
1278  delete mesonCand;
1279  mesonCand=0x0;
1280  }
1281  }
1282  }
1283  } else if (fMesonRecoMode == 1){
1284  if(fGammaCandidates->GetEntries()>0){
1285  for(Int_t firstGammaIndex=0;firstGammaIndex<fGammaCandidates->GetEntries();firstGammaIndex++){
1286  AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(firstGammaIndex));
1287  if (gamma0==NULL) continue;
1288 
1289  for(Int_t secondGammaIndex=0;secondGammaIndex<fClusterCandidates->GetEntries();secondGammaIndex++){
1290  Bool_t matched = kFALSE;
1291  AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(secondGammaIndex));
1292  if (gamma1==NULL) continue;
1293 
1294  if (gamma1->GetIsCaloPhoton()){
1295  AliVCluster* cluster = NULL;
1296  if(fInputEvent->IsA()==AliESDEvent::Class()){
1297  if(arrClustersMesonCand)
1298  cluster = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMesonCand->At(gamma1->GetCaloClusterRef()));
1299  else
1300  cluster = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
1301  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
1302  if(arrClustersMesonCand)
1303  cluster = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMesonCand->At(gamma1->GetCaloClusterRef()));
1304  else
1305  cluster = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
1306  }
1307 
1308  matched = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchConvPhotonToCluster(gamma0,cluster, fInputEvent, fWeightJetJetMC);
1309  if(arrClustersMesonCand) delete cluster;
1310  }
1311 
1312  AliAODConversionMother *mesonCand = new AliAODConversionMother(gamma0,gamma1);
1313  mesonCand->SetLabels(firstGammaIndex,secondGammaIndex);
1314 
1315  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesonCand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
1316  if (!matched){
1317  if (!(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedByMassCut(mesonCand, 0))){
1318  gamma0->SetUseForMesonPair(kFALSE);
1319  gamma1->SetUseForMesonPair(kFALSE);
1320  fHistoMotherInvMassRejected[fiCut]->Fill(mesonCand->M());
1321  }
1322  }
1323  }
1324  delete mesonCand;
1325  mesonCand=0x0;
1326  }
1327  }
1328  }
1329  } else if (fMesonRecoMode == 2){
1330  if(fClusterCandidates->GetEntries()>0){
1331  for(Int_t firstGammaIndex=0;firstGammaIndex<fClusterCandidates->GetEntries();firstGammaIndex++){
1332  AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(firstGammaIndex));
1333  if (gamma0==NULL) continue;
1334  for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fClusterCandidates->GetEntries();secondGammaIndex++){
1335  AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(secondGammaIndex));
1336  if (gamma1==NULL) continue;
1337 
1338  AliAODConversionMother *mesonCand = new AliAODConversionMother(gamma0,gamma1);
1339  mesonCand->SetLabels(firstGammaIndex,secondGammaIndex);
1340 
1341  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesonCand, kTRUE, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), gamma0->GetLeadingCellID(), gamma1->GetLeadingCellID()))){
1342  if (!(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedByMassCut(mesonCand, 0))){
1343  gamma0->SetUseForMesonPair(kFALSE);
1344  gamma1->SetUseForMesonPair(kFALSE);
1345  fHistoMotherInvMassRejected[fiCut]->Fill(mesonCand->M());
1346  }
1347  }
1348  delete mesonCand;
1349  mesonCand=0x0;
1350  }
1351  }
1352  }
1353  }
1354 }
1355 
1356 
1357 //________________________________________________________________________
1359  TClonesArray * arrClustersMesonCand = NULL;
1360  if(fCorrTaskSetting.CompareTo("") && fMesonRecoMode > 0)
1361  arrClustersMesonCand = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
1362 
1363  // AliVCaloCells* cells = 0x0;
1364  // cells = fInputEvent->GetEMCALCells();
1365  Int_t nMod = -1;
1366  Short_t cellNumber = 0;
1367  AliVCluster* cluster = NULL;
1368  AliVCluster* Cluster0 = NULL;
1369  AliVCluster* Cluster1 = NULL;
1370  fGeomEMCAL = AliEMCALGeometry::GetInstance();
1371  if (fMesonRecoMode == 1){ //PCM-CALO
1372  if(fGammaCandidates->GetEntries()>0){
1373  for(Int_t firstGammaIndex=0;firstGammaIndex<fGammaCandidates->GetEntries();firstGammaIndex++){
1374  AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(firstGammaIndex));
1375  if (gamma0==NULL) continue;
1376 
1377  for(Int_t secondGammaIndex=0;secondGammaIndex<fClusterCandidates->GetEntries();secondGammaIndex++){
1378  Bool_t matched = kFALSE;
1379  AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(secondGammaIndex));
1380  if (gamma1==NULL) continue;
1381 
1382  if (gamma1->GetIsCaloPhoton()){
1383 
1384  if(fInputEvent->IsA()==AliESDEvent::Class()){
1385  if(arrClustersMesonCand)
1386  cluster = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMesonCand->At(gamma1->GetCaloClusterRef()));
1387  else
1388  cluster = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
1389  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
1390  if(arrClustersMesonCand)
1391  cluster = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMesonCand->At(gamma1->GetCaloClusterRef()));
1392  else
1393  cluster = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
1394  }
1395  }
1396  matched = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchConvPhotonToCluster(gamma0,cluster, fInputEvent, fWeightJetJetMC);
1397  // if(arrClustersMesonCand) delete cluster;
1398 
1399  AliAODConversionMother *mesonCand = new AliAODConversionMother(gamma0,gamma1);
1400  mesonCand->SetLabels(firstGammaIndex,secondGammaIndex);
1401 
1402  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesonCand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
1403  if (matched){
1404  if(fHistoMotherMatchedInvMassPt[fiCut]) fHistoMotherMatchedInvMassPt[fiCut]->Fill(mesonCand->M(),mesonCand->Pt(),fWeightJetJetMC);
1405  }
1406 
1407 
1408  if (!matched){
1409 
1410  if (!gamma0->GetUseForMesonPair() || !gamma1->GetUseForMesonPair()){
1411  fHistoMotherInvMassRejected[fiCut]->Fill(mesonCand->M());
1412  delete mesonCand;
1413  mesonCand=0x0;
1414  continue;
1415  }
1417  fHistoMotherInvMassPt[fiCut]->Fill(mesonCand->M(),mesonCand->Pt(),fWeightJetJetMC);
1418  cellNumber = cluster->GetCellsAbsId()[0];
1419  nMod = fGeomEMCAL->GetSuperModuleNumber(cellNumber);
1420  fHistoMotherInvMassECalibSM[fiCut][nMod]->Fill(mesonCand->M(),gamma1->E(),fWeightJetJetMC);
1421  fHistoMotherInvMassECalib[fiCut]->Fill(mesonCand->M(),gamma1->E(),fWeightJetJetMC);
1422  }
1423 
1424 
1425  if (fDoMesonQA > 0){
1426  if (mesonCand->M() > fMesonInvMassWindow[0] && mesonCand->M() < fMesonInvMassWindow[1]){
1427  if (fHistoMotherMesonPtY[fiCut]) fHistoMotherMesonPtY[fiCut]->Fill(mesonCand->Pt(),mesonCand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(),fWeightJetJetMC);
1428  if (fHistoMotherMesonPtAlpha[fiCut]) fHistoMotherMesonPtAlpha[fiCut]->Fill(mesonCand->Pt(),mesonCand->GetAlpha(),fWeightJetJetMC);
1429  if (fHistoMotherMesonPtOpenAngle[fiCut]) fHistoMotherMesonPtOpenAngle[fiCut]->Fill(mesonCand->Pt(),mesonCand->GetOpeningAngle(),fWeightJetJetMC);
1431  }
1432  }
1433  if(fDoTHnSparse && ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
1434  Int_t zbin = 0;
1435  Int_t mbin = 0;
1436 
1437  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){
1438  zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
1439  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1441  }else {
1442  mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
1443  }
1444  }else{
1445  zbin = fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
1446  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1448  }else {
1450  }
1451  }
1452  Double_t sparesFill[4] = {mesonCand->M(),mesonCand->Pt(),(Double_t)zbin,(Double_t)mbin};
1453  if (fSparseMotherInvMassPtZM[fiCut]) fSparseMotherInvMassPtZM[fiCut]->Fill(sparesFill,1);
1454  }
1455  }
1456  }
1457  delete mesonCand;
1458  mesonCand=0x0;
1459  }
1460  }
1461  }
1462  } else if (fMesonRecoMode == 2){ //CALO-CALO
1463  if(fClusterCandidates->GetEntries()>0){
1464  for(Int_t firstGammaIndex=0;firstGammaIndex<fClusterCandidates->GetEntries();firstGammaIndex++){
1465  AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(firstGammaIndex));
1466  if (gamma0==NULL) continue;
1467  for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fClusterCandidates->GetEntries();secondGammaIndex++){
1468  AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(secondGammaIndex));
1469  if (gamma1==NULL) continue;
1470 
1471  AliAODConversionMother *mesonCand = new AliAODConversionMother(gamma0,gamma1);
1472  mesonCand->SetLabels(firstGammaIndex,secondGammaIndex);
1473 
1474  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesonCand, kTRUE, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), gamma0->GetLeadingCellID(), gamma1->GetLeadingCellID()))){
1475  if (!gamma0->GetUseForMesonPair() || !gamma1->GetUseForMesonPair()){
1476  fHistoMotherInvMassRejected[fiCut]->Fill(mesonCand->M());
1477  delete mesonCand;
1478  mesonCand=0x0;
1479  continue;
1480  }
1481  if (fHistoMotherInvMassPt[fiCut]) fHistoMotherInvMassPt[fiCut]->Fill(mesonCand->M(),mesonCand->Pt(), fWeightJetJetMC);
1482  // fill new histograms
1483 
1484 
1485 
1486  if(fInputEvent->IsA()==AliESDEvent::Class()){
1487  if(arrClustersMesonCand){
1488  Cluster0 = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMesonCand->At(gamma0->GetCaloClusterRef()));
1489  Cluster1 = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMesonCand->At(gamma1->GetCaloClusterRef()));
1490  }else{
1491  Cluster0 = fInputEvent->GetCaloCluster(gamma0->GetCaloClusterRef());
1492  Cluster1 = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
1493  }
1494  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
1495  if(arrClustersMesonCand){
1496  Cluster0 = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMesonCand->At(gamma0->GetCaloClusterRef()));
1497  Cluster1 = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMesonCand->At(gamma1->GetCaloClusterRef()));
1498  }else{
1499  Cluster0 = fInputEvent->GetCaloCluster(gamma0->GetCaloClusterRef());
1500  Cluster1 = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
1501  }
1502  }
1503 
1504  Double_t tempmesonCandWeight = 1; // for JetJet MC
1505  //Get SM for Cluster0 & Cluster1
1506  Int_t iCellClus0 = Cluster0->GetCellsAbsId()[0];
1507  Int_t iCellClus1 = Cluster1->GetCellsAbsId()[0];
1508  if(TMath::Abs(mesonCand->GetAlpha())<0.1 ){
1509  fHistoMotherInvMassECalib[fiCut]->Fill(mesonCand->M(),mesonCand->E(),tempmesonCandWeight);
1510  if(fGeomEMCAL->GetSuperModuleNumber(iCellClus0) == fGeomEMCAL->GetSuperModuleNumber(iCellClus1)){
1511  fHistoMotherInvMassECalibSM[fiCut][fGeomEMCAL->GetSuperModuleNumber(iCellClus0)]->Fill(mesonCand->M(),mesonCand->E(),tempmesonCandWeight);
1512  }
1513  }
1514 
1515 
1516  if (fDoMesonQA > 0 && fDoMesonQA < 3){
1517  if ( mesonCand->M() > fMesonInvMassWindow[0] && mesonCand->M() < fMesonInvMassWindow[1]){
1518  fHistoMotherMesonPtY[fiCut]->Fill(mesonCand->Pt(),mesonCand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), fWeightJetJetMC);
1519  fHistoMotherMesonPtAlpha[fiCut]->Fill(mesonCand->Pt(),mesonCand->GetAlpha(), fWeightJetJetMC);
1520  fHistoMotherMesonPtOpenAngle[fiCut]->Fill(mesonCand->Pt(),mesonCand->GetOpeningAngle(), fWeightJetJetMC);
1521  }
1522  }
1523  if(fDoTHnSparse && ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
1524  Int_t zbin = 0;
1525  Int_t mbin = 0;
1526 
1527  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){
1528  zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
1529  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1531  } else {
1533  }
1534  }
1535  Double_t sparesFill[4] = {mesonCand->M(),mesonCand->Pt(),(Double_t)zbin,(Double_t)mbin};
1536  if (fSparseMotherInvMassPtZM[fiCut]) fSparseMotherInvMassPtZM[fiCut]->Fill(sparesFill,1);
1537  }
1538  }
1539  delete mesonCand;
1540  mesonCand=0x0;
1541  }
1542  }
1543  }
1544  }
1545 }
1546 
1547 
1548 //________________________________________________________________________
1550 
1551  // set current BG handler
1552  AliGammaConversionAODBGHandler* currBGHandler = NULL;
1553  TList* currPhotonList = NULL;
1554  if (fMesonRecoMode == 0){
1555  currBGHandler = fBGHandler[fiCut];
1556  currPhotonList = fGammaCandidates;
1557  } else if (fMesonRecoMode == 1){
1558  currBGHandler = fBGClusHandler[fiCut];
1559  currPhotonList = fGammaCandidates;
1560  } else if (fMesonRecoMode == 2){
1561  currBGHandler = fBGClusHandler[fiCut];
1562  currPhotonList = fClusterCandidates;
1563  }
1564 
1565 
1566  Int_t nMod = -1;
1567  fGeomEMCAL = AliEMCALGeometry::GetInstance();
1568 
1569  Int_t zbin = currBGHandler->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
1570  Int_t mbin = 0;
1571  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1573  } else {
1574  mbin = currBGHandler->GetMultiplicityBinIndex(currPhotonList->GetEntries());
1575  }
1576 
1578  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1579  for(Int_t nEventsInBG=0;nEventsInBG<currBGHandler->GetNBGEvents();nEventsInBG++){
1580  AliGammaConversionAODVector *previousEventV0s = currBGHandler->GetBGGoodV0s(zbin,mbin,nEventsInBG);
1581  if (fMesonRecoMode < 2){
1582  if(fMoveParticleAccordingToVertex == kTRUE || ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0 ){
1583  bgEventVertex = currBGHandler->GetBGEventVertex(zbin,mbin,nEventsInBG);
1584  }
1585  }
1586  for(Int_t iCurrent=0;iCurrent<currPhotonList->GetEntries();iCurrent++){
1587  AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(currPhotonList->At(iCurrent));
1588  if (!currentEventGoodV0.GetUseForMesonPair() )continue;
1589  for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
1590  AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious)));
1591  if(fMoveParticleAccordingToVertex == kTRUE){
1592  if (bgEventVertex){
1593  MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex);
1594  }
1595  }
1596  if (fMesonRecoMode < 2){
1597  if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){
1598  if (bgEventVertex){
1599  RotateParticleAccordingToEP(&previousGoodV0,bgEventVertex->fEP,fEventPlaneAngle);
1600  }
1601  }
1602  }
1603  AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
1604  backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
1605  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate, kFALSE,
1606  ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()), currentEventGoodV0.GetLeadingCellID(), previousGoodV0.GetLeadingCellID())){
1607  if (fHistoMotherBackInvMassPt[fiCut]) fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt(),fWeightJetJetMC);
1608  // Double_t tempBGCandidateWeight = 1;
1609 
1610  if(fDoTHnSparse){
1611  Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
1612  if (fSparseMotherBackInvMassPtZM[fiCut]) fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
1613  }
1614  }
1615  }
1616  }
1617  }
1618  }else {
1619  for(Int_t nEventsInBG=0;nEventsInBG <currBGHandler->GetNBGEvents();nEventsInBG++){
1620  AliGammaConversionAODVector *previousEventV0s = currBGHandler->GetBGGoodV0s(zbin,mbin,nEventsInBG);
1621  if(previousEventV0s){
1622  if (fMesonRecoMode < 2){
1623  if(fMoveParticleAccordingToVertex == kTRUE || ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0 ){
1624  bgEventVertex = currBGHandler->GetBGEventVertex(zbin,mbin,nEventsInBG);
1625  }
1626  }
1627  for(Int_t iCurrent=0;iCurrent<currPhotonList->GetEntries();iCurrent++){
1628  AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(currPhotonList->At(iCurrent));
1629  if (!currentEventGoodV0.GetUseForMesonPair() )continue;
1630  for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
1631  AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious)));
1632  if(fMoveParticleAccordingToVertex == kTRUE){
1633  if (bgEventVertex){
1634  MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex);
1635  }
1636  }
1637  if (fMesonRecoMode < 2){
1638  if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){
1639  if (bgEventVertex){
1640  RotateParticleAccordingToEP(&previousGoodV0,bgEventVertex->fEP,fEventPlaneAngle);
1641  }
1642  }
1643  }
1644  AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
1645  backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
1646  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,
1647  ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()), currentEventGoodV0.GetLeadingCellID(), previousGoodV0.GetLeadingCellID())){
1648  if (fHistoMotherBackInvMassPt[fiCut]) fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt(),fWeightJetJetMC);
1649 
1650  if( currentEventGoodV0.GetIsCaloPhoton() && previousGoodV0.GetIsCaloPhoton() ){
1651  if( TMath::Abs(backgroundCandidate->GetAlpha())<0.1){
1652  fHistoMotherBackInvMassECalib[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->E(),fWeightJetJetMC);
1653  if(fGeomEMCAL->GetSuperModuleNumber(currentEventGoodV0.GetLeadingCellID()) == fGeomEMCAL->GetSuperModuleNumber(previousGoodV0.GetLeadingCellID())){
1654  nMod = fGeomEMCAL->GetSuperModuleNumber(currentEventGoodV0.GetLeadingCellID());
1655  fHistoMotherBackInvMassECalibSM[fiCut][nMod]->Fill(backgroundCandidate->M(),backgroundCandidate->E(),fWeightJetJetMC);
1656  }
1657  }
1658  } else{
1659  if( currentEventGoodV0.GetIsCaloPhoton() ){
1660  nMod = fGeomEMCAL->GetSuperModuleNumber(currentEventGoodV0.GetLeadingCellID());
1661  fHistoMotherBackInvMassECalibSM[fiCut][nMod]->Fill(backgroundCandidate->M(),currentEventGoodV0.E(),fWeightJetJetMC);
1662  fHistoMotherBackInvMassECalib[fiCut]->Fill(backgroundCandidate->M(),currentEventGoodV0.E(),fWeightJetJetMC);
1663  }
1664  else if(previousGoodV0.GetIsCaloPhoton()){
1665  nMod = fGeomEMCAL->GetSuperModuleNumber(previousGoodV0.GetLeadingCellID());
1666  fHistoMotherBackInvMassECalibSM[fiCut][nMod]->Fill(backgroundCandidate->M(),previousGoodV0.E(),fWeightJetJetMC);
1667  fHistoMotherBackInvMassECalib[fiCut]->Fill(backgroundCandidate->M(),previousGoodV0.E(),fWeightJetJetMC);
1668  }
1669  }
1670 
1671 
1672 
1673  if(fDoTHnSparse){
1674  Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
1675  if (fSparseMotherBackInvMassPtZM[fiCut]) fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
1676  }
1677  }
1678  delete backgroundCandidate;
1679  backgroundCandidate = 0x0;
1680  }
1681  }
1682  }
1683  }
1684  }
1685 }
1686 
1687 //________________________________________________________________________
1689 
1690  // set current BG handler
1691  AliConversionAODBGHandlerRP* currBGHandler = NULL;
1692  TList* currPhotonList = NULL;
1693  if (fMesonRecoMode == 0){
1694  currBGHandler = fBGHandlerRP[fiCut];
1695  currPhotonList = fGammaCandidates;
1696  } else if (fMesonRecoMode == 1){
1697  currBGHandler = fBGClusHandlerRP[fiCut];
1698  currPhotonList = fGammaCandidates;
1699  } else if (fMesonRecoMode == 2){
1700  currBGHandler = fBGClusHandlerRP[fiCut];
1701  currPhotonList = fClusterCandidates;
1702  }
1703 
1704  Int_t zbin = currBGHandler->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
1705  Int_t mbin = 0;
1706  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1708  } else {
1709  mbin = currBGHandler->GetMultiplicityBinIndex(currPhotonList->GetEntries());
1710  }
1711 
1712  //Rotation Method
1713  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseRotationMethod()){
1714  // Correct for the number of rotations
1715  // BG is for rotation the same, except for factor NRotations
1716  Double_t weight=1./Double_t(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents());
1717  for(Int_t firstGammaIndex=0;firstGammaIndex<currPhotonList->GetEntries();firstGammaIndex++){
1718  AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(currPhotonList->At(firstGammaIndex));
1719  if (gamma0==NULL) continue;
1720  if (!gamma0->GetUseForMesonPair() ) continue;
1721  for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<currPhotonList->GetEntries();secondGammaIndex++){
1722  AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(currPhotonList->At(secondGammaIndex));
1723  if (gamma1 == NULL) continue;
1724  if (!gamma1->GetUseForMesonPair() ) continue;
1725  if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelected(gamma1,fInputEvent))continue;
1726  for(Int_t nRandom=0;nRandom<((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents();nRandom++){
1727  RotateParticle(gamma1);
1728  AliAODConversionMother backgroundCandidate(gamma0,gamma1);
1729  backgroundCandidate.CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
1730  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(&backgroundCandidate, kFALSE, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
1731 
1732  if (fHistoMotherBackInvMassPt[fiCut]) fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt(),fWeightJetJetMC);
1733  if(fDoTHnSparse){
1734  Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
1735  if (fSparseMotherBackInvMassPtZM[fiCut]) fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
1736  }
1737  }
1738  }
1739  }
1740  }
1741 
1742  }else {
1743  // Do Event Mixing
1744  for(Int_t nEventsInBG=0;nEventsInBG <currBGHandler->GetNBGEvents(currPhotonList,fInputEvent);nEventsInBG++){
1745  AliGammaConversionPhotonVector *previousEventGammas = currBGHandler->GetBGGoodGammas(currPhotonList,fInputEvent,nEventsInBG);
1746  if(previousEventGammas){
1747  // test weighted background
1748  Double_t weight=1.0;
1749  // Correct for the number of eventmixing:
1750  // N gammas -> (N-1) + (N-2) +(N-3) ...+ (N-(N-1)) using sum formula sum(i)=N*(N-1)/2 -> N*(N-1)/2
1751  // real combinations (since you cannot combine a photon with its own)
1752  // but BG leads to N_{a}*N_{b}combinations
1753  weight*=0.5*(Double_t(currPhotonList->GetEntries()-1))/Double_t(previousEventGammas->size());
1754 
1755  for(Int_t iCurrent=0;iCurrent<currPhotonList->GetEntries();iCurrent++){
1756  AliAODConversionPhoton *gamma0 = (AliAODConversionPhoton*)(currPhotonList->At(iCurrent));
1757  if (!gamma0->GetUseForMesonPair() ) continue;
1758  for(UInt_t iPrevious=0;iPrevious<previousEventGammas->size();iPrevious++){
1759  AliAODConversionPhoton *gamma1 = (AliAODConversionPhoton*)(previousEventGammas->at(iPrevious));
1760  AliAODConversionMother backgroundCandidate(gamma0,gamma1);
1761  backgroundCandidate.CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
1763  ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
1764  if (fHistoMotherBackInvMassPt[fiCut]) fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt(),fWeightJetJetMC);
1765  if(fDoTHnSparse){
1766  Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
1767  if (fSparseMotherBackInvMassPtZM[fiCut]) fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
1768  }
1769  }
1770  }
1771  }
1772  }
1773  }
1774  }
1775 }
1776 
1777 //________________________________________________________________________
1779  Int_t fNDegreesPMBackground= ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->NDegreesRotation();
1780  Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180;
1781  Double_t rotationValue = fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
1782  gamma->RotateZ(rotationValue);
1783 }
1784 
1785 //________________________________________________________________________
1787  previousEventEP=previousEventEP+TMath::Pi();
1788  thisEventEP=thisEventEP+TMath::Pi();
1789  Double_t rotationValue= thisEventEP-previousEventEP;
1790  gamma->RotateZ(rotationValue);
1791 }
1792 
1793 //________________________________________________________________________
1795  //see header file for documentation
1796 
1797  Double_t dx = vertex->fX - fInputEvent->GetPrimaryVertex()->GetX();
1798  Double_t dy = vertex->fY - fInputEvent->GetPrimaryVertex()->GetY();
1799  Double_t dz = vertex->fZ - fInputEvent->GetPrimaryVertex()->GetZ();
1800 
1801  Double_t movedPlace[3] = {particle->GetConversionX() - dx,particle->GetConversionY() - dy,particle->GetConversionZ() - dz};
1802  particle->SetConversionPoint(movedPlace);
1803 }
1804 //________________________________________________________________________
1806  //see header file for documentation
1807  if(fGammaCandidates->GetEntries() >0 && fMesonRecoMode == 0 ){
1808  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1809  fBGHandler[fiCut]->AddEvent(fGammaCandidates,fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1811  }else { // means we use #V0s for multiplicity
1812  fBGHandler[fiCut]->AddEvent(fGammaCandidates, fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1813  fGammaCandidates->GetEntries(), fEventPlaneAngle);
1814  }
1815  } else if((fGammaCandidates->GetEntries() >0 || fClusterCandidates->GetEntries() > 0 ) && fMesonRecoMode == 1 ){
1816  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1817  fBGHandler[fiCut]->AddEvent(fGammaCandidates,fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1819  fBGClusHandler[fiCut]->AddEvent(fClusterCandidates,fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1821  }else { // means we use #V0s for multiplicity
1822  fBGHandler[fiCut]->AddEvent(fGammaCandidates, fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1823  fGammaCandidates->GetEntries(), fEventPlaneAngle);
1824  fBGClusHandler[fiCut]->AddEvent(fClusterCandidates, fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1825  fGammaCandidates->GetEntries(), fEventPlaneAngle);
1826  }
1827  } else if(fClusterCandidates->GetEntries() >0 && fMesonRecoMode == 2 ){
1828  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
1829  fBGClusHandler[fiCut]->AddEvent(fClusterCandidates,fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1831  }else { // means we use #V0s for multiplicity
1832  fBGClusHandler[fiCut]->AddEvent(fClusterCandidates, fInputEvent->GetPrimaryVertex()->GetX(), fInputEvent->GetPrimaryVertex()->GetY(), fInputEvent->GetPrimaryVertex()->GetZ(),
1833  fClusterCandidates->GetEntries(), fEventPlaneAngle);
1834  }
1835  }
1836 }
1837 
1838 //________________________________________________________________________
1840 
1841  // Relabeling For AOD Event
1842  // ESDiD -> AODiD
1843  // MCLabel -> AODMCLabel
1844 
1845  if(mode){
1846  fMCEventPos = new Int_t[fReaderGammas->GetEntries()];
1847  fMCEventNeg = new Int_t[fReaderGammas->GetEntries()];
1848  fESDArrayPos = new Int_t[fReaderGammas->GetEntries()];
1849  fESDArrayNeg = new Int_t[fReaderGammas->GetEntries()];
1850  }
1851 
1852  for(Int_t iGamma = 0;iGamma<fReaderGammas->GetEntries();iGamma++){
1853  AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(iGamma);
1854  if(!PhotonCandidate) continue;
1855  if(!mode){// Back to ESD Labels
1856  PhotonCandidate->SetMCLabelPositive(fMCEventPos[iGamma]);
1857  PhotonCandidate->SetMCLabelNegative(fMCEventNeg[iGamma]);
1858  PhotonCandidate->SetLabelPositive(fESDArrayPos[iGamma]);
1859  PhotonCandidate->SetLabelNegative(fESDArrayNeg[iGamma]);
1860  continue;
1861  }
1862  fMCEventPos[iGamma] = PhotonCandidate->GetMCLabelPositive();
1863  fMCEventNeg[iGamma] = PhotonCandidate->GetMCLabelNegative();
1864  fESDArrayPos[iGamma] = PhotonCandidate->GetTrackLabelPositive();
1865  fESDArrayNeg[iGamma] = PhotonCandidate->GetTrackLabelNegative();
1866 
1867  Bool_t AODLabelPos = kFALSE;
1868  Bool_t AODLabelNeg = kFALSE;
1869 
1870  for(Int_t i = 0; i<fInputEvent->GetNumberOfTracks();i++){
1871  AliAODTrack *tempDaughter = static_cast<AliAODTrack*>(fInputEvent->GetTrack(i));
1872  if(!AODLabelPos){
1873  if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelPositive() ){
1874  PhotonCandidate->SetMCLabelPositive(TMath::Abs(tempDaughter->GetLabel()));
1875  PhotonCandidate->SetLabelPositive(i);
1876  AODLabelPos = kTRUE;
1877  }
1878  }
1879  if(!AODLabelNeg){
1880  if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelNegative()){
1881  PhotonCandidate->SetMCLabelNegative(TMath::Abs(tempDaughter->GetLabel()));
1882  PhotonCandidate->SetLabelNegative(i);
1883  AODLabelNeg = kTRUE;
1884  }
1885  }
1886  if(AODLabelNeg && AODLabelPos){
1887  break;
1888  }
1889  }
1890  if(!AODLabelPos || !AODLabelNeg){
1891  cout<<"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl;
1892  if(!AODLabelNeg){
1893  PhotonCandidate->SetMCLabelNegative(-999999);
1894  PhotonCandidate->SetLabelNegative(-999999);
1895  }
1896  if(!AODLabelPos){
1897  PhotonCandidate->SetMCLabelPositive(-999999);
1898  PhotonCandidate->SetLabelPositive(-999999);
1899  }
1900  }
1901  }
1902 
1903  if(!mode){
1904  delete[] fMCEventPos;
1905  delete[] fMCEventNeg;
1906  delete[] fESDArrayPos;
1907  delete[] fESDArrayNeg;
1908  }
1909 }
1910 
1911 //________________________________________________________________________
1913  TAxis *axisafter = histoRebin->GetXaxis();
1914  Int_t bins = axisafter->GetNbins();
1915  Double_t from = axisafter->GetXmin();
1916  Double_t to = axisafter->GetXmax();
1917  Double_t *newbins = new Double_t[bins+1];
1918  newbins[0] = from;
1919  Double_t factor = TMath::Power(to/from, 1./bins);
1920  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
1921  axisafter->Set(bins, newbins);
1922  delete [] newbins;
1923 }
1924 
1925 //________________________________________________________________________
1927 {
1928  //fOutputContainer->Print(); // Will crash on GRID
1929 }
1930 
1931 //_________________________________________________________________________________
1933  if(tobechecked > -1){
1934  vector<Int_t>::iterator it;
1935  it = find (vec.begin(), vec.end(), tobechecked);
1936  if (it != vec.end()) return true;
1937  else return false;
1938  }
1939  return false;
1940 }
1941 
1942 //_________________________________________________________________________________
1944  if(tobechecked > -1){
1945  vector<Int_t>::iterator it;
1946  it = find (vec.begin(), vec.end(), tobechecked);
1947  if (it != vec.end()) return true;
1948  else{
1949  vec.push_back(tobechecked);
1950  return false;
1951  }
1952  }
1953  return false;
1954 }
1955 
1956 //_________________________________________________________________________________
1957 void AliAnalysisTaskConvCaloCalibration::FillMultipleCountMap(map<Int_t,Int_t> &ma, Int_t tobechecked){
1958  if( ma.find(tobechecked) != ma.end() ) ma[tobechecked] += 1;
1959  else ma[tobechecked] = 2;
1960  return;
1961 }
1962 
1963 //_________________________________________________________________________________
1965  map<Int_t, Int_t>::iterator it;
1966  for (it = ma.begin(); it != ma.end(); it++){
1967  hist->Fill(it->second, fWeightJetJetMC);
1968  }
1969  ma.clear();
1970  return;
1971 }
TH1F ** fHistoClusGammaE
array of histos with cluster, pt
virtual Double_t GetPhotonPhi() const
TH1F ** fHistoNV0Tracks
array of histos with number of calo gamma candidates per event
void SetUseForMesonPair(Bool_t useForMeson)
AliGammaConversionAODBGHandler ** fBGClusHandler
void SetCaloClusterRef(Long_t ref)
void SetLabels(Int_t label1, Int_t label2, Int_t label3=0)
double Double_t
Definition: External.C:58
TH1F ** fHistoNGammaConvCandidates
array of histos with vertex y distribution for selected events
GammaConversionVertex * GetBGEventVertex(Int_t zbin, Int_t mbin, Int_t event)
Definition: External.C:236
void SetConversionPoint(Double_t convpoint[3])
void SetMCLabelNegative(Int_t label)
void FillMultipleCountMap(map< Int_t, Int_t > &ma, Int_t tobechecked)
TList * fClusterCandidates
current list of photon candidates
AliGammaConversionPhotonVector * GetBGGoodGammas(TObjArray *const eventGammas, AliVEvent *fInputEvent, Int_t event)
Int_t GetNumberOfPrimaryTracks()
void FillMultipleCountHistoAndClear(map< Int_t, Int_t > &ma, TH1F *hist)
TH1F ** fHistoVertexX
array of histos with vertex z distribution for selected events
TProfile ** fProfileJetJetXSection
array of profiles with eta shift
TH1F ** fHistoClusRejectedHeadersGammaPt
array of histos with cluster, pt all headers
TH1F ** fHistoVertexY
array of histos with vertex x distribution for selected events
TH1F *** fHistoClusGammaESM
array of histos with cluster, pt
TString GetPeriodName()
Bool_t CheckVectorOnly(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoNEvents
array of histos with invariant mass pairs which were rejected
void RotateParticle(AliAODConversionPhoton *gamma)
TH2F ** fHistoMotherMesonPtAlpha
array of histograms with invariant mass cut around nominal mass, pt, Y
TProfile ** fProfileEtaShift
array of histos with mixed event background with alpha < 0.1 for NonLin
Bool_t GetProduceV0FindingEfficiency()
TH2F ** fHistoMotherMatchedInvMassPt
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
TH1F ** fHistoConvGammaPt
array of profiles with xsection for jetjet
std::vector< AliAODConversionPhoton * > AliGammaConversionAODVector
TH1F ** fHistoMotherInvMassRejected
array of histos with cluster, pt rejected headers
TH2F ** fHistoMotherMesonConvPhotonEtaPhi
array of histograms with invariant mass cut around nominal mass, pt, openAngle
int Int_t
Definition: External.C:63
TH1F ** fHistoNGammaCaloCandidates
array of histos with number of conversion gamma candidates per event
Class handling all kinds of selection cuts for Gamma Calo analysis.
Int_t GetMultiplicityBinIndex(Int_t mult) const
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void SetMCLabelPositive(Int_t label)
TH1F ** fHistoClusGammaPt
array of histogram conversion photon pT
void AddEvent(TList *const eventGammas, Double_t xvalue, Double_t yvalue, Double_t zvalue, Int_t multiplicity, Double_t epvalue=-100)
TH1F ** fHistoVertexZ
array of histos with number of good tracks (2010 Standard track cuts)
AliConversionPhotonCuts * GetConversionCuts()
Definition: AliV0ReaderV1.h:89
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH1F ** fHistoNEventsWOWeight
array of histos with event information
TH2F ** fHistoMotherMesonPtY
array of histogram with BG for mixed event photon pairs, inv Mass, pt
TH1F ** fHistoClusOverlapHeadersGammaPt
array of histos with cluster, E
void MoveParticleAccordingToVertex(AliAODConversionPhoton *particle, const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex)
Int_t mode
Definition: anaM.C:41
virtual Double_t GetPhotonEta() const
Double_t GetOpeningAngle() const
TH2F ** fHistoMotherBackInvMassECalib
array of histos with signal + background with alpha < 0.1 for NonLin
void SetLeadingCellID(Int_t index)
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)
TList * fEventCutArray
current list of cluster candidates
short Short_t
Definition: External.C:23
THnSparseF ** fSparseMotherBackInvMassPtZM
array of THnSparseF with signal + BG for same event photon pairs, inv Mass, pt
Double_t centMax
TH2F *** fHistoMotherInvMassECalibSM
array of histos for SPD Cluster vs Tracklet plot for pileup monitoring
TList * GetCaloTrackMatcherHistograms()
TH2F ** fHistoSPDClusterTrackletBackground
array of histograms with invariant mass cut around nominal mass ,eta/phi of conversion photon ...
AliGammaConversionAODVector * GetBGGoodV0s(Int_t zbin, Int_t mbin, Int_t event)
TH2F ** fHistoMotherMesonPtOpenAngle
array of histograms with invariant mass cut around nominal mass, pt, alpha
Definition: External.C:220
TH1F ** fHistoClusAllHeadersGammaPt
array of histos with cluster, pt overlapping with other headers
Class handling all kinds of selection cuts for Gamma Conversion analysis.
void SetLabelPositive(Int_t label)
Track labels.
void SetLabelNegative(Int_t label)
TH1F *** fHistoClusGammaPtSM
array of histos with cluster, E
TClonesArray * GetReconstructedGammas() const
Definition: AliV0ReaderV1.h:85
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
void AddEvent(TObjArray *const eventGammas, AliVEvent *fInputEvent)
TH1F ** fHistoJetJetNTrials
array of histos with V0 counts
void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
AliConvEventCuts * GetEventCuts()
Definition: AliV0ReaderV1.h:90
const char Option_t
Definition: External.C:48
TH2F ** fHistoMotherBackInvMassPt
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
TH1F ** fHistoNGoodESDTracks
array of histos with event information without event weights
bool Bool_t
Definition: External.C:53
TH2F ** fHistoMotherInvMassECalib
array of histos with mixed event background with alpha < 0.1 for NonLin for every Supermodule ...
TH2F *** fHistoMotherBackInvMassECalibSM
array of histos with signal + background with alpha < 0.1 for NonLin for every Supermodule ...
void CalculateDistanceOfClossetApproachToPrimVtx(const AliVVertex *primVertex)
vector< AliAODConversionPhoton * > AliGammaConversionPhotonVector
TList * GetV0FindingEfficiencyHistograms()
Double_t centMin