AliPhysics  3337bb0 (3337bb0)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 "TList.h"
42 class iostream;
43 
44 using namespace std;
45 
46 ClassImp(AliDalitzElectronCuts)
47 
48 
49 const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {
50 "MaxChi2TPCConstrainedGlobal",
51 "ededxSigmaITSCut",
52 "ededxSigmaTPCCut",
53 "pidedxSigmaTPCCut",
54 "piMinMomdedxSigmaTPCCut",
55 "piMaxMomdedxSigmaTPCCut",
56 "LowPRejectionSigmaCut",
57 "kTOFelectronPID",
58 "clsITSCut",
59 "clsTPCCut",
60 "EtaCut",
61 "PsiPair",
62 "RejectSharedElecGamma",
63 "MaxChi2PerClusterTPC",
64 "MaxChi2PerClusterITS",
65 "PtCut",
66 "DCAcut",
67 "MassCut",
68 "Weights",
69 "VPhotonMCPSmearing"
70 };
71 
72 //________________________________________________________________________
73 AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),
74  fHistograms(NULL),
75  fPIDResponse(NULL),
76  fesdTrackCuts(NULL),
77  fEtaCut(0.9),
78  fDoEtaCut(kFALSE),
79  fPtMinCut(0.0),
80  fPtMaxCut(9999),
81  fRadiusCut(1000.0),
82  fPsiPairCut(0.45),
83  fDeltaPhiCutMin(0.),
84  fDeltaPhiCutMax(0.12),
85  fMinClsTPC(0), // minimum clusters in the TPC
86  fMinClsTPCToF(0), // minimum clusters to findable clusters
87  fDodEdxSigmaITSCut(kFALSE),
88  fDodEdxSigmaTPCCut(kTRUE),
89  fDoTOFsigmaCut(kFALSE), // RRnewTOF
90  fDoRejectSharedElecGamma(kFALSE),
91  fDoPsiPairCut(kFALSE),
92  fPIDnSigmaAboveElectronLineITS(100),
93  fPIDnSigmaBelowElectronLineITS(-100),
94  fPIDnSigmaAboveElectronLineTPC(100),
95  fPIDnSigmaBelowElectronLineTPC(-100),
96  fPIDnSigmaAbovePionLineTPC(0),
97  fPIDnSigmaAbovePionLineTPCHighPt(-100),
98  fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
99  fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
100  fPIDMinPnSigmaAbovePionLineTPC(0),
101  fPIDMaxPnSigmaAbovePionLineTPC(0),
102  fDoKaonRejectionLowP(kFALSE),
103  fDoProtonRejectionLowP(kFALSE),
104  fDoPionRejectionLowP(kFALSE),
105  fPIDnSigmaAtLowPAroundKaonLine(0),
106  fPIDnSigmaAtLowPAroundProtonLine(0),
107  fPIDnSigmaAtLowPAroundPionLine(0),
108  fPIDMinPKaonRejectionLowP(1.5),
109  fPIDMinPProtonRejectionLowP(2.0),
110  fPIDMinPPionRejectionLowP(0.5),
111  fUseCorrectedTPCClsInfo(kFALSE),
112  fUseCrossedRows(kFALSE),
113  fUseTOFpid(kFALSE),
114  fRequireTOF(kFALSE),
115  fDoMassCut(kFALSE),
116  fDoMassMinCut(kFALSE),
117  fMassCutLowPt(999.),
118  fMassCutHighPt(999.),
119  fMassCutPtMin(-100.0),
120  fMassMinCut(-999.),
121  fDoWeights(kFALSE),
122  fUseVPhotonMCPSmearing(kFALSE),
123  fUseElectronMCPSmearing(kFALSE),
124  fCutString(NULL),
125  fCutStringRead(""),
126  hCutIndex(NULL),
127  hdEdxCuts(NULL),
128  hITSdEdxbefore(NULL),
129  hITSdEdxafter(NULL),
130  hTPCdEdxbefore(NULL),
131  hTPCdEdxafter(NULL),
132  hTPCdEdxSignalbefore(NULL),
133  hTPCdEdxSignalafter(NULL),
134  hTOFbefore(NULL),
135  hTOFafter(NULL),
136  hTrackDCAxyPtbefore(NULL),
137  hTrackDCAxyPtafter(NULL),
138  hTrackDCAzPtbefore(NULL),
139  hTrackDCAzPtafter(NULL),
140  hTrackNFindClsPtTPCbefore(NULL),
141  hTrackNFindClsPtTPCafter(NULL),
142  hTrackPosEtabeforeDedx(NULL),
143  hTrackNegEtabeforeDedx(NULL),
144  hTrackPosEtaafterDedx(NULL),
145  hTrackNegEtaafterDedx(NULL)
146  {
147  InitPIDResponse();
148  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
149  fCutString=new TObjString((GetCutNumber()).Data());
150 
151  //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
152  // Using standard function for setting Cuts
153  Bool_t selectPrimaries=kFALSE;
154  fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
155 }
156 
157 //________________________________________________________________________
159  // Destructor
160  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
161  // if(fHistograms)
162  // delete fHistograms;
163  // fHistograms = NULL;
164 
165  if(fCutString != NULL){
166  delete fCutString;
167  fCutString = NULL;
168  }
169 
170 
171 }
172 
173 //________________________________________________________________________
175 
176  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
177 
178  TH1::AddDirectory(kFALSE);
179 
180  TString cutName = "";
181 
182  if( cutNumber==""){
183  cutName = GetCutNumber().Data();
184  }
185  else {
186  cutName = cutNumber.Data();
187  }
188 
189  if(fHistograms != NULL){
190  delete fHistograms;
191  fHistograms=NULL;
192  }
193  if(fHistograms==NULL){
194  fHistograms=new TList();
195  if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
196  else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
197  }
198 
199 
200  Int_t kDedxSignalbins = 200;
201 
202  const Int_t kDCABins=62;
203 
204  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};
205 
206  const Int_t kPtBins=110;
207  Double_t binsPtDummy[kPtBins+1];
208  const Int_t kPBins = 109;
209  Double_t binsPDummy[kPBins+1];
210  binsPtDummy[0]=0.0;
211  binsPDummy[0]=0.05;
212 
213  for(Int_t i=1;i<kPtBins+1;i++)
214  {
215  if(binsPtDummy[i-1]+0.05<1.01)
216  binsPtDummy[i]=binsPtDummy[i-1]+0.05;
217  else
218  binsPtDummy[i]=binsPtDummy[i-1]+0.1;
219 
220  }
221  for(Int_t i=1; i <kPBins+1;i++){
222 
223  if( binsPDummy[i-1]+0.05<1.01)
224  binsPDummy[i] = binsPDummy[i-1]+0.05;
225  else
226  binsPDummy[i] = binsPDummy[i-1]+0.1;
227 
228  }
229 
230 
231 
232  hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
233  hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
234  hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
235  hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
236  hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
237  hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
238  fHistograms->Add(hCutIndex);
239 
240 
241 
242  // dEdx Cuts
243  hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
244  hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
245  hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
246  hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
247  hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
248  hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
249  hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
250  hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
251  hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
252  hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
253  hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
254  fHistograms->Add(hdEdxCuts);
255 
256 
257 
258  TAxis *AxisBeforeITS = NULL;
259  TAxis *AxisBeforedEdx = NULL;
260  TAxis *AxisBeforeTOF = NULL;
261  TAxis *AxisBeforedEdxSignal = NULL;
262 
263  if(preCut){
264 
265 
266  hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
268  AxisBeforeITS = hITSdEdxbefore->GetXaxis();
269 
270  hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
272  AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
273 
274  hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
276  AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
277 
278  hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
279  fHistograms->Add(hTOFbefore);
280  AxisBeforeTOF = hTOFbefore->GetXaxis();
281 
282  hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
284 
285  hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
287 
288  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);
290 
291 
292 
293  }
294 
295 
296  hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
298 
299  hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
301 
302  hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
304 
305  hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
306  fHistograms->Add(hTOFafter);
307 
308  hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
310 
311  hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
313 
314  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);
316 
317  hTrackPosEtabeforeDedx = new TH1F(Form("hTrack_Pos_Eta_before_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_before_Dedx",600,-1.5,1.5);
319 
320  hTrackNegEtabeforeDedx = new TH1F(Form("hTrack_Neg_Eta_before_Dedx %s",cutName.Data()),"hTrack_Neg_Eta_before_Dedx",600,-1.5,1.5);
322 
323  hTrackPosEtaafterDedx = new TH1F(Form("hTrack_Pos_Eta_after_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_after_Dedx",600,-1.5,1.5);
325 
326  hTrackNegEtaafterDedx = new TH1F(Form("hTrack_Neg_Eta_afterDedx %s",cutName.Data()),"hTrack_Neg_Eta_after_Dedx",600,-1.5,1.5);
328 
329 
330 
331  TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
332  Int_t bins = AxisAfter->GetNbins();
333  Double_t from = AxisAfter->GetXmin();
334  Double_t to = AxisAfter->GetXmax();
335  Double_t *newBins = new Double_t[bins+1];
336  newBins[0] = from;
337  Double_t factor = TMath::Power(to/from, 1./bins);
338  for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
339  AxisAfter->Set(bins, newBins);
340  AxisAfter = hTOFafter->GetXaxis();
341  AxisAfter->Set(bins, newBins);
342  AxisAfter = hITSdEdxafter->GetXaxis();
343  AxisAfter->Set(bins,newBins);
344  AxisAfter = hTPCdEdxSignalafter->GetXaxis();
345  AxisAfter->Set(bins,newBins);
346 
347  if(preCut){
348  AxisBeforeITS->Set(bins, newBins);
349  AxisBeforedEdx->Set(bins, newBins);
350  AxisBeforedEdxSignal->Set(bins,newBins);
351  AxisBeforeTOF->Set(bins, newBins);
352 
353  }
354  delete [] newBins;
355 
356  TH1::AddDirectory(kTRUE);
357 
358  // Event Cuts and Info
359 }
360 
361 
362 //________________________________________________________________________
364 
365 // Set Pointer to AliPIDResponse
366 
367  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
368 
369  if(man) {
370 
371  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
372  fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
373  if(fPIDResponse)return kTRUE;
374 
375  }
376 
377  return kFALSE;
378 }
380 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliMCEvent *mcEvent)
381 {
382  if( labelParticle < 0 || labelParticle >= mcEvent->GetNumberOfTracks() ) return kFALSE;
383  //if( mcEvent->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
384 
385  TParticle* particle = mcEvent->Particle(labelParticle);
386 
387  if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
388 
389  if( fDoEtaCut ){
390  if( particle->Eta() > fEtaCut || particle->Eta() < -fEtaCut )
391  return kFALSE;
392  }
393 
394 
395 return kTRUE;
396 }
397 
398 
401 {
402  //Selection of Reconstructed electrons
403 
404 
405  Float_t b[2];
406  Float_t bCov[3];
407  lTrack->GetImpactParameters(b,bCov);
408 
409  if (bCov[0]<=0 || bCov[2]<=0) {
410  AliDebug(1, "Estimated b resolution lower or equal zero!");
411  bCov[0]=0; bCov[2]=0;
412  }
413 
414 
415 
416  Float_t dcaToVertexXY = b[0];
417  Float_t dcaToVertexZ = b[1];
418  Double_t clsToF = GetNFindableClustersTPC(lTrack);
419 
420  if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
421  if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
422  if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
423 
424 
425 
426  if(hCutIndex)hCutIndex->Fill(kElectronIn);
427 
428  if (lTrack == NULL){
429  if(hCutIndex)hCutIndex->Fill(kNoTracks);
430  return kFALSE;
431  }
432 
433  if ( ! lTrack->GetConstrainedParam() ){
434  return kFALSE;
435  }
436  AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
437 
438 
439  // Track Cuts
440  if( !TrackIsSelected(lTrack) ){
441  if(hCutIndex)hCutIndex->Fill(kTrackCuts);
442  return kFALSE;
443  }
444 
445  if( lTrack->GetSign() > 0.0 ){
446 
447  if (hTrackPosEtabeforeDedx) hTrackPosEtabeforeDedx->Fill(lTrack->Eta());
448 
449  } else{
450 
451  if(hTrackNegEtabeforeDedx) hTrackNegEtabeforeDedx->Fill(lTrack->Eta());
452 
453  }
454 
455 
456  // dEdx Cuts
457  if( ! dEdxCuts( track ) ) {
458  if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
459  return kFALSE;
460 
461  }
462 
463  if( lTrack->GetSign() > 0.0 ){
464 
465  if( hTrackPosEtaafterDedx) hTrackPosEtaafterDedx->Fill(lTrack->Eta());
466 
467  } else{
468 
469  if( hTrackNegEtaafterDedx) hTrackNegEtaafterDedx->Fill(lTrack->Eta());
470 
471  }
472 
473 
474 
475  //Electron passed the cuts
476  if(hCutIndex)hCutIndex->Fill(kElectronOut);
477 
478  if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
479  if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
480  if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
481 
482 
483  return kTRUE;
484 }
485 
488  // Track Selection for Photon Reconstruction
489 
490 
491  Double_t clsToF = GetNFindableClustersTPC(lTrack);
492 
493 
494  if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
495 
496  return kFALSE;
497  }
498 
499  if( fDoEtaCut ) {
500  if( lTrack->Eta() > fEtaCut || lTrack->Eta() < -fEtaCut ) {
501  return kFALSE;
502  }
503  }
504 
505 
506  if( lTrack->Pt() < fPtMinCut || lTrack->Pt() > fPtMaxCut ) {
507 
508  return kFALSE;
509 
510  }
511 
512 
513 
514  if( clsToF < fMinClsTPCToF){
515  return kFALSE;
516  }
517 
518 
519 
520  return kTRUE;
521 }
523 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
524 
525  // Electron Identification Cuts for Photon reconstruction
526 
527  if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
528  if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
529 
530 
531 
532  //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
533 
534 
535 
536  Int_t cutIndex=0;
537 
538  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
539  if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
540  if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
541  if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
542 
543 
544  cutIndex++;
545 
546 
547  if( fDodEdxSigmaITSCut == kTRUE ){
548 
549 
550  if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
551  fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
552 
553  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
554  return kFALSE;
555  }
556 
557  }
558 
559  if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
560 
561 
562  cutIndex++;
563 
564 
565  if(fDodEdxSigmaTPCCut == kTRUE){
566 
567 
568  // TPC Electron Line
569  if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
570  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
571 
572  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
573  return kFALSE;
574  }
575  cutIndex++;
576 
577  // TPC Pion Line
578  if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
579  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
580  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
581  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
582 
583  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
584  return kFALSE;
585  }
586  }
587  cutIndex++;
588 
589  // High Pt Pion rej
590  if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
591  if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
592  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
593  fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
594 
595  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
596  return kFALSE;
597  }
598  }
599 
600  cutIndex++;
601  }
602 
603  else{ cutIndex+=3; }
604 
605 
606  if( fDoKaonRejectionLowP == kTRUE ){
607 
608  if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
609 
610  if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
611 
612  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
613 
614  return kFALSE;
615  }
616  }
617  }
618  cutIndex++;
619 
620  if( fDoProtonRejectionLowP == kTRUE ){
621 
622  if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
623  if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
624 
625  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
626  return kFALSE;
627  }
628  }
629  }
630  cutIndex++;
631 
632  if(fDoPionRejectionLowP == kTRUE){
633  if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
634  if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
635 
636  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
637  return kFALSE;
638  }
639  }
640  }
641  cutIndex++;
642 
643 
644  if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
645  if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
646  if(fUseTOFpid){
647  if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
648  fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
649  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
650  return kFALSE;
651  }
652  }
653  if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
654  }
655  else if ( fRequireTOF == kTRUE ) {
656 
657  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
658  return kFALSE;
659  }
660  cutIndex++;
661 
662  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
663  if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
664  if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
665 
666  return kTRUE;
667 }
669 
670 
671 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
672  //Returns pointer to the track with given ESD label
673  //(Important for AOD implementation, since Track array in AOD data is different
674  //from ESD array, but ESD tracklabels are stored in AOD Tracks)
675 
676  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
677  if(esdEvent) {
678  if(label > event->GetNumberOfTracks() ) return NULL;
679  AliESDtrack * track = esdEvent->GetTrack(label);
680  return track;
681 
682  } else {
683  for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
684  AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
685 
686  if(track) {
687  if(track->GetID() == label) {
688  return track;
689  }
690  }
691  }
692  }
693 
694  cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
695  return NULL;
696 }
699 
700 
701  for(Int_t i = 0;i<photons->GetEntries();i++){
702 
703  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
704 
705  Int_t posLabel = photonComp->GetTrackLabelPositive();
706  Int_t negLabel = photonComp->GetTrackLabelNegative();
707 
708  if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
709  return kFALSE;
710  }
711  }
712 
713  return kTRUE;
714 }
715 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
716 
717  if( pi0CandidatePt < fMassCutPtMin ){
718 
719  if( vphotonCandidateMass < fMassCutLowPt ){
720  return kTRUE;
721  }
722 
723  }
724  else{
725 
726  if( vphotonCandidateMass < fMassCutHighPt ){
727  return kTRUE;
728  }
729 
730  }
731 
732  return kFALSE;
733 
734 }
735 
737 
738 
739  Double_t clsToF=0;
740 
741  if( fUseCrossedRows == kFALSE ) {
742 
743  if ( !fUseCorrectedTPCClsInfo ){
744  if(lTrack->GetTPCNclsF()!=0){
745 
746  clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
747  }// Ncluster/Nfindablecluster
748  }
749  else {
750 
751  //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
752  clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
753 
754  }
755  } else {
756 
757  Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
758  clsToF = 1.0;
759  if ( lTrack->GetTPCNclsF()>0 ) {
760  clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
761  }
762  }
763 
764  return clsToF;
765 
766 }
767 
768 /*
769 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
770 {
771 //
772 // This angle is a measure for the contribution of the opening in polar
773 // direction ??0 to the opening angle ?? Pair
774 //
775 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
776 // Master Thesis. Thorsten Dahms. 2005
777 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
778 //
779  Double_t momPos[3];
780  Double_t momNeg[3];
781  if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
782  if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
783 
784  TVector3 posDaughter;
785  TVector3 negDaughter;
786 
787  posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
788  negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
789 
790  Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
791  Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
792 
793  if( openingAngle < 1e-20 ) return 0.;
794 
795  Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
796 
797  return psiAngle;
798 }*/
799 
801 {
802 //
803 // Returns true if it is a gamma conversion according to psi pair value
804 //
805  return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
806  TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
807 }
808 
812 
813  if(fCutString && fCutString->GetString().Length() == kNCuts) {
814  cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
815  fCutString->SetString(GetCutNumber());
816  } else {
817  cout << "fCutString not yet initialized, will not be updated" << endl;
818  return kFALSE;
819  }
820  // cout << fCutString->GetString().Data() << endl;
821  return kTRUE;
822 }
823 
826  fCutStringRead = Form("%s",analysisCutSelection.Data());
827 
828  // Initialize Cuts from a given Cut string
829 
830 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
831  AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
832 
833  if(analysisCutSelection.Length()!=kNCuts) {
834  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
835  return kFALSE;
836  }
837  if(!analysisCutSelection.IsAlnum()){
838  AliError("Cut selection is not alphanumeric");
839  return kFALSE;
840  }
841 
842  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
843  analysisCutSelectionLowerCase.ToLower();
844  const char *cutSelection = analysisCutSelectionLowerCase.Data();
845  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
846  for(Int_t ii=0;ii<kNCuts;ii++){
847  ASSIGNARRAY(ii);
848  }
849 
850 
851  // Set Individual Cuts
852  for(Int_t ii=0;ii<kNCuts;ii++){
853  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
854  }
855 
856  //PrintCuts();
857 
858  return kTRUE;
859 }
863 
864  //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
865 
866  switch (cutID) {
867 
869  if( SetMaxChi2TPCConstrainedGlobal( value ) ){
871  UpdateCutString(cutID, value);
872  return kTRUE;
873  } else return kFALSE;
874 
875  case kededxSigmaITSCut:
876  if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
877  fCuts[kededxSigmaITSCut] = value;
878  UpdateCutString(cutID, value);
879  return kTRUE;
880  } else return kFALSE;
881 
882  case kededxSigmaTPCCut:
883  if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
884  fCuts[kededxSigmaTPCCut] = value;
885  UpdateCutString(cutID, value);
886  return kTRUE;
887  } else return kFALSE;
888 
889  case kpidedxSigmaTPCCut:
890  if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
891  fCuts[kpidedxSigmaTPCCut] = value;
892  UpdateCutString(cutID, value);
893  return kTRUE;
894  } else return kFALSE;
895 
897  if( SetMinMomPiondEdxTPCCut(value)) {
899  UpdateCutString(cutID, value);
900  return kTRUE;
901  } else return kFALSE;
902 
904  if( SetMaxMomPiondEdxTPCCut(value)) {
906  UpdateCutString(cutID, value);
907  return kTRUE;
908  } else return kFALSE;
909 
911  if( SetLowPRejectionCuts(value) ) {
912  fCuts[kLowPRejectionSigmaCut] = value;
913  UpdateCutString(cutID, value);
914  return kTRUE;
915  } else return kFALSE;
916 
917 
918  case kTOFelectronPID:
919  if( SetTOFElectronPIDCut(value)) {
920  fCuts[kTOFelectronPID] = value;
921  UpdateCutString(cutID, value);
922  return kTRUE;
923  } else return kFALSE;
924  case kclsITSCut:
925  if( SetITSClusterCut(value) ) {
926  fCuts[kclsITSCut] = value;
927  UpdateCutString(cutID, value);
928  return kTRUE;
929  } else return kFALSE;
930  case kclsTPCCut:
931  if( SetTPCClusterCut(value)) {
932  fCuts[kclsTPCCut] = value;
933  UpdateCutString(cutID, value);
934  return kTRUE;
935  } else return kFALSE;
936 
937  case ketaCut:
938  if( SetEtaCut(value)) {
939  fCuts[ketaCut] = value;
940  UpdateCutString(cutID, value);
941  return kTRUE;
942  } else return kFALSE;
943  case kptCut:
944  if( SetPtCut(value)) {
945  fCuts[kptCut] = value;
946  UpdateCutString(cutID, value);
947  return kTRUE;
948  } else return kFALSE;
949 
950  case kDCACut:
951  if( SetDCACut(value)) {
952  fCuts[kDCACut] = value;
953  UpdateCutString(cutID, value);
954  return kTRUE;
955  } else return kFALSE;
956 
957 
958  case kPsiPair:
959  if( SetPsiPairCut(value)) {
960  fCuts[kPsiPair] = value;
961  UpdateCutString(cutID, value);
962  return kTRUE;
963  } else return kFALSE;
964 
966  if( SetRejectSharedElecGamma(value)) {
967  fCuts[kRejectSharedElecGamma] = value;
968  UpdateCutString(cutID, value);
969  return kTRUE;
970  } else return kFALSE;
971 
973  if( SetMaxChi2PerClusterTPC(value)) {
974  fCuts[kMaxChi2PerClusterTPC] = value;
975  UpdateCutString(cutID, value);
976  return kTRUE;
977  } else return kFALSE;
978 
980  if( SetMaxChi2PerClusterITS(value)) {
981  fCuts[kMaxChi2PerClusterITS] = value;
982  UpdateCutString(cutID, value);
983  return kTRUE;
984  } else return kFALSE;
985 
986  case kmassCut:
987  if( SetMassCut(value)) {
988  fCuts[kmassCut] = value;
989  UpdateCutString(cutID, value);
990  return kTRUE;
991  } else return kFALSE;
992  case kWeights:
993  if( SetDoWeights(value)) {
994  fCuts[kWeights] = value;
995  UpdateCutString(cutID, value);
996  return kTRUE;
997  } else return kFALSE;
998 
1000 
1001  if( SetUseVPhotonMCPmearing(value)) {
1002  fCuts[kuseVPhotonMCPSmearing] = value;
1003  UpdateCutString(cutID, value);
1004  return kTRUE;
1005  } else return kFALSE;
1006 
1007  case kNCuts:
1008  cout << "Error:: Cut id out of range"<< endl;
1009  return kFALSE;
1010  }
1011 
1012  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
1013  return kFALSE;
1014 
1015  //PrintCuts();
1016 
1017 }
1018 
1020 
1022  // Print out current Cut Selection
1023  for(Int_t ic = 0; ic < kNCuts; ic++) {
1024  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1025  }
1026 
1027 }
1030 {
1031  if( !fesdTrackCuts ) {
1032 
1033  cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1034  return kFALSE;
1035  }
1036 
1037  switch( maxChi2 ){
1038 
1039  case 0: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(1e10);
1040  break;
1041  case 1: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(25.);
1042  break;
1043  case 2: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36.);
1044  break;
1045  case 3: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(49.);
1046  break;
1047  case 4: fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(100.);
1048  break;
1049 
1050  default: cout<<"Warning: maxChi2 is not defined"<<maxChi2<<endl;
1051  return kFALSE;
1052 
1053  }
1054 
1055  return kTRUE;
1056 }
1059 { // Set Cut
1060 
1061  switch(ededxSigmaCut){
1062 
1063  case 0:
1064  fDodEdxSigmaITSCut = kFALSE;
1067  break;
1068  case 1: // -10,10
1069  fDodEdxSigmaITSCut = kTRUE;
1072  break;
1073  case 2: // -6,7
1074  fDodEdxSigmaITSCut = kTRUE;
1077  break;
1078  case 3: // -5,5
1079  fDodEdxSigmaITSCut = kTRUE;
1082  break;
1083  case 4: // -4,5
1084  fDodEdxSigmaITSCut = kTRUE;
1087  break;
1088  case 5: // -3,5
1089  fDodEdxSigmaITSCut = kTRUE;
1092  break;
1093  case 6: // -4,4
1094  fDodEdxSigmaITSCut = kTRUE;
1097  break;
1098  case 7: // -2.5,4
1099  fDodEdxSigmaITSCut = kTRUE;
1102  break;
1103  case 8: // -2,3.5
1104  fDodEdxSigmaITSCut = kTRUE;
1107  break;
1108  default:
1109  cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1110  return kFALSE;
1111 
1112  }
1113  return kTRUE;
1114 }
1115 
1118 { // Set Cut
1119  switch(ededxSigmaCut){
1120 
1121  case 0: fDodEdxSigmaTPCCut = kFALSE;
1124  break;
1125  case 1: // -10,10
1126  fDodEdxSigmaTPCCut = kTRUE;
1129  break;
1130  case 2: // -6,7
1131  fDodEdxSigmaTPCCut = kTRUE;
1134  break;
1135  case 3: // -5,5
1136  fDodEdxSigmaTPCCut = kTRUE;
1139  break;
1140  case 4: // -4,5
1141  fDodEdxSigmaTPCCut = kTRUE;
1144  break;
1145  case 5: // -3,5
1146  fDodEdxSigmaTPCCut = kTRUE;
1149  break;
1150  case 6: // -4,4
1151  fDodEdxSigmaTPCCut = kTRUE;
1154  break;
1155  case 7: // -2.5,4
1156  fDodEdxSigmaTPCCut = kTRUE;
1159  break;
1160  case 8: // -2,3.5
1161  fDodEdxSigmaTPCCut = kTRUE;
1164  break;
1165  default:
1166  cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1167  return kFALSE;
1168 
1169  }
1170  return kTRUE;
1171 }
1172 
1175 { // Set Cut
1176 
1177  switch(pidedxSigmaCut){
1178 
1179  case 0: fPIDnSigmaAbovePionLineTPC= 0;
1181  break;
1182  case 1: // -10
1183  fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1185  break;
1186  case 2: // 1
1187  fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1188  fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1189  break;
1190  case 3: // 0
1191  fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1192  fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1193  break;
1194  case 4: // 1
1197  break;
1198  case 5: // 1
1201  break;
1202  case 6: // 1
1205  break;
1206  case 7:
1207  fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1209  break;
1210  case 8: // 1
1211  fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1213  break;
1214  case 9: // 1
1217  break;
1218  default:
1219  cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1220  return kFALSE;
1221  }
1222  return kTRUE;
1223 }
1224 
1227 { // Set Cut
1228  switch(piMomdedxSigmaCut){
1229 
1230  case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1231  break;
1232  case 1: // 50.0 GeV
1234  break;
1235  case 2: // 20.0 GeV
1237  break;
1238  case 3: // 1.5 GeV
1240  break;
1241  case 4: // 1. GeV
1243  break;
1244  case 5: // 0.5 GeV
1246  break;
1247  case 6: // 0.4 GeV
1249  break;
1250  case 7: // 0.3 GeV
1252  break;
1253  case 8: // 0.25 GeV
1255  break;
1256  default:
1257  cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1258  return kFALSE;
1259  }
1260  return kTRUE;
1261 }
1264 
1265 
1266  if( !fesdTrackCuts ) {
1267 
1268  cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1269  return kFALSE;
1270  }
1271 
1272  switch(clsITSCut){
1273 
1274  case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1275  break;
1276  case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1277  break; //1 hit first layer of SPD
1278  case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1279  break; //1 hit in any layer of SPD
1280  case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1281  fesdTrackCuts->SetMinNClustersITS(4);
1282  // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1283  break;
1284  case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1285  fesdTrackCuts->SetMinNClustersITS(3);
1286  // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1287  break;
1288  case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1289  fesdTrackCuts->SetMinNClustersITS(4);
1290  // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1291  break;
1292  case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1293  fesdTrackCuts->SetMinNClustersITS(5);
1294  // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1295  break;
1296  case 7: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1297  fesdTrackCuts->SetMinNClustersITS(4);
1298  break;
1299  case 8: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1300  break;
1301  case 9: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1302  fesdTrackCuts->SetMinNClustersITS(4);
1303  break;
1304 
1305  default:
1306  cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1307  return kFALSE;
1308  }
1309 
1310 return kTRUE;
1311 }
1312 
1315 { // Set Cut
1316 
1317  //Update function for systematics 2015-10-08
1318 
1319  switch(clsTPCCut){
1320 
1321  case 0: // 0
1322  fMinClsTPC= 0.;
1323  fMinClsTPCToF = 0.;
1324  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1325  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1326  break;
1327 
1328  case 1: // 70
1329  fMinClsTPC= 70.;
1330  fMinClsTPCToF = 0.7;
1331 
1332  if( fUseCrossedRows ){
1333 
1334  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1335  fesdTrackCuts->SetMinNClustersTPC(0);
1336 
1337  } else {
1338 
1339  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1340  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1342  }
1343  break;
1344  case 2: // 80
1345  fMinClsTPC = 70.;
1346  fMinClsTPCToF = 0.9;
1347 
1348  if( fUseCrossedRows ){
1349 
1350  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1351  fesdTrackCuts->SetMinNClustersTPC(0);
1352 
1353  } else {
1354 
1355  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1356  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1358 
1359  }
1360  break;
1361  case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1362  fMinClsTPC = 70;
1363  fMinClsTPCToF = 0.8;
1364 
1365  if( fUseCrossedRows ){
1366 
1367  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1368  fesdTrackCuts->SetMinNClustersTPC(0);
1369 
1370  } else {
1371 
1372  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1373  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1375 
1376  }
1377  //fUseCrossedRows = kTRUE;
1378  break;
1379  case 4: // 0% of findable clusters
1380  fMinClsTPC = 90;
1381  fMinClsTPCToF = 0.8;
1382 
1383  if( fUseCrossedRows ){
1384 
1385  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1386  fesdTrackCuts->SetMinNClustersTPC(0);
1387 
1388  } else {
1389 
1390  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1391  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1393 
1394  }
1395  break;
1396  case 5: // 35% of findable clusters
1397  fMinClsTPC = 70;
1398  fMinClsTPCToF = 0.35;
1399 
1400  if( fUseCrossedRows ){
1401 
1402  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1403  fesdTrackCuts->SetMinNClustersTPC(0);
1404 
1405  } else {
1406 
1407  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1408  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1410 
1411  }
1412  break;
1413  case 6: // 60% of findable clusters
1414  fMinClsTPC = 70;
1415  fMinClsTPCToF = 0.60;
1416 
1417  if( fUseCrossedRows ){
1418 
1419  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1420  fesdTrackCuts->SetMinNClustersTPC(0);
1421 
1422  } else {
1423 
1424  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1425  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1427 
1428  }
1429  break;
1430  case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1431  // Changed 2014-02-04 before fMinClsTPC = 50.;
1432  fMinClsTPC = 90;
1433  fMinClsTPCToF = 0.35;
1434 
1435  if( fUseCrossedRows ){
1436 
1437  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1438  fesdTrackCuts->SetMinNClustersTPC(0);
1439 
1440  } else {
1441 
1442  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1443  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1445 
1446  }
1447  break;
1448 
1449  case 8: fMinClsTPC = 0;
1450  fMinClsTPCToF = 0.35;
1451 
1452  if( fUseCrossedRows ){
1453 
1454  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1455  fesdTrackCuts->SetMinNClustersTPC(0);
1456 
1457  } else {
1458 
1459  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1460  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1462 
1463  }
1464  break;
1465 
1466  case 9: // 35% of findable clusters
1467  fMinClsTPC = 70;
1468  fMinClsTPCToF = 0.35;
1469 
1470  if( fUseCrossedRows ){
1471 
1472  fesdTrackCuts->SetMinNCrossedRowsTPC(fMinClsTPC);
1473  fesdTrackCuts->SetMinNClustersTPC(0);
1474 
1475  } else {
1476 
1477  fesdTrackCuts->SetMinNCrossedRowsTPC(0);
1478  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1480 
1481  }
1482  break;
1483 
1484  default:
1485  cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1486  return kFALSE;
1487  }
1488  return kTRUE;
1489 }
1490 
1491 /*
1493 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1494 { // Set Cut
1495  switch(clsTPCCut){
1496  case 0: // 0
1497  fMinClsTPC= 0.;
1498  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1499  break;
1500  case 1: // 70
1501  fMinClsTPC= 70.;
1502  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1503  break;
1504  case 2: // 80
1505  fMinClsTPC= 80.;
1506  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1507  break;
1508  case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1509  fMinClsTPCToF = 0.8;
1510  fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1511  fesdTrackCuts->SetMinNClustersTPC(0);
1512  fUseCrossedRows = kTRUE;
1513  break;
1514  case 4: // 0% of findable clusters
1515  fMinClsTPC= 70.;
1516  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1517  fMinClsTPCToF= 0.0;
1518  fUseCorrectedTPCClsInfo=0;
1519  break;
1520  case 5: // 35% of findable clusters
1521  fMinClsTPC = 70.;
1522  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1523  fMinClsTPCToF= 0.35;
1524  fUseCorrectedTPCClsInfo=0;
1525  break;
1526  case 6: // 60% of findable clusters
1527  fMinClsTPC= 70.;
1528  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1529  fMinClsTPCToF= 0.6;
1530  fUseCorrectedTPCClsInfo=0;
1531  break;
1532  case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1533  // Changed 2014-02-04 before fMinClsTPC = 50.;
1534  fMinClsTPCToF = 0.6;
1535  fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1536  fesdTrackCuts->SetMinNClustersTPC(0);
1537  fUseCrossedRows = kTRUE;
1538  break;
1539  case 8: fMinClsTPC = 0.;
1540  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1541  fMinClsTPCToF= 0.35;
1542  fUseCorrectedTPCClsInfo=0;
1543  break;
1544  case 9: // 35% of findable clusters
1545  fMinClsTPC = 70.;
1546  fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1547  fMinClsTPCToF= 0.35;
1548  fUseCorrectedTPCClsInfo=1;
1549  break;
1550 
1551  default:
1552  cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1553  return kFALSE;
1554  }
1555  return kTRUE;
1556 }*/
1557 
1560 {
1561  // Set eta Cut
1562  switch(etaCut){
1563  case 0:
1564  fEtaCut = 100.;
1565  fDoEtaCut = kFALSE;
1566  break;
1567  case 1: // 1.4
1568  fEtaCut = 1.4;
1569  fDoEtaCut = kTRUE;
1570  break;
1571  case 2: // 1.2
1572  fEtaCut = 1.2;
1573  fDoEtaCut = kTRUE;
1574  break;
1575  case 3: // 0.9
1576  fEtaCut = 0.9;
1577  fDoEtaCut = kTRUE;
1578  break;
1579  case 4: // 0.8
1580  fEtaCut = 0.8;
1581  fDoEtaCut = kTRUE;
1582  break;
1583  case 5: // 0.75
1584  fEtaCut = 0.75;
1585  fDoEtaCut = kTRUE;
1586  break;
1587  case 6: //0.6
1588  fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1589  fDoEtaCut = kTRUE;
1590  break;
1591  case 7: //0.5
1592  fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1593  fDoEtaCut = kTRUE;
1594  break;
1595  case 8: fEtaCut = 0.4;
1596  fDoEtaCut = kTRUE;
1597  break;
1598  case 9: fEtaCut = 0.65;
1599  fDoEtaCut = kTRUE;
1600  break;
1601  default:
1602  cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1603  return kFALSE;
1604  }
1605  return kTRUE;
1606 }
1607 
1610 {
1611  // Set Pt Cut
1612  //0.1GeV, 0.125 GeV, 0.15 GeV
1613 
1614  switch(ptCut){
1615 
1616  case 0: fPtMinCut = 0.075;
1617  fPtMaxCut = 9999;
1618  break;
1619  case 1: // 0.1
1620  fPtMinCut = 0.1;
1621  fPtMaxCut = 9999;
1622  break;
1623  case 2: // 0.125 GeV
1624  fPtMinCut = 0.125;
1625  fPtMaxCut = 9999;
1626  break;
1627  case 3: // 0.15 GeV
1628  fPtMinCut = 0.15;
1629  fPtMaxCut = 9999;
1630  break;
1631  // 0.5 - 0.7
1632  case 4: fPtMinCut = 0.5;
1633  fPtMaxCut = 0.7;
1634  break;
1635  case 5: // 0.175 GeV
1636  fPtMinCut = 0.175;
1637  fPtMaxCut = 9999;
1638  break;
1639  default:
1640  cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1641  return kFALSE;
1642  }
1643  return kTRUE;
1644 }
1645 
1646 
1649 {
1650  // Set DCA Cut
1651 
1652  if( !fesdTrackCuts ) {
1653 
1654  cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1655  return kFALSE;
1656  }
1657 
1658  switch(dcaCut){
1659 
1660  case 0: //Open cuts//
1661  fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1662  fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1663  break;
1664  case 1:
1665  fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01"); //Standard 2010
1666  fesdTrackCuts->SetMaxDCAToVertexZ(2);
1667  break;
1668  case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1669  fesdTrackCuts->SetMaxDCAToVertexXY(1);
1670  break;
1671  case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1"); //Standard 2011
1672  fesdTrackCuts->SetMaxDCAToVertexZ(2);
1673  break;
1674  case 4: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0525+0.175/pt^1.1");
1675  fesdTrackCuts->SetMaxDCAToVertexZ(2);
1676  break;
1677  case 5: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1678  fesdTrackCuts->SetMaxDCAToVertexZ(1);
1679  break;
1680  case 6: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1681  fesdTrackCuts->SetMaxDCAToVertexZ(5);
1682  break;
1683  case 7: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1"); //Standard 2011
1684  fesdTrackCuts->SetMaxDCAToVertexZ(1);
1685  break;
1686  case 8: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1"); //Standard 2011
1687  fesdTrackCuts->SetMaxDCAToVertexZ(5);
1688  break;
1689  default:
1690  cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1691  return kFALSE;
1692  }
1693  return kTRUE;
1694 }
1695 
1696 
1697 
1698 
1701 { // Set Cut
1702  switch(piMaxMomdedxSigmaCut){
1703 
1704  case 0:
1706  break;
1707  case 1: // 100. GeV
1709  break;
1710  case 2: // 5. GeV
1712  break;
1713  case 3: // 4. GeV
1715  break;
1716  case 4: // 3.5 GeV
1718  break;
1719  case 5: // 3. GeV
1721  break;
1722  default:
1723  cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1724  return kFALSE;
1725  }
1726  return kTRUE;
1727 }
1728 
1731 { // Set Cut
1732  switch(LowPRejectionSigmaCut){
1733  case 0: //
1734  fDoKaonRejectionLowP=kFALSE;
1735  fDoProtonRejectionLowP=kFALSE;
1736  fDoPionRejectionLowP=kFALSE;
1741  break;
1742  case 1: //
1743  fDoKaonRejectionLowP=kTRUE;
1744  fDoProtonRejectionLowP=kTRUE;
1745  fDoPionRejectionLowP=kTRUE;
1750  break;
1751  case 2: //
1752  fDoKaonRejectionLowP=kTRUE;
1753  fDoProtonRejectionLowP=kTRUE;
1754  fDoPionRejectionLowP=kTRUE;
1759  break;
1760  case 3: //
1761  fDoKaonRejectionLowP=kTRUE;
1762  fDoProtonRejectionLowP=kTRUE;
1763  fDoPionRejectionLowP=kTRUE;
1768  break;
1769  case 4: //
1770  fDoKaonRejectionLowP=kTRUE;
1771  fDoProtonRejectionLowP=kTRUE;
1772  fDoPionRejectionLowP=kTRUE;
1777  break;
1778  case 5: //
1779  fDoKaonRejectionLowP=kTRUE;
1780  fDoProtonRejectionLowP=kTRUE;
1781  fDoPionRejectionLowP=kTRUE;
1786  break;
1787  case 6: //
1788  fDoKaonRejectionLowP=kTRUE;
1789  fDoProtonRejectionLowP=kTRUE;
1790  fDoPionRejectionLowP=kTRUE;
1795  break;
1796  case 7: //
1797  fDoKaonRejectionLowP=kFALSE;
1798  fDoProtonRejectionLowP=kFALSE;
1799  fDoPionRejectionLowP=kTRUE;
1804  break;
1805  case 8:
1806  fDoKaonRejectionLowP=kFALSE;
1807  fDoProtonRejectionLowP=kFALSE;
1808  fDoPionRejectionLowP=kTRUE;
1813  break;
1814  default:
1815  cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1816  return kFALSE;
1817  }
1818  return kTRUE;
1819 }
1820 
1823  // Set Cut
1824  switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1825  case 0: // no cut
1826  fRequireTOF = kFALSE;
1827  fUseTOFpid = kFALSE;
1830  break;
1831  case 1: // -7,7
1832  fRequireTOF = kFALSE;
1833  fUseTOFpid = kTRUE;
1836  break;
1837  case 2: // -5,5
1838  fRequireTOF = kFALSE;
1839  fUseTOFpid = kTRUE;
1842  break;
1843  case 3: // -3,5
1844  fRequireTOF = kFALSE;
1845  fUseTOFpid = kTRUE;
1848  break;
1849  case 4: // -2,3
1850  fRequireTOF = kFALSE;
1851  fUseTOFpid = kTRUE;
1854  break;
1855  case 5: // -3, 3 TOF mandatory
1856  fRequireTOF = kTRUE;
1857  fUseTOFpid = kTRUE;
1860  break;
1861  default:
1862  cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1863  return kFALSE;
1864  }
1865  return kTRUE;
1866 }
1868 
1870 
1871 
1872  switch(psiCut) {
1873  case 0:
1874  fDoPsiPairCut = kFALSE;
1875  fPsiPairCut = 10000.; //
1876  fDeltaPhiCutMin = -1000.;
1877  fDeltaPhiCutMax = 1000.;
1878 
1879  break;
1880  case 1:
1881  fDoPsiPairCut = kTRUE;
1882  fPsiPairCut = 0.45; // Standard
1883  fDeltaPhiCutMin = 0.0;
1884  fDeltaPhiCutMax = 0.12;
1885  break;
1886  case 2:
1887  fDoPsiPairCut = kTRUE;
1888  fPsiPairCut = 0.60;
1889  fDeltaPhiCutMin = 0.0;
1890  fDeltaPhiCutMax = 0.12;
1891  break;
1892  case 3:
1893  fDoPsiPairCut = kTRUE;
1894  fPsiPairCut = 0.52;
1895  fDeltaPhiCutMin = 0.0;
1896  fDeltaPhiCutMax = 0.12;
1897  break;
1898  case 4:
1899  fDoPsiPairCut = kTRUE;
1900  fPsiPairCut = 0.30;
1901  fDeltaPhiCutMin = 0.0;
1902  fDeltaPhiCutMax = 0.12;
1903  break;
1904  case 5:
1905  fDoPsiPairCut = kTRUE;
1906  fPsiPairCut = 0.60;
1907  fDeltaPhiCutMin = 0.0;
1908  fDeltaPhiCutMax = 0.06;
1909  break;
1910  case 6:
1911  fDoPsiPairCut = kTRUE;
1912  fPsiPairCut = 0.65;
1913  fDeltaPhiCutMin = 0.0;
1914  fDeltaPhiCutMax = 0.14;
1915  break;
1916 
1917 
1918  default:
1919  cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1920  return kFALSE;
1921  }
1922 
1923  return kTRUE;
1924 }
1925 
1928 
1929 
1930  switch(RCut) {
1931  case 0:
1932  fDoRejectSharedElecGamma = kFALSE;
1933  fRadiusCut = 10000; //
1934  break;
1935  case 1:
1936  fDoRejectSharedElecGamma = kTRUE;
1937  fRadiusCut = 2.0; // cm
1938  break;
1939  case 2:
1940  fDoRejectSharedElecGamma = kTRUE;
1941  fRadiusCut = 3.0; // Standard
1942  break;
1943  case 3:
1944  fDoRejectSharedElecGamma = kTRUE;
1945  fRadiusCut = 4.0; //
1946  break;
1947  case 4:
1948  fDoRejectSharedElecGamma = kTRUE;
1949  fRadiusCut = 5.0; //
1950  break;
1951  case 5:
1952  fDoRejectSharedElecGamma = kTRUE;
1953  fRadiusCut = 10.0; //
1954  break;
1955  case 6:
1956  fDoRejectSharedElecGamma = kTRUE;
1957  fRadiusCut = 15.0; //
1958  break;
1959  default:
1960  cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1961  return kFALSE;
1962  }
1963 
1964  return kTRUE;
1965 }
1968 
1969  if( !fesdTrackCuts ) {
1970 
1971  cout<<"Warning: AliESDtrackCuts is not initialized "<<endl;
1972  return kFALSE;
1973  }
1974 
1975 
1976  // Set Cut
1977  switch(maxChi2){
1978 
1979  case 0: fesdTrackCuts->SetMaxChi2PerClusterTPC(1e10);
1980  break;
1981  case 1: fesdTrackCuts->SetMaxChi2PerClusterTPC(3.);
1982  break;
1983  case 2: fesdTrackCuts->SetMaxChi2PerClusterTPC(4.);
1984  break;
1985  case 3: fesdTrackCuts->SetMaxChi2PerClusterTPC(5.);
1986  break;
1987  default:
1988  cout<<"Warning: SetMaxChi2PerClusterTPC not defined "<<maxChi2<<endl;
1989  return kFALSE;
1990  }
1991  return kTRUE;
1992 }
1993 
1996 { // Set Cut
1997 
1998  if( !fesdTrackCuts ) {
1999 
2000  cout<<"Warning: AliESDtrackCuts is not initialized "<<endl;
2001  return kFALSE;
2002  }
2003 
2004  switch(maxChi2){
2005  case 0:
2006  fesdTrackCuts->SetMaxChi2PerClusterITS(1e10);
2007  break;
2008  case 1:
2009  fesdTrackCuts->SetMaxChi2PerClusterITS(25.);
2010  break;
2011  case 2:
2012  fesdTrackCuts->SetMaxChi2PerClusterITS(36.);
2013  break;
2014  case 3:
2015  fesdTrackCuts->SetMaxChi2PerClusterITS(49.);
2016  break;
2017  default:
2018  cout<<"Warning: SetMaxChi2PerClusterITS not defined "<<maxChi2<<endl;
2019  return kFALSE;
2020  }
2021  return kTRUE;
2022 }
2023 
2026 { // Set Cut
2027  switch(opc){
2028 
2029  case 0: fDoWeights = kFALSE;
2030  break;
2031  case 1: fDoWeights = kTRUE;
2032  break;
2033  default:
2034  cout<<"Warning: Weights option not defined "<<opc<<endl;
2035  return kFALSE;
2036  }
2037  return kTRUE;
2038 }
2041 { // Set Cut
2042  switch(massCut){
2043 
2044  case 0:
2045 
2046  fMassCutPtMin = -999.; //GeV
2047  fMassCutLowPt = 999.; //GeV/c^2
2048  fMassCutHighPt = 999.; //GeV/c^2
2049  fMassMinCut = -999;
2050  fDoMassCut = kFALSE;
2051  fDoMassMinCut = kFALSE;
2052  break;
2053  case 1:
2054  //fMassCut = 0.135; //GeV/c^2
2055  fMassCutPtMin = -999.; //GeV
2056  fMassCutLowPt = 0.135; //GeV/c^2
2057  fMassCutHighPt = 0.135; //GeV/c^2
2058  fMassMinCut = -999;
2059  fDoMassCut = kTRUE;
2060  fDoMassMinCut = kFALSE;
2061  break;
2062  case 2:
2063  //fMassCut = 0.100; //GeV/c^2
2064  fMassCutPtMin = -999.; //GeV
2065  fMassCutLowPt = 0.100; //GeV/c^2
2066  fMassCutHighPt = 0.100; //GeV/c^2
2067  fMassMinCut = -999;
2068  fDoMassCut = kTRUE;
2069  fDoMassMinCut = kFALSE;
2070  break;
2071  case 3:
2072  /*fMassCut = 0.075; //GeV/c^2 Changed from Feb 25
2073  fMassCutPtMin = -999.; //GeV
2074  fMassCutLowPt = 0.075; //GeV/c^2
2075  fMassCutHighPt = 0.075; //GeV/c^2
2076  fDoMassCut = kTRUE;
2077  fDoMassMinCut = kFALSE;*/
2078  fMassCutPtMin = 1.0; //GeV
2079  fMassCutLowPt = 0.015; //GeV/c^2
2080  fMassCutHighPt = 0.035; //GeV/c^2
2081  fMassMinCut = 0.002;
2082  fDoMassCut = kTRUE;
2083  fDoMassMinCut = kTRUE;
2084  break;
2085  case 4:
2086  //fMassCut = 0.050; //GeV/c^2
2087  fMassCutPtMin = -999.; //GeV
2088  fMassCutLowPt = 0.050; //GeV/c^2
2089  fMassCutHighPt = 0.050; //GeV/c^2
2090  fMassMinCut = -999;
2091  fDoMassCut = kTRUE;
2092  fDoMassMinCut = kFALSE;
2093  break;
2094  case 5:
2095 
2096  fMassCutPtMin = -999.; //GeV
2097  fMassCutLowPt = 0.035; //GeV/c^2
2098  fMassCutHighPt = 0.035; //GeV/c^2
2099  fMassMinCut = -999;
2100  fDoMassCut = kTRUE;
2101  fDoMassMinCut = kFALSE;
2102  break;
2103  case 6:
2104  fMassCutPtMin = -999.; //GeV
2105  fMassCutLowPt = 0.015; //GeV/c^2
2106  fMassCutHighPt = 0.015; //GeV/c^2
2107  fMassMinCut = -999;
2108  fDoMassCut = kTRUE;
2109  fDoMassMinCut = kFALSE;
2110  break;
2111  case 7: fMassCutPtMin = 1.0; //GeV
2112  fMassCutLowPt = 0.015; //GeV/c^2
2113  fMassCutHighPt = 0.035; //GeV/c^2
2114  fMassMinCut = -999;
2115  fDoMassCut = kTRUE;
2116  fDoMassMinCut = kFALSE;
2117  break;
2118  case 8: fMassCutPtMin = 1.0; //GeV
2119  fMassCutLowPt = 0.015; //GeV/c^2
2120  fMassCutHighPt = 0.050; //GeV/c^2
2121  fMassMinCut = -999;
2122  fDoMassCut = kTRUE;
2123  fDoMassMinCut = kFALSE;
2124  break;
2125  case 9: fMassCutPtMin = 1.0; //GeV
2126  fMassCutLowPt = 0.025; //GeV/c^2
2127  fMassCutHighPt = 0.035; //GeV/c^2
2128  fMassMinCut = -999;
2129  fDoMassCut = kTRUE;
2130  fDoMassMinCut = kFALSE;
2131  break;
2132  default:
2133  cout<<"Warning: MassCut not defined "<<massCut<<endl;
2134  return kFALSE;
2135  }
2136  return kTRUE;
2137 }
2139 {// Set Cut
2140  switch(useMCPSmearing){
2141 
2142  case 0:
2143  fUseVPhotonMCPSmearing=kFALSE;
2144  fUseElectronMCPSmearing=kFALSE;
2145  break;
2146  case 1:
2147  fUseVPhotonMCPSmearing=kTRUE;
2148  fUseElectronMCPSmearing=kFALSE;
2149  break;
2150  case 2:
2151  fUseVPhotonMCPSmearing=kFALSE;
2153  break;
2154 
2155 
2156  default: cout<<"Warning: Virtual Photon SMearing not defined "<<useMCPSmearing<<endl;
2157  return kFALSE;
2158 
2159  }
2160 
2161  return kTRUE;
2162 }
2163 
2164 
2167  // returns TString with current cut number
2168  return fCutStringRead;
2169 }
2170 
2171 
2174  //Create and return standard 2010 PbPb cuts
2175  AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
2176  if(!cuts->InitializeCutsFromCutString("9069640364102")){
2177  cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
2178  return cuts;
2179 }
2180 
2183  //Create and return standard 2010 PbPb cuts
2184  AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
2185 
2186  if(!cuts->InitializeCutsFromCutString("9069640364102")){
2187  cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
2188  return cuts;
2189 }
2190 
Bool_t SetMaxChi2PerClusterITS(Int_t maxChi2)
Bool_t ElectronIsSelectedMC(Int_t labelParticle, AliMCEvent *mcEvent)
Bool_t UpdateCutString(cutIds cutID, Int_t value)
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)
#define ASSIGNARRAY(i)
Bool_t SetTPCClusterCut(Int_t clsTPCCut)
Bool_t RejectSharedElecGamma(TList *photons, Int_t indexEle)
AliESDtrackCuts * fesdTrackCuts
Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
int Int_t
Definition: External.C:63
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)
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 GetNFindableClustersTPC(AliESDtrack *lTrack)
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 TrackIsSelected(AliESDtrack *lTrack)
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)