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