-Move cent, z axis into sparse
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliDalitzElectronCuts.cxx
1 \r
2 /**************************************************************************\r
3  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
4  *                                                                        *\r
5  * Authors: Svein Lindal, Daniel Lohner                                   *\r
6  * Version 1.0                                                            *\r
7  *                                                                        *\r
8  * Permission to use, copy, modify and distribute this software and its   *\r
9  * documentation strictly for non-commercial purposes is hereby granted   *\r
10  * without fee, provided that the above copyright notice appears in all   *\r
11  * copies and that both the copyright notice and this permission notice   *\r
12  * appear in the supporting documentation. The authors make no claims     *\r
13  * about the suitability of this software for any purpose. It is          *\r
14  * provided "as is" without express or implied warranty.                  *\r
15  **************************************************************************/\r
16 \r
17 ////////////////////////////////////////////////\r
18 //--------------------------------------------- \r
19 // Class handling all kinds of selection cuts for\r
20 // Gamma Conversion analysis\r
21 //---------------------------------------------\r
22 ////////////////////////////////////////////////\r
23 \r
24 \r
25 #include "AliDalitzElectronCuts.h"\r
26 #include "AliAODConversionPhoton.h"\r
27 #include "AliKFVertex.h"\r
28 #include "AliAODTrack.h"\r
29 #include "AliESDtrack.h"\r
30 #include "AliAnalysisManager.h"\r
31 #include "AliInputEventHandler.h"\r
32 #include "AliMCEventHandler.h"\r
33 #include "AliAODHandler.h"\r
34 #include "AliPIDResponse.h"\r
35 #include "TH1.h"\r
36 #include "TH2.h"\r
37 #include "AliStack.h"\r
38 #include "TObjString.h"\r
39 #include "AliAODEvent.h"\r
40 #include "AliESDEvent.h"\r
41 #include "TList.h"\r
42 class iostream;\r
43 \r
44 using namespace std;\r
45 \r
46 ClassImp(AliDalitzElectronCuts)\r
47 \r
48 \r
49 const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {\r
50 "GoodId",\r
51 "ededxSigmaITSCut",\r
52 "ededxSigmaTPCCut",\r
53 "pidedxSigmaTPCCut",\r
54 "piMinMomdedxSigmaTPCCut",\r
55 "piMaxMomdedxSigmaTPCCut",\r
56 "LowPRejectionSigmaCut",\r
57 "kTOFelectronPID",\r
58 "clsITSCut",\r
59 "clsTPCCut",\r
60 "EtaCut",\r
61 "PsiPair",\r
62 "RejectSharedElecGamma",\r
63 "BackgroundScheme",\r
64 "NumberOfRotations",\r
65 "PtCut",\r
66 "DCAcut",\r
67 "MassCut",\r
68 "kWeights"\r
69 };\r
70 \r
71 //________________________________________________________________________\r
72 AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),\r
73     fHistograms(NULL),\r
74     fPIDResponse(NULL),\r
75     fesdTrackCuts(NULL),\r
76     fEtaCut(0.9),\r
77     fEtaShift(0.0),\r
78     fDoEtaCut(kFALSE),\r
79     fPtCut(0.0),\r
80     fRadiusCut(1000.0),\r
81     fPsiPairCut(0.45),\r
82     fDeltaPhiCutMin(0.),\r
83     fDeltaPhiCutMax(0.12),\r
84     fMinClsTPC(0), // minimum clusters in the TPC\r
85     fMinClsTPCToF(0), // minimum clusters to findable clusters\r
86     fDodEdxSigmaITSCut(kFALSE),\r
87     fDodEdxSigmaTPCCut(kTRUE),\r
88     fDoTOFsigmaCut(kFALSE), // RRnewTOF\r
89     fDoRejectSharedElecGamma(kFALSE),\r
90     fDoPsiPairCut(kFALSE),\r
91     fPIDnSigmaAboveElectronLineITS(100),\r
92     fPIDnSigmaBelowElectronLineITS(-100),\r
93     fPIDnSigmaAboveElectronLineTPC(100),\r
94     fPIDnSigmaBelowElectronLineTPC(-100),\r
95     fPIDnSigmaAbovePionLineTPC(0),\r
96     fPIDnSigmaAbovePionLineTPCHighPt(-100),\r
97     fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF\r
98     fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF\r
99     fPIDMinPnSigmaAbovePionLineTPC(0),\r
100     fPIDMaxPnSigmaAbovePionLineTPC(0),\r
101     fDoKaonRejectionLowP(kFALSE),\r
102     fDoProtonRejectionLowP(kFALSE),\r
103     fDoPionRejectionLowP(kFALSE),\r
104     fPIDnSigmaAtLowPAroundKaonLine(0),\r
105     fPIDnSigmaAtLowPAroundProtonLine(0),\r
106     fPIDnSigmaAtLowPAroundPionLine(0),\r
107     fPIDMinPKaonRejectionLowP(1.5),\r
108     fPIDMinPProtonRejectionLowP(2.0),\r
109     fPIDMinPPionRejectionLowP(0.5),\r
110     fUseCorrectedTPCClsInfo(kFALSE),\r
111     fUseTOFpid(kFALSE),\r
112     fRequireTOF(kFALSE),\r
113     fUseTrackMultiplicityForBG(kFALSE),\r
114     fBKGMethod(0),\r
115     fnumberOfRotationEventsForBG(0),\r
116     fDoMassCut(kFALSE),\r
117     fMassCutLowPt(999.),\r
118     fMassCutHighPt(999.),\r
119     fMassCutPtMin(-100.0),\r
120     fDoWeights(kFALSE),\r
121     fCutString(NULL),\r
122     hCutIndex(NULL),\r
123     hdEdxCuts(NULL),\r
124     hITSdEdxbefore(NULL),\r
125     hITSdEdxafter(NULL),\r
126     hTPCdEdxbefore(NULL),\r
127     hTPCdEdxafter(NULL),\r
128     hTPCdEdxSignalbefore(NULL),\r
129     hTPCdEdxSignalafter(NULL),\r
130     hTOFbefore(NULL),\r
131     hTOFafter(NULL),\r
132     hTrackDCAxyPtbefore(NULL),\r
133     hTrackDCAxyPtafter(NULL),\r
134     hTrackDCAzPtbefore(NULL),\r
135     hTrackDCAzPtafter(NULL),\r
136     hTrackNFindClsPtTPCbefore(NULL),\r
137     hTrackNFindClsPtTPCafter(NULL)\r
138    {\r
139     InitPIDResponse();\r
140     for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}\r
141     fCutString=new TObjString((GetCutNumber()).Data());\r
142 \r
143    //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");\r
144    // Using standard function for setting Cuts\r
145     Bool_t selectPrimaries=kFALSE;\r
146     fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);\r
147 }\r
148 \r
149 //________________________________________________________________________\r
150 AliDalitzElectronCuts::~AliDalitzElectronCuts() {\r
151     // Destructor\r
152   //Deleting fHistograms leads to seg fault it it's added to output collection of a task\r
153   // if(fHistograms)\r
154   //    delete fHistograms;\r
155   // fHistograms = NULL;\r
156 \r
157    if(fCutString != NULL){\r
158       delete fCutString;\r
159       fCutString = NULL;\r
160    }\r
161 \r
162 \r
163 }\r
164 \r
165 //________________________________________________________________________\r
166 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){\r
167 \r
168     // Initialize Cut Histograms for QA (only initialized and filled if function is called)\r
169 \r
170      TString cutName = "";\r
171     \r
172      if( cutNumber==""){\r
173          cutName = GetCutNumber().Data();\r
174      }\r
175      else {\r
176             cutName = cutNumber.Data();\r
177      } \r
178 \r
179     if(fHistograms != NULL){\r
180         delete fHistograms;\r
181         fHistograms=NULL;\r
182     }\r
183     if(fHistograms==NULL){\r
184         fHistograms=new TList();\r
185         if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));\r
186         else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));\r
187     }\r
188 \r
189 \r
190     hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);\r
191     hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");\r
192     hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");\r
193     hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");\r
194     hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");\r
195     hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");\r
196     fHistograms->Add(hCutIndex);\r
197 \r
198 \r
199 \r
200     // dEdx Cuts\r
201     hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);\r
202     hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");\r
203     hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");\r
204     hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");\r
205     hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");\r
206     hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");\r
207     hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");\r
208     hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");\r
209     hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");\r
210     hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");\r
211     hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");\r
212     fHistograms->Add(hdEdxCuts);\r
213     \r
214 \r
215 \r
216     TAxis *AxisBeforeITS  = NULL;\r
217     TAxis *AxisBeforedEdx = NULL;\r
218     TAxis *AxisBeforeTOF  = NULL;\r
219     TAxis *AxisBeforedEdxSignal = NULL;\r
220 \r
221     if(preCut){\r
222 \r
223 \r
224        hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,150,0.05,20,400,-10,10);\r
225        fHistograms->Add(hITSdEdxbefore);\r
226        AxisBeforeITS = hITSdEdxbefore->GetXaxis();\r
227 \r
228        hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,150,0.05,20,400,-10,10);\r
229        fHistograms->Add(hTPCdEdxbefore);\r
230        AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();\r
231 \r
232        hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,150,0.05,20.0,800,0.0,200);\r
233        fHistograms->Add(hTPCdEdxSignalbefore);\r
234        AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();\r
235 \r
236        hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,150,0.05,20,400,-6,10);\r
237        fHistograms->Add(hTOFbefore);\r
238        AxisBeforeTOF = hTOFbefore->GetXaxis();\r
239        \r
240        hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",800,-4.0,4.0,400,0.,10.);\r
241        fHistograms->Add(hTrackDCAxyPtbefore);   \r
242        \r
243        hTrackDCAzPtbefore  = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz  Vs Pt of tracks before",800,-4.0,4.0,400,0.,10.);\r
244        fHistograms->Add(hTrackDCAzPtbefore); \r
245        \r
246        hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",100,0,1,400,0.,10.);\r
247        fHistograms->Add(hTrackNFindClsPtTPCbefore); \r
248         \r
249        \r
250 \r
251     }\r
252 \r
253 \r
254     hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,150,0.05,20,400, -10,10);\r
255     fHistograms->Add(hITSdEdxafter);\r
256 \r
257     hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,150,0.05,20,400, -10,10);\r
258     fHistograms->Add(hTPCdEdxafter);\r
259 \r
260     hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,150,0.05,20.0,800,0.0,200);\r
261     fHistograms->Add(hTPCdEdxSignalafter);\r
262 \r
263     hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,150,0.05,20,400,-6,10);\r
264     fHistograms->Add(hTOFafter);\r
265       \r
266     hTrackDCAxyPtafter  = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",800,-4.0,4.0,400,0.,10.);\r
267     fHistograms->Add(hTrackDCAxyPtafter); \r
268     \r
269     hTrackDCAzPtafter  = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks  after",800,-4.0,4.0,400,0.,10.);\r
270     fHistograms->Add(hTrackDCAzPtafter); \r
271     \r
272     hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",100,0,1,400,0.,10.);\r
273     fHistograms->Add(hTrackNFindClsPtTPCafter); \r
274     \r
275     \r
276 \r
277     TAxis *AxisAfter = hTPCdEdxafter->GetXaxis(); \r
278     Int_t bins = AxisAfter->GetNbins();\r
279     Double_t from = AxisAfter->GetXmin();\r
280     Double_t to = AxisAfter->GetXmax();\r
281     Double_t *newBins = new Double_t[bins+1];\r
282     newBins[0] = from;\r
283     Double_t factor = TMath::Power(to/from, 1./bins);\r
284     for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];\r
285     AxisAfter->Set(bins, newBins);\r
286     AxisAfter = hTOFafter->GetXaxis(); \r
287     AxisAfter->Set(bins, newBins);\r
288     AxisAfter = hITSdEdxafter->GetXaxis();\r
289     AxisAfter->Set(bins,newBins); \r
290     AxisAfter = hTPCdEdxSignalafter->GetXaxis();\r
291     AxisAfter->Set(bins,newBins);\r
292     \r
293     if(preCut){\r
294        AxisBeforeITS->Set(bins, newBins);\r
295        AxisBeforedEdx->Set(bins, newBins);\r
296        AxisBeforedEdxSignal->Set(bins,newBins);\r
297        AxisBeforeTOF->Set(bins, newBins);\r
298        \r
299     }\r
300     delete [] newBins;\r
301 \r
302         \r
303     // Event Cuts and Info\r
304 }\r
305 \r
306 \r
307 //________________________________________________________________________\r
308 Bool_t AliDalitzElectronCuts::InitPIDResponse(){\r
309 \r
310 // Set Pointer to AliPIDResponse\r
311 \r
312   AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
313 \r
314   if(man) {\r
315 \r
316     AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
317     fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();\r
318     if(fPIDResponse)return kTRUE;\r
319 \r
320   }\r
321 \r
322   return kFALSE;\r
323 }\r
324 ///________________________________________________________________________\r
325 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)\r
326 {   \r
327         if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;\r
328         if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana\r
329 \r
330         TParticle* particle = fMCStack->Particle(labelParticle);\r
331 \r
332         if( TMath::Abs( particle->GetPdgCode() ) != 11 )  return kFALSE;\r
333         \r
334         if( fDoEtaCut ){\r
335           if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )\r
336           return kFALSE;\r
337         }\r
338         \r
339 \r
340 return kTRUE;\r
341 }\r
342 \r
343 \r
344 ///________________________________________________________________________\r
345 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)\r
346 {\r
347     //Selection of Reconstructed electrons\r
348     \r
349     \r
350     Float_t b[2];\r
351     Float_t bCov[3];\r
352     lTrack->GetImpactParameters(b,bCov);\r
353    \r
354     if (bCov[0]<=0 || bCov[2]<=0) {\r
355         AliDebug(1, "Estimated b resolution lower or equal zero!");\r
356         bCov[0]=0; bCov[2]=0;\r
357     }\r
358     \r
359     \r
360 \r
361     Float_t dcaToVertexXY = b[0];\r
362     Float_t dcaToVertexZ  = b[1];\r
363     Double_t clsToF = GetNFindableClustersTPC(lTrack);\r
364    \r
365    if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());\r
366    if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());\r
367    if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());\r
368    \r
369    \r
370 \r
371     if(hCutIndex)hCutIndex->Fill(kElectronIn);\r
372 \r
373     if (lTrack == NULL){\r
374       if(hCutIndex)hCutIndex->Fill(kNoTracks);\r
375          return kFALSE;  \r
376     }   \r
377        \r
378     if ( ! lTrack->GetConstrainedParam() ){\r
379         return kFALSE;\r
380     }\r
381     AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);\r
382 \r
383 \r
384     // Track Cuts\r
385     if( !TrackIsSelected(lTrack) ){\r
386          if(hCutIndex)hCutIndex->Fill(kTrackCuts);\r
387          return kFALSE;\r
388     }\r
389 \r
390 \r
391     // dEdx Cuts\r
392     if( ! dEdxCuts( track ) ) {\r
393          if(hCutIndex)hCutIndex->Fill(kdEdxCuts);\r
394          return kFALSE;\r
395 \r
396     }\r
397 \r
398     //Electron passed the cuts\r
399     if(hCutIndex)hCutIndex->Fill(kElectronOut);\r
400     \r
401     if( hTrackDCAxyPtafter)        hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());\r
402     if( hTrackDCAzPtafter )        hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());\r
403     if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());\r
404 \r
405 \r
406     return kTRUE;\r
407 }\r
408 \r
409 ///________________________________________________________________________\r
410 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {\r
411     // Track Selection for Photon Reconstruction\r
412     \r
413          \r
414     Double_t clsToF = GetNFindableClustersTPC(lTrack);\r
415     \r
416 \r
417     if( ! fesdTrackCuts->AcceptTrack(lTrack) ){\r
418 \r
419         return kFALSE;\r
420     }\r
421     \r
422     if( fDoEtaCut ) {\r
423       if(  lTrack->Eta() > (fEtaCut + fEtaShift) || lTrack->Eta() < (-fEtaCut + fEtaShift) ) {\r
424         return kFALSE;\r
425       }\r
426    }\r
427    \r
428    \r
429    if( lTrack->Pt() < fPtCut ) {\r
430      \r
431         return kFALSE;\r
432         \r
433    }\r
434 \r
435    \r
436 \r
437     if( clsToF < fMinClsTPCToF){\r
438     return kFALSE;\r
439     }\r
440 \r
441     \r
442 \r
443    return kTRUE;\r
444 }\r
445 ///________________________________________________________________________\r
446 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){\r
447 \r
448     // Electron Identification Cuts for Photon reconstruction\r
449 \r
450     if(!fPIDResponse){  InitPIDResponse();  }// Try to reinitialize PID Response\r
451     if(!fPIDResponse){  AliError("No PID Response"); return kFALSE;}// if still missing fatal error\r
452 \r
453 \r
454 \r
455     //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;\r
456 \r
457 \r
458 \r
459     Int_t cutIndex=0;\r
460 \r
461     if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
462     if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));\r
463     if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));\r
464     if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));\r
465 \r
466 \r
467     cutIndex++;\r
468 \r
469 \r
470                 if( fDodEdxSigmaITSCut == kTRUE ){\r
471 \r
472 \r
473                         if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||\r
474                                         fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){\r
475                                 \r
476                                 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
477                                 return kFALSE;\r
478       }\r
479                         \r
480                 }\r
481                 \r
482                 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));\r
483                 \r
484                 \r
485                 cutIndex++;\r
486                 \r
487                 \r
488                 if(fDodEdxSigmaTPCCut == kTRUE){\r
489                         \r
490                         \r
491       // TPC Electron Line\r
492       if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||\r
493                                         fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){\r
494                                 \r
495                                 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
496                                 return kFALSE;\r
497       }\r
498       cutIndex++;\r
499                         \r
500       // TPC Pion Line\r
501                         if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){\r
502                                 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC     &&\r
503                                          fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&\r
504                                          fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){\r
505                                         \r
506                                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
507                                         return kFALSE;\r
508                                 }\r
509                         }\r
510                         cutIndex++;\r
511                         \r
512                         // High Pt Pion rej\r
513                         if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){\r
514                                 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&\r
515                                          fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&\r
516                                          fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){\r
517                                         \r
518                                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
519                                         return kFALSE;\r
520                                 }\r
521                         }\r
522                         \r
523                         cutIndex++;\r
524                 }\r
525 \r
526                 else{ cutIndex+=3; }\r
527 \r
528 \r
529                 if(   fDoKaonRejectionLowP == kTRUE   ){\r
530 \r
531                         if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){\r
532                                 \r
533                                 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){\r
534                                         \r
535                                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
536                                         \r
537                                         return kFALSE;\r
538                                 }\r
539                         }\r
540                 }\r
541                 cutIndex++;\r
542                 \r
543                 if(   fDoProtonRejectionLowP == kTRUE    ){\r
544                         \r
545                         if( fCurrentTrack->P()  < fPIDMinPProtonRejectionLowP ){\r
546                                 if( TMath::Abs(   fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){\r
547                                         \r
548                                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
549                                         return kFALSE;\r
550                                 }\r
551                         }\r
552                 }\r
553                 cutIndex++;\r
554                 \r
555                 if(fDoPionRejectionLowP == kTRUE){\r
556                         if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){\r
557                                 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){\r
558                                         \r
559                                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
560                                         return kFALSE;\r
561                                 }\r
562                         }\r
563                 }\r
564                 cutIndex++;\r
565                 \r
566                 \r
567                 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){\r
568                         if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
569                         if(fUseTOFpid){\r
570         if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||\r
571            fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){\r
572                                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
573                                         return kFALSE;\r
574         }\r
575                         }\r
576                         if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
577                 }\r
578                 else if ( fRequireTOF == kTRUE ) {\r
579                         \r
580                         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
581                         return kFALSE;\r
582                 }\r
583                 cutIndex++;\r
584                 \r
585                 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
586                 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));\r
587                 if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));\r
588                 \r
589                 return kTRUE;\r
590 }\r
591 ///________________________________________________________________________\r
592 \r
593 \r
594 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){\r
595     //Returns pointer to the track with given ESD label\r
596     //(Important for AOD implementation, since Track array in AOD data is different\r
597     //from ESD array, but ESD tracklabels are stored in AOD Tracks)\r
598 \r
599   AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);\r
600   if(esdEvent) {\r
601         if(label > event->GetNumberOfTracks() ) return NULL;\r
602         AliESDtrack * track = esdEvent->GetTrack(label);\r
603         return track;\r
604         \r
605   } else { \r
606         for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {\r
607           AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));\r
608           \r
609           if(track) { \r
610                 if(track->GetID() == label) {\r
611                   return track;\r
612                 }\r
613           }\r
614         }\r
615     }\r
616   \r
617   cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;\r
618   return NULL;\r
619 }\r
620 ///________________________________________________________________________\r
621 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){\r
622 \r
623 \r
624      for(Int_t i = 0;i<photons->GetEntries();i++){\r
625 \r
626       AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);\r
627 \r
628       Int_t posLabel = photonComp->GetTrackLabelPositive();\r
629       Int_t negLabel = photonComp->GetTrackLabelNegative();\r
630 \r
631       if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){\r
632         return kFALSE;\r
633       }\r
634      }\r
635 \r
636    return kTRUE;\r
637 }\r
638 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){\r
639   \r
640         if( pi0CandidatePt < fMassCutPtMin ){\r
641           \r
642               if( vphotonCandidateMass < fMassCutLowPt ){\r
643                     return kTRUE;\r
644               }\r
645                 \r
646         }\r
647         else{\r
648           \r
649                if( vphotonCandidateMass < fMassCutHighPt ){\r
650                     return kTRUE;\r
651                }\r
652               \r
653         }\r
654         \r
655         return kFALSE;\r
656           \r
657 }\r
658 \r
659 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){\r
660   \r
661   \r
662   Double_t clsToF=0;\r
663 \r
664 \r
665     if ( !fUseCorrectedTPCClsInfo ){\r
666         if(lTrack->GetTPCNclsF()!=0){\r
667 \r
668               clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();\r
669         }// Ncluster/Nfindablecluster\r
670     }\r
671     else {\r
672 \r
673               //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));\r
674               clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike\r
675                 \r
676     }\r
677   \r
678   return clsToF;\r
679    \r
680 }\r
681 \r
682 /*\r
683 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )\r
684 {\r
685 //\r
686 // This angle is a measure for the contribution of the opening in polar\r
687 // direction ??0 to the opening angle ?? Pair\r
688 //\r
689 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC\r
690 //      Master Thesis. Thorsten Dahms. 2005\r
691 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf\r
692 //\r
693         Double_t momPos[3];\r
694         Double_t momNeg[3];\r
695         if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );\r
696         if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );\r
697 \r
698         TVector3 posDaughter;\r
699         TVector3 negDaughter;\r
700 \r
701         posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );\r
702         negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );\r
703 \r
704         Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();\r
705         Double_t openingAngle =  posDaughter.Angle( negDaughter );  //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );\r
706 \r
707         if( openingAngle < 1e-20 ) return 0.;\r
708 \r
709         Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );\r
710 \r
711         return psiAngle;\r
712 }*/\r
713 \r
714 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )\r
715 {\r
716 //\r
717 // Returns true if it is a gamma conversion according to psi pair value\r
718 //\r
719         return ( (deltaPhi > fDeltaPhiCutMin  &&  deltaPhi < fDeltaPhiCutMax) &&\r
720         TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );\r
721 }\r
722 \r
723 ///________________________________________________________________________\r
724 Bool_t AliDalitzElectronCuts::UpdateCutString() {\r
725 ///Update the cut string (if it has been created yet)\r
726 \r
727   if(fCutString && fCutString->GetString().Length() == kNCuts) {\r
728 //         cout << "Updating cut id in spot number " << cutID << " to " << value << endl;\r
729         fCutString->SetString(GetCutNumber());\r
730   } else {\r
731 //         cout << "fCutString not yet initialized, will not be updated" << endl;\r
732         return kFALSE;\r
733   }\r
734  // cout << fCutString->GetString().Data() << endl;\r
735   return kTRUE;\r
736 }\r
737 \r
738 ///________________________________________________________________________\r
739 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {\r
740    // Initialize Cuts from a given Cut string\r
741 \r
742 //   out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;\r
743   AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));\r
744   \r
745   if(analysisCutSelection.Length()!=kNCuts) {\r
746         AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));\r
747         return kFALSE;\r
748   }\r
749   if(!analysisCutSelection.IsDigit()){\r
750         AliError("Cut selection contains characters");\r
751         return kFALSE;\r
752   }\r
753   \r
754   const char *cutSelection = analysisCutSelection.Data();\r
755   #define ASSIGNARRAY(i)        fCuts[i] = cutSelection[i] - '0'\r
756   for(Int_t ii=0;ii<kNCuts;ii++){\r
757       ASSIGNARRAY(ii);\r
758   }\r
759 \r
760   // TestFlag\r
761   if(fCuts[0] !=9){\r
762     AliError("Analysis Cut Selection does not start with 9");\r
763         PrintCuts();\r
764     return kFALSE;\r
765   }\r
766 \r
767   // Set Individual Cuts\r
768   for(Int_t ii=0;ii<kNCuts;ii++){\r
769       if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;\r
770   }\r
771 \r
772   //PrintCuts();\r
773 \r
774     return kTRUE;\r
775 }\r
776 ///________________________________________________________________________\r
777 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {\r
778   ///Set individual cut ID\r
779 \r
780   //cout << "Updating cut  " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;\r
781 \r
782   switch (cutID) {\r
783   case kgoodId:\r
784         fCuts[kgoodId] = value;\r
785         if(value != 9) {\r
786           cout << "Error:: First value of cut string is wrong, aborting!!" << endl;\r
787           return kFALSE;\r
788         } else {\r
789           return kTRUE;\r
790         }\r
791 \r
792   case kededxSigmaITSCut:\r
793         if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented \r
794           fCuts[kededxSigmaITSCut] = value;\r
795           UpdateCutString();\r
796           return kTRUE;\r
797         } else return kFALSE;\r
798 \r
799         case kededxSigmaTPCCut:\r
800                 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented \r
801                         fCuts[kededxSigmaTPCCut] = value;\r
802                         UpdateCutString();\r
803                         return kTRUE;\r
804                 } else return kFALSE;\r
805                 \r
806   case kpidedxSigmaTPCCut:\r
807                 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented\r
808                         fCuts[kpidedxSigmaTPCCut] = value;\r
809                         UpdateCutString();\r
810                         return kTRUE;\r
811                 } else return kFALSE;\r
812                 \r
813   case kpiMinMomdedxSigmaTPCCut:\r
814                 if( SetMinMomPiondEdxTPCCut(value)) {\r
815                         fCuts[kpiMinMomdedxSigmaTPCCut] = value;\r
816                         UpdateCutString();\r
817                         return kTRUE;\r
818                 } else return kFALSE;\r
819                 \r
820   case kpiMaxMomdedxSigmaTPCCut:\r
821                 if( SetMaxMomPiondEdxTPCCut(value)) {\r
822                         fCuts[kpiMaxMomdedxSigmaTPCCut] = value;\r
823                         UpdateCutString();\r
824                         return kTRUE;\r
825                 } else return kFALSE;\r
826                 \r
827   case kLowPRejectionSigmaCut:\r
828                 if( SetLowPRejectionCuts(value) ) {\r
829                         fCuts[kLowPRejectionSigmaCut] = value;\r
830                         UpdateCutString();\r
831                         return kTRUE;\r
832                 } else return kFALSE;\r
833                 \r
834                 \r
835   case kTOFelectronPID:\r
836                 if( SetTOFElectronPIDCut(value)) {\r
837                         fCuts[kTOFelectronPID] = value;\r
838                         UpdateCutString();\r
839                         return kTRUE;\r
840                 } else return kFALSE;\r
841   case kclsITSCut:\r
842                 if( SetITSClusterCut(value) ) {\r
843                         fCuts[kclsITSCut] = value;\r
844                         UpdateCutString();\r
845                         return kTRUE;                   \r
846                 } else return kFALSE;\r
847   case kclsTPCCut:\r
848                 if( SetTPCClusterCut(value)) {\r
849                         fCuts[kclsTPCCut] = value;\r
850                         UpdateCutString();\r
851                         return kTRUE;\r
852                 } else return kFALSE;\r
853                 \r
854   case ketaCut:\r
855                 if( SetEtaCut(value)) {\r
856                         fCuts[ketaCut] = value;\r
857                         UpdateCutString();\r
858                         return kTRUE;\r
859                 } else return kFALSE;\r
860   case kptCut:  \r
861                 if( SetPtCut(value)) {\r
862                         fCuts[kptCut] = value;\r
863                         UpdateCutString();\r
864                         return kTRUE;\r
865                 } else return kFALSE;\r
866     \r
867   case kDCACut:\r
868                 if( SetDCACut(value)) {\r
869                         fCuts[kDCACut] = value;\r
870                         UpdateCutString();\r
871                         return kTRUE;\r
872                 } else return kFALSE;\r
873               \r
874               \r
875         case kPsiPair:\r
876                 if( SetPsiPairCut(value)) {\r
877                         fCuts[kPsiPair] = value;\r
878                         UpdateCutString();\r
879                         return kTRUE;\r
880                 } else return kFALSE;\r
881                 \r
882   case kRejectSharedElecGamma:\r
883                 if( SetRejectSharedElecGamma(value)) {\r
884                         fCuts[kRejectSharedElecGamma] = value;\r
885                         UpdateCutString();\r
886           return kTRUE;\r
887                 } else return kFALSE;\r
888                 \r
889   case kBackgroundScheme:\r
890                 if( SetBackgroundScheme(value)) {\r
891                         fCuts[kBackgroundScheme] = value;\r
892                         UpdateCutString();\r
893                         return kTRUE;\r
894                 } else return kFALSE;\r
895 \r
896   case kNumberOfRotations:\r
897                 if( SetNumberOfRotations(value)) {\r
898                         fCuts[kNumberOfRotations] = value;\r
899                         UpdateCutString();\r
900                         return kTRUE;\r
901                 } else return kFALSE;\r
902                 \r
903   case kmassCut:\r
904                 if( SetMassCut(value)) {\r
905                         fCuts[kmassCut] = value;\r
906                         UpdateCutString();\r
907                         return kTRUE;\r
908                 } else return kFALSE;\r
909   case kWeights:\r
910                 if( SetDoWeights(value)) {\r
911                         fCuts[kWeights] = value;\r
912                         UpdateCutString();\r
913                         return kTRUE;\r
914                 } else return kFALSE;\r
915                \r
916                 \r
917   case kNCuts:\r
918                 cout << "Error:: Cut id out of range"<< endl;\r
919                 return kFALSE;\r
920   }\r
921         \r
922   cout << "Error:: Cut id " << cutID << " not recognized "<< endl;\r
923   return kFALSE;\r
924 \r
925   //PrintCuts();\r
926   \r
927 }\r
928 \r
929 ///________________________________________________________________________\r
930 \r
931 void AliDalitzElectronCuts::PrintCuts() {\r
932     // Print out current Cut Selection\r
933   for(Int_t ic = 0; ic < kNCuts; ic++) {\r
934         printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);\r
935   }\r
936 \r
937 }\r
938 \r
939 ///________________________________________________________________________\r
940 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)\r
941 {   // Set Cut\r
942 \r
943         switch(ededxSigmaCut){\r
944 \r
945         case 0: \r
946                 fDodEdxSigmaITSCut = kFALSE;\r
947                 fPIDnSigmaBelowElectronLineITS=-100;\r
948                 fPIDnSigmaAboveElectronLineITS= 100;\r
949                 break;\r
950         case 1: // -10,10\r
951                 fDodEdxSigmaITSCut = kTRUE;\r
952                 fPIDnSigmaBelowElectronLineITS=-10;\r
953                 fPIDnSigmaAboveElectronLineITS=10;\r
954                 break;\r
955         case 2: // -6,7\r
956                 fDodEdxSigmaITSCut = kTRUE;\r
957                 fPIDnSigmaBelowElectronLineITS=-6;\r
958                 fPIDnSigmaAboveElectronLineITS=7;\r
959                 break;\r
960         case 3: // -5,5\r
961                 fDodEdxSigmaITSCut = kTRUE;\r
962                 fPIDnSigmaBelowElectronLineITS=-5;\r
963                 fPIDnSigmaAboveElectronLineITS=5;\r
964                 break;\r
965         case 4: // -4,5\r
966                 fDodEdxSigmaITSCut = kTRUE;\r
967                 fPIDnSigmaBelowElectronLineITS=-4;\r
968                 fPIDnSigmaAboveElectronLineITS=5;\r
969                 break;\r
970         case 5: // -3,5\r
971                 fDodEdxSigmaITSCut = kTRUE;\r
972                 fPIDnSigmaBelowElectronLineITS=-3;\r
973                 fPIDnSigmaAboveElectronLineITS=5;\r
974                 break;\r
975         case 6: // -4,4\r
976                 fDodEdxSigmaITSCut = kTRUE;\r
977                 fPIDnSigmaBelowElectronLineITS=-4;\r
978                 fPIDnSigmaAboveElectronLineITS=4;\r
979                 break;\r
980         case 7: // -2.5,4\r
981                 fDodEdxSigmaITSCut = kTRUE;\r
982                 fPIDnSigmaBelowElectronLineITS=-2.5;\r
983                 fPIDnSigmaAboveElectronLineITS=4;\r
984                 break;\r
985         case 8: // -2,3.5\r
986                 fDodEdxSigmaITSCut = kTRUE;\r
987                 fPIDnSigmaBelowElectronLineITS=-2;\r
988                 fPIDnSigmaAboveElectronLineITS=3.5;\r
989                 break;\r
990         default:\r
991                 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;\r
992                 return kFALSE;\r
993     \r
994         }\r
995         return kTRUE;\r
996 }\r
997 \r
998 ///________________________________________________________________________\r
999 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)\r
1000 {   // Set Cut\r
1001         switch(ededxSigmaCut){\r
1002 \r
1003         case 0: fDodEdxSigmaTPCCut = kFALSE;\r
1004                 fPIDnSigmaBelowElectronLineTPC=-10;\r
1005                 fPIDnSigmaAboveElectronLineTPC=10;\r
1006                 break;\r
1007         case 1: // -10,10\r
1008                 fDodEdxSigmaTPCCut = kTRUE;\r
1009                 fPIDnSigmaBelowElectronLineTPC=-10;\r
1010                 fPIDnSigmaAboveElectronLineTPC=10;\r
1011                 break;\r
1012         case 2: // -6,7\r
1013                 fDodEdxSigmaTPCCut = kTRUE;\r
1014                 fPIDnSigmaBelowElectronLineTPC=-6;\r
1015                 fPIDnSigmaAboveElectronLineTPC=7;\r
1016                 break;\r
1017         case 3: // -5,5\r
1018                 fDodEdxSigmaTPCCut = kTRUE;\r
1019                 fPIDnSigmaBelowElectronLineTPC=-5;\r
1020                 fPIDnSigmaAboveElectronLineTPC=5;\r
1021                 break;\r
1022         case 4: // -4,5\r
1023                 fDodEdxSigmaTPCCut = kTRUE;\r
1024                 fPIDnSigmaBelowElectronLineTPC=-4;\r
1025                 fPIDnSigmaAboveElectronLineTPC=5;\r
1026                 break;  \r
1027         case 5: // -3,5\r
1028                 fDodEdxSigmaTPCCut = kTRUE;\r
1029                 fPIDnSigmaBelowElectronLineTPC=-3;\r
1030                 fPIDnSigmaAboveElectronLineTPC=5;\r
1031                 break;\r
1032         case 6: // -4,4\r
1033                 fDodEdxSigmaTPCCut = kTRUE;\r
1034                 fPIDnSigmaBelowElectronLineTPC=-4;\r
1035                 fPIDnSigmaAboveElectronLineTPC=4;\r
1036                 break;\r
1037         case 7: // -2.5,4\r
1038                 fDodEdxSigmaTPCCut = kTRUE;\r
1039                 fPIDnSigmaBelowElectronLineTPC=-2.5;\r
1040                 fPIDnSigmaAboveElectronLineTPC=4;\r
1041                 break;\r
1042         case 8: // -2,3.5\r
1043                 fDodEdxSigmaTPCCut = kTRUE;\r
1044                 fPIDnSigmaBelowElectronLineTPC=-2;\r
1045                 fPIDnSigmaAboveElectronLineTPC=3.5;\r
1046                 break;\r
1047         default:\r
1048                 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;\r
1049                 return kFALSE;\r
1050     \r
1051         }\r
1052         return kTRUE;\r
1053 }\r
1054 \r
1055 ///________________________________________________________________________\r
1056 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)\r
1057 {   // Set Cut\r
1058 \r
1059         switch(pidedxSigmaCut){\r
1060                 \r
1061         case 0: fPIDnSigmaAbovePionLineTPC= 0;\r
1062                 fPIDnSigmaAbovePionLineTPCHighPt=-100;\r
1063                 break;\r
1064         case 1:  // -10\r
1065                 fPIDnSigmaAbovePionLineTPC=3.0;            //Update Sep-05-2013 from -10 to 3\r
1066                 fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
1067                 break;\r
1068         case 2:  // 1\r
1069                 fPIDnSigmaAbovePionLineTPC=2;              //Update Sep-09-2013 from -1  to  2\r
1070                 fPIDnSigmaAbovePionLineTPCHighPt=-1;       //Update Sep-09-2013 from -10 to -1\r
1071                 break;\r
1072         case 3:   // 0\r
1073                 fPIDnSigmaAbovePionLineTPC=2;              //Update Sep-09-2013 from   0 to   2\r
1074                 fPIDnSigmaAbovePionLineTPCHighPt=0;        //Update Sep-09-2013 from -10 to   0\r
1075                 break;\r
1076         case 4:  // 1\r
1077                 fPIDnSigmaAbovePionLineTPC=1;\r
1078                 fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
1079                 break;\r
1080         case 5:  // 1\r
1081                 fPIDnSigmaAbovePionLineTPC=2.;\r
1082                 fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
1083                 break;\r
1084         case 6:  // 1\r
1085                 fPIDnSigmaAbovePionLineTPC=2.5;\r
1086                 fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
1087                 break;\r
1088         case 7:\r
1089                 fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0 \r
1090                 fPIDnSigmaAbovePionLineTPCHighPt = 2.0;\r
1091                 break;\r
1092         case 8:  // 1\r
1093                 fPIDnSigmaAbovePionLineTPC = 1.5;   // Updated May-16-2013 from 3.5 and -10 to +1.5, +1\r
1094                 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;\r
1095                 break;\r
1096         case 9:  // 1\r
1097                 fPIDnSigmaAbovePionLineTPC=1.5;\r
1098                 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;\r
1099                 break;\r
1100         default:\r
1101                 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;\r
1102                 return kFALSE;\r
1103         }\r
1104         return kTRUE;\r
1105 }\r
1106 \r
1107 ///________________________________________________________________________\r
1108 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)\r
1109 {   // Set Cut\r
1110         switch(piMomdedxSigmaCut){\r
1111                 \r
1112         case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;\r
1113                 break;\r
1114         case 1:  // 50.0 GeV\r
1115                 fPIDMinPnSigmaAbovePionLineTPC=50.;\r
1116                 break;\r
1117         case 2:  // 20.0 GeV\r
1118                 fPIDMinPnSigmaAbovePionLineTPC=20.;\r
1119                 break;\r
1120         case 3:  // 1.5 GeV\r
1121                 fPIDMinPnSigmaAbovePionLineTPC=1.5;\r
1122                 break;\r
1123         case 4:  // 1. GeV\r
1124                 fPIDMinPnSigmaAbovePionLineTPC=1.;\r
1125                 break;  \r
1126         case 5:  // 0.5 GeV\r
1127                 fPIDMinPnSigmaAbovePionLineTPC=0.5;\r
1128                 break;\r
1129         case 6:  // 0.4 GeV\r
1130                 fPIDMinPnSigmaAbovePionLineTPC=0.4;\r
1131                 break;    \r
1132         case 7:  // 0.3 GeV\r
1133                 fPIDMinPnSigmaAbovePionLineTPC=0.3;\r
1134                 break;\r
1135         case 8:  // 0.25 GeV\r
1136                 fPIDMinPnSigmaAbovePionLineTPC=0.25;\r
1137                 break;\r
1138         default:\r
1139                 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;\r
1140                 return kFALSE;\r
1141         }\r
1142         return kTRUE;\r
1143 }\r
1144 ///________________________________________________________________________\r
1145 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){\r
1146 \r
1147     \r
1148         if( !fesdTrackCuts ) {\r
1149 \r
1150                 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;\r
1151                 return kFALSE;\r
1152         }\r
1153 \r
1154         switch(clsITSCut){\r
1155 \r
1156         case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);\r
1157                 break;\r
1158         case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);\r
1159                 break;  //1 hit first layer of SPD\r
1160         case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
1161                 break; //1 hit in any layer of SPD\r
1162         case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);\r
1163                 fesdTrackCuts->SetMinNClustersITS(4);\r
1164                 // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD  \r
1165                 break;\r
1166         case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
1167                 fesdTrackCuts->SetMinNClustersITS(3);\r
1168                 // 3 hits in total in the ITS. At least 1 hit in any layer of SPD\r
1169                 break;\r
1170         case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
1171                 fesdTrackCuts->SetMinNClustersITS(4);\r
1172                 // 4 hits in total in the ITS. At least 1 hit in any layer of SPD\r
1173                 break;\r
1174         case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
1175                 fesdTrackCuts->SetMinNClustersITS(5);\r
1176                 // 5 hits in total in the ITS. At least 1 hit in any layer of SPD\r
1177                 break;\r
1178         default:\r
1179                 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;\r
1180                 return kFALSE;\r
1181         }\r
1182         \r
1183 return kTRUE;\r
1184 }\r
1185 \r
1186 ///________________________________________________________________________\r
1187 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)\r
1188 {   // Set Cut\r
1189         switch(clsTPCCut){\r
1190         case 0: // 0\r
1191                 fMinClsTPC= 0;\r
1192                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1193                 break;\r
1194         case 1:  // 70\r
1195                 fMinClsTPC= 70;\r
1196                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1197                 break;\r
1198         case 2:  // 80\r
1199                 fMinClsTPC= 80;\r
1200                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1201                 break;\r
1202         case 3:  // 100\r
1203                 fMinClsTPC= 100;\r
1204                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1205                 break;\r
1206         case 4:  // 0% of findable clusters\r
1207                 fMinClsTPC= 70;  \r
1208                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1209                 fMinClsTPCToF= 0.0;\r
1210                 fUseCorrectedTPCClsInfo=0;\r
1211                 break;\r
1212         case 5:  // 35% of findable clusters\r
1213                 fMinClsTPC = 70;  \r
1214                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1215                 fMinClsTPCToF= 0.35;\r
1216                 fUseCorrectedTPCClsInfo=0;\r
1217                 break;\r
1218         case 6:  // 60% of findable clusters\r
1219                 fMinClsTPC= 70;  \r
1220                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1221                 fMinClsTPCToF= 0.6;\r
1222                 fUseCorrectedTPCClsInfo=0;\r
1223                 break;\r
1224         case 7:  // 70% of findable clusters\r
1225                 fMinClsTPC= 70;  \r
1226                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1227                 fMinClsTPCToF= 0.7;\r
1228                 fUseCorrectedTPCClsInfo=0;\r
1229                 break;\r
1230         case 8: fMinClsTPC = 0;  \r
1231                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1232                 fMinClsTPCToF= 0.35;\r
1233                 fUseCorrectedTPCClsInfo=0;\r
1234                 break;\r
1235         case 9:  // 35% of findable clusters\r
1236                 fMinClsTPC = 70;  \r
1237                 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);\r
1238                 fMinClsTPCToF= 0.35;\r
1239                 fUseCorrectedTPCClsInfo=1;\r
1240                 break;\r
1241           \r
1242         default:\r
1243                 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;\r
1244                 return kFALSE;\r
1245         }\r
1246         return kTRUE;\r
1247 }\r
1248 \r
1249 ///________________________________________________________________________\r
1250 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)\r
1251\r
1252   // Set eta Cut\r
1253         switch(etaCut){\r
1254         case 0: \r
1255                 fEtaCut = 100.;\r
1256                 fDoEtaCut = kFALSE;\r
1257                 break;\r
1258         case 1: // 1.4\r
1259                 fEtaCut = 1.4;\r
1260                 fDoEtaCut = kTRUE;\r
1261                 break;\r
1262         case 2: // 1.2\r
1263                 fEtaCut = 1.2;\r
1264                 fDoEtaCut = kTRUE;\r
1265                 break;\r
1266         case 3: // 0.9\r
1267                 fEtaCut = 0.9;\r
1268                 fDoEtaCut = kTRUE;\r
1269                 break;\r
1270         case 4: // 0.8\r
1271                 fEtaCut = 0.8;\r
1272                 fDoEtaCut = kTRUE;\r
1273                 break;\r
1274         case 5: // 0.75\r
1275                 fEtaCut = 0.75;\r
1276                 fDoEtaCut = kTRUE;\r
1277                 break;\r
1278         case 6: //0.6\r
1279                 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10\r
1280                 fDoEtaCut = kTRUE;\r
1281                 break;\r
1282         case 7: //0.5\r
1283                 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10\r
1284                 fDoEtaCut = kTRUE;\r
1285                 break;\r
1286         case 8: fEtaCut = 0.4;\r
1287                 fDoEtaCut = kTRUE;\r
1288                 break;\r
1289         default:\r
1290                 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;\r
1291                 return kFALSE;\r
1292         }\r
1293         return kTRUE;\r
1294 }\r
1295 \r
1296 ///________________________________________________________________________\r
1297 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)\r
1298\r
1299         // Set Pt Cut\r
1300          //0.1GeV, 0.125 GeV, 0.15 GeV\r
1301   \r
1302         switch(ptCut){\r
1303           \r
1304         case 0: fPtCut = 0.075;         \r
1305                 break;\r
1306         case 1:  // 0.1\r
1307                 fPtCut  = 0.1;  \r
1308                 break;\r
1309         case 2:  // 0.125 GeV\r
1310                 fPtCut  = 0.125;                \r
1311                 break;\r
1312         case 3: // 0.15 GeV\r
1313                 fPtCut  = 0.15;\r
1314                 break;\r
1315         default:\r
1316                 cout<<"Warning: PtCut not defined "<<ptCut<<endl;\r
1317                 return kFALSE;\r
1318         }\r
1319         return kTRUE;\r
1320 }\r
1321 \r
1322 \r
1323 ///________________________________________________________________________\r
1324 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)\r
1325\r
1326   // Set DCA Cut\r
1327   \r
1328         if( !fesdTrackCuts ) {\r
1329 \r
1330                 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;\r
1331                 return kFALSE;\r
1332         }\r
1333   \r
1334         switch(dcaCut){\r
1335           \r
1336         case 0: \r
1337                 //Open cuts//\r
1338                 fesdTrackCuts->SetMaxDCAToVertexZ(1000);\r
1339                 fesdTrackCuts->SetMaxDCAToVertexXY(1000);\r
1340                 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);\r
1341                 break;\r
1342                \r
1343         case 1: \r
1344                 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");\r
1345                 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);\r
1346                 \r
1347                 break;\r
1348         case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);\r
1349                 fesdTrackCuts->SetMaxDCAToVertexXY(1);\r
1350                 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);\r
1351                 break; \r
1352                 \r
1353         default:\r
1354                 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;\r
1355                 return kFALSE;\r
1356         }\r
1357         return kTRUE;\r
1358 }\r
1359 \r
1360 \r
1361 \r
1362 \r
1363 ///________________________________________________________________________\r
1364 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)\r
1365 {   // Set Cut\r
1366    switch(piMaxMomdedxSigmaCut){\r
1367 \r
1368          case 0: \r
1369                  fPIDMaxPnSigmaAbovePionLineTPC=0.;\r
1370                  break;\r
1371          case 1:  // 100. GeV\r
1372                  fPIDMaxPnSigmaAbovePionLineTPC=100.;\r
1373                  break;\r
1374          case 2:  // 5. GeV\r
1375                  fPIDMaxPnSigmaAbovePionLineTPC=5.;\r
1376                         break;\r
1377          case 3:  // 4. GeV\r
1378                  fPIDMaxPnSigmaAbovePionLineTPC=4.;\r
1379                  break;\r
1380          case 4:  // 3.5 GeV\r
1381                  fPIDMaxPnSigmaAbovePionLineTPC=3.5;\r
1382                  break;\r
1383          case 5:  // 3. GeV\r
1384                  fPIDMaxPnSigmaAbovePionLineTPC=3.;\r
1385                  break;\r
1386          default:\r
1387                  cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;\r
1388                  return kFALSE;\r
1389          }\r
1390          return kTRUE;\r
1391 }\r
1392 \r
1393 ///________________________________________________________________________\r
1394 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)\r
1395 {   // Set Cut\r
1396         switch(LowPRejectionSigmaCut){\r
1397         case 0:  //\r
1398                 fDoKaonRejectionLowP=kFALSE;\r
1399                 fDoProtonRejectionLowP=kFALSE;\r
1400                 fDoPionRejectionLowP=kFALSE;\r
1401                 fPIDnSigmaAtLowPAroundKaonLine=0;\r
1402                 fPIDnSigmaAtLowPAroundProtonLine=0;\r
1403                 fPIDnSigmaAtLowPAroundPionLine=0;\r
1404                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1405                 break;\r
1406         case 1:  //\r
1407                 fDoKaonRejectionLowP=kTRUE;\r
1408                 fDoProtonRejectionLowP=kTRUE;\r
1409                 fDoPionRejectionLowP=kTRUE;\r
1410                 fPIDnSigmaAtLowPAroundKaonLine=0.5;\r
1411                 fPIDnSigmaAtLowPAroundProtonLine=0.5;\r
1412                 fPIDnSigmaAtLowPAroundPionLine=0.5;\r
1413                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1414                 break;\r
1415         case 2:  //\r
1416                 fDoKaonRejectionLowP=kTRUE;\r
1417                 fDoProtonRejectionLowP=kTRUE;\r
1418                 fDoPionRejectionLowP=kTRUE;\r
1419                 fPIDnSigmaAtLowPAroundKaonLine=1.0;\r
1420                 fPIDnSigmaAtLowPAroundProtonLine=1.0;\r
1421                 fPIDnSigmaAtLowPAroundPionLine=1.0;\r
1422                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1423                 break;\r
1424         case 3:  //\r
1425                 fDoKaonRejectionLowP=kTRUE;\r
1426                 fDoProtonRejectionLowP=kTRUE;\r
1427                 fDoPionRejectionLowP=kTRUE;\r
1428                 fPIDnSigmaAtLowPAroundKaonLine=1.5;\r
1429                 fPIDnSigmaAtLowPAroundProtonLine=1.5;\r
1430                 fPIDnSigmaAtLowPAroundPionLine=1.5;\r
1431                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1432                 break;\r
1433         case 4:  //\r
1434                 fDoKaonRejectionLowP=kTRUE;\r
1435                 fDoProtonRejectionLowP=kTRUE;\r
1436                 fDoPionRejectionLowP=kTRUE;\r
1437                 fPIDnSigmaAtLowPAroundKaonLine=2.0;\r
1438                 fPIDnSigmaAtLowPAroundProtonLine=2.0;\r
1439                 fPIDnSigmaAtLowPAroundPionLine=2.0;\r
1440                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1441                 break;\r
1442         case 5:  //\r
1443                 fDoKaonRejectionLowP=kTRUE;\r
1444                 fDoProtonRejectionLowP=kTRUE;\r
1445                 fDoPionRejectionLowP=kTRUE;\r
1446                 fPIDnSigmaAtLowPAroundKaonLine=2.0;\r
1447                 fPIDnSigmaAtLowPAroundProtonLine=2.0;\r
1448                 fPIDnSigmaAtLowPAroundPionLine=2.5;\r
1449                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1450                 break;\r
1451         case 6:  //\r
1452                 fDoKaonRejectionLowP=kTRUE;\r
1453                 fDoProtonRejectionLowP=kTRUE;\r
1454                 fDoPionRejectionLowP=kTRUE;\r
1455                 fPIDnSigmaAtLowPAroundKaonLine=0.;\r
1456                 fPIDnSigmaAtLowPAroundProtonLine=0.;\r
1457                 fPIDnSigmaAtLowPAroundPionLine=2.;\r
1458                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1459                 break;\r
1460         case 7: //\r
1461                 fDoKaonRejectionLowP=kFALSE;\r
1462                 fDoProtonRejectionLowP=kFALSE;\r
1463                 fDoPionRejectionLowP=kTRUE;\r
1464                 fPIDnSigmaAtLowPAroundKaonLine=0.0;\r
1465                 fPIDnSigmaAtLowPAroundProtonLine=0.0;\r
1466                 fPIDnSigmaAtLowPAroundPionLine=1.0;\r
1467                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1468                 break;\r
1469         case 8:\r
1470                 fDoKaonRejectionLowP=kFALSE;\r
1471                 fDoProtonRejectionLowP=kFALSE;\r
1472                 fDoPionRejectionLowP=kTRUE;\r
1473                 fPIDnSigmaAtLowPAroundKaonLine=0.;\r
1474                 fPIDnSigmaAtLowPAroundProtonLine=0.;\r
1475                 fPIDnSigmaAtLowPAroundPionLine=0.5; \r
1476                 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;\r
1477                 break;  \r
1478         default:\r
1479                 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;\r
1480                 return kFALSE;\r
1481         }\r
1482         return kTRUE;\r
1483 }\r
1484 \r
1485 ///________________________________________________________________________\r
1486 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){\r
1487     // Set Cut\r
1488         switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////\r
1489         case 0: // no cut\r
1490                 fRequireTOF = kFALSE;\r
1491                 fUseTOFpid = kFALSE;\r
1492                 fTofPIDnSigmaBelowElectronLine=-100;\r
1493                 fTofPIDnSigmaAboveElectronLine=100;\r
1494                 break;\r
1495         case 1: // -7,7\r
1496                 fRequireTOF = kFALSE;\r
1497                 fUseTOFpid = kTRUE;\r
1498                 fTofPIDnSigmaBelowElectronLine=-7;\r
1499                 fTofPIDnSigmaAboveElectronLine=7;\r
1500                 break;\r
1501         case 2: // -5,5\r
1502                 fRequireTOF = kFALSE;\r
1503                 fUseTOFpid = kTRUE;\r
1504                 fTofPIDnSigmaBelowElectronLine=-5;\r
1505                 fTofPIDnSigmaAboveElectronLine=5;\r
1506                 break;\r
1507         case 3: // -3,5\r
1508                 fRequireTOF = kFALSE;\r
1509                 fUseTOFpid = kTRUE;\r
1510                 fTofPIDnSigmaBelowElectronLine=-3;\r
1511                 fTofPIDnSigmaAboveElectronLine=5;\r
1512                 break;\r
1513         case 4: // -2,3\r
1514                 fRequireTOF = kFALSE;\r
1515                 fUseTOFpid = kTRUE;\r
1516                 fTofPIDnSigmaBelowElectronLine=-2;\r
1517                 fTofPIDnSigmaAboveElectronLine=3;\r
1518                 break;\r
1519         case 5: // -3, 3 TOF mandatory\r
1520                 fRequireTOF = kTRUE;\r
1521                 fUseTOFpid  = kTRUE;\r
1522                 fTofPIDnSigmaBelowElectronLine= -3;\r
1523                 fTofPIDnSigmaAboveElectronLine=  3;\r
1524                 break;\r
1525         default:\r
1526         cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;\r
1527         return kFALSE;\r
1528     } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////\r
1529     return kTRUE;\r
1530 }\r
1531 ///_______________________________________________________________________________\r
1532 \r
1533 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {\r
1534   \r
1535 \r
1536   switch(psiCut) {\r
1537   case 0:\r
1538         fDoPsiPairCut = kFALSE;\r
1539         fPsiPairCut = 10000.; //\r
1540         fDeltaPhiCutMin = -1000.;\r
1541         fDeltaPhiCutMax =  1000.;\r
1542         \r
1543         break;\r
1544   case 1:\r
1545         fDoPsiPairCut = kTRUE;\r
1546         fPsiPairCut = 0.45; // Standard\r
1547         fDeltaPhiCutMin = 0.0;\r
1548         fDeltaPhiCutMax = 0.12;\r
1549         break;\r
1550   case 2:\r
1551         fDoPsiPairCut = kTRUE;\r
1552         fPsiPairCut = 0.60; \r
1553         fDeltaPhiCutMin = 0.0;\r
1554         fDeltaPhiCutMax = 0.12;\r
1555         break;\r
1556   case 3:\r
1557         fDoPsiPairCut = kTRUE;\r
1558         fPsiPairCut = 0.52;\r
1559         fDeltaPhiCutMin = 0.0;\r
1560         fDeltaPhiCutMax = 0.12;\r
1561         break;\r
1562     \r
1563   default:\r
1564       cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;\r
1565       return kFALSE;\r
1566   }\r
1567 \r
1568   return kTRUE;\r
1569 }\r
1570 \r
1571 ///_______________________________________________________________________________\r
1572 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {\r
1573   \r
1574 \r
1575   switch(RCut) {\r
1576   case 0:\r
1577         fDoRejectSharedElecGamma = kFALSE;\r
1578         fRadiusCut = 10000; // \r
1579         break;\r
1580   case 1:\r
1581         fDoRejectSharedElecGamma = kTRUE;\r
1582         fRadiusCut = 2.0; // cm \r
1583         break;\r
1584   case 2:\r
1585         fDoRejectSharedElecGamma = kTRUE;\r
1586         fRadiusCut = 3.0; // Standard\r
1587         break;\r
1588   case 3:\r
1589         fDoRejectSharedElecGamma = kTRUE;\r
1590         fRadiusCut = 4.0; // \r
1591         break;\r
1592   case 4:\r
1593         fDoRejectSharedElecGamma = kTRUE;\r
1594         fRadiusCut = 5.0; // \r
1595         break;\r
1596   case 5:\r
1597         fDoRejectSharedElecGamma = kTRUE;\r
1598         fRadiusCut = 10.0; // \r
1599         break;\r
1600   case 6:\r
1601         fDoRejectSharedElecGamma = kTRUE;\r
1602         fRadiusCut = 15.0; // \r
1603         break;\r
1604   default:\r
1605       cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;\r
1606       return kFALSE;\r
1607   }\r
1608 \r
1609   return kTRUE;\r
1610 }\r
1611 ///__________________________________________________________________________\r
1612 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){\r
1613 \r
1614     // Set Cut\r
1615     switch(BackgroundScheme){\r
1616 \r
1617     case 0: //Rotation\r
1618             fBKGMethod = 0;\r
1619             fUseTrackMultiplicityForBG = kFALSE;\r
1620         break;\r
1621     case 1: // mixed event with V0 multiplicity\r
1622             fBKGMethod  = 1;\r
1623             fUseTrackMultiplicityForBG = kFALSE;\r
1624         break;\r
1625     case 2: // mixed event with track multiplicity\r
1626             fUseTrackMultiplicityForBG = kTRUE;\r
1627             fBKGMethod  = 1;\r
1628         break;\r
1629     case 3: //Rotation\r
1630            fUseTrackMultiplicityForBG = kFALSE;\r
1631             fBKGMethod  = 2;\r
1632         break;\r
1633     case 4: //Rotation\r
1634             fUseTrackMultiplicityForBG = kTRUE;\r
1635             fBKGMethod  = 2;\r
1636         break;\r
1637     case 5: fUseTrackMultiplicityForBG = kTRUE;\r
1638             fBKGMethod  = 3;\r
1639         break;\r
1640 \r
1641     default:\r
1642         cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;\r
1643         return kFALSE;\r
1644     }\r
1645     return kTRUE;\r
1646 }\r
1647 \r
1648 ///________________________________________________________________________\r
1649 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)\r
1650 {   // Set Cut\r
1651     switch(NumberOfRotations){\r
1652     case 0:\r
1653         fnumberOfRotationEventsForBG = 5;\r
1654         break;\r
1655     case 1:\r
1656         fnumberOfRotationEventsForBG = 10;\r
1657         break;\r
1658     case 2:\r
1659         fnumberOfRotationEventsForBG = 15;\r
1660         break;\r
1661     case 3:\r
1662         fnumberOfRotationEventsForBG = 20;\r
1663         break;\r
1664     case 4:\r
1665         fnumberOfRotationEventsForBG = 2;\r
1666         break;\r
1667     case 5:\r
1668         fnumberOfRotationEventsForBG = 50;\r
1669         break;\r
1670     case 6:\r
1671         fnumberOfRotationEventsForBG = 80;\r
1672         break;\r
1673     case 7:\r
1674         fnumberOfRotationEventsForBG = 100;\r
1675         break;\r
1676     default:\r
1677         cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;\r
1678         return kFALSE;\r
1679     }\r
1680     return kTRUE;\r
1681 }\r
1682 \r
1683 \r
1684 \r
1685 ///________________________________________________________________________\r
1686 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)\r
1687 {   // Set Cut\r
1688     switch(opc){\r
1689       \r
1690     case 0:             fDoWeights = kFALSE;\r
1691                         break;\r
1692     case 1:             fDoWeights = kTRUE;\r
1693                         break; \r
1694     default:\r
1695                         cout<<"Warning: Weights option not defined "<<opc<<endl;\r
1696                         return kFALSE;\r
1697     }\r
1698     return kTRUE;\r
1699 }\r
1700 ///________________________________________________________________________\r
1701 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)\r
1702 {   // Set Cut\r
1703     switch(massCut){\r
1704       \r
1705     case 0:\r
1706                         \r
1707                         fMassCutPtMin  = -999.; //GeV\r
1708                         fMassCutLowPt  =  999.; //GeV/c^2\r
1709                         fMassCutHighPt =  999.; //GeV/c^2\r
1710                         fDoMassCut = kFALSE;   \r
1711                         break;\r
1712     case 1:\r
1713                         //fMassCut = 0.135;             //GeV/c^2\r
1714                         fMassCutPtMin  = -999.; //GeV\r
1715                         fMassCutLowPt  = 0.135; //GeV/c^2\r
1716                         fMassCutHighPt = 0.135; //GeV/c^2\r
1717                         fDoMassCut = kTRUE;\r
1718                         break; \r
1719     case 2:\r
1720                         //fMassCut = 0.100;     //GeV/c^2\r
1721                         fMassCutPtMin  = -999.; //GeV\r
1722                         fMassCutLowPt  = 0.100; //GeV/c^2\r
1723                         fMassCutHighPt = 0.100; //GeV/c^2\r
1724                         fDoMassCut = kTRUE;\r
1725                         break;\r
1726     case 3:\r
1727                         //fMassCut = 0.075;     //GeV/c^2\r
1728                         fMassCutPtMin  = -999.; //GeV\r
1729                         fMassCutLowPt  = 0.075; //GeV/c^2\r
1730                         fMassCutHighPt = 0.075; //GeV/c^2\r
1731                         fDoMassCut = kTRUE;\r
1732                         break;\r
1733     case 4:\r
1734                         //fMassCut = 0.050;     //GeV/c^2\r
1735                         fMassCutPtMin  = -999.; //GeV\r
1736                         fMassCutLowPt  = 0.050; //GeV/c^2\r
1737                         fMassCutHighPt = 0.050; //GeV/c^2\r
1738                         fDoMassCut = kTRUE;\r
1739                         break;\r
1740     case 5:\r
1741                         \r
1742                         fMassCutPtMin  = -999.; //GeV\r
1743                         fMassCutLowPt  = 0.035; //GeV/c^2\r
1744                         fMassCutHighPt = 0.035; //GeV/c^2\r
1745                         fDoMassCut = kTRUE;\r
1746                         break;\r
1747     case 6:\r
1748                         fMassCutPtMin  = -999.; //GeV\r
1749                         fMassCutLowPt  = 0.015; //GeV/c^2\r
1750                         fMassCutHighPt = 0.015; //GeV/c^2\r
1751                         fDoMassCut = kTRUE;\r
1752                         break;\r
1753     case 7:             fMassCutPtMin  = 1.0;   //GeV\r
1754                         fMassCutLowPt  = 0.015; //GeV/c^2\r
1755                         fMassCutHighPt = 0.035; //GeV/c^2\r
1756                         fDoMassCut = kTRUE;\r
1757                         break;\r
1758     default:\r
1759                         cout<<"Warning: MassCut not defined "<<massCut<<endl;\r
1760                         return kFALSE;\r
1761     }\r
1762     return kTRUE;\r
1763 }\r
1764 \r
1765 \r
1766 \r
1767 ///________________________________________________________________________\r
1768 TString AliDalitzElectronCuts::GetCutNumber(){\r
1769     // returns TString with current cut number\r
1770   TString a(kNCuts);\r
1771   for(Int_t ii=0;ii<kNCuts;ii++){\r
1772         a.Append(Form("%d",fCuts[ii]));\r
1773   }\r
1774   return a;\r
1775 }\r
1776 \r
1777 \r
1778 ///________________________________________________________________________\r
1779 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){\r
1780     //Create and return standard 2010 PbPb cuts\r
1781     AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");\r
1782     if(!cuts->InitializeCutsFromCutString("9069640364102")){\r
1783         cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}\r
1784     return cuts;\r
1785 }\r
1786 \r
1787 ///________________________________________________________________________\r
1788 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){\r
1789     //Create and return standard 2010 PbPb cuts\r
1790     AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");\r
1791                                           \r
1792     if(!cuts->InitializeCutsFromCutString("9069640364102")){\r
1793         cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}\r
1794      return cuts;\r
1795 }\r
1796 \r