2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Authors: Svein Lindal, Daniel Lohner *
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 **************************************************************************/
17 ////////////////////////////////////////////////
18 //---------------------------------------------
19 // Class handling all kinds of selection cuts for
20 // Gamma Conversion analysis
21 //---------------------------------------------
22 ////////////////////////////////////////////////
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"
38 #include "TObjString.h"
39 #include "AliAODEvent.h"
40 #include "AliESDEvent.h"
46 ClassImp(AliDalitzElectronCuts)
49 const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {
54 "piMinMomdedxSigmaTPCCut",
55 "piMaxMomdedxSigmaTPCCut",
56 "LowPRejectionSigmaCut",
62 "RejectSharedElecGamma",
71 //________________________________________________________________________
72 AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),
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),
115 fUseTrackMultiplicityForBG(kFALSE),
117 fnumberOfRotationEventsForBG(0),
119 fDoMassMinCut(kFALSE),
121 fMassCutHighPt(999.),
122 fMassCutPtMin(-100.0),
128 hITSdEdxbefore(NULL),
130 hTPCdEdxbefore(NULL),
132 hTPCdEdxSignalbefore(NULL),
133 hTPCdEdxSignalafter(NULL),
136 hTrackDCAxyPtbefore(NULL),
137 hTrackDCAxyPtafter(NULL),
138 hTrackDCAzPtbefore(NULL),
139 hTrackDCAzPtafter(NULL),
140 hTrackNFindClsPtTPCbefore(NULL),
141 hTrackNFindClsPtTPCafter(NULL)
144 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
145 fCutString=new TObjString((GetCutNumber()).Data());
147 //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
148 // Using standard function for setting Cuts
149 Bool_t selectPrimaries=kFALSE;
150 fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
153 //________________________________________________________________________
154 AliDalitzElectronCuts::~AliDalitzElectronCuts() {
156 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
158 // delete fHistograms;
159 // fHistograms = NULL;
161 if(fCutString != NULL){
169 //________________________________________________________________________
170 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
172 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
174 TH1::AddDirectory(kFALSE);
176 TString cutName = "";
179 cutName = GetCutNumber().Data();
182 cutName = cutNumber.Data();
185 if(fHistograms != NULL){
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()));
196 Int_t kDedxSignalbins = 200;
198 const Int_t kDCABins=62;
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};
202 const Int_t kPtBins=110;
203 Double_t binsPtDummy[kPtBins+1];
204 const Int_t kPBins = 109;
205 Double_t binsPDummy[kPBins+1];
209 for(Int_t i=1;i<kPtBins+1;i++)
211 if(binsPtDummy[i-1]+0.05<1.01)
212 binsPtDummy[i]=binsPtDummy[i-1]+0.05;
214 binsPtDummy[i]=binsPtDummy[i-1]+0.1;
217 for(Int_t i=1; i <kPBins+1;i++){
219 if( binsPDummy[i-1]+0.05<1.01)
220 binsPDummy[i] = binsPDummy[i-1]+0.05;
222 binsPDummy[i] = binsPDummy[i-1]+0.1;
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);
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);
254 TAxis *AxisBeforeITS = NULL;
255 TAxis *AxisBeforedEdx = NULL;
256 TAxis *AxisBeforeTOF = NULL;
257 TAxis *AxisBeforedEdxSignal = NULL;
262 hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
263 fHistograms->Add(hITSdEdxbefore);
264 AxisBeforeITS = hITSdEdxbefore->GetXaxis();
266 hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
267 fHistograms->Add(hTPCdEdxbefore);
268 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
270 hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
271 fHistograms->Add(hTPCdEdxSignalbefore);
272 AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
274 hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
275 fHistograms->Add(hTOFbefore);
276 AxisBeforeTOF = hTOFbefore->GetXaxis();
278 hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
279 fHistograms->Add(hTrackDCAxyPtbefore);
281 hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
282 fHistograms->Add(hTrackDCAzPtbefore);
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);
285 fHistograms->Add(hTrackNFindClsPtTPCbefore);
292 hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
293 fHistograms->Add(hITSdEdxafter);
295 hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
296 fHistograms->Add(hTPCdEdxafter);
298 hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
299 fHistograms->Add(hTPCdEdxSignalafter);
301 hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
302 fHistograms->Add(hTOFafter);
304 hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
305 fHistograms->Add(hTrackDCAxyPtafter);
307 hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
308 fHistograms->Add(hTrackDCAzPtafter);
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);
311 fHistograms->Add(hTrackNFindClsPtTPCafter);
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];
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);
332 AxisBeforeITS->Set(bins, newBins);
333 AxisBeforedEdx->Set(bins, newBins);
334 AxisBeforedEdxSignal->Set(bins,newBins);
335 AxisBeforeTOF->Set(bins, newBins);
340 TH1::AddDirectory(kTRUE);
342 // Event Cuts and Info
346 //________________________________________________________________________
347 Bool_t AliDalitzElectronCuts::InitPIDResponse(){
349 // Set Pointer to AliPIDResponse
351 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
355 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
356 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
357 if(fPIDResponse)return kTRUE;
363 ///________________________________________________________________________
364 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)
366 if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;
367 if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
369 TParticle* particle = fMCStack->Particle(labelParticle);
371 if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
374 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
383 ///________________________________________________________________________
384 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
386 //Selection of Reconstructed electrons
391 lTrack->GetImpactParameters(b,bCov);
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;
400 Float_t dcaToVertexXY = b[0];
401 Float_t dcaToVertexZ = b[1];
402 Double_t clsToF = GetNFindableClustersTPC(lTrack);
404 if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
405 if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
406 if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
410 if(hCutIndex)hCutIndex->Fill(kElectronIn);
413 if(hCutIndex)hCutIndex->Fill(kNoTracks);
417 if ( ! lTrack->GetConstrainedParam() ){
420 AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
424 if( !TrackIsSelected(lTrack) ){
425 if(hCutIndex)hCutIndex->Fill(kTrackCuts);
431 if( ! dEdxCuts( track ) ) {
432 if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
437 //Electron passed the cuts
438 if(hCutIndex)hCutIndex->Fill(kElectronOut);
440 if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
441 if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
442 if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
448 ///________________________________________________________________________
449 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
450 // Track Selection for Photon Reconstruction
453 Double_t clsToF = GetNFindableClustersTPC(lTrack);
456 if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
462 if( lTrack->Eta() > (fEtaCut + fEtaShift) || lTrack->Eta() < (-fEtaCut + fEtaShift) ) {
468 if( lTrack->Pt() < fPtMinCut || lTrack->Pt() > fPtMaxCut ) {
476 if( clsToF < fMinClsTPCToF){
484 ///________________________________________________________________________
485 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
487 // Electron Identification Cuts for Photon reconstruction
489 if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
490 if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
494 //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
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()));
509 if( fDodEdxSigmaITSCut == kTRUE ){
512 if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
513 fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
515 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
521 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
527 if(fDodEdxSigmaTPCCut == kTRUE){
531 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
532 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
534 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
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){
545 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
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){
557 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
568 if( fDoKaonRejectionLowP == kTRUE ){
570 if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
572 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
574 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
582 if( fDoProtonRejectionLowP == kTRUE ){
584 if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
585 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
587 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
594 if(fDoPionRejectionLowP == kTRUE){
595 if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
596 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
598 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
606 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
607 if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
609 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
610 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
611 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
615 if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
617 else if ( fRequireTOF == kTRUE ) {
619 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
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()));
630 ///________________________________________________________________________
633 AliVTrack *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)
638 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
640 if(label > event->GetNumberOfTracks() ) return NULL;
641 AliESDtrack * track = esdEvent->GetTrack(label);
645 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
646 AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
649 if(track->GetID() == label) {
656 cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
659 ///________________________________________________________________________
660 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
663 for(Int_t i = 0;i<photons->GetEntries();i++){
665 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
667 Int_t posLabel = photonComp->GetTrackLabelPositive();
668 Int_t negLabel = photonComp->GetTrackLabelNegative();
670 if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
677 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
679 if( pi0CandidatePt < fMassCutPtMin ){
681 if( vphotonCandidateMass < fMassCutLowPt ){
688 if( vphotonCandidateMass < fMassCutHighPt ){
698 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){
703 if( fUseCrossedRows == kFALSE ) {
705 if ( !fUseCorrectedTPCClsInfo ){
706 if(lTrack->GetTPCNclsF()!=0){
708 clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
709 }// Ncluster/Nfindablecluster
713 //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
714 clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
719 Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
721 if ( lTrack->GetTPCNclsF()>0 ) {
722 clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
731 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
734 // This angle is a measure for the contribution of the opening in polar
735 // direction ??0 to the opening angle ?? Pair
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
743 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
744 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
746 TVector3 posDaughter;
747 TVector3 negDaughter;
749 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
750 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
752 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
753 Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
755 if( openingAngle < 1e-20 ) return 0.;
757 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
762 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
765 // Returns true if it is a gamma conversion according to psi pair value
767 return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
768 TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
771 ///________________________________________________________________________
772 Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
773 ///Update the cut string (if it has been created yet)
775 if(fCutString && fCutString->GetString().Length() == kNCuts) {
776 cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
777 fCutString->SetString(GetCutNumber());
779 cout << "fCutString not yet initialized, will not be updated" << endl;
782 // cout << fCutString->GetString().Data() << endl;
786 ///________________________________________________________________________
787 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
788 // Initialize Cuts from a given Cut string
790 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
791 AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
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));
797 if(!analysisCutSelection.IsDigit()){
798 AliError("Cut selection contains characters");
802 const char *cutSelection = analysisCutSelection.Data();
803 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
804 for(Int_t ii=0;ii<kNCuts;ii++){
810 AliError("Analysis Cut Selection does not start with 9");
815 // Set Individual Cuts
816 for(Int_t ii=0;ii<kNCuts;ii++){
817 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
824 ///________________________________________________________________________
825 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
826 ///Set individual cut ID
828 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
832 fCuts[kgoodId] = value;
834 cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
840 case kededxSigmaITSCut:
841 if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
842 fCuts[kededxSigmaITSCut] = value;
843 UpdateCutString(cutID, value);
845 } else return kFALSE;
847 case kededxSigmaTPCCut:
848 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
849 fCuts[kededxSigmaTPCCut] = value;
850 UpdateCutString(cutID, value);
852 } else return kFALSE;
854 case kpidedxSigmaTPCCut:
855 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
856 fCuts[kpidedxSigmaTPCCut] = value;
857 UpdateCutString(cutID, value);
859 } else return kFALSE;
861 case kpiMinMomdedxSigmaTPCCut:
862 if( SetMinMomPiondEdxTPCCut(value)) {
863 fCuts[kpiMinMomdedxSigmaTPCCut] = value;
864 UpdateCutString(cutID, value);
866 } else return kFALSE;
868 case kpiMaxMomdedxSigmaTPCCut:
869 if( SetMaxMomPiondEdxTPCCut(value)) {
870 fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
871 UpdateCutString(cutID, value);
873 } else return kFALSE;
875 case kLowPRejectionSigmaCut:
876 if( SetLowPRejectionCuts(value) ) {
877 fCuts[kLowPRejectionSigmaCut] = value;
878 UpdateCutString(cutID, value);
880 } else return kFALSE;
883 case kTOFelectronPID:
884 if( SetTOFElectronPIDCut(value)) {
885 fCuts[kTOFelectronPID] = value;
886 UpdateCutString(cutID, value);
888 } else return kFALSE;
890 if( SetITSClusterCut(value) ) {
891 fCuts[kclsITSCut] = value;
892 UpdateCutString(cutID, value);
894 } else return kFALSE;
896 if( SetTPCClusterCut(value)) {
897 fCuts[kclsTPCCut] = value;
898 UpdateCutString(cutID, value);
900 } else return kFALSE;
903 if( SetEtaCut(value)) {
904 fCuts[ketaCut] = value;
905 UpdateCutString(cutID, value);
907 } else return kFALSE;
909 if( SetPtCut(value)) {
910 fCuts[kptCut] = value;
911 UpdateCutString(cutID, value);
913 } else return kFALSE;
916 if( SetDCACut(value)) {
917 fCuts[kDCACut] = value;
918 UpdateCutString(cutID, value);
920 } else return kFALSE;
924 if( SetPsiPairCut(value)) {
925 fCuts[kPsiPair] = value;
926 UpdateCutString(cutID, value);
928 } else return kFALSE;
930 case kRejectSharedElecGamma:
931 if( SetRejectSharedElecGamma(value)) {
932 fCuts[kRejectSharedElecGamma] = value;
933 UpdateCutString(cutID, value);
935 } else return kFALSE;
937 case kBackgroundScheme:
938 if( SetBackgroundScheme(value)) {
939 fCuts[kBackgroundScheme] = value;
940 UpdateCutString(cutID, value);
942 } else return kFALSE;
944 case kNumberOfRotations:
945 if( SetNumberOfRotations(value)) {
946 fCuts[kNumberOfRotations] = value;
947 UpdateCutString(cutID, value);
949 } else return kFALSE;
952 if( SetMassCut(value)) {
953 fCuts[kmassCut] = value;
954 UpdateCutString(cutID, value);
956 } else return kFALSE;
958 if( SetDoWeights(value)) {
959 fCuts[kWeights] = value;
960 UpdateCutString(cutID, value);
962 } else return kFALSE;
966 cout << "Error:: Cut id out of range"<< endl;
970 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
977 ///________________________________________________________________________
979 void 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]);
987 ///________________________________________________________________________
988 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
991 switch(ededxSigmaCut){
994 fDodEdxSigmaITSCut = kFALSE;
995 fPIDnSigmaBelowElectronLineITS=-100;
996 fPIDnSigmaAboveElectronLineITS= 100;
999 fDodEdxSigmaITSCut = kTRUE;
1000 fPIDnSigmaBelowElectronLineITS=-10;
1001 fPIDnSigmaAboveElectronLineITS=10;
1004 fDodEdxSigmaITSCut = kTRUE;
1005 fPIDnSigmaBelowElectronLineITS=-6;
1006 fPIDnSigmaAboveElectronLineITS=7;
1009 fDodEdxSigmaITSCut = kTRUE;
1010 fPIDnSigmaBelowElectronLineITS=-5;
1011 fPIDnSigmaAboveElectronLineITS=5;
1014 fDodEdxSigmaITSCut = kTRUE;
1015 fPIDnSigmaBelowElectronLineITS=-4;
1016 fPIDnSigmaAboveElectronLineITS=5;
1019 fDodEdxSigmaITSCut = kTRUE;
1020 fPIDnSigmaBelowElectronLineITS=-3;
1021 fPIDnSigmaAboveElectronLineITS=5;
1024 fDodEdxSigmaITSCut = kTRUE;
1025 fPIDnSigmaBelowElectronLineITS=-4;
1026 fPIDnSigmaAboveElectronLineITS=4;
1029 fDodEdxSigmaITSCut = kTRUE;
1030 fPIDnSigmaBelowElectronLineITS=-2.5;
1031 fPIDnSigmaAboveElectronLineITS=4;
1034 fDodEdxSigmaITSCut = kTRUE;
1035 fPIDnSigmaBelowElectronLineITS=-2;
1036 fPIDnSigmaAboveElectronLineITS=3.5;
1039 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1046 ///________________________________________________________________________
1047 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
1049 switch(ededxSigmaCut){
1051 case 0: fDodEdxSigmaTPCCut = kFALSE;
1052 fPIDnSigmaBelowElectronLineTPC=-10;
1053 fPIDnSigmaAboveElectronLineTPC=10;
1056 fDodEdxSigmaTPCCut = kTRUE;
1057 fPIDnSigmaBelowElectronLineTPC=-10;
1058 fPIDnSigmaAboveElectronLineTPC=10;
1061 fDodEdxSigmaTPCCut = kTRUE;
1062 fPIDnSigmaBelowElectronLineTPC=-6;
1063 fPIDnSigmaAboveElectronLineTPC=7;
1066 fDodEdxSigmaTPCCut = kTRUE;
1067 fPIDnSigmaBelowElectronLineTPC=-5;
1068 fPIDnSigmaAboveElectronLineTPC=5;
1071 fDodEdxSigmaTPCCut = kTRUE;
1072 fPIDnSigmaBelowElectronLineTPC=-4;
1073 fPIDnSigmaAboveElectronLineTPC=5;
1076 fDodEdxSigmaTPCCut = kTRUE;
1077 fPIDnSigmaBelowElectronLineTPC=-3;
1078 fPIDnSigmaAboveElectronLineTPC=5;
1081 fDodEdxSigmaTPCCut = kTRUE;
1082 fPIDnSigmaBelowElectronLineTPC=-4;
1083 fPIDnSigmaAboveElectronLineTPC=4;
1086 fDodEdxSigmaTPCCut = kTRUE;
1087 fPIDnSigmaBelowElectronLineTPC=-2.5;
1088 fPIDnSigmaAboveElectronLineTPC=4;
1091 fDodEdxSigmaTPCCut = kTRUE;
1092 fPIDnSigmaBelowElectronLineTPC=-2;
1093 fPIDnSigmaAboveElectronLineTPC=3.5;
1096 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1103 ///________________________________________________________________________
1104 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
1107 switch(pidedxSigmaCut){
1109 case 0: fPIDnSigmaAbovePionLineTPC= 0;
1110 fPIDnSigmaAbovePionLineTPCHighPt=-100;
1113 fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1114 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1117 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1118 fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1121 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1122 fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1125 fPIDnSigmaAbovePionLineTPC=1;
1126 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1129 fPIDnSigmaAbovePionLineTPC=2.;
1130 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1133 fPIDnSigmaAbovePionLineTPC=2.5;
1134 fPIDnSigmaAbovePionLineTPCHighPt=-10;
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;
1141 fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1142 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;
1145 fPIDnSigmaAbovePionLineTPC=1.5;
1146 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
1149 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1155 ///________________________________________________________________________
1156 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
1158 switch(piMomdedxSigmaCut){
1160 case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1163 fPIDMinPnSigmaAbovePionLineTPC=50.;
1166 fPIDMinPnSigmaAbovePionLineTPC=20.;
1169 fPIDMinPnSigmaAbovePionLineTPC=1.5;
1172 fPIDMinPnSigmaAbovePionLineTPC=1.;
1175 fPIDMinPnSigmaAbovePionLineTPC=0.5;
1178 fPIDMinPnSigmaAbovePionLineTPC=0.4;
1181 fPIDMinPnSigmaAbovePionLineTPC=0.3;
1184 fPIDMinPnSigmaAbovePionLineTPC=0.25;
1187 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1192 ///________________________________________________________________________
1193 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
1196 if( !fesdTrackCuts ) {
1198 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1204 case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
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
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
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
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
1226 case 7: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1227 fesdTrackCuts->SetMinNClustersITS(4);
1229 case 8: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1231 case 9: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1232 fesdTrackCuts->SetMinNClustersITS(4);
1236 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1243 ///________________________________________________________________________
1244 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1249 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1253 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1257 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
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;
1265 case 4: // 0% of findable clusters
1267 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1269 fUseCorrectedTPCClsInfo=0;
1271 case 5: // 35% of findable clusters
1273 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1274 fMinClsTPCToF= 0.35;
1275 fUseCorrectedTPCClsInfo=0;
1277 case 6: // 60% of findable clusters
1279 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1281 fUseCorrectedTPCClsInfo=0;
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;
1290 case 8: fMinClsTPC = 0.;
1291 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1292 fMinClsTPCToF= 0.35;
1293 fUseCorrectedTPCClsInfo=0;
1295 case 9: // 35% of findable clusters
1297 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1298 fMinClsTPCToF= 0.35;
1299 fUseCorrectedTPCClsInfo=1;
1303 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1309 ///________________________________________________________________________
1310 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
1339 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1343 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1346 case 8: fEtaCut = 0.4;
1349 case 9: fEtaCut = 0.65;
1353 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1359 ///________________________________________________________________________
1360 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)
1363 //0.1GeV, 0.125 GeV, 0.15 GeV
1367 case 0: fPtMinCut = 0.075;
1374 case 2: // 0.125 GeV
1383 case 4: fPtMinCut = 0.5;
1386 case 5: // 0.175 GeV
1391 cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1398 ///________________________________________________________________________
1399 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)
1403 if( !fesdTrackCuts ) {
1405 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1413 fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1414 fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1415 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1419 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1420 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1423 case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1424 fesdTrackCuts->SetMaxDCAToVertexXY(1);
1425 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1428 case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
1429 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1433 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1442 ///________________________________________________________________________
1443 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
1445 switch(piMaxMomdedxSigmaCut){
1448 fPIDMaxPnSigmaAbovePionLineTPC=0.;
1451 fPIDMaxPnSigmaAbovePionLineTPC=100.;
1454 fPIDMaxPnSigmaAbovePionLineTPC=5.;
1457 fPIDMaxPnSigmaAbovePionLineTPC=4.;
1460 fPIDMaxPnSigmaAbovePionLineTPC=3.5;
1463 fPIDMaxPnSigmaAbovePionLineTPC=3.;
1466 cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1472 ///________________________________________________________________________
1473 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
1475 switch(LowPRejectionSigmaCut){
1477 fDoKaonRejectionLowP=kFALSE;
1478 fDoProtonRejectionLowP=kFALSE;
1479 fDoPionRejectionLowP=kFALSE;
1480 fPIDnSigmaAtLowPAroundKaonLine=0;
1481 fPIDnSigmaAtLowPAroundProtonLine=0;
1482 fPIDnSigmaAtLowPAroundPionLine=0;
1483 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1486 fDoKaonRejectionLowP=kTRUE;
1487 fDoProtonRejectionLowP=kTRUE;
1488 fDoPionRejectionLowP=kTRUE;
1489 fPIDnSigmaAtLowPAroundKaonLine=0.5;
1490 fPIDnSigmaAtLowPAroundProtonLine=0.5;
1491 fPIDnSigmaAtLowPAroundPionLine=0.5;
1492 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1495 fDoKaonRejectionLowP=kTRUE;
1496 fDoProtonRejectionLowP=kTRUE;
1497 fDoPionRejectionLowP=kTRUE;
1498 fPIDnSigmaAtLowPAroundKaonLine=1.0;
1499 fPIDnSigmaAtLowPAroundProtonLine=1.0;
1500 fPIDnSigmaAtLowPAroundPionLine=1.0;
1501 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1504 fDoKaonRejectionLowP=kTRUE;
1505 fDoProtonRejectionLowP=kTRUE;
1506 fDoPionRejectionLowP=kTRUE;
1507 fPIDnSigmaAtLowPAroundKaonLine=1.5;
1508 fPIDnSigmaAtLowPAroundProtonLine=1.5;
1509 fPIDnSigmaAtLowPAroundPionLine=1.5;
1510 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1513 fDoKaonRejectionLowP=kTRUE;
1514 fDoProtonRejectionLowP=kTRUE;
1515 fDoPionRejectionLowP=kTRUE;
1516 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1517 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1518 fPIDnSigmaAtLowPAroundPionLine=2.0;
1519 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1522 fDoKaonRejectionLowP=kTRUE;
1523 fDoProtonRejectionLowP=kTRUE;
1524 fDoPionRejectionLowP=kTRUE;
1525 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1526 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1527 fPIDnSigmaAtLowPAroundPionLine=2.5;
1528 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1531 fDoKaonRejectionLowP=kTRUE;
1532 fDoProtonRejectionLowP=kTRUE;
1533 fDoPionRejectionLowP=kTRUE;
1534 fPIDnSigmaAtLowPAroundKaonLine=0.;
1535 fPIDnSigmaAtLowPAroundProtonLine=0.;
1536 fPIDnSigmaAtLowPAroundPionLine=2.;
1537 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1540 fDoKaonRejectionLowP=kFALSE;
1541 fDoProtonRejectionLowP=kFALSE;
1542 fDoPionRejectionLowP=kTRUE;
1543 fPIDnSigmaAtLowPAroundKaonLine=0.0;
1544 fPIDnSigmaAtLowPAroundProtonLine=0.0;
1545 fPIDnSigmaAtLowPAroundPionLine=1.0;
1546 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1549 fDoKaonRejectionLowP=kFALSE;
1550 fDoProtonRejectionLowP=kFALSE;
1551 fDoPionRejectionLowP=kTRUE;
1552 fPIDnSigmaAtLowPAroundKaonLine=0.;
1553 fPIDnSigmaAtLowPAroundProtonLine=0.;
1554 fPIDnSigmaAtLowPAroundPionLine=0.5;
1555 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1558 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1564 ///________________________________________________________________________
1565 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
1567 switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1569 fRequireTOF = kFALSE;
1570 fUseTOFpid = kFALSE;
1571 fTofPIDnSigmaBelowElectronLine=-100;
1572 fTofPIDnSigmaAboveElectronLine=100;
1575 fRequireTOF = kFALSE;
1577 fTofPIDnSigmaBelowElectronLine=-7;
1578 fTofPIDnSigmaAboveElectronLine=7;
1581 fRequireTOF = kFALSE;
1583 fTofPIDnSigmaBelowElectronLine=-5;
1584 fTofPIDnSigmaAboveElectronLine=5;
1587 fRequireTOF = kFALSE;
1589 fTofPIDnSigmaBelowElectronLine=-3;
1590 fTofPIDnSigmaAboveElectronLine=5;
1593 fRequireTOF = kFALSE;
1595 fTofPIDnSigmaBelowElectronLine=-2;
1596 fTofPIDnSigmaAboveElectronLine=3;
1598 case 5: // -3, 3 TOF mandatory
1599 fRequireTOF = kTRUE;
1601 fTofPIDnSigmaBelowElectronLine= -3;
1602 fTofPIDnSigmaAboveElectronLine= 3;
1605 cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1607 } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
1610 ///_______________________________________________________________________________
1612 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
1617 fDoPsiPairCut = kFALSE;
1618 fPsiPairCut = 10000.; //
1619 fDeltaPhiCutMin = -1000.;
1620 fDeltaPhiCutMax = 1000.;
1624 fDoPsiPairCut = kTRUE;
1625 fPsiPairCut = 0.45; // Standard
1626 fDeltaPhiCutMin = 0.0;
1627 fDeltaPhiCutMax = 0.12;
1630 fDoPsiPairCut = kTRUE;
1632 fDeltaPhiCutMin = 0.0;
1633 fDeltaPhiCutMax = 0.12;
1636 fDoPsiPairCut = kTRUE;
1638 fDeltaPhiCutMin = 0.0;
1639 fDeltaPhiCutMax = 0.12;
1642 fDoPsiPairCut = kTRUE;
1644 fDeltaPhiCutMin = 0.0;
1645 fDeltaPhiCutMax = 0.12;
1649 cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1656 ///_______________________________________________________________________________
1657 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
1662 fDoRejectSharedElecGamma = kFALSE;
1663 fRadiusCut = 10000; //
1666 fDoRejectSharedElecGamma = kTRUE;
1667 fRadiusCut = 2.0; // cm
1670 fDoRejectSharedElecGamma = kTRUE;
1671 fRadiusCut = 3.0; // Standard
1674 fDoRejectSharedElecGamma = kTRUE;
1675 fRadiusCut = 4.0; //
1678 fDoRejectSharedElecGamma = kTRUE;
1679 fRadiusCut = 5.0; //
1682 fDoRejectSharedElecGamma = kTRUE;
1683 fRadiusCut = 10.0; //
1686 fDoRejectSharedElecGamma = kTRUE;
1687 fRadiusCut = 15.0; //
1690 cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1696 ///__________________________________________________________________________
1697 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1700 switch(BackgroundScheme){
1704 fUseTrackMultiplicityForBG = kFALSE;
1706 case 1: // mixed event with V0 multiplicity
1708 fUseTrackMultiplicityForBG = kFALSE;
1710 case 2: // mixed event with track multiplicity
1711 fUseTrackMultiplicityForBG = kTRUE;
1715 fUseTrackMultiplicityForBG = kFALSE;
1719 fUseTrackMultiplicityForBG = kTRUE;
1722 case 5: fUseTrackMultiplicityForBG = kTRUE;
1727 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1733 ///________________________________________________________________________
1734 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
1736 switch(NumberOfRotations){
1738 fnumberOfRotationEventsForBG = 5;
1741 fnumberOfRotationEventsForBG = 10;
1744 fnumberOfRotationEventsForBG = 15;
1747 fnumberOfRotationEventsForBG = 20;
1750 fnumberOfRotationEventsForBG = 2;
1753 fnumberOfRotationEventsForBG = 50;
1756 fnumberOfRotationEventsForBG = 80;
1759 fnumberOfRotationEventsForBG = 100;
1762 cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
1770 ///________________________________________________________________________
1771 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)
1775 case 0: fDoWeights = kFALSE;
1777 case 1: fDoWeights = kTRUE;
1780 cout<<"Warning: Weights option not defined "<<opc<<endl;
1785 ///________________________________________________________________________
1786 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)
1792 fMassCutPtMin = -999.; //GeV
1793 fMassCutLowPt = 999.; //GeV/c^2
1794 fMassCutHighPt = 999.; //GeV/c^2
1796 fDoMassCut = kFALSE;
1797 fDoMassMinCut = kFALSE;
1800 //fMassCut = 0.135; //GeV/c^2
1801 fMassCutPtMin = -999.; //GeV
1802 fMassCutLowPt = 0.135; //GeV/c^2
1803 fMassCutHighPt = 0.135; //GeV/c^2
1806 fDoMassMinCut = kFALSE;
1809 //fMassCut = 0.100; //GeV/c^2
1810 fMassCutPtMin = -999.; //GeV
1811 fMassCutLowPt = 0.100; //GeV/c^2
1812 fMassCutHighPt = 0.100; //GeV/c^2
1815 fDoMassMinCut = kFALSE;
1818 /*fMassCut = 0.075; //GeV/c^2 Changed from Feb 25
1819 fMassCutPtMin = -999.; //GeV
1820 fMassCutLowPt = 0.075; //GeV/c^2
1821 fMassCutHighPt = 0.075; //GeV/c^2
1823 fDoMassMinCut = kFALSE;*/
1824 fMassCutPtMin = 1.0; //GeV
1825 fMassCutLowPt = 0.015; //GeV/c^2
1826 fMassCutHighPt = 0.035; //GeV/c^2
1827 fMassMinCut = 0.002;
1829 fDoMassMinCut = kTRUE;
1832 //fMassCut = 0.050; //GeV/c^2
1833 fMassCutPtMin = -999.; //GeV
1834 fMassCutLowPt = 0.050; //GeV/c^2
1835 fMassCutHighPt = 0.050; //GeV/c^2
1838 fDoMassMinCut = kFALSE;
1842 fMassCutPtMin = -999.; //GeV
1843 fMassCutLowPt = 0.035; //GeV/c^2
1844 fMassCutHighPt = 0.035; //GeV/c^2
1847 fDoMassMinCut = kFALSE;
1850 fMassCutPtMin = -999.; //GeV
1851 fMassCutLowPt = 0.015; //GeV/c^2
1852 fMassCutHighPt = 0.015; //GeV/c^2
1855 fDoMassMinCut = kFALSE;
1857 case 7: fMassCutPtMin = 1.0; //GeV
1858 fMassCutLowPt = 0.015; //GeV/c^2
1859 fMassCutHighPt = 0.035; //GeV/c^2
1862 fDoMassMinCut = kFALSE;
1864 case 8: fMassCutPtMin = 1.0; //GeV
1865 fMassCutLowPt = 0.015; //GeV/c^2
1866 fMassCutHighPt = 0.050; //GeV/c^2
1869 fDoMassMinCut = kFALSE;
1871 case 9: fMassCutPtMin = 1.0; //GeV
1872 fMassCutLowPt = 0.025; //GeV/c^2
1873 fMassCutHighPt = 0.035; //GeV/c^2
1876 fDoMassMinCut = kFALSE;
1879 cout<<"Warning: MassCut not defined "<<massCut<<endl;
1887 ///________________________________________________________________________
1888 TString AliDalitzElectronCuts::GetCutNumber(){
1889 // returns TString with current cut number
1891 for(Int_t ii=0;ii<kNCuts;ii++){
1892 a.Append(Form("%d",fCuts[ii]));
1898 ///________________________________________________________________________
1899 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
1900 //Create and return standard 2010 PbPb cuts
1901 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
1902 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1903 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
1907 ///________________________________________________________________________
1908 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
1909 //Create and return standard 2010 PbPb cuts
1910 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
1912 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1913 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}