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),
125 fUseVPhotonMCPSmearing(kFALSE),
129 hITSdEdxbefore(NULL),
131 hTPCdEdxbefore(NULL),
133 hTPCdEdxSignalbefore(NULL),
134 hTPCdEdxSignalafter(NULL),
137 hTrackDCAxyPtbefore(NULL),
138 hTrackDCAxyPtafter(NULL),
139 hTrackDCAzPtbefore(NULL),
140 hTrackDCAzPtafter(NULL),
141 hTrackNFindClsPtTPCbefore(NULL),
142 hTrackNFindClsPtTPCafter(NULL)
145 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
146 fCutString=new TObjString((GetCutNumber()).Data());
148 //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
149 // Using standard function for setting Cuts
150 Bool_t selectPrimaries=kFALSE;
151 fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
154 //________________________________________________________________________
155 AliDalitzElectronCuts::~AliDalitzElectronCuts() {
157 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
159 // delete fHistograms;
160 // fHistograms = NULL;
162 if(fCutString != NULL){
170 //________________________________________________________________________
171 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
173 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
175 TH1::AddDirectory(kFALSE);
177 TString cutName = "";
180 cutName = GetCutNumber().Data();
183 cutName = cutNumber.Data();
186 if(fHistograms != NULL){
190 if(fHistograms==NULL){
191 fHistograms=new TList();
192 if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
193 else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
197 Int_t kDedxSignalbins = 200;
199 const Int_t kDCABins=62;
201 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};
203 const Int_t kPtBins=110;
204 Double_t binsPtDummy[kPtBins+1];
205 const Int_t kPBins = 109;
206 Double_t binsPDummy[kPBins+1];
210 for(Int_t i=1;i<kPtBins+1;i++)
212 if(binsPtDummy[i-1]+0.05<1.01)
213 binsPtDummy[i]=binsPtDummy[i-1]+0.05;
215 binsPtDummy[i]=binsPtDummy[i-1]+0.1;
218 for(Int_t i=1; i <kPBins+1;i++){
220 if( binsPDummy[i-1]+0.05<1.01)
221 binsPDummy[i] = binsPDummy[i-1]+0.05;
223 binsPDummy[i] = binsPDummy[i-1]+0.1;
229 hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
230 hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
231 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
232 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
233 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
234 hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
235 fHistograms->Add(hCutIndex);
240 hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
241 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
242 hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
243 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
244 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
245 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
246 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
247 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
248 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
249 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
250 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
251 fHistograms->Add(hdEdxCuts);
255 TAxis *AxisBeforeITS = NULL;
256 TAxis *AxisBeforedEdx = NULL;
257 TAxis *AxisBeforeTOF = NULL;
258 TAxis *AxisBeforedEdxSignal = NULL;
263 hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
264 fHistograms->Add(hITSdEdxbefore);
265 AxisBeforeITS = hITSdEdxbefore->GetXaxis();
267 hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
268 fHistograms->Add(hTPCdEdxbefore);
269 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
271 hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
272 fHistograms->Add(hTPCdEdxSignalbefore);
273 AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
275 hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
276 fHistograms->Add(hTOFbefore);
277 AxisBeforeTOF = hTOFbefore->GetXaxis();
279 hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
280 fHistograms->Add(hTrackDCAxyPtbefore);
282 hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
283 fHistograms->Add(hTrackDCAzPtbefore);
285 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);
286 fHistograms->Add(hTrackNFindClsPtTPCbefore);
293 hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
294 fHistograms->Add(hITSdEdxafter);
296 hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
297 fHistograms->Add(hTPCdEdxafter);
299 hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
300 fHistograms->Add(hTPCdEdxSignalafter);
302 hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
303 fHistograms->Add(hTOFafter);
305 hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
306 fHistograms->Add(hTrackDCAxyPtafter);
308 hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
309 fHistograms->Add(hTrackDCAzPtafter);
311 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);
312 fHistograms->Add(hTrackNFindClsPtTPCafter);
316 TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
317 Int_t bins = AxisAfter->GetNbins();
318 Double_t from = AxisAfter->GetXmin();
319 Double_t to = AxisAfter->GetXmax();
320 Double_t *newBins = new Double_t[bins+1];
322 Double_t factor = TMath::Power(to/from, 1./bins);
323 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
324 AxisAfter->Set(bins, newBins);
325 AxisAfter = hTOFafter->GetXaxis();
326 AxisAfter->Set(bins, newBins);
327 AxisAfter = hITSdEdxafter->GetXaxis();
328 AxisAfter->Set(bins,newBins);
329 AxisAfter = hTPCdEdxSignalafter->GetXaxis();
330 AxisAfter->Set(bins,newBins);
333 AxisBeforeITS->Set(bins, newBins);
334 AxisBeforedEdx->Set(bins, newBins);
335 AxisBeforedEdxSignal->Set(bins,newBins);
336 AxisBeforeTOF->Set(bins, newBins);
341 TH1::AddDirectory(kTRUE);
343 // Event Cuts and Info
347 //________________________________________________________________________
348 Bool_t AliDalitzElectronCuts::InitPIDResponse(){
350 // Set Pointer to AliPIDResponse
352 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
356 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
357 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
358 if(fPIDResponse)return kTRUE;
364 ///________________________________________________________________________
365 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)
367 if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;
368 if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
370 TParticle* particle = fMCStack->Particle(labelParticle);
372 if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
375 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
384 ///________________________________________________________________________
385 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
387 //Selection of Reconstructed electrons
392 lTrack->GetImpactParameters(b,bCov);
394 if (bCov[0]<=0 || bCov[2]<=0) {
395 AliDebug(1, "Estimated b resolution lower or equal zero!");
396 bCov[0]=0; bCov[2]=0;
401 Float_t dcaToVertexXY = b[0];
402 Float_t dcaToVertexZ = b[1];
403 Double_t clsToF = GetNFindableClustersTPC(lTrack);
405 if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
406 if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
407 if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
411 if(hCutIndex)hCutIndex->Fill(kElectronIn);
414 if(hCutIndex)hCutIndex->Fill(kNoTracks);
418 if ( ! lTrack->GetConstrainedParam() ){
421 AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
425 if( !TrackIsSelected(lTrack) ){
426 if(hCutIndex)hCutIndex->Fill(kTrackCuts);
432 if( ! dEdxCuts( track ) ) {
433 if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
438 //Electron passed the cuts
439 if(hCutIndex)hCutIndex->Fill(kElectronOut);
441 if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
442 if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
443 if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
449 ///________________________________________________________________________
450 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
451 // Track Selection for Photon Reconstruction
454 Double_t clsToF = GetNFindableClustersTPC(lTrack);
457 if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
463 if( lTrack->Eta() > (fEtaCut + fEtaShift) || lTrack->Eta() < (-fEtaCut + fEtaShift) ) {
469 if( lTrack->Pt() < fPtMinCut || lTrack->Pt() > fPtMaxCut ) {
477 if( clsToF < fMinClsTPCToF){
485 ///________________________________________________________________________
486 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
488 // Electron Identification Cuts for Photon reconstruction
490 if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
491 if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
495 //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
501 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
502 if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
503 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
504 if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
510 if( fDodEdxSigmaITSCut == kTRUE ){
513 if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
514 fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
516 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
522 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
528 if(fDodEdxSigmaTPCCut == kTRUE){
532 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
533 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
535 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
541 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
542 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
543 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
544 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
546 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
553 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
554 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
555 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
556 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
558 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
569 if( fDoKaonRejectionLowP == kTRUE ){
571 if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
573 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
575 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
583 if( fDoProtonRejectionLowP == kTRUE ){
585 if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
586 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
588 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
595 if(fDoPionRejectionLowP == kTRUE){
596 if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
597 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
599 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
607 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
608 if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
610 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
611 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
612 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
616 if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
618 else if ( fRequireTOF == kTRUE ) {
620 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
625 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
626 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
627 if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
631 ///________________________________________________________________________
634 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
635 //Returns pointer to the track with given ESD label
636 //(Important for AOD implementation, since Track array in AOD data is different
637 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
639 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
641 if(label > event->GetNumberOfTracks() ) return NULL;
642 AliESDtrack * track = esdEvent->GetTrack(label);
646 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
647 AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
650 if(track->GetID() == label) {
657 cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
660 ///________________________________________________________________________
661 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
664 for(Int_t i = 0;i<photons->GetEntries();i++){
666 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
668 Int_t posLabel = photonComp->GetTrackLabelPositive();
669 Int_t negLabel = photonComp->GetTrackLabelNegative();
671 if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
678 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
680 if( pi0CandidatePt < fMassCutPtMin ){
682 if( vphotonCandidateMass < fMassCutLowPt ){
689 if( vphotonCandidateMass < fMassCutHighPt ){
699 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){
704 if( fUseCrossedRows == kFALSE ) {
706 if ( !fUseCorrectedTPCClsInfo ){
707 if(lTrack->GetTPCNclsF()!=0){
709 clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
710 }// Ncluster/Nfindablecluster
714 //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
715 clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
720 Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
722 if ( lTrack->GetTPCNclsF()>0 ) {
723 clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
732 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
735 // This angle is a measure for the contribution of the opening in polar
736 // direction ??0 to the opening angle ?? Pair
738 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
739 // Master Thesis. Thorsten Dahms. 2005
740 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
744 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
745 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
747 TVector3 posDaughter;
748 TVector3 negDaughter;
750 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
751 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
753 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
754 Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
756 if( openingAngle < 1e-20 ) return 0.;
758 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
763 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
766 // Returns true if it is a gamma conversion according to psi pair value
768 return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
769 TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
772 ///________________________________________________________________________
773 Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
774 ///Update the cut string (if it has been created yet)
776 if(fCutString && fCutString->GetString().Length() == kNCuts) {
777 cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
778 fCutString->SetString(GetCutNumber());
780 cout << "fCutString not yet initialized, will not be updated" << endl;
783 // cout << fCutString->GetString().Data() << endl;
787 ///________________________________________________________________________
788 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
789 // Initialize Cuts from a given Cut string
791 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
792 AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
794 if(analysisCutSelection.Length()!=kNCuts) {
795 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
798 if(!analysisCutSelection.IsDigit()){
799 AliError("Cut selection contains characters");
803 const char *cutSelection = analysisCutSelection.Data();
804 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
805 for(Int_t ii=0;ii<kNCuts;ii++){
811 AliError("Analysis Cut Selection does not start with 9");
816 // Set Individual Cuts
817 for(Int_t ii=0;ii<kNCuts;ii++){
818 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
825 ///________________________________________________________________________
826 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
827 ///Set individual cut ID
829 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
833 fCuts[kgoodId] = value;
835 cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
841 case kededxSigmaITSCut:
842 if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
843 fCuts[kededxSigmaITSCut] = value;
844 UpdateCutString(cutID, value);
846 } else return kFALSE;
848 case kededxSigmaTPCCut:
849 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
850 fCuts[kededxSigmaTPCCut] = value;
851 UpdateCutString(cutID, value);
853 } else return kFALSE;
855 case kpidedxSigmaTPCCut:
856 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
857 fCuts[kpidedxSigmaTPCCut] = value;
858 UpdateCutString(cutID, value);
860 } else return kFALSE;
862 case kpiMinMomdedxSigmaTPCCut:
863 if( SetMinMomPiondEdxTPCCut(value)) {
864 fCuts[kpiMinMomdedxSigmaTPCCut] = value;
865 UpdateCutString(cutID, value);
867 } else return kFALSE;
869 case kpiMaxMomdedxSigmaTPCCut:
870 if( SetMaxMomPiondEdxTPCCut(value)) {
871 fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
872 UpdateCutString(cutID, value);
874 } else return kFALSE;
876 case kLowPRejectionSigmaCut:
877 if( SetLowPRejectionCuts(value) ) {
878 fCuts[kLowPRejectionSigmaCut] = value;
879 UpdateCutString(cutID, value);
881 } else return kFALSE;
884 case kTOFelectronPID:
885 if( SetTOFElectronPIDCut(value)) {
886 fCuts[kTOFelectronPID] = value;
887 UpdateCutString(cutID, value);
889 } else return kFALSE;
891 if( SetITSClusterCut(value) ) {
892 fCuts[kclsITSCut] = value;
893 UpdateCutString(cutID, value);
895 } else return kFALSE;
897 if( SetTPCClusterCut(value)) {
898 fCuts[kclsTPCCut] = value;
899 UpdateCutString(cutID, value);
901 } else return kFALSE;
904 if( SetEtaCut(value)) {
905 fCuts[ketaCut] = value;
906 UpdateCutString(cutID, value);
908 } else return kFALSE;
910 if( SetPtCut(value)) {
911 fCuts[kptCut] = value;
912 UpdateCutString(cutID, value);
914 } else return kFALSE;
917 if( SetDCACut(value)) {
918 fCuts[kDCACut] = value;
919 UpdateCutString(cutID, value);
921 } else return kFALSE;
925 if( SetPsiPairCut(value)) {
926 fCuts[kPsiPair] = value;
927 UpdateCutString(cutID, value);
929 } else return kFALSE;
931 case kRejectSharedElecGamma:
932 if( SetRejectSharedElecGamma(value)) {
933 fCuts[kRejectSharedElecGamma] = value;
934 UpdateCutString(cutID, value);
936 } else return kFALSE;
938 case kBackgroundScheme:
939 if( SetBackgroundScheme(value)) {
940 fCuts[kBackgroundScheme] = value;
941 UpdateCutString(cutID, value);
943 } else return kFALSE;
945 case kNumberOfRotations:
946 if( SetNumberOfRotations(value)) {
947 fCuts[kNumberOfRotations] = value;
948 UpdateCutString(cutID, value);
950 } else return kFALSE;
953 if( SetMassCut(value)) {
954 fCuts[kmassCut] = value;
955 UpdateCutString(cutID, value);
957 } else return kFALSE;
959 if( SetDoWeights(value)) {
960 fCuts[kWeights] = value;
961 UpdateCutString(cutID, value);
963 } else return kFALSE;
965 case kuseVPhotonMCPSmearing:
967 if( SetUseVPhotonMCPmearing(value)) {
968 fCuts[kuseVPhotonMCPSmearing] = value;
969 UpdateCutString(cutID, value);
971 } else return kFALSE;
974 cout << "Error:: Cut id out of range"<< endl;
978 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
985 ///________________________________________________________________________
987 void AliDalitzElectronCuts::PrintCuts() {
988 // Print out current Cut Selection
989 for(Int_t ic = 0; ic < kNCuts; ic++) {
990 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
995 ///________________________________________________________________________
996 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
999 switch(ededxSigmaCut){
1002 fDodEdxSigmaITSCut = kFALSE;
1003 fPIDnSigmaBelowElectronLineITS=-100;
1004 fPIDnSigmaAboveElectronLineITS= 100;
1007 fDodEdxSigmaITSCut = kTRUE;
1008 fPIDnSigmaBelowElectronLineITS=-10;
1009 fPIDnSigmaAboveElectronLineITS=10;
1012 fDodEdxSigmaITSCut = kTRUE;
1013 fPIDnSigmaBelowElectronLineITS=-6;
1014 fPIDnSigmaAboveElectronLineITS=7;
1017 fDodEdxSigmaITSCut = kTRUE;
1018 fPIDnSigmaBelowElectronLineITS=-5;
1019 fPIDnSigmaAboveElectronLineITS=5;
1022 fDodEdxSigmaITSCut = kTRUE;
1023 fPIDnSigmaBelowElectronLineITS=-4;
1024 fPIDnSigmaAboveElectronLineITS=5;
1027 fDodEdxSigmaITSCut = kTRUE;
1028 fPIDnSigmaBelowElectronLineITS=-3;
1029 fPIDnSigmaAboveElectronLineITS=5;
1032 fDodEdxSigmaITSCut = kTRUE;
1033 fPIDnSigmaBelowElectronLineITS=-4;
1034 fPIDnSigmaAboveElectronLineITS=4;
1037 fDodEdxSigmaITSCut = kTRUE;
1038 fPIDnSigmaBelowElectronLineITS=-2.5;
1039 fPIDnSigmaAboveElectronLineITS=4;
1042 fDodEdxSigmaITSCut = kTRUE;
1043 fPIDnSigmaBelowElectronLineITS=-2;
1044 fPIDnSigmaAboveElectronLineITS=3.5;
1047 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1054 ///________________________________________________________________________
1055 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
1057 switch(ededxSigmaCut){
1059 case 0: fDodEdxSigmaTPCCut = kFALSE;
1060 fPIDnSigmaBelowElectronLineTPC=-10;
1061 fPIDnSigmaAboveElectronLineTPC=10;
1064 fDodEdxSigmaTPCCut = kTRUE;
1065 fPIDnSigmaBelowElectronLineTPC=-10;
1066 fPIDnSigmaAboveElectronLineTPC=10;
1069 fDodEdxSigmaTPCCut = kTRUE;
1070 fPIDnSigmaBelowElectronLineTPC=-6;
1071 fPIDnSigmaAboveElectronLineTPC=7;
1074 fDodEdxSigmaTPCCut = kTRUE;
1075 fPIDnSigmaBelowElectronLineTPC=-5;
1076 fPIDnSigmaAboveElectronLineTPC=5;
1079 fDodEdxSigmaTPCCut = kTRUE;
1080 fPIDnSigmaBelowElectronLineTPC=-4;
1081 fPIDnSigmaAboveElectronLineTPC=5;
1084 fDodEdxSigmaTPCCut = kTRUE;
1085 fPIDnSigmaBelowElectronLineTPC=-3;
1086 fPIDnSigmaAboveElectronLineTPC=5;
1089 fDodEdxSigmaTPCCut = kTRUE;
1090 fPIDnSigmaBelowElectronLineTPC=-4;
1091 fPIDnSigmaAboveElectronLineTPC=4;
1094 fDodEdxSigmaTPCCut = kTRUE;
1095 fPIDnSigmaBelowElectronLineTPC=-2.5;
1096 fPIDnSigmaAboveElectronLineTPC=4;
1099 fDodEdxSigmaTPCCut = kTRUE;
1100 fPIDnSigmaBelowElectronLineTPC=-2;
1101 fPIDnSigmaAboveElectronLineTPC=3.5;
1104 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1111 ///________________________________________________________________________
1112 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
1115 switch(pidedxSigmaCut){
1117 case 0: fPIDnSigmaAbovePionLineTPC= 0;
1118 fPIDnSigmaAbovePionLineTPCHighPt=-100;
1121 fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1122 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1125 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1126 fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1129 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1130 fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1133 fPIDnSigmaAbovePionLineTPC=1;
1134 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1137 fPIDnSigmaAbovePionLineTPC=2.;
1138 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1141 fPIDnSigmaAbovePionLineTPC=2.5;
1142 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1145 fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1146 fPIDnSigmaAbovePionLineTPCHighPt = 2.0;
1149 fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1150 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;
1153 fPIDnSigmaAbovePionLineTPC=1.5;
1154 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
1157 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1163 ///________________________________________________________________________
1164 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
1166 switch(piMomdedxSigmaCut){
1168 case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1171 fPIDMinPnSigmaAbovePionLineTPC=50.;
1174 fPIDMinPnSigmaAbovePionLineTPC=20.;
1177 fPIDMinPnSigmaAbovePionLineTPC=1.5;
1180 fPIDMinPnSigmaAbovePionLineTPC=1.;
1183 fPIDMinPnSigmaAbovePionLineTPC=0.5;
1186 fPIDMinPnSigmaAbovePionLineTPC=0.4;
1189 fPIDMinPnSigmaAbovePionLineTPC=0.3;
1192 fPIDMinPnSigmaAbovePionLineTPC=0.25;
1195 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1200 ///________________________________________________________________________
1201 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
1204 if( !fesdTrackCuts ) {
1206 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1212 case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1214 case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1215 break; //1 hit first layer of SPD
1216 case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1217 break; //1 hit in any layer of SPD
1218 case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1219 fesdTrackCuts->SetMinNClustersITS(4);
1220 // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1222 case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1223 fesdTrackCuts->SetMinNClustersITS(3);
1224 // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1226 case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1227 fesdTrackCuts->SetMinNClustersITS(4);
1228 // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1230 case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1231 fesdTrackCuts->SetMinNClustersITS(5);
1232 // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1234 case 7: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1235 fesdTrackCuts->SetMinNClustersITS(4);
1237 case 8: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1239 case 9: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1240 fesdTrackCuts->SetMinNClustersITS(4);
1244 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1251 ///________________________________________________________________________
1252 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1257 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1261 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1265 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1267 case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1268 fMinClsTPCToF = 0.8;
1269 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1270 fesdTrackCuts->SetMinNClustersTPC(0);
1271 fUseCrossedRows = kTRUE;
1273 case 4: // 0% of findable clusters
1275 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1277 fUseCorrectedTPCClsInfo=0;
1279 case 5: // 35% of findable clusters
1281 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1282 fMinClsTPCToF= 0.35;
1283 fUseCorrectedTPCClsInfo=0;
1285 case 6: // 60% of findable clusters
1287 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1289 fUseCorrectedTPCClsInfo=0;
1291 case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1292 // Changed 2014-02-04 before fMinClsTPC = 50.;
1293 fMinClsTPCToF = 0.6;
1294 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1295 fesdTrackCuts->SetMinNClustersTPC(0);
1296 fUseCrossedRows = kTRUE;
1298 case 8: fMinClsTPC = 0.;
1299 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1300 fMinClsTPCToF= 0.35;
1301 fUseCorrectedTPCClsInfo=0;
1303 case 9: // 35% of findable clusters
1305 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1306 fMinClsTPCToF= 0.35;
1307 fUseCorrectedTPCClsInfo=1;
1311 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1317 ///________________________________________________________________________
1318 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
1347 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1351 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1354 case 8: fEtaCut = 0.4;
1357 case 9: fEtaCut = 0.65;
1361 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1367 ///________________________________________________________________________
1368 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)
1371 //0.1GeV, 0.125 GeV, 0.15 GeV
1375 case 0: fPtMinCut = 0.075;
1382 case 2: // 0.125 GeV
1391 case 4: fPtMinCut = 0.5;
1394 case 5: // 0.175 GeV
1399 cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1406 ///________________________________________________________________________
1407 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)
1411 if( !fesdTrackCuts ) {
1413 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1421 fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1422 fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1423 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1427 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1428 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1431 case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1432 fesdTrackCuts->SetMaxDCAToVertexXY(1);
1433 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1436 case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
1437 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1441 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1450 ///________________________________________________________________________
1451 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
1453 switch(piMaxMomdedxSigmaCut){
1456 fPIDMaxPnSigmaAbovePionLineTPC=0.;
1459 fPIDMaxPnSigmaAbovePionLineTPC=100.;
1462 fPIDMaxPnSigmaAbovePionLineTPC=5.;
1465 fPIDMaxPnSigmaAbovePionLineTPC=4.;
1468 fPIDMaxPnSigmaAbovePionLineTPC=3.5;
1471 fPIDMaxPnSigmaAbovePionLineTPC=3.;
1474 cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1480 ///________________________________________________________________________
1481 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
1483 switch(LowPRejectionSigmaCut){
1485 fDoKaonRejectionLowP=kFALSE;
1486 fDoProtonRejectionLowP=kFALSE;
1487 fDoPionRejectionLowP=kFALSE;
1488 fPIDnSigmaAtLowPAroundKaonLine=0;
1489 fPIDnSigmaAtLowPAroundProtonLine=0;
1490 fPIDnSigmaAtLowPAroundPionLine=0;
1491 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1494 fDoKaonRejectionLowP=kTRUE;
1495 fDoProtonRejectionLowP=kTRUE;
1496 fDoPionRejectionLowP=kTRUE;
1497 fPIDnSigmaAtLowPAroundKaonLine=0.5;
1498 fPIDnSigmaAtLowPAroundProtonLine=0.5;
1499 fPIDnSigmaAtLowPAroundPionLine=0.5;
1500 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1503 fDoKaonRejectionLowP=kTRUE;
1504 fDoProtonRejectionLowP=kTRUE;
1505 fDoPionRejectionLowP=kTRUE;
1506 fPIDnSigmaAtLowPAroundKaonLine=1.0;
1507 fPIDnSigmaAtLowPAroundProtonLine=1.0;
1508 fPIDnSigmaAtLowPAroundPionLine=1.0;
1509 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1512 fDoKaonRejectionLowP=kTRUE;
1513 fDoProtonRejectionLowP=kTRUE;
1514 fDoPionRejectionLowP=kTRUE;
1515 fPIDnSigmaAtLowPAroundKaonLine=1.5;
1516 fPIDnSigmaAtLowPAroundProtonLine=1.5;
1517 fPIDnSigmaAtLowPAroundPionLine=1.5;
1518 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1521 fDoKaonRejectionLowP=kTRUE;
1522 fDoProtonRejectionLowP=kTRUE;
1523 fDoPionRejectionLowP=kTRUE;
1524 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1525 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1526 fPIDnSigmaAtLowPAroundPionLine=2.0;
1527 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1530 fDoKaonRejectionLowP=kTRUE;
1531 fDoProtonRejectionLowP=kTRUE;
1532 fDoPionRejectionLowP=kTRUE;
1533 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1534 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1535 fPIDnSigmaAtLowPAroundPionLine=2.5;
1536 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1539 fDoKaonRejectionLowP=kTRUE;
1540 fDoProtonRejectionLowP=kTRUE;
1541 fDoPionRejectionLowP=kTRUE;
1542 fPIDnSigmaAtLowPAroundKaonLine=0.;
1543 fPIDnSigmaAtLowPAroundProtonLine=0.;
1544 fPIDnSigmaAtLowPAroundPionLine=2.;
1545 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1548 fDoKaonRejectionLowP=kFALSE;
1549 fDoProtonRejectionLowP=kFALSE;
1550 fDoPionRejectionLowP=kTRUE;
1551 fPIDnSigmaAtLowPAroundKaonLine=0.0;
1552 fPIDnSigmaAtLowPAroundProtonLine=0.0;
1553 fPIDnSigmaAtLowPAroundPionLine=1.0;
1554 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1557 fDoKaonRejectionLowP=kFALSE;
1558 fDoProtonRejectionLowP=kFALSE;
1559 fDoPionRejectionLowP=kTRUE;
1560 fPIDnSigmaAtLowPAroundKaonLine=0.;
1561 fPIDnSigmaAtLowPAroundProtonLine=0.;
1562 fPIDnSigmaAtLowPAroundPionLine=0.5;
1563 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1566 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1572 ///________________________________________________________________________
1573 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
1575 switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1577 fRequireTOF = kFALSE;
1578 fUseTOFpid = kFALSE;
1579 fTofPIDnSigmaBelowElectronLine=-100;
1580 fTofPIDnSigmaAboveElectronLine=100;
1583 fRequireTOF = kFALSE;
1585 fTofPIDnSigmaBelowElectronLine=-7;
1586 fTofPIDnSigmaAboveElectronLine=7;
1589 fRequireTOF = kFALSE;
1591 fTofPIDnSigmaBelowElectronLine=-5;
1592 fTofPIDnSigmaAboveElectronLine=5;
1595 fRequireTOF = kFALSE;
1597 fTofPIDnSigmaBelowElectronLine=-3;
1598 fTofPIDnSigmaAboveElectronLine=5;
1601 fRequireTOF = kFALSE;
1603 fTofPIDnSigmaBelowElectronLine=-2;
1604 fTofPIDnSigmaAboveElectronLine=3;
1606 case 5: // -3, 3 TOF mandatory
1607 fRequireTOF = kTRUE;
1609 fTofPIDnSigmaBelowElectronLine= -3;
1610 fTofPIDnSigmaAboveElectronLine= 3;
1613 cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1615 } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
1618 ///_______________________________________________________________________________
1620 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
1625 fDoPsiPairCut = kFALSE;
1626 fPsiPairCut = 10000.; //
1627 fDeltaPhiCutMin = -1000.;
1628 fDeltaPhiCutMax = 1000.;
1632 fDoPsiPairCut = kTRUE;
1633 fPsiPairCut = 0.45; // Standard
1634 fDeltaPhiCutMin = 0.0;
1635 fDeltaPhiCutMax = 0.12;
1638 fDoPsiPairCut = kTRUE;
1640 fDeltaPhiCutMin = 0.0;
1641 fDeltaPhiCutMax = 0.12;
1644 fDoPsiPairCut = kTRUE;
1646 fDeltaPhiCutMin = 0.0;
1647 fDeltaPhiCutMax = 0.12;
1650 fDoPsiPairCut = kTRUE;
1652 fDeltaPhiCutMin = 0.0;
1653 fDeltaPhiCutMax = 0.12;
1657 cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1664 ///_______________________________________________________________________________
1665 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
1670 fDoRejectSharedElecGamma = kFALSE;
1671 fRadiusCut = 10000; //
1674 fDoRejectSharedElecGamma = kTRUE;
1675 fRadiusCut = 2.0; // cm
1678 fDoRejectSharedElecGamma = kTRUE;
1679 fRadiusCut = 3.0; // Standard
1682 fDoRejectSharedElecGamma = kTRUE;
1683 fRadiusCut = 4.0; //
1686 fDoRejectSharedElecGamma = kTRUE;
1687 fRadiusCut = 5.0; //
1690 fDoRejectSharedElecGamma = kTRUE;
1691 fRadiusCut = 10.0; //
1694 fDoRejectSharedElecGamma = kTRUE;
1695 fRadiusCut = 15.0; //
1698 cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1704 ///__________________________________________________________________________
1705 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1708 switch(BackgroundScheme){
1712 fUseTrackMultiplicityForBG = kFALSE;
1714 case 1: // mixed event with V0 multiplicity
1716 fUseTrackMultiplicityForBG = kFALSE;
1718 case 2: // mixed event with track multiplicity
1719 fUseTrackMultiplicityForBG = kTRUE;
1723 fUseTrackMultiplicityForBG = kFALSE;
1727 fUseTrackMultiplicityForBG = kTRUE;
1730 case 5: fUseTrackMultiplicityForBG = kTRUE;
1735 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1741 ///________________________________________________________________________
1742 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
1744 switch(NumberOfRotations){
1746 fnumberOfRotationEventsForBG = 5;
1749 fnumberOfRotationEventsForBG = 10;
1752 fnumberOfRotationEventsForBG = 15;
1755 fnumberOfRotationEventsForBG = 20;
1758 fnumberOfRotationEventsForBG = 2;
1761 fnumberOfRotationEventsForBG = 50;
1764 fnumberOfRotationEventsForBG = 80;
1767 fnumberOfRotationEventsForBG = 100;
1770 cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
1778 ///________________________________________________________________________
1779 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)
1783 case 0: fDoWeights = kFALSE;
1785 case 1: fDoWeights = kTRUE;
1788 cout<<"Warning: Weights option not defined "<<opc<<endl;
1793 ///________________________________________________________________________
1794 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)
1800 fMassCutPtMin = -999.; //GeV
1801 fMassCutLowPt = 999.; //GeV/c^2
1802 fMassCutHighPt = 999.; //GeV/c^2
1804 fDoMassCut = kFALSE;
1805 fDoMassMinCut = kFALSE;
1808 //fMassCut = 0.135; //GeV/c^2
1809 fMassCutPtMin = -999.; //GeV
1810 fMassCutLowPt = 0.135; //GeV/c^2
1811 fMassCutHighPt = 0.135; //GeV/c^2
1814 fDoMassMinCut = kFALSE;
1817 //fMassCut = 0.100; //GeV/c^2
1818 fMassCutPtMin = -999.; //GeV
1819 fMassCutLowPt = 0.100; //GeV/c^2
1820 fMassCutHighPt = 0.100; //GeV/c^2
1823 fDoMassMinCut = kFALSE;
1826 /*fMassCut = 0.075; //GeV/c^2 Changed from Feb 25
1827 fMassCutPtMin = -999.; //GeV
1828 fMassCutLowPt = 0.075; //GeV/c^2
1829 fMassCutHighPt = 0.075; //GeV/c^2
1831 fDoMassMinCut = kFALSE;*/
1832 fMassCutPtMin = 1.0; //GeV
1833 fMassCutLowPt = 0.015; //GeV/c^2
1834 fMassCutHighPt = 0.035; //GeV/c^2
1835 fMassMinCut = 0.002;
1837 fDoMassMinCut = kTRUE;
1840 //fMassCut = 0.050; //GeV/c^2
1841 fMassCutPtMin = -999.; //GeV
1842 fMassCutLowPt = 0.050; //GeV/c^2
1843 fMassCutHighPt = 0.050; //GeV/c^2
1846 fDoMassMinCut = kFALSE;
1850 fMassCutPtMin = -999.; //GeV
1851 fMassCutLowPt = 0.035; //GeV/c^2
1852 fMassCutHighPt = 0.035; //GeV/c^2
1855 fDoMassMinCut = kFALSE;
1858 fMassCutPtMin = -999.; //GeV
1859 fMassCutLowPt = 0.015; //GeV/c^2
1860 fMassCutHighPt = 0.015; //GeV/c^2
1863 fDoMassMinCut = kFALSE;
1865 case 7: fMassCutPtMin = 1.0; //GeV
1866 fMassCutLowPt = 0.015; //GeV/c^2
1867 fMassCutHighPt = 0.035; //GeV/c^2
1870 fDoMassMinCut = kFALSE;
1872 case 8: fMassCutPtMin = 1.0; //GeV
1873 fMassCutLowPt = 0.015; //GeV/c^2
1874 fMassCutHighPt = 0.050; //GeV/c^2
1877 fDoMassMinCut = kFALSE;
1879 case 9: fMassCutPtMin = 1.0; //GeV
1880 fMassCutLowPt = 0.025; //GeV/c^2
1881 fMassCutHighPt = 0.035; //GeV/c^2
1884 fDoMassMinCut = kFALSE;
1887 cout<<"Warning: MassCut not defined "<<massCut<<endl;
1892 Bool_t AliDalitzElectronCuts::SetUseVPhotonMCPmearing(Int_t useMCPSmearing)
1894 switch(useMCPSmearing){
1897 fUseVPhotonMCPSmearing=kFALSE;
1900 fUseVPhotonMCPSmearing=kTRUE;
1903 default: cout<<"Warning: MassCut not defined "<<useMCPSmearing<<endl;
1912 ///________________________________________________________________________
1913 TString AliDalitzElectronCuts::GetCutNumber(){
1914 // returns TString with current cut number
1916 for(Int_t ii=0;ii<kNCuts;ii++){
1917 a.Append(Form("%d",fCuts[ii]));
1923 ///________________________________________________________________________
1924 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
1925 //Create and return standard 2010 PbPb cuts
1926 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
1927 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1928 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
1932 ///________________________________________________________________________
1933 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
1934 //Create and return standard 2010 PbPb cuts
1935 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
1937 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1938 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}