AliPhysics  608b256 (608b256)
AliDalitzElectronCuts.cxx
Go to the documentation of this file.
1 
2 /**************************************************************************
3  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * *
5  * Authors: Svein Lindal, Daniel Lohner *
6  * Version 1.0 *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //---------------------------------------------
19 // Class handling all kinds of selection cuts for
20 // Gamma Conversion analysis
21 //---------------------------------------------
23 
24 
25 #include "AliDalitzElectronCuts.h"
26 #include "AliAODConversionPhoton.h"
27 #include "AliKFVertex.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
30 #include "AliAnalysisManager.h"
31 #include "AliInputEventHandler.h"
32 #include "AliMCEventHandler.h"
33 #include "AliAODHandler.h"
34 #include "AliPIDResponse.h"
35 #include "TH1.h"
36 #include "TH2.h"
37 #include "AliMCEvent.h"
38 #include "TObjString.h"
39 #include "AliAODEvent.h"
40 #include "AliESDEvent.h"
41 #include "AliDalitzData.h"
42 #include "AliDalitzAODESD.h"
43 #include "AliDalitzEventMC.h"
44 #include "AliDalitzAODESDMC.h"
45 #include "TList.h"
46 class iostream;
47 
48 using namespace std;
49 
50 ClassImp(AliDalitzElectronCuts)
51 
52 
53 const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {
54  "MaxChi2TPCConstrainedGlobal", //0
55  "ededxSigmaITSCut", //1
56  "ededxSigmaTPCCut", //2
57  "pidedxSigmaTPCCut", //3
58  "piMinMomdedxSigmaTPCCut", //4
59  "piMaxMomdedxSigmaTPCCut", //5
60  "LowPRejectionSigmaCut", //6
61  "kTOFelectronPID", //7
62  "clsITSCut", //8
63  "clsTPCCut", //9
64  "EtaCut", //10
65  "PsiPair", //11
66  "RejectSharedElecGamma", //12
67  "MaxChi2PerClusterTPC", //13
68  "MaxChi2PerClusterITS", //14
69  "PtCut", //15
70  "DCAcut", //16
71  "MassCut", //17
72  "Weights", //18
73  "VPhotonMCPSmearing" //19
74 };
75 
76 //________________________________________________________________________
77 AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),
78  fHistograms(NULL),
79  fPIDResponse(NULL),
80  fesdTrackCuts(NULL),
81  fEtaCut(0.9),
82  fDoEtaCut(kFALSE),
83  fPtMinCut(0.0),
84  fPtMaxCut(9999),
85  fRadiusCut(1000.0),
86  fPsiPairCut(0.45),
87  fDeltaPhiCutMin(0.),
88  fDeltaPhiCutMax(0.12),
89  fMaxDCAVertexz(1000.),
90  fMaxDCAVertexxy(1000.),
91  fDCAVertexPt(""),
92  fMinClsTPC(0), // minimum clusters in the TPC
93  fMinClsTPCToF(0), // minimum clusters to findable clusters
94  fDodEdxSigmaITSCut(kFALSE),
95  fDodEdxSigmaTPCCut(kTRUE),
96  fDoTOFsigmaCut(kFALSE), // RRnewTOF
97  fDoRejectSharedElecGamma(kFALSE),
98  fDoPsiPairCut(kFALSE),
99  fPIDnSigmaAboveElectronLineITS(100),
100  fPIDnSigmaBelowElectronLineITS(-100),
101  fPIDnSigmaAboveElectronLineTPC(100),
102  fPIDnSigmaBelowElectronLineTPC(-100),
103  fPIDnSigmaAbovePionLineTPC(0),
104  fPIDnSigmaAbovePionLineTPCHighPt(-100),
105  fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
106  fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
107  fPIDMinPnSigmaAbovePionLineTPC(0),
108  fPIDMaxPnSigmaAbovePionLineTPC(0),
109  fDoKaonRejectionLowP(kFALSE),
110  fDoProtonRejectionLowP(kFALSE),
111  fDoPionRejectionLowP(kFALSE),
112  fPIDnSigmaAtLowPAroundKaonLine(0),
113  fPIDnSigmaAtLowPAroundProtonLine(0),
114  fPIDnSigmaAtLowPAroundPionLine(0),
115  fPIDMinPKaonRejectionLowP(1.5),
116  fPIDMinPProtonRejectionLowP(2.0),
117  fPIDMinPPionRejectionLowP(0.5),
118  fUseCorrectedTPCClsInfo(kFALSE),
119  fUseCrossedRows(kFALSE),
120  fITSCut(0),
121  fUseTOFpid(kFALSE),
122  fRequireTOF(kFALSE),
123  fDoMassCut(kFALSE),
124  fDoMassMinCut(kFALSE),
125  fMassCutLowPt(999.),
126  fMassCutHighPt(999.),
127  fMassCutPtMin(-100.0),
128  fMassMinCut(-999.),
129  fDoWeights(kFALSE),
130  fUseVPhotonMCPSmearing(kFALSE),
131  fUseElectronMCPSmearing(kFALSE),
132  fCutString(NULL),
133  fCutStringRead(""),
134  hCutIndex(NULL),
135  hdEdxCuts(NULL),
136  hITSdEdxbefore(NULL),
137  hITSdEdxafter(NULL),
138  hTPCdEdxbefore(NULL),
139  hTPCdEdxafter(NULL),
140  hTPCdEdxSignalbefore(NULL),
141  hTPCdEdxSignalafter(NULL),
142  hTOFbefore(NULL),
143  hTOFafter(NULL),
144  hTrackDCAxyPtbefore(NULL),
145  hTrackDCAxyPtafter(NULL),
146  hTrackDCAzPtbefore(NULL),
147  hTrackDCAzPtafter(NULL),
148  hTrackNFindClsPtTPCbefore(NULL),
149  hTrackNFindClsPtTPCafter(NULL),
150  hTrackPosEtabeforeDedx(NULL),
151  hTrackNegEtabeforeDedx(NULL),
152  hTrackPosEtaafterDedx(NULL),
153  hTrackNegEtaafterDedx(NULL)
154  {
155  InitPIDResponse();
156  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
157  fCutString=new TObjString((GetCutNumber()).Data());
158 
159  //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
160  // Using standard function for setting Cuts
161  Bool_t selectPrimaries=kFALSE;
162  fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
163 }
164 //NOTE work here Edgar New function.
166  //SetMaxChi2TPCConstrainedGlobal
167  //fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(1e10);
168  // if (!(aliaodtrack->GetDalitzAODTrack()->TestFilterBit(28))){
169  // return kFALSE;
170  //56
171  //}
172 
173  if(!(aliaodtrack->GetDalitzAODTrack()->IsHybridGlobalConstrainedGlobal())){//GlobalConstrained
174  return kFALSE;
175  }
176 
177  if((aliaodtrack->GetDalitzAODTrack()->IsGlobalConstrained())){//GlobalConstrained
178  return kFALSE;
179  }
180 
181  if(fUseCrossedRows){
182  if (aliaodtrack->GetTPCCrossedRowsG()<kclsTPCCut) return kFALSE;}
183  else {
184  if (aliaodtrack->GetNclsG()<kclsTPCCut) return kFALSE;}
185 
186  //0:First layer SPD
187  //1:Second layer SPD
188  //2:First layer SDD
189  //3:Second layer SDD
190  //4:First layer SSD
191  //5:Second layer SSD
192  //cout<<fITSCut<<endl;
193  if(fITSCut==1){//At list on hit any layer of SPD point
194  if (!aliaodtrack->HasPointOnITSLayerG(0)) return kFALSE;
195  }
196  if(fITSCut==2){//At list on hit any layer of SPD point
197  if ((!aliaodtrack->HasPointOnITSLayerG(0))&&(!aliaodtrack->HasPointOnITSLayerG(1))) return kFALSE;
198  }
199  if(fITSCut==3){//At list on hit any layer of SPD point
200  if ((!aliaodtrack->HasPointOnITSLayerG(0))&&(aliaodtrack->GetITSclsG()<4)) return kFALSE;
201  }
202  if(fITSCut==4){//At list on hit any layer of SPD point
203  if ((!aliaodtrack->HasPointOnITSLayerG(0))&&(!aliaodtrack->HasPointOnITSLayerG(1))&&(aliaodtrack->GetITSclsG()<3)) return kFALSE;
204  }
205  if(fITSCut==5){//At list on hit any layer of SPD point
206  if ((!aliaodtrack->HasPointOnITSLayerG(0))&&(!aliaodtrack->HasPointOnITSLayerG(1))&&(aliaodtrack->GetITSclsG()<4)) return kFALSE;
207  }
208  if(fITSCut==6){//At list on hit any layer of SPD point
209  if ((!aliaodtrack->HasPointOnITSLayerG(0))&&(!aliaodtrack->HasPointOnITSLayerG(1))&&(aliaodtrack->GetITSclsG()<5)) return kFALSE;
210  }
211  if(fITSCut==7){//At list on hit any layer of SPD point
212  if ((aliaodtrack->GetITSclsG()<4)) return kFALSE;
213  }
214  if(fITSCut==8){//At list on hit any layer of SPD point
215  if ((!aliaodtrack->HasPointOnITSLayerG(0))||(!aliaodtrack->HasPointOnITSLayerG(1))) return kFALSE;
216  }
217  if(fITSCut==9){//At list on hit any layer of SPD point
218  if ((!aliaodtrack->HasPointOnITSLayerG(0))||(!aliaodtrack->HasPointOnITSLayerG(1))&&(aliaodtrack->GetITSclsG()<4)) return kFALSE;
219  }
220 
221  //DCAcut
222  if(fDCAVertexPt.CompareTo("no")){
223  fDCAVertexPt.ReplaceAll("pt","x");
224  TFormula* DCAPtCutsForm= new TFormula("Conversion",fDCAVertexPt.Data());
225  fMaxDCAVertexxy=DCAPtCutsForm->Eval(aliaodtrack->GetPtG());
226  delete DCAPtCutsForm;
227  }
228  // cout<<" Datos DCAz "<<aliaodtrack->GetDCAz()<<" Datos DCAxy "<<aliaodtrack->GetDCAxy()<<endl;
229  //cout<<" CorteDCAz "<<fMaxDCAVertexz<<" CorteDCAxy "<<fMaxDCAVertexxy<<endl;
230  //cout<<dcaCut<<endl;
231  if (TMath::Abs(aliaodtrack->GetDCAxy())>fMaxDCAVertexxy){
232  return kFALSE;
233  }
234  //cout<<fMaxDCAVertexxy<<" xy and z "<<fMaxDCAVertexz<<endl;
235  if (TMath::Abs(aliaodtrack->GetDCAz())>fMaxDCAVertexz){
236  cout<<fMaxDCAVertexz<<endl;
237  return kFALSE;
238  }
239 
240  // if(dcaCut==1){//At list on hit any layer of SPD point
241  // if ((!aliaodtrack->HasPointOnITSLayerG(0))||(!aliaodtrack->HasPointOnITSLayerG(1))&&(aliaodtrack->GetITSclsG()<4)) return kFALSE;
242  //}
243  // Bool_t PxPyPzAtDCA(Double_t* p) const
244 //{ p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; }
245  // Bool_t XYZAtDCA(Double_t* x) const
246 //{ x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; }
247 
248  return kTRUE;
249  //Filtro que quiero
250  //minimo de cluster TPC y ITS
251  //DCA x and y
252  //Constrained global
253 }
254 //________________________________________________________________________
256  // Destructor
257  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
258  // if(fHistograms)
259  // delete fHistograms;
260  // fHistograms = NULL;
261 
262  if(fCutString != NULL){
263  delete fCutString;
264  fCutString = NULL;
265  }
266 }
267 
268 //________________________________________________________________________
270 
271  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
272  TH1::AddDirectory(kFALSE);
273  TString cutName = "";
274  if( cutNumber==""){
275  cutName = GetCutNumber().Data();
276  } else {
277  cutName = cutNumber.Data();
278  }
279 
280  if(fHistograms != NULL){
281  delete fHistograms;
282  fHistograms=NULL;
283  }
284  if(fHistograms==NULL){
285  fHistograms=new TList();
286  if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
287  else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
288  }
289 
290  Int_t kDedxSignalbins = 200;
291  const Int_t kDCABins=62;
292 
293  Double_t binsDCADummy[63]={-3.0, -2.7, -2.4, -2.1, -1.8, -1.5, -1.2, -0.9, -0.6, -0.3, -0.25, -0.2, -0.19, -0.18, -0.17, -0.16, -0.15, -0.14, -0.13, -0.12, -0.11, -0.10, -0.09, -0.08, -0.07, -0.06, -0.05, -0.04, -0.03, -0.02, -0.01, 0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.25, 0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3.0};
294 
295  const Int_t kPtBins=110;
296  Double_t binsPtDummy[kPtBins+1];
297  const Int_t kPBins = 109;
298  Double_t binsPDummy[kPBins+1];
299  binsPtDummy[0]=0.0;
300  binsPDummy[0]=0.05;
301 
302  for(Int_t i=1;i<kPtBins+1;i++){
303  if(binsPtDummy[i-1]+0.05<1.01)
304  binsPtDummy[i]=binsPtDummy[i-1]+0.05;
305  else
306  binsPtDummy[i]=binsPtDummy[i-1]+0.1;
307  }
308  for(Int_t i=1; i <kPBins+1;i++){
309  if( binsPDummy[i-1]+0.05<1.01)
310  binsPDummy[i] = binsPDummy[i-1]+0.05;
311  else
312  binsPDummy[i] = binsPDummy[i-1]+0.1;
313  }
314 
315  hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
316  hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
317  hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
318  hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
319  hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
320  hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
321  fHistograms->Add(hCutIndex);
322 
323  // dEdx Cuts
324  hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
325  hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
326  hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
327  hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
328  hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
329  hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
330  hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
331  hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
332  hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
333  hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
334  hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
335  fHistograms->Add(hdEdxCuts);
336 
337  TAxis *AxisBeforeITS = NULL;
338  TAxis *AxisBeforedEdx = NULL;
339  TAxis *AxisBeforeTOF = NULL;
340  TAxis *AxisBeforedEdxSignal = NULL;
341 
342  if(preCut){
343  hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
345  AxisBeforeITS = hITSdEdxbefore->GetXaxis();
346 
347  hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
349  AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
350 
351  hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
353  AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
354 
355  hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
356  fHistograms->Add(hTOFbefore);
357  AxisBeforeTOF = hTOFbefore->GetXaxis();
358 
359  hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
361 
362  hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
364 
365  hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",60,0,1.5,kPtBins,binsPtDummy);
367  }
368 
369  hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
371 
372  hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
374 
375  hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
377 
378  hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
379  fHistograms->Add(hTOFafter);
380 
381  hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
383 
384  hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
386 
387  hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",60,0,1.5,kPtBins,binsPtDummy);
389 
390  hTrackPosEtabeforeDedx = new TH1F(Form("hTrack_Pos_Eta_before_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_before_Dedx",600,-1.5,1.5);
392 
393  hTrackNegEtabeforeDedx = new TH1F(Form("hTrack_Neg_Eta_before_Dedx %s",cutName.Data()),"hTrack_Neg_Eta_before_Dedx",600,-1.5,1.5);
395 
396  hTrackPosEtaafterDedx = new TH1F(Form("hTrack_Pos_Eta_after_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_after_Dedx",600,-1.5,1.5);
398 
399  hTrackNegEtaafterDedx = new TH1F(Form("hTrack_Neg_Eta_afterDedx %s",cutName.Data()),"hTrack_Neg_Eta_after_Dedx",600,-1.5,1.5);
401 
402  TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
403  Int_t bins = AxisAfter->GetNbins();
404  Double_t from = AxisAfter->GetXmin();
405  Double_t to = AxisAfter->GetXmax();
406  Double_t *newBins = new Double_t[bins+1];
407  newBins[0] = from;
408  Double_t factor = TMath::Power(to/from, 1./bins);
409  for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
410  AxisAfter->Set(bins, newBins);
411  AxisAfter = hTOFafter->GetXaxis();
412  AxisAfter->Set(bins, newBins);
413  AxisAfter = hITSdEdxafter->GetXaxis();
414  AxisAfter->Set(bins,newBins);
415  AxisAfter = hTPCdEdxSignalafter->GetXaxis();
416  AxisAfter->Set(bins,newBins);
417 
418  if(preCut){
419  AxisBeforeITS->Set(bins, newBins);
420  AxisBeforedEdx->Set(bins, newBins);
421  AxisBeforedEdxSignal->Set(bins,newBins);
422  AxisBeforeTOF->Set(bins, newBins);
423  }
424  delete [] newBins;
425 
426  TH1::AddDirectory(kTRUE);
427 
428  // Event Cuts and Info
429 }
430 
431 
432 //________________________________________________________________________
434 
435  // Set Pointer to AliPIDResponse
436  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
437  if(man) {
438  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
439  fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
440  if(fPIDResponse)return kTRUE;
441 
442  }
443 
444  return kFALSE;
445 }
447 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliMCEvent *mcEvent)
448 {
449 return kTRUE; //Dummy function
450 }
452 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliMCEvent *mcESDEvent, AliDalitzEventMC *mcAODESDEvent )
453 {
454  if( labelParticle < 0 || labelParticle >= mcESDEvent->GetNumberOfTracks() ) return kFALSE;
455  //if( mcEvent->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
456  AliDalitzAODESDMC* particle = mcAODESDEvent->Particle(labelParticle);
457  //TParticle* particle = mcEvent->Particle(labelParticle);
458 
459  if( TMath::Abs( particle->GetPdgCodeG() ) != 11 ) return kFALSE;
460 
461  if( fDoEtaCut ){
462  if( particle->EtaG() > fEtaCut || particle->EtaG() < -fEtaCut )
463  return kFALSE;
464  }
465 
466  return kTRUE;
467 }
468 
471 {
472  //Dummy Function
473 }
476 {
477  //cout<<"ElectronIsSelected Entro"<<endl;
478  if(lTrack->GetIsESD()){
479  if ( ! lTrack->GetParamG() ){
480  return kFALSE;
481  // lTrack->IsHybridGlobalConstrainedGlobal();
482  }
483  }
484  // cout<<"ParamG"<<lTrack->GetParamG()<<endl;
485  //cout<<"PasoGetParamG"<<endl;
486  //Selection of Reconstructed electrons
487  Float_t b[2];
488  Float_t bCov[3];
489  lTrack->GetImpactParametersG(b,bCov);
490 
491  Float_t dcaToVertexXY = b[0];
492  Float_t dcaToVertexZ = b[1];
493  Double_t clsToF = GetNFindableClustersTPC(lTrack);
494 
495  if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->GetPtG());
496  if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->GetPtG());
497  if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->GetPtG());
498 
499  if(hCutIndex)hCutIndex->Fill(kElectronIn);
500  if (lTrack == NULL){
501  if(hCutIndex)hCutIndex->Fill(kNoTracks);
502  return kFALSE;
503  }
504 
505  // if ( ! lTrack->GetParamG() ){
506  // return kFALSE;
507  // }NOTE comente 22 Febrero
508 
509  // Track Cuts
510  if( !TrackIsSelected(lTrack) ){
511  if(hCutIndex)hCutIndex->Fill(kTrackCuts);
512  return kFALSE;
513  }
514  if( lTrack->GetSignG() > 0.0 ){
516  } else{
518 
519  }
520  AliVTrack * track = lTrack->GetDalitzVTrack();
521  // dEdx Cuts
522  if( ! dEdxCuts( track ) ) {
523  if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
524  return kFALSE;
525  }
526 
527  if( lTrack->GetSignG() > 0.0 ){
529  } else{
531  }
532 
533  //Electron passed the cuts
534  if(hCutIndex)hCutIndex->Fill(kElectronOut);
535 
536  if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->GetPtG());
537  if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->GetPtG());
538  if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->GetPtG());
539 
540 //cout<<" Acabo ElectronIsSelected "<<endl;
541  return kTRUE;
542 }
543 
546  // Track Selection for Photon Reconstruction
547  Double_t clsToF = GetNFindableClustersTPC(lTrack);
548  if (lTrack->GetIsESD()){
549  if( ! fesdTrackCuts->AcceptTrack(lTrack->GetDalitzESDTrack())){
550  return kFALSE;
551  }
552  }
553  else
554  if (!(AcceptedAODESDTrack(lTrack)==kTRUE)){
555  return kFALSE;
556  }
557  if( fDoEtaCut ) {
558  if( lTrack->GetEtaG() > fEtaCut || lTrack->GetEtaG() < -fEtaCut ) {
559  return kFALSE;
560  }
561  }
562 //cout<<" Paso Eta Cuts "<<lTrack->GetEtaG()<<endl;
563  if( lTrack->GetPtG() < fPtMinCut || lTrack->GetPtG() > fPtMaxCut ) {
564  return kFALSE;
565  }
566 
567  if( clsToF < fMinClsTPCToF){
568  return kFALSE;
569  }
570  return kTRUE;
571 }
573 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
574 
575  // Electron Identification Cuts for Photon reconstruction
576  if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
577  if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
578 
579  //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
580  Int_t cutIndex=0;
581  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
582  if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
583  if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
584  if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
585  cutIndex++;
586 
587  if( fDodEdxSigmaITSCut == kTRUE ){
588  if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
589  fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
590  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
591  return kFALSE;
592  }
593  }
594 
595  if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
596  cutIndex++;
597 
598  if(fDodEdxSigmaTPCCut == kTRUE){
599  // TPC Electron Line
600  if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
601  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
602  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
603  return kFALSE;
604  }
605  cutIndex++;
606 
607  // TPC Pion Line
608  if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
609  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
610  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
611  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
612  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
613  return kFALSE;
614  }
615  }
616  cutIndex++;
617 
618  // High Pt Pion rej
619  if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
620  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
621  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
622  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
623  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
624  return kFALSE;
625  }
626  }
627  cutIndex++;
628  } else{ cutIndex+=3; }
629 
630 
631  if( fDoKaonRejectionLowP == kTRUE ){
632  if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
633  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
634  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
635  return kFALSE;
636  }
637  }
638  }
639  cutIndex++;
640 
641  if( fDoProtonRejectionLowP == kTRUE ){
642  if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
643  if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
644  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
645  return kFALSE;
646  }
647  }
648  }
649  cutIndex++;
650 
651  if(fDoPionRejectionLowP == kTRUE){
652  if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
653  if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
654  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
655  return kFALSE;
656  }
657  }
658  }
659  cutIndex++;
660 
661 
662  if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
663  if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
664  if(fUseTOFpid){
665  if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
666  fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
667  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
668  return kFALSE;
669  }
670  }
671  if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
672  } else if ( fRequireTOF == kTRUE ) {
673  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
674  return kFALSE;
675  }
676  cutIndex++;
677 
678  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
679  if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
680  if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
681 
682  return kTRUE;
683 }
684 
686 
687 
688 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
689  //Returns pointer to the track with given ESD label
690  //(Important for AOD implementation, since Track array in AOD data is different
691  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
692 
693  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
694  if(esdEvent) {
695  if(label > event->GetNumberOfTracks() ) return NULL;
696  AliESDtrack * track = esdEvent->GetTrack(label);
697  return track;
698  } else {
699  for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
700  AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
701  if(track) {
702  if(track->GetID() == label) {
703  return track;
704  }
705  }
706  }
707  }
708 
709  cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
710  return NULL;
711 }
714  for(Int_t i = 0;i<photons->GetEntries();i++){
715 
716  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
717  Int_t posLabel = photonComp->GetTrackLabelPositive();
718  Int_t negLabel = photonComp->GetTrackLabelNegative();
719 
720  if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
721  return kFALSE;
722  }
723  }
724 
725  return kTRUE;
726 }
727 
728 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
729 
730  if( pi0CandidatePt < fMassCutPtMin ){
731  if( vphotonCandidateMass < fMassCutLowPt ){
732  return kTRUE;
733  }
734  } else {
735  if( vphotonCandidateMass < fMassCutHighPt ){
736  return kTRUE;
737  }
738  }
739  return kFALSE;
740 }
741 
743  Double_t clsToF=0;
744  if( fUseCrossedRows == kFALSE ) {
745  if ( !fUseCorrectedTPCClsInfo ){
746  if(lTrack->GetTPCNclsFG()!=0){
747  clsToF = (Double_t)lTrack->GetNclsG()/(Double_t)lTrack->GetTPCNclsFG();
748  }// Ncluster/Nfindablecluster
749  } //else {
750  //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
751  //clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask Friederike, we never used
752  //}
753  } else {
754  Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRowsG();
755  clsToF = 1.0;
756  if ( lTrack->GetTPCNclsFG()>0 ) {
757  clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsFG();
758  }
759  }
760  return clsToF;
761 }
762 
763 
765 {
766 //
767 // Returns true if it is a gamma conversion according to psi pair value
768 //
769  return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
770  TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
771 }
772 
776  if(fCutString && fCutString->GetString().Length() == kNCuts) {
777  fCutString->SetString(GetCutNumber());
778  } else {
779  return kFALSE;
780  }
781  return kTRUE;
782 }
783 
786  fCutStringRead = Form("%s",analysisCutSelection.Data());
787 
788  // Initialize Cuts from a given Cut string
789 
790 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
791  AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
792 
793  if(analysisCutSelection.Length()!=kNCuts) {
794  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
795  return kFALSE;
796  }
797  if(!analysisCutSelection.IsAlnum()){
798  AliError("Cut selection is not alphanumeric");
799  return kFALSE;
800  }
801 
802  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
803  analysisCutSelectionLowerCase.ToLower();
804  const char *cutSelection = analysisCutSelectionLowerCase.Data();
805  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
806  for(Int_t ii=0;ii<kNCuts;ii++){
807  ASSIGNARRAY(ii);
808  }
809 
810 
811  // Set Individual Cuts
812  for(Int_t ii=0;ii<kNCuts;ii++){
813  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
814  }
815 
816  //PrintCuts();
817  return kTRUE;
818 }
822 
823  cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
824  switch (cutID) {
826  if( SetMaxChi2TPCConstrainedGlobal( value ) ){
828  UpdateCutString();
829  return kTRUE;
830  } else return kFALSE;
831 
832  case kededxSigmaITSCut:
833  if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
834  fCuts[kededxSigmaITSCut] = value;
835  UpdateCutString();
836  return kTRUE;
837  } else return kFALSE;
838 
839  case kededxSigmaTPCCut:
840  if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
841  fCuts[kededxSigmaTPCCut] = value;
842  UpdateCutString();
843  return kTRUE;
844  } else return kFALSE;
845 
846  case kpidedxSigmaTPCCut:
847  if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
848  fCuts[kpidedxSigmaTPCCut] = value;
849  UpdateCutString();
850  return kTRUE;
851  } else return kFALSE;
852 
854  if( SetMinMomPiondEdxTPCCut(value)) {
856  UpdateCutString();
857  return kTRUE;
858  } else return kFALSE;
859 
861  if( SetMaxMomPiondEdxTPCCut(value)) {
863  UpdateCutString();
864  return kTRUE;
865  } else return kFALSE;
866 
868  if( SetLowPRejectionCuts(value) ) {
869  fCuts[kLowPRejectionSigmaCut] = value;
870  UpdateCutString();
871  return kTRUE;
872  } else return kFALSE;
873 
874 
875  case kTOFelectronPID:
876  if( SetTOFElectronPIDCut(value)) {
877  fCuts[kTOFelectronPID] = value;
878  UpdateCutString();
879  return kTRUE;
880  } else return kFALSE;
881  case kclsITSCut:
882  if( SetITSClusterCut(value) ) {
883  fCuts[kclsITSCut] = value;
884  UpdateCutString();
885  return kTRUE;
886  } else return kFALSE;
887  case kclsTPCCut:
888  if( SetTPCClusterCut(value)) {
889  fCuts[kclsTPCCut] = value;
890  UpdateCutString();
891  return kTRUE;
892  } else return kFALSE;
893 
894  case ketaCut:
895  if( SetEtaCut(value)) {
896  fCuts[ketaCut] = value;
897  UpdateCutString();
898  return kTRUE;
899  } else return kFALSE;
900  case kptCut:
901  if( SetPtCut(value)) {
902  fCuts[kptCut] = value;
903  UpdateCutString();
904  return kTRUE;
905  } else return kFALSE;
906 
907  case kDCACut:
908  if( SetDCACut(value)) {
909  fCuts[kDCACut] = value;
910  UpdateCutString();
911  return kTRUE;
912  } else return kFALSE;
913 
914 
915  case kPsiPair:
916  if( SetPsiPairCut(value)) {
917  fCuts[kPsiPair] = value;
918  UpdateCutString();
919  return kTRUE;
920  } else return kFALSE;
921 
923  if( SetRejectSharedElecGamma(value)) {
924  fCuts[kRejectSharedElecGamma] = value;
925  UpdateCutString();
926  return kTRUE;
927  } else return kFALSE;
928 
930  if( SetMaxChi2PerClusterTPC(value)) {
931  fCuts[kMaxChi2PerClusterTPC] = value;
932  UpdateCutString();
933  return kTRUE;
934  } else return kFALSE;
935 
937  if( SetMaxChi2PerClusterITS(value)) {
938  fCuts[kMaxChi2PerClusterITS] = value;
939  UpdateCutString();
940  return kTRUE;
941  } else return kFALSE;
942 
943  case kmassCut:
944  if( SetMassCut(value)) {
945  fCuts[kmassCut] = value;
946  UpdateCutString();
947  return kTRUE;
948  } else return kFALSE;
949  case kWeights:
950  if( SetDoWeights(value)) {
951  fCuts[kWeights] = value;
952  UpdateCutString();
953  return kTRUE;
954  } else return kFALSE;
955 
957  if( SetUseVPhotonMCPmearing(value)) {
958  fCuts[kuseVPhotonMCPSmearing] = value;
959  UpdateCutString();
960  return kTRUE;
961  } else return kFALSE;
962 
963  case kNCuts:
964  cout << "Error:: Cut id out of range"<< endl;
965  return kFALSE;
966  }
967 
968  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
969  return kFALSE;
970 
971  //PrintCuts();
972 
973 }
974 
976 
978  // Print out current Cut Selection
979  for(Int_t ic = 0; ic < kNCuts; ic++) {
980  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
981  }
982 
983 }
986 {
987  if( !fesdTrackCuts ) {
988  cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
989  return kFALSE;
990  }
991 
992  switch( maxChi2 ){
993  case 0: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(1e10);
994  break;
995  case 1: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(25.);
996  break;
997  case 2: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36.);
998  break;
999  case 3: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(49.);
1000  break;
1001  case 4: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(100.);
1002  break;
1003  default: cout<<"Warning: maxChi2 is not defined"<<maxChi2<<endl;
1004  return kFALSE;
1005  }
1006 
1007  return kTRUE;
1008 }
1011  // Set Cut
1012  switch(ededxSigmaCut){
1013  case 0:
1014  fDodEdxSigmaITSCut = kFALSE;
1017  break;
1018  case 1: // -10,10
1019  fDodEdxSigmaITSCut = kTRUE;
1022  break;
1023  case 2: // -6,7
1024  fDodEdxSigmaITSCut = kTRUE;
1027  break;
1028  case 3: // -5,5
1029  fDodEdxSigmaITSCut = kTRUE;
1032  break;
1033  case 4: // -4,5
1034  fDodEdxSigmaITSCut = kTRUE;
1037  break;
1038  case 5: // -3,5
1039  fDodEdxSigmaITSCut = kTRUE;
1042  break;
1043  case 6: // -4,4
1044  fDodEdxSigmaITSCut = kTRUE;
1047  break;
1048  case 7: // -2.5,4
1049  fDodEdxSigmaITSCut = kTRUE;
1052  break;
1053  case 8: // -2,3.5
1054  fDodEdxSigmaITSCut = kTRUE;
1057  break;
1058  default:
1059  cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1060  return kFALSE;
1061  }
1062  return kTRUE;
1063 }
1064 
1067  // Set Cut
1068  switch(ededxSigmaCut){
1069  case 0: fDodEdxSigmaTPCCut = kFALSE;
1072  break;
1073  case 1: // -10,10
1074  fDodEdxSigmaTPCCut = kTRUE;
1077  break;
1078  case 2: // -6,7
1079  fDodEdxSigmaTPCCut = kTRUE;
1082  break;
1083  case 3: // -5,5
1084  fDodEdxSigmaTPCCut = kTRUE;
1087  break;
1088  case 4: // -4,5
1089  fDodEdxSigmaTPCCut = kTRUE;
1092  break;
1093  case 5: // -3,5
1094  fDodEdxSigmaTPCCut = kTRUE;
1097  break;
1098  case 6: // -4,4
1099  fDodEdxSigmaTPCCut = kTRUE;
1102  break;
1103  case 7: // -2.5,4
1104  fDodEdxSigmaTPCCut = kTRUE;
1107  break;
1108  case 8: // -2,3.5
1109  fDodEdxSigmaTPCCut = kTRUE;
1112  break;
1113  case 9: // -3,4
1114  fDodEdxSigmaTPCCut = kTRUE;
1117  break;
1118  default:
1119  cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1120  return kFALSE;
1121  }
1122  return kTRUE;
1123 }
1124 
1127  // Set Cut
1128  switch(pidedxSigmaCut){
1129  case 0: fPIDnSigmaAbovePionLineTPC= 0;
1131  break;
1132  case 1: // -10
1133  fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1135  break;
1136  case 2: // 1
1137  fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1138  fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1139  break;
1140  case 3: // 0
1141  fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1142  fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1143  break;
1144  case 4: // 1
1147  break;
1148  case 5: // 1
1151  break;
1152  case 6: // 1
1155  break;
1156  case 7:
1157  fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1159  break;
1160  case 8: // 1
1161  fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1163  break;
1164  case 9: // 1
1167  break;
1168  case 10: // a
1171  break;
1172  case 11: // b
1175  break;
1176  case 12: // c
1179  break;
1180  default:
1181  cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1182  return kFALSE;
1183  }
1184  return kTRUE;
1185 }
1186 
1189 { // Set Cut
1190  switch(piMomdedxSigmaCut){
1191  case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1192  break;
1193  case 1: // 50.0 GeV
1195  break;
1196  case 2: // 20.0 GeV
1198  break;
1199  case 3: // 1.5 GeV
1201  break;
1202  case 4: // 1. GeV
1204  break;
1205  case 5: // 0.5 GeV
1207  break;
1208  case 6: // 0.4 GeV
1210  break;
1211  case 7: // 0.3 GeV
1213  break;
1214  case 8: // 0.25 GeV
1216  break;
1217  default:
1218  cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1219  return kFALSE;
1220  }
1221  return kTRUE;
1222 }
1225 fITSCut=clsITSCut;//Important to update AOD, if yoy modifiy this options, please updated it on function AcceptedAODESDTrack
1226  if( !fesdTrackCuts ) {
1227  cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1228  return kFALSE;
1229  }
1230 
1231  switch(clsITSCut){
1232  case 0:
1233  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1234  break;
1235  case 1:
1236  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1237  break; //1 hit first layer of SPD
1238  case 2:
1239  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1240  break; //1 hit in any layer of SPD
1241  case 3:
1242  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1243  fesdTrackCuts->SetMinNClustersITS(4);
1244  // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1245  break;
1246  case 4:
1247  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1248  fesdTrackCuts->SetMinNClustersITS(3);
1249  // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1250  break;
1251  case 5:
1252  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1253  fesdTrackCuts->SetMinNClustersITS(4);
1254  // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1255  break;
1256  case 6:
1257  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1258  fesdTrackCuts->SetMinNClustersITS(5);
1259  // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1260  break;
1261  case 7:
1262  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1263  fesdTrackCuts->SetMinNClustersITS(4);
1264  break;
1265  case 8:
1266  fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1267  break;
1268  case 9: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1269  fesdTrackCuts->SetMinNClustersITS(4);
1270  break;
1271 
1272  default:
1273  cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1274  return kFALSE;
1275  }
1276 
1277  return kTRUE;
1278 }
1279 
1282 { // Set Cut
1283 
1284  //Update function for systematics 2015-10-08
1285  switch(clsTPCCut){
1286  case 0: // 0
1287  fMinClsTPC= 0.;
1288  fMinClsTPCToF = 0.;
1289  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1290  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1291  break;
1292 
1293  case 1: // 70
1294  fMinClsTPC= 70.;
1295  fMinClsTPCToF = 0.7;
1296  if( fUseCrossedRows ){
1297  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1298  fesdTrackCuts->SetMinNClustersTPC(0);
1299  } else {
1300  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1301  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1303  }
1304  break;
1305  case 2: // 80
1306  fMinClsTPC = 70.;
1307  fMinClsTPCToF = 0.9;
1308  if( fUseCrossedRows ){
1309  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1310  fesdTrackCuts->SetMinNClustersTPC(0);
1311  } else {
1312  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1313  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1315  }
1316  break;
1317  case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1318  fMinClsTPC = 70;
1319  fMinClsTPCToF = 0.8;
1320  if( fUseCrossedRows ){
1321  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1322  fesdTrackCuts->SetMinNClustersTPC(0);
1323  } else {
1324  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1325  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1327  }
1328  //fUseCrossedRows = kTRUE;
1329  break;
1330  case 4: // 0% of findable clusters
1331  fMinClsTPC = 90;
1332  fMinClsTPCToF = 0.8;
1333  if( fUseCrossedRows ){
1334  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1335  fesdTrackCuts->SetMinNClustersTPC(0);
1336  } else {
1337  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1338  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1340  }
1341  break;
1342  case 5: // 35% of findable clusters
1343  fMinClsTPC = 70;
1344  fMinClsTPCToF = 0.35;
1345  if( fUseCrossedRows ){
1346  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1347  fesdTrackCuts->SetMinNClustersTPC(0);
1348  } else {
1349  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1350  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1352  }
1353  break;
1354  case 6: // 60% of findable clusters
1355  fMinClsTPC = 70;
1356  fMinClsTPCToF = 0.60;
1357  if( fUseCrossedRows ){
1358  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1359  fesdTrackCuts->SetMinNClustersTPC(0);
1360  } else {
1361  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1362  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1364  }
1365  break;
1366  case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1367  // Changed 2014-02-04 before fMinClsTPC = 50.;
1368  fMinClsTPC = 90;
1369  fMinClsTPCToF = 0.35;
1370  if( fUseCrossedRows ){
1371  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1372  fesdTrackCuts->SetMinNClustersTPC(0);
1373  } else {
1374  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1375  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1377  }
1378  break;
1379 
1380  case 8: fMinClsTPC = 0;
1381  fMinClsTPCToF = 0.35;
1382  if( fUseCrossedRows ){
1383  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1384  fesdTrackCuts->SetMinNClustersTPC(0);
1385  } else {
1386  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1387  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1389  }
1390  break;
1391 
1392  case 9: // 35% of findable clusters
1393  fMinClsTPC = 70;
1394  fMinClsTPCToF = 0.35;
1395  if( fUseCrossedRows ){
1396  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1397  fesdTrackCuts->SetMinNClustersTPC(0);
1398  } else {
1399  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1400  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1402  }
1403  break;
1404 
1405  default:
1406  cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1407  return kFALSE;
1408  }
1409  return kTRUE;
1410 }
1411 
1414 {
1415  // Set eta Cut
1416  switch(etaCut){
1417  case 0:
1418  fEtaCut = 100.;
1419  fDoEtaCut = kFALSE;
1420  break;
1421  case 1: // 1.4
1422  fEtaCut = 1.4;
1423  fDoEtaCut = kTRUE;
1424  break;
1425  case 2: // 1.2
1426  fEtaCut = 1.2;
1427  fDoEtaCut = kTRUE;
1428  break;
1429  case 3: // 0.9
1430  fEtaCut = 0.9;
1431  fDoEtaCut = kTRUE;
1432  break;
1433  case 4: // 0.8
1434  fEtaCut = 0.8;
1435  fDoEtaCut = kTRUE;
1436  break;
1437  case 5: // 0.75
1438  fEtaCut = 0.75;
1439  fDoEtaCut = kTRUE;
1440  break;
1441  case 6: //0.6
1442  fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1443  fDoEtaCut = kTRUE;
1444  break;
1445  case 7: //0.5
1446  fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1447  fDoEtaCut = kTRUE;
1448  break;
1449  case 8: fEtaCut = 0.4;
1450  fDoEtaCut = kTRUE;
1451  break;
1452  case 9: fEtaCut = 0.65;
1453  fDoEtaCut = kTRUE;
1454  break;
1455  default:
1456  cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1457  return kFALSE;
1458  }
1459  return kTRUE;
1460 }
1461 
1464 {
1465  // Set Pt Cut
1466  //0.1GeV, 0.125 GeV, 0.15 GeV
1467  switch(ptCut){
1468  case 0: fPtMinCut = 0.075;
1469  fPtMaxCut = 9999;
1470  break;
1471  case 1: // 0.1
1472  fPtMinCut = 0.1;
1473  fPtMaxCut = 9999;
1474  break;
1475  case 2: // 0.125 GeV
1476  fPtMinCut = 0.125;
1477  fPtMaxCut = 9999;
1478  break;
1479  case 3: // 0.15 GeV
1480  fPtMinCut = 0.15;
1481  fPtMaxCut = 9999;
1482  break;
1483  // 0.5 - 0.7
1484  case 4:
1485  fPtMinCut = 0.5;
1486  fPtMaxCut = 0.7;
1487  break;
1488  case 5: // 0.175 GeV
1489  fPtMinCut = 0.175;
1490  fPtMaxCut = 9999;
1491  break;
1492  // 50 MeV
1493  case 6:
1494  fPtMinCut = 0.05;
1495  fPtMaxCut = 9999;
1496  break;
1497  case 7:
1498  fPtMinCut = 0.9;
1499  fPtMaxCut = 9999;
1500  break;
1501  default:
1502  cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1503  return kFALSE;
1504  }
1505  return kTRUE;
1506 }
1507 
1508 
1511 {
1512  // Set DCA Cut
1513  if( !fesdTrackCuts ) {
1514  cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1515  return kFALSE;
1516  }
1517 
1518  switch(dcaCut){
1519  case 0: //Open cuts//
1520  fMaxDCAVertexxy=1000.;
1521  fMaxDCAVertexz=1000.;
1522  fDCAVertexPt="no";
1523  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1524  fesdTrackCuts->SetMaxDCAToVertexXY(fMaxDCAVertexxy);
1525  break;
1526  case 1:
1527  fMaxDCAVertexxy=1000.;
1528  fMaxDCAVertexz=2.;
1529  fDCAVertexPt="0.0182+0.0350/pt^1.01";
1530  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data()); //Standard 2010
1531  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1532  break;
1533  case 2:
1534  fMaxDCAVertexxy=1.;
1535  fMaxDCAVertexz=2.;
1536  fDCAVertexPt="no";
1537  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1538  fesdTrackCuts->SetMaxDCAToVertexXY(fMaxDCAVertexxy);
1539  break;
1540  case 3:
1541  fMaxDCAVertexxy=1000.;
1542  fMaxDCAVertexz=2.;
1543  fDCAVertexPt="0.0105+0.0350/pt^1.1";
1544  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data()); //Standard 2011
1545  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1546  break;
1547  case 4:
1548  fMaxDCAVertexxy=1000.;
1549  fMaxDCAVertexz=2.;
1550  fDCAVertexPt="0.0525+0.175/pt^1.1";
1551  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data());
1552  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1553  break;
1554  case 5:
1555  fMaxDCAVertexxy=1000.;
1556  fMaxDCAVertexz=1.;
1557  fDCAVertexPt="0.0182+0.0350/pt^1.01";
1558  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data());
1559  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1560  break;
1561  case 6:
1562  fMaxDCAVertexxy=1000.;
1563  fMaxDCAVertexz=5.;
1564  fDCAVertexPt="0.0182+0.0350/pt^1.01";
1565  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data());
1566  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1567  break;
1568  case 7:
1569  fMaxDCAVertexxy=1000.;
1570  fMaxDCAVertexz=1.;
1571  fDCAVertexPt="0.0105+0.0350/pt^1.1";
1572  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data()); //Standard 2011
1573  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1574  break;
1575  case 8:
1576  fMaxDCAVertexxy=1000.;
1577  fMaxDCAVertexz=5.;
1578  fDCAVertexPt="0.0105+0.0350/pt^1.1";
1579  fesdTrackCuts->SetMaxDCAToVertexXYPtDep(fDCAVertexPt.Data()); //Standard 2011
1580  fesdTrackCuts->SetMaxDCAToVertexZ(fMaxDCAVertexz);
1581  break;
1582  default:
1583  cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1584  return kFALSE;
1585  }
1586  return kTRUE;
1587 }
1588 
1591 { // Set Cut
1592  switch(piMaxMomdedxSigmaCut){
1593  case 0:
1595  break;
1596  case 1: // 100. GeV
1598  break;
1599  case 2: // 5. GeV
1601  break;
1602  case 3: // 4. GeV
1604  break;
1605  case 4: // 3.5 GeV
1607  break;
1608  case 5: // 3. GeV
1610  break;
1611  case 6: // 2. GeV
1613  break;
1614  default:
1615  cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1616  return kFALSE;
1617  }
1618  return kTRUE;
1619 }
1620 
1623 { // Set Cut
1624  switch(LowPRejectionSigmaCut){
1625  case 0: //
1626  fDoKaonRejectionLowP=kFALSE;
1627  fDoProtonRejectionLowP=kFALSE;
1628  fDoPionRejectionLowP=kFALSE;
1633  break;
1634  case 1: //
1635  fDoKaonRejectionLowP=kTRUE;
1636  fDoProtonRejectionLowP=kTRUE;
1637  fDoPionRejectionLowP=kTRUE;
1642  break;
1643  case 2: //
1644  fDoKaonRejectionLowP=kTRUE;
1645  fDoProtonRejectionLowP=kTRUE;
1646  fDoPionRejectionLowP=kTRUE;
1651  break;
1652  case 3: //
1653  fDoKaonRejectionLowP=kTRUE;
1654  fDoProtonRejectionLowP=kTRUE;
1655  fDoPionRejectionLowP=kTRUE;
1660  break;
1661  case 4: //
1662  fDoKaonRejectionLowP=kTRUE;
1663  fDoProtonRejectionLowP=kTRUE;
1664  fDoPionRejectionLowP=kTRUE;
1669  break;
1670  case 5: //
1671  fDoKaonRejectionLowP=kTRUE;
1672  fDoProtonRejectionLowP=kTRUE;
1673  fDoPionRejectionLowP=kTRUE;
1678  break;
1679  case 6: //
1680  fDoKaonRejectionLowP=kTRUE;
1681  fDoProtonRejectionLowP=kTRUE;
1682  fDoPionRejectionLowP=kTRUE;
1687  break;
1688  case 7: //
1689  fDoKaonRejectionLowP=kFALSE;
1690  fDoProtonRejectionLowP=kFALSE;
1691  fDoPionRejectionLowP=kTRUE;
1696  break;
1697  case 8:
1698  fDoKaonRejectionLowP=kFALSE;
1699  fDoProtonRejectionLowP=kFALSE;
1700  fDoPionRejectionLowP=kTRUE;
1705  break;
1706  default:
1707  cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1708  return kFALSE;
1709  }
1710  return kTRUE;
1711 }
1712 
1715  // Set Cut
1716  switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1717  case 0: // no cut
1718  fRequireTOF = kFALSE;
1719  fUseTOFpid = kFALSE;
1722  break;
1723  case 1: // -7,7
1724  fRequireTOF = kFALSE;
1725  fUseTOFpid = kTRUE;
1728  break;
1729  case 2: // -5,5
1730  fRequireTOF = kFALSE;
1731  fUseTOFpid = kTRUE;
1734  break;
1735  case 3: // -3,5
1736  fRequireTOF = kFALSE;
1737  fUseTOFpid = kTRUE;
1740  break;
1741  case 4: // -2,3
1742  fRequireTOF = kFALSE;
1743  fUseTOFpid = kTRUE;
1746  break;
1747  case 5: // -3, 3 TOF mandatory
1748  fRequireTOF = kTRUE;
1749  fUseTOFpid = kTRUE;
1752  break;
1753  default:
1754  cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1755  return kFALSE;
1756  }
1757  return kTRUE;
1758 }
1760 
1762  switch(psiCut) {
1763  case 0:
1764  fDoPsiPairCut = kFALSE;
1765  fPsiPairCut = 10000.; //
1766  fDeltaPhiCutMin = -1000.;
1767  fDeltaPhiCutMax = 1000.;
1768  break;
1769  case 1:
1770  fDoPsiPairCut = kTRUE;
1771  fPsiPairCut = 0.45; // Standard
1772  fDeltaPhiCutMin = 0.0;
1773  fDeltaPhiCutMax = 0.12;
1774  break;
1775  case 2:
1776  fDoPsiPairCut = kTRUE;
1777  fPsiPairCut = 0.60;
1778  fDeltaPhiCutMin = 0.0;
1779  fDeltaPhiCutMax = 0.12;
1780  break;
1781  case 3:
1782  fDoPsiPairCut = kTRUE;
1783  fPsiPairCut = 0.52;
1784  fDeltaPhiCutMin = 0.0;
1785  fDeltaPhiCutMax = 0.12;
1786  break;
1787  case 4:
1788  fDoPsiPairCut = kTRUE;
1789  fPsiPairCut = 0.30;
1790  fDeltaPhiCutMin = 0.0;
1791  fDeltaPhiCutMax = 0.12;
1792  break;
1793  case 5:
1794  fDoPsiPairCut = kTRUE;
1795  fPsiPairCut = 0.60;
1796  fDeltaPhiCutMin = 0.0;
1797  fDeltaPhiCutMax = 0.06;
1798  break;
1799  case 6:
1800  fDoPsiPairCut = kTRUE;
1801  fPsiPairCut = 0.65;
1802  fDeltaPhiCutMin = 0.0;
1803  fDeltaPhiCutMax = 0.14;
1804  break;
1805  default:
1806  cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1807  return kFALSE;
1808  }
1809  return kTRUE;
1810 }
1811 
1814  switch(RCut) {
1815  case 0:
1816  fDoRejectSharedElecGamma = kFALSE;
1817  fRadiusCut = 10000; //
1818  break;
1819  case 1:
1820  fDoRejectSharedElecGamma = kTRUE;
1821  fRadiusCut = 2.0; // cm
1822  break;
1823  case 2:
1824  fDoRejectSharedElecGamma = kTRUE;
1825  fRadiusCut = 3.0; // Standard
1826  break;
1827  case 3:
1828  fDoRejectSharedElecGamma = kTRUE;
1829  fRadiusCut = 4.0; //
1830  break;
1831  case 4:
1832  fDoRejectSharedElecGamma = kTRUE;
1833  fRadiusCut = 5.0; //
1834  break;
1835  case 5:
1836  fDoRejectSharedElecGamma = kTRUE;
1837  fRadiusCut = 10.0; //
1838  break;
1839  case 6:
1840  fDoRejectSharedElecGamma = kTRUE;
1841  fRadiusCut = 15.0; //
1842  break;
1843  default:
1844  cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1845  return kFALSE;
1846  }
1847  return kTRUE;
1848 }
1851 
1852  if( !fesdTrackCuts ) {
1853  cout<<"Warning: AliESDtrackCuts is not initialized "<<endl;
1854  return kFALSE;
1855  }
1856 
1857  // Set Cut
1858  switch(maxChi2){
1859  case 0:
1860  fesdTrackCuts->SetMaxChi2PerClusterTPC(1e10);
1861  break;
1862  case 1:
1863  fesdTrackCuts->SetMaxChi2PerClusterTPC(3.);
1864  break;
1865  case 2:
1866  fesdTrackCuts->SetMaxChi2PerClusterTPC(4.);
1867  break;
1868  case 3:
1869  fesdTrackCuts->SetMaxChi2PerClusterTPC(5.);
1870  break;
1871  default:
1872  cout<<"Warning: SetMaxChi2PerClusterTPC not defined "<<maxChi2<<endl;
1873  return kFALSE;
1874  }
1875  return kTRUE;
1876 }
1877 
1880 { // Set Cut
1881  if( !fesdTrackCuts ) {
1882  cout<<"Warning: AliESDtrackCuts is not initialized "<<endl;
1883  return kFALSE;
1884  }
1885 
1886  switch(maxChi2){
1887  case 0:
1888  fesdTrackCuts->SetMaxChi2PerClusterITS(1e10);
1889  break;
1890  case 1:
1891  fesdTrackCuts->SetMaxChi2PerClusterITS(25.);
1892  break;
1893  case 2:
1894  fesdTrackCuts->SetMaxChi2PerClusterITS(36.);
1895  break;
1896  case 3:
1897  fesdTrackCuts->SetMaxChi2PerClusterITS(49.);
1898  break;
1899  default:
1900  cout<<"Warning: SetMaxChi2PerClusterITS not defined "<<maxChi2<<endl;
1901  return kFALSE;
1902  }
1903  return kTRUE;
1904 }
1905 
1908 { // Set Cut
1909  switch(opc){
1910  case 0:
1911  fDoWeights = kFALSE;
1912  break;
1913  case 1:
1914  fDoWeights = kTRUE;
1915  break;
1916  default:
1917  cout<<"Warning: Weights option not defined "<<opc<<endl;
1918  return kFALSE;
1919  }
1920  return kTRUE;
1921 }
1924 { // Set Cut
1925  switch(massCut){
1926  case 0:
1927  fMassCutPtMin = -999.; //GeV
1928  fMassCutLowPt = 999.; //GeV/c^2
1929  fMassCutHighPt = 999.; //GeV/c^2
1930  fMassMinCut = -999;
1931  fDoMassCut = kFALSE;
1932  fDoMassMinCut = kFALSE;
1933  break;
1934  case 1:
1935  //fMassCut = 0.135; //GeV/c^2
1936  fMassCutPtMin = -999.; //GeV
1937  fMassCutLowPt = 0.135; //GeV/c^2
1938  fMassCutHighPt = 0.135; //GeV/c^2
1939  fMassMinCut = -999;
1940  fDoMassCut = kTRUE;
1941  fDoMassMinCut = kFALSE;
1942  break;
1943  case 2:
1944  //fMassCut = 0.100; //GeV/c^2
1945  fMassCutPtMin = -999.; //GeV
1946  fMassCutLowPt = 0.100; //GeV/c^2
1947  fMassCutHighPt = 0.100; //GeV/c^2
1948  fMassMinCut = -999;
1949  fDoMassCut = kTRUE;
1950  fDoMassMinCut = kFALSE;
1951  break;
1952  case 3:
1953  fMassCutPtMin = 1.0; //GeV
1954  fMassCutLowPt = 0.015; //GeV/c^2
1955  fMassCutHighPt = 0.035; //GeV/c^2
1956  fMassMinCut = 0.002;
1957  fDoMassCut = kTRUE;
1958  fDoMassMinCut = kTRUE;
1959  break;
1960  case 4:
1961  //fMassCut = 0.050; //GeV/c^2
1962  fMassCutPtMin = -999.; //GeV
1963  fMassCutLowPt = 0.050; //GeV/c^2
1964  fMassCutHighPt = 0.050; //GeV/c^2
1965  fMassMinCut = -999;
1966  fDoMassCut = kTRUE;
1967  fDoMassMinCut = kFALSE;
1968  break;
1969  case 5:
1970  fMassCutPtMin = -999.; //GeV
1971  fMassCutLowPt = 0.035; //GeV/c^2
1972  fMassCutHighPt = 0.035; //GeV/c^2
1973  fMassMinCut = -999;
1974  fDoMassCut = kTRUE;
1975  fDoMassMinCut = kFALSE;
1976  break;
1977  case 6:
1978  fMassCutPtMin = -999.; //GeV
1979  fMassCutLowPt = 0.015; //GeV/c^2
1980  fMassCutHighPt = 0.015; //GeV/c^2
1981  fMassMinCut = -999;
1982  fDoMassCut = kTRUE;
1983  fDoMassMinCut = kFALSE;
1984  break;
1985  case 7:
1986  fMassCutPtMin = 1.0; //GeV
1987  fMassCutLowPt = 0.015; //GeV/c^2
1988  fMassCutHighPt = 0.035; //GeV/c^2
1989  fMassMinCut = -999;
1990  fDoMassCut = kTRUE;
1991  fDoMassMinCut = kFALSE;
1992  break;
1993  case 8:
1994  fMassCutPtMin = 1.0; //GeV
1995  fMassCutLowPt = 0.015; //GeV/c^2
1996  fMassCutHighPt = 0.050; //GeV/c^2
1997  fMassMinCut = -999;
1998  fDoMassCut = kTRUE;
1999  fDoMassMinCut = kFALSE;
2000  break;
2001  case 9:
2002  fMassCutPtMin = 1.0; //GeV
2003  fMassCutLowPt = 0.025; //GeV/c^2
2004  fMassCutHighPt = 0.035; //GeV/c^2
2005  fMassMinCut = -999;
2006  fDoMassCut = kTRUE;
2007  fDoMassMinCut = kFALSE;
2008  break;
2009  case 10: //a
2010  fMassCutPtMin = 1.0; //GeV
2011  fMassCutLowPt = 0.02; //GeV/c^2
2012  fMassCutHighPt = 0.03; //GeV/c^2
2013  fMassMinCut = -999;
2014  fDoMassCut = kTRUE;
2015  fDoMassMinCut = kFALSE;
2016  break;
2017  case 11: //b
2018  fMassCutPtMin = 1.0; //GeV
2019  fMassCutLowPt = 0.027; //GeV/c^2
2020  fMassCutHighPt = 0.054; //GeV/c^2
2021  fMassMinCut = -999;
2022  fDoMassCut = kTRUE;
2023  fDoMassMinCut = kFALSE;
2024  break;
2025  case 12: //c
2026  fMassCutPtMin = 1.0; //GeV
2027  fMassCutLowPt = 0.02; //GeV/c^2
2028  fMassCutHighPt = 0.02; //GeV/c^2
2029  fMassMinCut = -999;
2030  fDoMassCut = kTRUE;
2031  fDoMassMinCut = kFALSE;
2032  break;
2033  case 13: //d
2034  fMassCutPtMin = 1.0; //GeV
2035  fMassCutLowPt = 0.04; //GeV/c^2
2036  fMassCutHighPt = 0.04; //GeV/c^2
2037  fMassMinCut = -999;
2038  fDoMassCut = kTRUE;
2039  fDoMassMinCut = kFALSE;
2040  break;
2041  case 14: //e
2042  fMassCutPtMin = 1.0; //GeV
2043  fMassCutLowPt = 0.06; //GeV/c^2
2044  fMassCutHighPt = 0.06; //GeV/c^2
2045  fMassMinCut = -999;
2046  fDoMassCut = kTRUE;
2047  fDoMassMinCut = kFALSE;
2048  break;
2049  case 15: //f
2050  fMassCutPtMin = 1.0; //GeV
2051  fMassCutLowPt = 0.08; //GeV/c^2
2052  fMassCutHighPt = 0.08; //GeV/c^2
2053  fMassMinCut = -999;
2054  fDoMassCut = kTRUE;
2055  fDoMassMinCut = kFALSE;
2056  break;
2057  case 16: //g
2058  fMassCutPtMin = 1.0; //GeV
2059  fMassCutLowPt = 0.15; //GeV/c^2
2060  fMassCutHighPt = 0.15; //GeV/c^2
2061  fMassMinCut = -999;
2062  fDoMassCut = kTRUE;
2063  fDoMassMinCut = kFALSE;
2064  break;
2065  case 17: //h
2066  fMassCutPtMin = 1.0; //GeV
2067  fMassCutLowPt = 0.2; //GeV/c^2
2068  fMassCutHighPt = 0.2; //GeV/c^2
2069  fMassMinCut = -999;
2070  fDoMassCut = kTRUE;
2071  fDoMassMinCut = kFALSE;
2072  break;
2073  default:
2074  cout<<"Warning: MassCut not defined "<<massCut<<endl;
2075  return kFALSE;
2076  }
2077  return kTRUE;
2078 }
2080 {// Set Cut
2081  switch(useMCPSmearing){
2082  case 0:
2083  fUseVPhotonMCPSmearing=kFALSE;
2084  fUseElectronMCPSmearing=kFALSE;
2085  break;
2086  case 1:
2087  fUseVPhotonMCPSmearing=kTRUE;
2088  fUseElectronMCPSmearing=kFALSE;
2089  break;
2090  case 2:
2091  fUseVPhotonMCPSmearing=kFALSE;
2093  break;
2094  default: cout<<"Warning: Virtual Photon SMearing not defined "<<useMCPSmearing<<endl;
2095  return kFALSE;
2096 
2097  }
2098  return kTRUE;
2099 }
2100 
2101 
2104  // returns TString with current cut number
2105  return fCutStringRead;
2106 }
2107 
2108 
2111  //Create and return standard 2010 PbPb cuts
2112  AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
2113  if(!cuts->InitializeCutsFromCutString("9069640364102")){
2114  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
2115  return cuts;
2116 }
2117 
2120  //Create and return standard 2010 PbPb cuts
2121  AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
2122 
2123  if(!cuts->InitializeCutsFromCutString("9069640364102")){
2124  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
2125  return cuts;
2126 }
2127 
Bool_t SetMaxChi2PerClusterITS(Int_t maxChi2)
Bool_t ElectronIsSelectedMC(Int_t labelParticle, AliMCEvent *mcEvent)
static AliDalitzElectronCuts * GetStandardCuts2010pp()
Bool_t SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
double Double_t
Definition: External.C:58
Bool_t SetDCACut(Int_t dcaCut)
Bool_t MassCut(Double_t pi0CandidatePt, Double_t vphotonCandidateMass)
Bool_t SetPtCut(Int_t ptCut)
Definition: External.C:236
const char * title
Definition: MakeQAPdf.C:27
Bool_t SetRejectSharedElecGamma(Int_t RCut)
AliAODTrack * GetDalitzAODTrack()
#define ASSIGNARRAY(i)
Bool_t HasPointOnITSLayerG(Int_t i)
AliDalitzAODESDMC * Particle(Int_t i)
Bool_t SetTPCClusterCut(Int_t clsTPCCut)
Bool_t RejectSharedElecGamma(TList *photons, Int_t indexEle)
AliESDtrack * GetDalitzESDTrack()
AliESDtrackCuts * fesdTrackCuts
Double_t GetNFindableClustersTPC(AliDalitzAODESD *lTrack)
Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
const AliExternalTrackParam * GetParamG()
Bool_t AcceptedAODESDTrack(AliDalitzAODESD *aliaodtrack)
int Int_t
Definition: External.C:63
AliVTrack * GetDalitzVTrack()
Double_t GetTPCNclsFG()
float Float_t
Definition: External.C:68
Bool_t SetUseVPhotonMCPmearing(Int_t useMCPSmearing)
Bool_t SetMaxMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
Bool_t SetMaxChi2TPCConstrainedGlobal(Int_t maxChi2)
Bool_t SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
Bool_t SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
Bool_t TrackIsSelected(AliDalitzAODESD *lTrack)
void GetImpactParametersG(Float_t *p, Float_t *cov) const
AliDalitzElectronCuts(const char *name="ElectronCuts", const char *title="Electron Cuts")
Bool_t SetEtaCut(Int_t etaCut)
static AliVTrack * GetTrack(AliVEvent *event, Int_t label)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Bool_t dEdxCuts(AliVTrack *track)
Cut functions.
Bool_t ElectronIsSelected(AliESDtrack *lTrack)
Double_t GetTPCCrossedRowsG()
Bool_t SetMaxChi2PerClusterTPC(Int_t maxChi2)
static const char * fgkCutNames[kNCuts]
Bool_t IsFromGammaConversion(Double_t psiPair, Double_t deltaPhi)
Bool_t SetITSClusterCut(Int_t clsITSCut)
Bool_t SetMassCut(Int_t massCut)
static AliDalitzElectronCuts * GetStandardCuts2010PbPb()
bool Bool_t
Definition: External.C:53
Bool_t SetCut(cutIds cutID, Int_t cut)
Bool_t InitializeCutsFromCutString(const TString analysisCutSelection)
Bool_t SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
Bool_t SetPsiPairCut(Int_t psiCut)
void InitCutHistograms(TString name="", Bool_t preCut=kTRUE, TString cutName="")
Double_t GetConversionRadius() const
Bool_t SetTOFElectronPIDCut(Int_t TOFelectronPID)