changes from gsi. Using mult if no centrality. testfilterbit 128
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / macros / AddTaskGammaConvDalitz.C
1
2 AliAnalysisTaskGammaConvDalitz* AddTaskGammaConvDalitz(
3                                                     AliV0Reader *v0Reader,
4                                                     Bool_t computeBkg,
5                                                     Bool_t standalone = kFALSE
6                                                   ){
7
8
9     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10     if (!mgr) {
11         ::Error("AddGammaConvDalitz", "No analysis manager to connect to.");
12         return 0;
13     }
14
15     // Check the analysis type using the event handlers connected to the analysis manager.
16     //==============================================================================
17     if (!mgr->GetInputEventHandler()) {
18         ::Error("AddGammaConvDalitz", "This task requires an input event handler");
19         return 0;
20     }
21
22
23         //------------------------- Dalitz task ---------------------------------
24         AliGammaConversionHistograms* histogramsD = new AliGammaConversionHistograms();
25         AddHistogramsDalitz( histogramsD );
26         
27         AliAnalysisTaskGammaConvDalitz* dalitzTask = new AliAnalysisTaskGammaConvDalitz("GammaConversionTaskDalitz");
28         AliV0Reader* v0ReaderD = v0Reader;
29         
30         dalitzTask->AdoptHistograms( histogramsD );
31         dalitzTask->SetComputeBackground( computeBkg );
32         dalitzTask->SetUseBayesPID( kGCUseBayesPID );
33         dalitzTask->SetNSigmasElecTPC( kGCNSigmaBelowElecTPCbethe, kGCNSigmaAboveElecTPCbethe);
34         dalitzTask->SetNSigmasPionTPC( kGCNSigmaAbovePionTPCbethe );
35         dalitzTask->SetNSigmasKaonTPC( kGCNSigmaAboveKaonTPCbethe );
36         dalitzTask->SetNSigmasProtonTPC( kGCNSigmaAboveProtonTPCbethe );
37
38         dalitzTask->SetUseESDtrackIndexCut( kGCUseTrackIndexCut );
39         dalitzTask->SetUsePsiPairCut( kGCUsePsiPairCut );
40         dalitzTask->SetPsiPairCut( kGCPsiPairCut, kGCDeltaPhiCutMin, kGCDeltaPhiCutMax, kGCReadMagFieldSign);
41         dalitzTask->SetUseMassCut( kGCUseMassCut );
42         dalitzTask->SetUseGammaCut( kGCUseGammaCut );
43         dalitzTask->SetUseAliKF( kGCUseAliKF );
44         
45         dalitzTask->SetTrackSelectionCriteria(kGCTrkSelectionCriteria);
46         
47         //  track selection
48         // -----------------------------
49         
50         AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts("track cuts for pi0 Dalitz decay");
51         
52         esdTrackCuts->SetEtaRange( -0.9, 0.9 );
53         esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
54
55         esdTrackCuts->SetMinNClustersITS(2);
56         esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
57         esdTrackCuts->SetRequireITSRefit(kTRUE);
58         
59         //esdTrackCuts->SetRequireSigmaToVertex(kTRUE);
60         //esdTrackCuts->SetMaxNsigmaToVertex(3);
61         
62         esdTrackCuts->SetMaxDCAToVertexXY(1.);
63         esdTrackCuts->SetMaxDCAToVertexZ(3.);
64         esdTrackCuts->SetDCAToVertex2D(kTRUE);
65         
66         // ITSsa
67         AliESDtrackCuts* esdITSsaTrackCuts = new AliESDtrackCuts(*esdTrackCuts);
68         esdITSsaTrackCuts->SetRequireITSStandAlone(kTRUE);
69         
70         dalitzTask->AdoptITSsaTrackCuts( esdITSsaTrackCuts );
71         
72         esdTrackCuts->SetMinNClustersTPC(80);
73         esdTrackCuts->SetMaxChi2PerClusterTPC(4.);
74         esdTrackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
75         esdTrackCuts->SetRequireTPCRefit(kTRUE);
76         
77         dalitzTask->AdoptESDtrackCuts( esdTrackCuts );
78         
79         // --------------------- electrons pid cuts -----------------------------
80         esdPidCuts = new AliESDpidCuts("Electrons", "Electron PID cuts");
81         //   esdPidCuts->SetTPCnSigmaCut(AliPID::kElectron, 3.);
82         esdPidCuts->SetTPCnSigmaCut(AliPID::kElectron, -3., 3.);
83         //esdPidCuts->SetTPCnSigmaCut(AliPID::kPion, -1000., 0.);
84
85     dalitzTask->AdoptESDpidCuts( esdPidCuts );
86
87         if( standalone )
88         {
89                 v0ReaderD = new AliV0Reader( *v0Reader ); // Copy constructor
90                 v0ReaderD->SetHistograms( histogramsD );
91                 v0ReaderD->SetDoMCTruth( kGCdoMCTruth );    // NOTE: not copied in Copy constructor!!!
92                 v0ReaderD->SetESDtrackCuts( esdTrackCuts );
93                 dalitzTask->SetRunStandalone( kTRUE );
94         }
95         
96         dalitzTask->SetV0Reader( v0ReaderD );
97         dalitzTask->SetDoMC(kGCdoMCTruth);
98         
99         dalitzTask->SetDebugLevel(AliLog::kFatal);
100         
101         // Select triggers events (needs AliPhysicsSelectionTask in the train)
102          dalitzTask->SelectCollisionCandidates();
103         
104         // Add task to the manager 
105         mgr->AddTask( dalitzTask );
106
107     // Connect I/O to the task
108     TString outputfile = AliAnalysisManager::GetCommonFileName();
109     outputfile += ":PWGGA_GammaConversion";
110     outputfile += Form("_%s",kGCAnalysisCutSelectionId.Data());
111     AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("histogramsAliGammaConversionDalitz", TList::Class(),AliAnalysisManager::kOutputContainer, outputfile);
112     mgr->ConnectInput ( dalitzTask, 0, mgr->GetCommonInputContainer() );
113     mgr->ConnectOutput( dalitzTask, 1, coutput3 );
114
115     return dalitzTask;
116 }
117
118 //----------------------------------------------------------------------------------
119
120 // Table_MC
121 Int_t kGCnElementsPi0Table  = 5;
122 const char* kGCPi0Table[] = {
123     "Events",                            // 0
124     "\\pi^{0}->\\gamma\\gamma",          // 1
125     "\\pi^{0}->e+e-\\gamma",             // 2
126     "\\pi^{0}->e+e-\\gamma acceptance",  // 3
127     "\\pi^{0}->e+e-\\gamma converted"    // 4
128 };
129
130 //----------------------------------------------------------------------------------
131 // Table_PID
132 Int_t kGCnElementsPidTable  = 6;
133 const char* kGCPidTable[] = { "e", "\\mu", "\\pi", "K", "p", "sum" };
134
135 //----------------------------------------------------------------------------------
136
137 // Table_ElectronDalitz (ESD cuts)
138 Int_t kGCnElementsElectronDalitzTable = 8;
139 const char * kGCElectronDalitzTable[] = {
140   "Events",                  // 0
141   "e+ candidates",           // 1
142   "e- candidates",           // 2
143   "e+ Dalitz",               // 3
144   "e- Dalitz",               // 4
145   "dalitz pairs",            // 5
146   "\\gamma \\pi^{0}",        // 6
147   "\\pi^{0} Dalitz"          // 7
148 };
149
150 //----------------------------------------------------------------------------------
151 // Table_ElectronDalitz (ESD cuts)
152 Int_t kGCnElementsCutsTable  = 6;
153 const char * kGCCutsTable[] = {
154   "Events",                   //0
155   "No cut",                   //1
156   "Index cut",                //2
157   "PsiPair cut",              //3
158   "Mass    cut",              //4
159   "Angle   cut"               //5
160 };
161
162 //----------------------------------------------------------------------------------
163 void AddHistogramsDalitz( AliGammaConversionHistograms *histograms )
164 {
165     // Generation
166     //
167   if(kGCdoMCTruth)
168   {
169     // pi0
170     histograms->AddHistogram("MC_Pi0Dalitz_P", "\\pi^{0} Dalitz decay", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt/5., "p (GeV/c)", "");
171     histograms->AddHistogram("MC_Pi0Dalitz_Pt", "\\pi^{0} Dalitz decay", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt/5., "p_{t} (GeV/c)", "");
172     histograms->AddHistogram("MC_Pi0Dalitz_Eta", "\\pi^{0} Dalitz decay", kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "\\eta" , "");
173     histograms->AddHistogram("MC_Pi0Dalitz_Pt_vs_Y", "\\pi^{0} Dalitz decay", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt/5., "y","p_{t} (GeV/c)");
174     histograms->AddHistogram("MC_Acceptance_Pi0Dalitz_Pt_vs_Y", "\\pi^{0} Acceptance", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt/5., "y","p_{t} (GeV/c)");
175     histograms->AddHistogram("MC_Acceptance_GC_Pi0Dalitz_Pt_vs_Y", "\\pi^{0} Acceptance with converted \\gamma", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt/5., "y","p_{t} (GeV/c)");
176    
177     // e+ from pi0
178     histograms->AddHistogram("MC_EposDalitz_Pt", "e+ from Dalitz pair",              kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
179     histograms->AddHistogram("MC_EposDalitz_Eta", "e+ from Dalitz pair",              kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
180     
181     // e- from pi0
182     histograms->AddHistogram("MC_EnegDalitz_Pt", "e- from Dalitz pair",              kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
183     histograms->AddHistogram("MC_EnegDalitz_Eta", "e- from Dalitz pair",              kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
184
185     // gamma from pi0
186     histograms->AddHistogram("MC_GammaPi0Dalitz_Pt", "\\gamma from \\pi^{0} Dalitz decay",            kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
187     histograms->AddHistogram("MC_GammaPi0Dalitz_Eta", "\\gamma from \\pi^{0} Dalitz decay",            kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
188
189     // angles
190     // e+e-
191     histograms->AddHistogram("MC_EposEnegDalitz_Angle", "e+e- Dalitz pair", kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"Angle(e+,e-) (rad)","");
192     // e+e- gamma
193     histograms->AddHistogram("MC_EposEnegDalitz_GammaPi0_Angle",  "Angle between the plane e+e- and \\gamma from Pi0 Dalitz decay", kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"\\theta (rad)","");
194     histograms->AddHistogram("MC_EposEnegDalitz_GammaPi0_Angle_vs_P","Angle between the plane e+e- and \\gamma from Pi0 Dalitz decay",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"\\theta (rad)","p(\\pi^{0}) (GeV/c)");
195     histograms->AddHistogram("MC_EposEnegDalitz_GammaPi0_Angle_vs_Pt","Angle between the plane e+e- and \\gamma from Pi0 Dalitz decay",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"\\theta (rad)","p_{t}(\\pi^{0}) (GeV/c)");
196
197     // Pi0 within acceptance
198     histograms->AddHistogram("MC_Acceptance_Pi0Dalitz_Pt", "\\pi^{0} Dalitz decay within acceptance",             kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
199     histograms->AddHistogram("MC_Acceptance_Pi0Dalitz_Eta", "\\pi^{0} Dalitz decay within acceptance",             kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
200     histograms->AddHistogram("MC_Acceptance_Pi0Dalitz_Radius", "\\pi^{0} Dalitz decay within acceptance",             kGCnXBinsR,kGCfirstXBinR,kGClastXBinR,"Radius(XY) cm","");
201     
202     histograms->AddHistogram("MC_Acceptance_GammaPi0Dalitz_Pt", "\\gamma from \\pi^{0} Dalitz,  \\pi^{0} within acceptance ",  kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
203     histograms->AddHistogram("MC_Acceptance_GammaPi0Dalitz_Eta", "\\gamma from \\pi^{0} Dalitz,  \\pi^{0} within acceptance ",  kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
204     
205     // e+
206     histograms->AddHistogram("MC_Acceptance_EposPi0Dalitz_Pt",  "e+ from \\pi^{0} Dalitz,  \\pi^{0} within acceptance", kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
207     histograms->AddHistogram("MC_Acceptance_EposPi0Dalitz_Eta", "e+ from \\pi^{0} Dalitz,  \\pi^{0} within acceptance", kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
208     
209     // e-
210     histograms->AddHistogram("MC_Acceptance_EnegPi0Dalitz_Pt",  "e- from \\pi^{0} Dalitz,  \\pi^{0} within acceptance",              kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
211     histograms->AddHistogram("MC_Acceptance_EnegPi0Dalitz_Eta", "e- from \\pi^{0} Dalitz,  \\pi^{0} within acceptance",              kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
212     
213     
214     histograms->AddHistogram("MC_Acceptance_DalitzPair_OpeningAngle", "Dalitz pair within acceptance", kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"Angle(e+,e-) (rad)","");
215     histograms->AddHistogram("MC_GC_GammaPi0Dalitz_All_Z_vs_R",    "\\gamma from \\pi^{0} Dalitz decay", kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "Z (cm)"," R (cm)");
216
217     // e+ within acceptance
218     histograms->AddHistogram("MC_Acceptance_EposDalitz_Pt",  "e+ from Dalitz pair within acceptance",              kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
219     histograms->AddHistogram("MC_Acceptance_EposDalitz_Eta", "e+ from Dalitz pair within acceptance",              kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
220     
221     // e-
222     histograms->AddHistogram("MC_Acceptance_EnegDalitz_Pt",  "e- from Dalitz pair within acceptance",              kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
223     histograms->AddHistogram("MC_Acceptance_EnegDalitz_Eta", "e- from Dalitz pair within acceptance",              kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
224     // e+e-
225     histograms->AddHistogram("MC_Acceptance_DalitzPair_EposPt_vs_EnegPt","Dalitz pair within acceptance",     kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t}(e+) (GeV/c)","p_{t}(e-) (GeV/c)");
226
227     // within acceptance with gamma converted
228     histograms->AddHistogram("MC_Acceptance_GC_Pi0Dalitz_Pt", "\\pi^{0} Dalitz decay within acceptance with \\gamma converted",  kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
229     histograms->AddHistogram("MC_Acceptance_GC_Pi0Dalitz_Eta", "\\pi^{0} Dalitz decay within acceptance with \\gamma converted", kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
230     
231     histograms->AddHistogram("MC_Acceptance_GC_EposPi0Dalitz_Pt", "e+ from Dalitz pair,  \\pi^{0}  within acceptance with \\gamma converted", kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
232     histograms->AddHistogram("MC_Acceptance_GC_EposPi0Dalitz_Eta", "e+ from Dalitz pair,  \\pi^{0}  within acceptance with \\gamma converted", kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
233
234     histograms->AddHistogram("MC_Acceptance_GC_EnegPi0Dalitz_Pt", "e- from Dalitz pair,  \\pi^{0}  within acceptance with \\gamma converted", kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
235     histograms->AddHistogram("MC_Acceptance_GC_EnegPi0Dalitz_Eta", "e- from Dalitz pair,  \\pi^{0}  within acceptance with \\gamma converted", kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
236     
237     histograms->AddHistogram("MC_Acceptance_GC_GammaPi0Dalitz_Pt", "\\gamma from \\pi^{0} Dalitz,  \\pi^{0}  within acceptance with \\gamma converted", kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
238     histograms->AddHistogram("MC_Acceptance_GC_GammaPi0Dalitz_Eta", "\\gamma from \\pi^{0} Dalitz,  \\pi^{0}  within acceptance with \\gamma converted", kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
239     histograms->AddHistogram("MC_Acceptance_GC_GammaPi0Dalitz_Z_vs_R",  "\\gamma from \\pi^{0} Dalitz decay within acceptance GC", kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "Z (cm)","R (cm)");
240   }
241     //  Reconstruction
242     // ---------------------------------------------------------------------------
243
244     // reconstructed epos
245     histograms->AddHistogram("ESD_Debug_Table","Table Debug",10,-5,5,"Quality","");
246     histograms->AddHistogram("ESD_EposCandidates_Pt", "Reconstructed e+ candidates",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
247     histograms->AddHistogram("ESD_EposCandidates_Eta", "Reconstructed e+ candidates",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
248
249     // reconstructed eneg
250     histograms->AddHistogram("ESD_EnegCandidates_Pt", "Reconstructed e- candidates",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
251     histograms->AddHistogram("ESD_EnegCandidates_Eta", "Reconstructed e- candidates",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
252
253     // Reconstructed dalitz pair
254     histograms->AddHistogram("ESD_DalitzPairCandidates_Pt", "Reconstructed Dalitz pair candidates",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
255     histograms->AddHistogram("ESD_DalitzPairCandidates_Mass", "Reconstructed Dalitz pair candidates", kGCnXBinsDalitzMass, kGCfirstXBinDalitzMass, kGClastXBinDalitzMass, "M(e+,e-) (GeV/c^{2})","");
256     
257     // gammas
258     histograms->AddHistogram("ESD_GammaCandidates_Pt", "Reconstructed \\gamma candidates",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
259     histograms->AddHistogram("ESD_GammaCandidates_Eta", "Reconstructed \\gamma candidates",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
260
261     histograms->AddHistogram("ESD_EposEneg_GammaCandidates_Angle", "Angle between e+, e- candidates and \\gamma candidates", kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"Angle(e+e-, \\gamma) (rad)","");
262
263     // Reconstructed pi0
264     //
265     histograms->AddHistogram("ESD_Pi0_P", "\\pi^{0} Dalitz decay", kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p (GeV/c)","");
266     histograms->AddHistogram("ESD_Pi0_Pt", "\\pi^{0} Dalitz decay",               kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
267     histograms->AddHistogram("ESD_Pi0_Eta", "\\pi^{0} Dalitz decay",               kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
268      histograms->AddHistogram("ESD_Pi0_Y",        "\\pi^{0} Dalitz decay",               kGCnXBinsRapid,kGCfirstXBinRapid,kGClastXBinRapid,"y","");
269     histograms->AddHistogram("ESD_Pi0_Phi",          "\\pi^{0} Dalitz decay",               kGCnXBinsPhi,kGCfirstXBinPhi,kGClastXBinPhi," \\phi (rad)","");
270     histograms->AddHistogram("ESD_Pi0_Mass",      "\\pi^{0} Dalitz decay",                kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"M(e+,e-,\\gamma) (GeV/c^{2})","");
271     histograms->AddHistogram("ESD_Pi0_Pt_vs_Y","\\pi^{0} Dalitz decay", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"y","p_{t} (GeV/c)");
272     histograms->AddHistogram("ESD_Pi0_Mass_vs_Pt","\\pi^{0} Dalitz decay",               kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5., kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"p_{t} (GeV/c)","M(e+,e-,\\gamma) (GeV/c^{2})");
273     histograms->AddHistogram("ESD_Pi0_Mass_vs_Eta","\\pi^{0} Dalitz decay",               kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta, kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"\\eta","M(e+,e-,\\gamma) (GeV/c^{2})");
274     histograms->AddHistogram("ESD_Pi0_Mass_vs_Y","\\pi^{0} Dalitz decay", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid,  kGCnXBinsPi0DalitzMass,  kGCfirstXBinPi0DalitzMass,  kGClastXBinPi0DalitzMass, "y","M(e+,e-,\\gamma) (GeV/c^{2})");
275
276     // Background
277     histograms->AddHistogram("ESD_BKG_EposEneg", "Like sign background",              kGCnXBinsDalitzMass, kGCfirstXBinDalitzMass, kGClastXBinDalitzMass,"M(e+,e+) & M(e-,e-) (GeV/c^{2})","");
278     histograms->AddHistogram("ESD_BKG_PrevGamma", "e+e- with \\gamma used in the signal",              kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"M(e+,e-,\\gamma) (GeV/c^{2})","");
279     histograms->AddHistogram("ESD_BKG_PrevGamma_vs_Pt", "Backgroud: \\gamma used in the signal",  kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,  kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass, "p_{t} (GeV/c)", "M(e+,e-,\\gamma) (GeV/c^{2})");
280
281     histograms->AddHistogram("ESD_BKG_BGHandler", "e+e- with \\gamma from a pool of events",              kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"M(e+,e-,\\gamma) (GeV/c^{2})","");
282     histograms->AddHistogram("ESD_BKG_BGHandler_vs_Pt", "e+e- with \\gamma from a pool of events",  kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,      kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"p_{t} (GeV/c)","M(e+,e-,\\gamma) (GeV/c^{2})");
283
284     histograms->AddHistogram("ESD_BKG_Electron", "e+ with e-,\\gamma from a pool of events",              kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"M(e+,e-,\\gamma) (GeV/c^{2})","");
285     histograms->AddHistogram("ESD_BKG_Electron_vs_Pt", "e+ with e-,\\gamma from a pool of events", kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,       kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"p_{t} (GeV/c)","M(e+,e-,\\gamma) (GeV/c^{2})");
286
287
288     // GEANT
289     // ---------------------
290   if(kGCdoMCTruth)
291   {
292     histograms->AddHistogram("MC_ESD_EposDalitz_Pt", "Reconstructed e+ from Dalitz pair (MC)",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
293     histograms->AddHistogram("MC_ESD_EposDalitz_Eta", "Reconstructed e+ from Dalitz pair (MC)",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
294
295     // reconstructed eneg
296     histograms->AddHistogram("MC_ESD_EnegDalitz_Pt", "Reconstructed e- from Dalitz pair (MC)",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
297     histograms->AddHistogram("MC_ESD_EnegDalitz_Eta", "Reconstructed e- from Dalitz pair (MC)",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
298
299     // Reconstructed dalitz pair
300     histograms->AddHistogram("MC_ESD_DalitzPair_Pt", "Reconstructed Dalitz pair (MC)",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
301     histograms->AddHistogram("MC_ESD_DalitzPair_Mass", "Reconstructed Dalitz pair (MC)",              kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"M(e+,e-) (GeV/c^{2})","");
302
303     // reconstructed gammas
304     histograms->AddHistogram("MC_ESD_Gamma_Pt", "Reconstructed \\gamma (MC)",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
305     histograms->AddHistogram("MC_ESD_Gamma_Eta", "Reconstructed \\gamma (MC)",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
306
307     // gamma from Dalitz
308     histograms->AddHistogram("MC_ESD_GammaPi0Dalitz_Pt", "Reconstructed \\gamma from \\pi^{0} Dalitz (MC)",   kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
309     histograms->AddHistogram("MC_ESD_GammaPi0Dalitz_Eta", "Reconstructed \\gamma from \\pi^{0} Dalitz (MC)",       kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
310
311     // Reconstructed pi0 (MC)
312     histograms->AddHistogram("MC_ESD_Pi0_P", "\\pi^{0} Dalitz decay (MC)",               kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p (GeV/c)","");
313     histograms->AddHistogram("MC_ESD_Pi0_Pt", "\\pi^{0} Dalitz decay (MC)",               kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"p_{t} (GeV/c)","");
314     histograms->AddHistogram("MC_ESD_Pi0_Eta", "\\pi^{0} Dalitz decay (MC)",               kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta,"\\eta","");
315      histograms->AddHistogram("MC_ESD_Pi0_Y",        "\\pi^{0} Dalitz decay (MC)",               kGCnXBinsRapid,kGCfirstXBinRapid,kGClastXBinRapid,"y","");
316     histograms->AddHistogram("MC_ESD_Pi0_Phi",          "\\pi^{0} Dalitz decay (MC)",               kGCnXBinsPhi,kGCfirstXBinPhi,kGClastXBinPhi," \\phi (rad)","");
317     histograms->AddHistogram("MC_ESD_Pi0_Mass",      "\\pi^{0} Dalitz decay (MC)",                kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"M(e+,e-,\\gamma) (GeV/c^{2})","");
318     
319     histograms->AddHistogram("MC_ESD_Pi0_Pt_vs_Y","\\pi^{0} Dalitz decay (MC)", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5.,"y","p_{t} (GeV/c)");
320     histograms->AddHistogram("MC_ESD_Pi0_Mass_vs_Pt","\\pi^{0} Dalitz decay (MC)",               kGCnXBinsPt,kGCfirstXBinPt,kGClastXBinPt/5., kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"p_{t} (GeV/c)","M(e+,e-,\\gamma) (GeV/c^{2})");
321     histograms->AddHistogram("MC_ESD_Pi0_Mass_vs_Eta","\\pi^{0} Dalitz decay (MC)",               kGCnXBinsEta,kGCfirstXBinEta,kGClastXBinEta, kGCnXBinsPi0DalitzMass, kGCfirstXBinPi0DalitzMass, kGClastXBinPi0DalitzMass,"\\eta","M(e+,e-,\\gamma) (GeV/c^{2})");
322     histograms->AddHistogram("MC_ESD_Pi0_Mass_vs_Y","\\pi^{0} Dalitz decay (MC)", kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid,  kGCnXBinsPi0DalitzMass,  kGCfirstXBinPi0DalitzMass,  kGClastXBinPi0DalitzMass, "y","M(e+,e-,\\gamma) (GeV/c^{2})");
323   }
324   
325   //if(kGCTrkSelectionCriteria != 1)
326     // ITS standalone
327     histograms->AddHistogram("ESD_ITSsa_dEdx_vs_P",          "ITS standalone tracks",    kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","ITS Signal (a.u.)");
328     histograms->AddHistogram("ESD_ITSsa_PidCut_dEdx_vs_P", "ITS standalone tracks after PID",     kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","ITS Signal (a.u.)");
329   
330   if(kGCdoMCTruth)
331   {
332     histograms->AddHistogram("MC_ESD_ITSsa_PidCut_dEdx_vs_P", "ITS standalone tracks after PID (MC)",     kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","ITS Signal (a.u.)");
333     histograms->AddHistogram("MC_ESD_ITSsa_Electron_dEdx_vs_P",       "ITS standalone electrons",    kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","ITS Signal (a.u.)");
334   }
335     // TPC dEdx
336     histograms->AddHistogram("ESD_TPC_dEdx_vs_P" ,  "Global tracks",               kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","TPC Signal (a.u.)");
337     histograms->AddHistogram("ESD_TPC_PidCut_dEdx_vs_P",   "Global tracks after PID",     kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","TPC Signal (a.u.)");
338     
339   if(kGCdoMCTruth)
340   {
341     histograms->AddHistogram("MC_ESD_TPC_Electron_dEdx_vs_P" ,        "Electron global tracks",     kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","TPC Signal (a.u.)");
342     histograms->AddHistogram("MC_ESD_TPC_PidCut_dEdx_vs_P",   "Global tracks after PID (MC)",     kGCnXBinsP*5, kGCfirstXBinP, kGClastXBinP/5.,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"p (GeV/c)","TPC Signal (a.u.)");
343   }
344
345 // psi pair
346      histograms->AddHistogram("ESD_EposEneg_PsiPair_vs_DPhi", "e+e- candidates", 2*kGCnXBinsOpeningAngle, -1*kGClastXBinOpeningAngle, kGClastXBinOpeningAngle, 2*kGCnXBinsOpeningAngle, -1*kGClastXBinOpeningAngle, kGClastXBinOpeningAngle, "\\Delta\\phi (rad)","\\psi_{pair}");
347   
348   if(kGCdoMCTruth)
349   {
350      histograms->AddHistogram("MC_ESD_DalitzPair_PsiPair_vs_DPhi", "Dalitz pairs (MC)", 2*kGCnXBinsOpeningAngle, -1*kGClastXBinOpeningAngle, kGClastXBinOpeningAngle, 2*kGCnXBinsOpeningAngle, -1*kGClastXBinOpeningAngle, kGClastXBinOpeningAngle, "\\Delta\\phi (rad)","\\psi_{pair}");
351
352      histograms->AddHistogram("MC_ESD_EposEnegGamma_PsiPair_vs_DPhi", "e+e- from \\gamma conversion (MC)", 2*kGCnXBinsOpeningAngle, -1*kGClastXBinOpeningAngle, kGClastXBinOpeningAngle, 2*kGCnXBinsOpeningAngle, -1*kGClastXBinOpeningAngle, kGClastXBinOpeningAngle, "\\Delta\\phi (rad)","\\psi_{pair}");
353   }
354
355     // Tables
356   if(kGCdoMCTruth)
357   {
358     histograms->AddTable("Table_Generation","Generation",kGCnElementsPi0Table,kGCPi0Table);
359     histograms->AddTable("Table_PID","particle table (Row: PID, Col: MC)", kGCnElementsPidTable, kGCPidTable, kGCnElementsPidTable, kGCPidTable);
360   }
361     histograms->AddTable("Table_Reconstruction","Reconstruction",kGCnElementsElectronDalitzTable,kGCElectronDalitzTable);
362     histograms->AddTable("Table_Cuts","Number of \\pi^{0}->e+e-\\gamma after cuts",kGCnElementsCutsTable,kGCCutsTable);
363 }
364
365
366  /*
367         // NOTE: We should use fESDpid from fV0Reader (right now it is private)
368         // Better parameters for MonteCarlo from A. Kalweit 2010/01/8
369
370
371               fESDpid->GetTPCResponse().SetBetheBlochParameters(  4.23232575531564326e+00/50.,
372                                                                   8.68482806165147636e+00,
373                                                                   1.34000000000000005e-05,
374                                                                   2.30445734159456084e+00,
375                                                                   2.25624744086878559e+00);//Trujillo
376
377                 
378             fESDpid->GetTPCResponse().SetBetheBlochParameters(   2.49397e+00,
379                                                                   1.46884e+01,
380                                                                   7.44848e-04,
381                                                                   2.24803e+00,
382                                                                   4.85791e+00); //AliRoot v4-18-Rev-10 //Dalitz Generation*/
383
384
385 /*        fESDpid->GetTPCResponse().SetBetheBlochParameters(  2.15898e+00/50.,
386                                                                   1.75295e+01,
387                                                                   3.40030e-09,
388                                                                   1.96178e+00,
389                                                                   3.91720e+00 );
390
391                 //MC-CERN
392         
393
394     } 
395         else { 
396         // Better parameters for data from A. Kalweit 2010/01/8
397         fESDpid->GetTPCResponse().SetBetheBlochParameters( 0.0283086,
398                                                            2.63394e+01,
399                                                            5.04114e-11,
400                                                            2.12543e+00,
401                                                            4.88663e+00 );
402     */