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),
83 fDeltaPhiCutMax(0.12),
84 fMinClsTPC(0), // minimum clusters in the TPC
85 fMinClsTPCToF(0), // minimum clusters to findable clusters
86 fDodEdxSigmaITSCut(kFALSE),
87 fDodEdxSigmaTPCCut(kTRUE),
88 fDoTOFsigmaCut(kFALSE), // RRnewTOF
89 fDoRejectSharedElecGamma(kFALSE),
90 fDoPsiPairCut(kFALSE),
91 fPIDnSigmaAboveElectronLineITS(100),
92 fPIDnSigmaBelowElectronLineITS(-100),
93 fPIDnSigmaAboveElectronLineTPC(100),
94 fPIDnSigmaBelowElectronLineTPC(-100),
95 fPIDnSigmaAbovePionLineTPC(0),
96 fPIDnSigmaAbovePionLineTPCHighPt(-100),
97 fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
98 fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
99 fPIDMinPnSigmaAbovePionLineTPC(0),
100 fPIDMaxPnSigmaAbovePionLineTPC(0),
101 fDoKaonRejectionLowP(kFALSE),
102 fDoProtonRejectionLowP(kFALSE),
103 fDoPionRejectionLowP(kFALSE),
104 fPIDnSigmaAtLowPAroundKaonLine(0),
105 fPIDnSigmaAtLowPAroundProtonLine(0),
106 fPIDnSigmaAtLowPAroundPionLine(0),
107 fPIDMinPKaonRejectionLowP(1.5),
108 fPIDMinPProtonRejectionLowP(2.0),
109 fPIDMinPPionRejectionLowP(0.5),
110 fUseCorrectedTPCClsInfo(kFALSE),
111 fUseCrossedRows(kFALSE),
114 fUseTrackMultiplicityForBG(kFALSE),
116 fnumberOfRotationEventsForBG(0),
118 fDoMassMinCut(kFALSE),
120 fMassCutHighPt(999.),
121 fMassCutPtMin(-100.0),
124 fUseVPhotonMCPSmearing(kFALSE),
125 fUseElectronMCPSmearing(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),
143 hTrackPosEtabeforeDedx(NULL),
144 hTrackNegEtabeforeDedx(NULL),
145 hTrackPosEtaafterDedx(NULL),
146 hTrackNegEtaafterDedx(NULL)
149 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
150 fCutString=new TObjString((GetCutNumber()).Data());
152 //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
153 // Using standard function for setting Cuts
154 Bool_t selectPrimaries=kFALSE;
155 fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
158 //________________________________________________________________________
159 AliDalitzElectronCuts::~AliDalitzElectronCuts() {
161 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
163 // delete fHistograms;
164 // fHistograms = NULL;
166 if(fCutString != NULL){
174 //________________________________________________________________________
175 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
177 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
179 TH1::AddDirectory(kFALSE);
181 TString cutName = "";
184 cutName = GetCutNumber().Data();
187 cutName = cutNumber.Data();
190 if(fHistograms != NULL){
194 if(fHistograms==NULL){
195 fHistograms=new TList();
196 if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
197 else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
201 Int_t kDedxSignalbins = 200;
203 const Int_t kDCABins=62;
205 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};
207 const Int_t kPtBins=110;
208 Double_t binsPtDummy[kPtBins+1];
209 const Int_t kPBins = 109;
210 Double_t binsPDummy[kPBins+1];
214 for(Int_t i=1;i<kPtBins+1;i++)
216 if(binsPtDummy[i-1]+0.05<1.01)
217 binsPtDummy[i]=binsPtDummy[i-1]+0.05;
219 binsPtDummy[i]=binsPtDummy[i-1]+0.1;
222 for(Int_t i=1; i <kPBins+1;i++){
224 if( binsPDummy[i-1]+0.05<1.01)
225 binsPDummy[i] = binsPDummy[i-1]+0.05;
227 binsPDummy[i] = binsPDummy[i-1]+0.1;
233 hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
234 hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
235 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
236 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
237 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
238 hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
239 fHistograms->Add(hCutIndex);
244 hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
245 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
246 hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
247 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
248 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
249 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
250 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
251 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
252 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
253 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
254 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
255 fHistograms->Add(hdEdxCuts);
259 TAxis *AxisBeforeITS = NULL;
260 TAxis *AxisBeforedEdx = NULL;
261 TAxis *AxisBeforeTOF = NULL;
262 TAxis *AxisBeforedEdxSignal = NULL;
267 hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
268 fHistograms->Add(hITSdEdxbefore);
269 AxisBeforeITS = hITSdEdxbefore->GetXaxis();
271 hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
272 fHistograms->Add(hTPCdEdxbefore);
273 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
275 hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
276 fHistograms->Add(hTPCdEdxSignalbefore);
277 AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
279 hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
280 fHistograms->Add(hTOFbefore);
281 AxisBeforeTOF = hTOFbefore->GetXaxis();
283 hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
284 fHistograms->Add(hTrackDCAxyPtbefore);
286 hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
287 fHistograms->Add(hTrackDCAzPtbefore);
289 hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",60,0,1.5,kPtBins,binsPtDummy);
290 fHistograms->Add(hTrackNFindClsPtTPCbefore);
297 hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
298 fHistograms->Add(hITSdEdxafter);
300 hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
301 fHistograms->Add(hTPCdEdxafter);
303 hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
304 fHistograms->Add(hTPCdEdxSignalafter);
306 hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
307 fHistograms->Add(hTOFafter);
309 hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
310 fHistograms->Add(hTrackDCAxyPtafter);
312 hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
313 fHistograms->Add(hTrackDCAzPtafter);
315 hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",60,0,1.5,kPtBins,binsPtDummy);
316 fHistograms->Add(hTrackNFindClsPtTPCafter);
318 hTrackPosEtabeforeDedx = new TH1F(Form("hTrack_Pos_Eta_before_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_before_Dedx",600,-1.5,1.5);
319 fHistograms->Add(hTrackPosEtabeforeDedx);
321 hTrackNegEtabeforeDedx = new TH1F(Form("hTrack_Neg_Eta_before_Dedx %s",cutName.Data()),"hTrack_Neg_Eta_before_Dedx",600,-1.5,1.5);
322 fHistograms->Add(hTrackNegEtabeforeDedx);
324 hTrackPosEtaafterDedx = new TH1F(Form("hTrack_Pos_Eta_after_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_after_Dedx",600,-1.5,1.5);
325 fHistograms->Add(hTrackPosEtaafterDedx);
327 hTrackNegEtaafterDedx = new TH1F(Form("hTrack_Neg_Eta_afterDedx %s",cutName.Data()),"hTrack_Neg_Eta_after_Dedx",600,-1.5,1.5);
328 fHistograms->Add(hTrackNegEtaafterDedx);
332 TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
333 Int_t bins = AxisAfter->GetNbins();
334 Double_t from = AxisAfter->GetXmin();
335 Double_t to = AxisAfter->GetXmax();
336 Double_t *newBins = new Double_t[bins+1];
338 Double_t factor = TMath::Power(to/from, 1./bins);
339 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
340 AxisAfter->Set(bins, newBins);
341 AxisAfter = hTOFafter->GetXaxis();
342 AxisAfter->Set(bins, newBins);
343 AxisAfter = hITSdEdxafter->GetXaxis();
344 AxisAfter->Set(bins,newBins);
345 AxisAfter = hTPCdEdxSignalafter->GetXaxis();
346 AxisAfter->Set(bins,newBins);
349 AxisBeforeITS->Set(bins, newBins);
350 AxisBeforedEdx->Set(bins, newBins);
351 AxisBeforedEdxSignal->Set(bins,newBins);
352 AxisBeforeTOF->Set(bins, newBins);
357 TH1::AddDirectory(kTRUE);
359 // Event Cuts and Info
363 //________________________________________________________________________
364 Bool_t AliDalitzElectronCuts::InitPIDResponse(){
366 // Set Pointer to AliPIDResponse
368 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
372 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
373 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
374 if(fPIDResponse)return kTRUE;
380 ///________________________________________________________________________
381 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)
383 if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;
384 if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
386 TParticle* particle = fMCStack->Particle(labelParticle);
388 if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
391 if( particle->Eta() > fEtaCut || particle->Eta() < -fEtaCut )
400 ///________________________________________________________________________
401 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
403 //Selection of Reconstructed electrons
408 lTrack->GetImpactParameters(b,bCov);
410 if (bCov[0]<=0 || bCov[2]<=0) {
411 AliDebug(1, "Estimated b resolution lower or equal zero!");
412 bCov[0]=0; bCov[2]=0;
417 Float_t dcaToVertexXY = b[0];
418 Float_t dcaToVertexZ = b[1];
419 Double_t clsToF = GetNFindableClustersTPC(lTrack);
421 if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
422 if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
423 if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
427 if(hCutIndex)hCutIndex->Fill(kElectronIn);
430 if(hCutIndex)hCutIndex->Fill(kNoTracks);
434 if ( ! lTrack->GetConstrainedParam() ){
437 AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
441 if( !TrackIsSelected(lTrack) ){
442 if(hCutIndex)hCutIndex->Fill(kTrackCuts);
446 if( lTrack->GetSign() > 0.0 ){
448 if (hTrackPosEtabeforeDedx) hTrackPosEtabeforeDedx->Fill(lTrack->Eta());
452 if(hTrackNegEtabeforeDedx) hTrackNegEtabeforeDedx->Fill(lTrack->Eta());
458 if( ! dEdxCuts( track ) ) {
459 if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
464 if( lTrack->GetSign() > 0.0 ){
466 if( hTrackPosEtaafterDedx) hTrackPosEtaafterDedx->Fill(lTrack->Eta());
470 if( hTrackNegEtaafterDedx) hTrackNegEtaafterDedx->Fill(lTrack->Eta());
476 //Electron passed the cuts
477 if(hCutIndex)hCutIndex->Fill(kElectronOut);
479 if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
480 if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
481 if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
487 ///________________________________________________________________________
488 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
489 // Track Selection for Photon Reconstruction
492 Double_t clsToF = GetNFindableClustersTPC(lTrack);
495 if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
501 if( lTrack->Eta() > fEtaCut || lTrack->Eta() < -fEtaCut ) {
507 if( lTrack->Pt() < fPtMinCut || lTrack->Pt() > fPtMaxCut ) {
515 if( clsToF < fMinClsTPCToF){
523 ///________________________________________________________________________
524 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
526 // Electron Identification Cuts for Photon reconstruction
528 if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
529 if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
533 //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
539 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
540 if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
541 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
542 if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
548 if( fDodEdxSigmaITSCut == kTRUE ){
551 if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
552 fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
554 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
560 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
566 if(fDodEdxSigmaTPCCut == kTRUE){
570 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
571 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
573 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
579 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
580 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
581 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
582 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
584 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
591 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
592 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
593 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
594 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
596 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
607 if( fDoKaonRejectionLowP == kTRUE ){
609 if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
611 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
613 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
621 if( fDoProtonRejectionLowP == kTRUE ){
623 if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
624 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
626 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
633 if(fDoPionRejectionLowP == kTRUE){
634 if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
635 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
637 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
645 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
646 if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
648 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
649 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
650 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
654 if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
656 else if ( fRequireTOF == kTRUE ) {
658 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
663 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
664 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
665 if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
669 ///________________________________________________________________________
672 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
673 //Returns pointer to the track with given ESD label
674 //(Important for AOD implementation, since Track array in AOD data is different
675 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
677 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
679 if(label > event->GetNumberOfTracks() ) return NULL;
680 AliESDtrack * track = esdEvent->GetTrack(label);
684 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
685 AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
688 if(track->GetID() == label) {
695 cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
698 ///________________________________________________________________________
699 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
702 for(Int_t i = 0;i<photons->GetEntries();i++){
704 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
706 Int_t posLabel = photonComp->GetTrackLabelPositive();
707 Int_t negLabel = photonComp->GetTrackLabelNegative();
709 if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
716 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
718 if( pi0CandidatePt < fMassCutPtMin ){
720 if( vphotonCandidateMass < fMassCutLowPt ){
727 if( vphotonCandidateMass < fMassCutHighPt ){
737 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){
742 if( fUseCrossedRows == kFALSE ) {
744 if ( !fUseCorrectedTPCClsInfo ){
745 if(lTrack->GetTPCNclsF()!=0){
747 clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
748 }// Ncluster/Nfindablecluster
752 //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
753 clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
758 Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
760 if ( lTrack->GetTPCNclsF()>0 ) {
761 clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
770 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
773 // This angle is a measure for the contribution of the opening in polar
774 // direction ??0 to the opening angle ?? Pair
776 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
777 // Master Thesis. Thorsten Dahms. 2005
778 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
782 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
783 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
785 TVector3 posDaughter;
786 TVector3 negDaughter;
788 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
789 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
791 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
792 Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
794 if( openingAngle < 1e-20 ) return 0.;
796 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
801 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
804 // Returns true if it is a gamma conversion according to psi pair value
806 return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
807 TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
810 ///________________________________________________________________________
811 Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
812 ///Update the cut string (if it has been created yet)
814 if(fCutString && fCutString->GetString().Length() == kNCuts) {
815 cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
816 fCutString->SetString(GetCutNumber());
818 cout << "fCutString not yet initialized, will not be updated" << endl;
821 // cout << fCutString->GetString().Data() << endl;
825 ///________________________________________________________________________
826 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
827 // Initialize Cuts from a given Cut string
829 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
830 AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
832 if(analysisCutSelection.Length()!=kNCuts) {
833 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
836 if(!analysisCutSelection.IsDigit()){
837 AliError("Cut selection contains characters");
841 const char *cutSelection = analysisCutSelection.Data();
842 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
843 for(Int_t ii=0;ii<kNCuts;ii++){
849 AliError("Analysis Cut Selection does not start with 9");
854 // Set Individual Cuts
855 for(Int_t ii=0;ii<kNCuts;ii++){
856 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
863 ///________________________________________________________________________
864 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
865 ///Set individual cut ID
867 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
871 fCuts[kgoodId] = value;
873 cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
879 case kededxSigmaITSCut:
880 if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
881 fCuts[kededxSigmaITSCut] = value;
882 UpdateCutString(cutID, value);
884 } else return kFALSE;
886 case kededxSigmaTPCCut:
887 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
888 fCuts[kededxSigmaTPCCut] = value;
889 UpdateCutString(cutID, value);
891 } else return kFALSE;
893 case kpidedxSigmaTPCCut:
894 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
895 fCuts[kpidedxSigmaTPCCut] = value;
896 UpdateCutString(cutID, value);
898 } else return kFALSE;
900 case kpiMinMomdedxSigmaTPCCut:
901 if( SetMinMomPiondEdxTPCCut(value)) {
902 fCuts[kpiMinMomdedxSigmaTPCCut] = value;
903 UpdateCutString(cutID, value);
905 } else return kFALSE;
907 case kpiMaxMomdedxSigmaTPCCut:
908 if( SetMaxMomPiondEdxTPCCut(value)) {
909 fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
910 UpdateCutString(cutID, value);
912 } else return kFALSE;
914 case kLowPRejectionSigmaCut:
915 if( SetLowPRejectionCuts(value) ) {
916 fCuts[kLowPRejectionSigmaCut] = value;
917 UpdateCutString(cutID, value);
919 } else return kFALSE;
922 case kTOFelectronPID:
923 if( SetTOFElectronPIDCut(value)) {
924 fCuts[kTOFelectronPID] = value;
925 UpdateCutString(cutID, value);
927 } else return kFALSE;
929 if( SetITSClusterCut(value) ) {
930 fCuts[kclsITSCut] = value;
931 UpdateCutString(cutID, value);
933 } else return kFALSE;
935 if( SetTPCClusterCut(value)) {
936 fCuts[kclsTPCCut] = value;
937 UpdateCutString(cutID, value);
939 } else return kFALSE;
942 if( SetEtaCut(value)) {
943 fCuts[ketaCut] = value;
944 UpdateCutString(cutID, value);
946 } else return kFALSE;
948 if( SetPtCut(value)) {
949 fCuts[kptCut] = value;
950 UpdateCutString(cutID, value);
952 } else return kFALSE;
955 if( SetDCACut(value)) {
956 fCuts[kDCACut] = value;
957 UpdateCutString(cutID, value);
959 } else return kFALSE;
963 if( SetPsiPairCut(value)) {
964 fCuts[kPsiPair] = value;
965 UpdateCutString(cutID, value);
967 } else return kFALSE;
969 case kRejectSharedElecGamma:
970 if( SetRejectSharedElecGamma(value)) {
971 fCuts[kRejectSharedElecGamma] = value;
972 UpdateCutString(cutID, value);
974 } else return kFALSE;
976 case kBackgroundScheme:
977 if( SetBackgroundScheme(value)) {
978 fCuts[kBackgroundScheme] = value;
979 UpdateCutString(cutID, value);
981 } else return kFALSE;
983 case kNumberOfRotations:
984 if( SetNumberOfRotations(value)) {
985 fCuts[kNumberOfRotations] = value;
986 UpdateCutString(cutID, value);
988 } else return kFALSE;
991 if( SetMassCut(value)) {
992 fCuts[kmassCut] = value;
993 UpdateCutString(cutID, value);
995 } else return kFALSE;
997 if( SetDoWeights(value)) {
998 fCuts[kWeights] = value;
999 UpdateCutString(cutID, value);
1001 } else return kFALSE;
1003 case kuseVPhotonMCPSmearing:
1005 if( SetUseVPhotonMCPmearing(value)) {
1006 fCuts[kuseVPhotonMCPSmearing] = value;
1007 UpdateCutString(cutID, value);
1009 } else return kFALSE;
1012 cout << "Error:: Cut id out of range"<< endl;
1016 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
1023 ///________________________________________________________________________
1025 void AliDalitzElectronCuts::PrintCuts() {
1026 // Print out current Cut Selection
1027 for(Int_t ic = 0; ic < kNCuts; ic++) {
1028 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1033 ///________________________________________________________________________
1034 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
1037 switch(ededxSigmaCut){
1040 fDodEdxSigmaITSCut = kFALSE;
1041 fPIDnSigmaBelowElectronLineITS=-100;
1042 fPIDnSigmaAboveElectronLineITS= 100;
1045 fDodEdxSigmaITSCut = kTRUE;
1046 fPIDnSigmaBelowElectronLineITS=-10;
1047 fPIDnSigmaAboveElectronLineITS=10;
1050 fDodEdxSigmaITSCut = kTRUE;
1051 fPIDnSigmaBelowElectronLineITS=-6;
1052 fPIDnSigmaAboveElectronLineITS=7;
1055 fDodEdxSigmaITSCut = kTRUE;
1056 fPIDnSigmaBelowElectronLineITS=-5;
1057 fPIDnSigmaAboveElectronLineITS=5;
1060 fDodEdxSigmaITSCut = kTRUE;
1061 fPIDnSigmaBelowElectronLineITS=-4;
1062 fPIDnSigmaAboveElectronLineITS=5;
1065 fDodEdxSigmaITSCut = kTRUE;
1066 fPIDnSigmaBelowElectronLineITS=-3;
1067 fPIDnSigmaAboveElectronLineITS=5;
1070 fDodEdxSigmaITSCut = kTRUE;
1071 fPIDnSigmaBelowElectronLineITS=-4;
1072 fPIDnSigmaAboveElectronLineITS=4;
1075 fDodEdxSigmaITSCut = kTRUE;
1076 fPIDnSigmaBelowElectronLineITS=-2.5;
1077 fPIDnSigmaAboveElectronLineITS=4;
1080 fDodEdxSigmaITSCut = kTRUE;
1081 fPIDnSigmaBelowElectronLineITS=-2;
1082 fPIDnSigmaAboveElectronLineITS=3.5;
1085 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1092 ///________________________________________________________________________
1093 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
1095 switch(ededxSigmaCut){
1097 case 0: fDodEdxSigmaTPCCut = kFALSE;
1098 fPIDnSigmaBelowElectronLineTPC=-10;
1099 fPIDnSigmaAboveElectronLineTPC=10;
1102 fDodEdxSigmaTPCCut = kTRUE;
1103 fPIDnSigmaBelowElectronLineTPC=-10;
1104 fPIDnSigmaAboveElectronLineTPC=10;
1107 fDodEdxSigmaTPCCut = kTRUE;
1108 fPIDnSigmaBelowElectronLineTPC=-6;
1109 fPIDnSigmaAboveElectronLineTPC=7;
1112 fDodEdxSigmaTPCCut = kTRUE;
1113 fPIDnSigmaBelowElectronLineTPC=-5;
1114 fPIDnSigmaAboveElectronLineTPC=5;
1117 fDodEdxSigmaTPCCut = kTRUE;
1118 fPIDnSigmaBelowElectronLineTPC=-4;
1119 fPIDnSigmaAboveElectronLineTPC=5;
1122 fDodEdxSigmaTPCCut = kTRUE;
1123 fPIDnSigmaBelowElectronLineTPC=-3;
1124 fPIDnSigmaAboveElectronLineTPC=5;
1127 fDodEdxSigmaTPCCut = kTRUE;
1128 fPIDnSigmaBelowElectronLineTPC=-4;
1129 fPIDnSigmaAboveElectronLineTPC=4;
1132 fDodEdxSigmaTPCCut = kTRUE;
1133 fPIDnSigmaBelowElectronLineTPC=-2.5;
1134 fPIDnSigmaAboveElectronLineTPC=4;
1137 fDodEdxSigmaTPCCut = kTRUE;
1138 fPIDnSigmaBelowElectronLineTPC=-2;
1139 fPIDnSigmaAboveElectronLineTPC=3.5;
1142 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1149 ///________________________________________________________________________
1150 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
1153 switch(pidedxSigmaCut){
1155 case 0: fPIDnSigmaAbovePionLineTPC= 0;
1156 fPIDnSigmaAbovePionLineTPCHighPt=-100;
1159 fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1160 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1163 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1164 fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1167 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1168 fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1171 fPIDnSigmaAbovePionLineTPC=1;
1172 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1175 fPIDnSigmaAbovePionLineTPC=2.;
1176 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1179 fPIDnSigmaAbovePionLineTPC=2.5;
1180 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1183 fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1184 fPIDnSigmaAbovePionLineTPCHighPt = 2.0;
1187 fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1188 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;
1191 fPIDnSigmaAbovePionLineTPC=1.5;
1192 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
1195 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1201 ///________________________________________________________________________
1202 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
1204 switch(piMomdedxSigmaCut){
1206 case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1209 fPIDMinPnSigmaAbovePionLineTPC=50.;
1212 fPIDMinPnSigmaAbovePionLineTPC=20.;
1215 fPIDMinPnSigmaAbovePionLineTPC=1.5;
1218 fPIDMinPnSigmaAbovePionLineTPC=1.;
1221 fPIDMinPnSigmaAbovePionLineTPC=0.5;
1224 fPIDMinPnSigmaAbovePionLineTPC=0.4;
1227 fPIDMinPnSigmaAbovePionLineTPC=0.3;
1230 fPIDMinPnSigmaAbovePionLineTPC=0.25;
1233 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1238 ///________________________________________________________________________
1239 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
1242 if( !fesdTrackCuts ) {
1244 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1250 case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1252 case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1253 break; //1 hit first layer of SPD
1254 case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1255 break; //1 hit in any layer of SPD
1256 case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1257 fesdTrackCuts->SetMinNClustersITS(4);
1258 // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1260 case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1261 fesdTrackCuts->SetMinNClustersITS(3);
1262 // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1264 case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1265 fesdTrackCuts->SetMinNClustersITS(4);
1266 // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1268 case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1269 fesdTrackCuts->SetMinNClustersITS(5);
1270 // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1272 case 7: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1273 fesdTrackCuts->SetMinNClustersITS(4);
1275 case 8: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1277 case 9: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1278 fesdTrackCuts->SetMinNClustersITS(4);
1282 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1289 ///________________________________________________________________________
1290 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1295 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1299 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1303 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1305 case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1306 fMinClsTPCToF = 0.8;
1307 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1308 fesdTrackCuts->SetMinNClustersTPC(0);
1309 fUseCrossedRows = kTRUE;
1311 case 4: // 0% of findable clusters
1313 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1315 fUseCorrectedTPCClsInfo=0;
1317 case 5: // 35% of findable clusters
1319 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1320 fMinClsTPCToF= 0.35;
1321 fUseCorrectedTPCClsInfo=0;
1323 case 6: // 60% of findable clusters
1325 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1327 fUseCorrectedTPCClsInfo=0;
1329 case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1330 // Changed 2014-02-04 before fMinClsTPC = 50.;
1331 fMinClsTPCToF = 0.6;
1332 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1333 fesdTrackCuts->SetMinNClustersTPC(0);
1334 fUseCrossedRows = kTRUE;
1336 case 8: fMinClsTPC = 0.;
1337 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1338 fMinClsTPCToF= 0.35;
1339 fUseCorrectedTPCClsInfo=0;
1341 case 9: // 35% of findable clusters
1343 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1344 fMinClsTPCToF= 0.35;
1345 fUseCorrectedTPCClsInfo=1;
1349 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1355 ///________________________________________________________________________
1356 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
1385 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1389 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1392 case 8: fEtaCut = 0.4;
1395 case 9: fEtaCut = 0.65;
1399 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1405 ///________________________________________________________________________
1406 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)
1409 //0.1GeV, 0.125 GeV, 0.15 GeV
1413 case 0: fPtMinCut = 0.075;
1420 case 2: // 0.125 GeV
1429 case 4: fPtMinCut = 0.5;
1432 case 5: // 0.175 GeV
1437 cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1444 ///________________________________________________________________________
1445 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)
1449 if( !fesdTrackCuts ) {
1451 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1459 fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1460 fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1461 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1465 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1466 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1469 case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1470 fesdTrackCuts->SetMaxDCAToVertexXY(1);
1471 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1474 case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
1475 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1479 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1488 ///________________________________________________________________________
1489 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
1491 switch(piMaxMomdedxSigmaCut){
1494 fPIDMaxPnSigmaAbovePionLineTPC=0.;
1497 fPIDMaxPnSigmaAbovePionLineTPC=100.;
1500 fPIDMaxPnSigmaAbovePionLineTPC=5.;
1503 fPIDMaxPnSigmaAbovePionLineTPC=4.;
1506 fPIDMaxPnSigmaAbovePionLineTPC=3.5;
1509 fPIDMaxPnSigmaAbovePionLineTPC=3.;
1512 cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1518 ///________________________________________________________________________
1519 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
1521 switch(LowPRejectionSigmaCut){
1523 fDoKaonRejectionLowP=kFALSE;
1524 fDoProtonRejectionLowP=kFALSE;
1525 fDoPionRejectionLowP=kFALSE;
1526 fPIDnSigmaAtLowPAroundKaonLine=0;
1527 fPIDnSigmaAtLowPAroundProtonLine=0;
1528 fPIDnSigmaAtLowPAroundPionLine=0;
1529 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1532 fDoKaonRejectionLowP=kTRUE;
1533 fDoProtonRejectionLowP=kTRUE;
1534 fDoPionRejectionLowP=kTRUE;
1535 fPIDnSigmaAtLowPAroundKaonLine=0.5;
1536 fPIDnSigmaAtLowPAroundProtonLine=0.5;
1537 fPIDnSigmaAtLowPAroundPionLine=0.5;
1538 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1541 fDoKaonRejectionLowP=kTRUE;
1542 fDoProtonRejectionLowP=kTRUE;
1543 fDoPionRejectionLowP=kTRUE;
1544 fPIDnSigmaAtLowPAroundKaonLine=1.0;
1545 fPIDnSigmaAtLowPAroundProtonLine=1.0;
1546 fPIDnSigmaAtLowPAroundPionLine=1.0;
1547 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1550 fDoKaonRejectionLowP=kTRUE;
1551 fDoProtonRejectionLowP=kTRUE;
1552 fDoPionRejectionLowP=kTRUE;
1553 fPIDnSigmaAtLowPAroundKaonLine=1.5;
1554 fPIDnSigmaAtLowPAroundProtonLine=1.5;
1555 fPIDnSigmaAtLowPAroundPionLine=1.5;
1556 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1559 fDoKaonRejectionLowP=kTRUE;
1560 fDoProtonRejectionLowP=kTRUE;
1561 fDoPionRejectionLowP=kTRUE;
1562 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1563 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1564 fPIDnSigmaAtLowPAroundPionLine=2.0;
1565 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1568 fDoKaonRejectionLowP=kTRUE;
1569 fDoProtonRejectionLowP=kTRUE;
1570 fDoPionRejectionLowP=kTRUE;
1571 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1572 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1573 fPIDnSigmaAtLowPAroundPionLine=2.5;
1574 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1577 fDoKaonRejectionLowP=kTRUE;
1578 fDoProtonRejectionLowP=kTRUE;
1579 fDoPionRejectionLowP=kTRUE;
1580 fPIDnSigmaAtLowPAroundKaonLine=0.;
1581 fPIDnSigmaAtLowPAroundProtonLine=0.;
1582 fPIDnSigmaAtLowPAroundPionLine=2.;
1583 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1586 fDoKaonRejectionLowP=kFALSE;
1587 fDoProtonRejectionLowP=kFALSE;
1588 fDoPionRejectionLowP=kTRUE;
1589 fPIDnSigmaAtLowPAroundKaonLine=0.0;
1590 fPIDnSigmaAtLowPAroundProtonLine=0.0;
1591 fPIDnSigmaAtLowPAroundPionLine=1.0;
1592 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1595 fDoKaonRejectionLowP=kFALSE;
1596 fDoProtonRejectionLowP=kFALSE;
1597 fDoPionRejectionLowP=kTRUE;
1598 fPIDnSigmaAtLowPAroundKaonLine=0.;
1599 fPIDnSigmaAtLowPAroundProtonLine=0.;
1600 fPIDnSigmaAtLowPAroundPionLine=0.5;
1601 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1604 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1610 ///________________________________________________________________________
1611 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
1613 switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1615 fRequireTOF = kFALSE;
1616 fUseTOFpid = kFALSE;
1617 fTofPIDnSigmaBelowElectronLine=-100;
1618 fTofPIDnSigmaAboveElectronLine=100;
1621 fRequireTOF = kFALSE;
1623 fTofPIDnSigmaBelowElectronLine=-7;
1624 fTofPIDnSigmaAboveElectronLine=7;
1627 fRequireTOF = kFALSE;
1629 fTofPIDnSigmaBelowElectronLine=-5;
1630 fTofPIDnSigmaAboveElectronLine=5;
1633 fRequireTOF = kFALSE;
1635 fTofPIDnSigmaBelowElectronLine=-3;
1636 fTofPIDnSigmaAboveElectronLine=5;
1639 fRequireTOF = kFALSE;
1641 fTofPIDnSigmaBelowElectronLine=-2;
1642 fTofPIDnSigmaAboveElectronLine=3;
1644 case 5: // -3, 3 TOF mandatory
1645 fRequireTOF = kTRUE;
1647 fTofPIDnSigmaBelowElectronLine= -3;
1648 fTofPIDnSigmaAboveElectronLine= 3;
1651 cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1653 } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
1656 ///_______________________________________________________________________________
1658 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
1663 fDoPsiPairCut = kFALSE;
1664 fPsiPairCut = 10000.; //
1665 fDeltaPhiCutMin = -1000.;
1666 fDeltaPhiCutMax = 1000.;
1670 fDoPsiPairCut = kTRUE;
1671 fPsiPairCut = 0.45; // Standard
1672 fDeltaPhiCutMin = 0.0;
1673 fDeltaPhiCutMax = 0.12;
1676 fDoPsiPairCut = kTRUE;
1678 fDeltaPhiCutMin = 0.0;
1679 fDeltaPhiCutMax = 0.12;
1682 fDoPsiPairCut = kTRUE;
1684 fDeltaPhiCutMin = 0.0;
1685 fDeltaPhiCutMax = 0.12;
1688 fDoPsiPairCut = kTRUE;
1690 fDeltaPhiCutMin = 0.0;
1691 fDeltaPhiCutMax = 0.12;
1694 fDoPsiPairCut = kTRUE;
1696 fDeltaPhiCutMin = 0.0;
1697 fDeltaPhiCutMax = 0.06;
1702 cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1709 ///_______________________________________________________________________________
1710 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
1715 fDoRejectSharedElecGamma = kFALSE;
1716 fRadiusCut = 10000; //
1719 fDoRejectSharedElecGamma = kTRUE;
1720 fRadiusCut = 2.0; // cm
1723 fDoRejectSharedElecGamma = kTRUE;
1724 fRadiusCut = 3.0; // Standard
1727 fDoRejectSharedElecGamma = kTRUE;
1728 fRadiusCut = 4.0; //
1731 fDoRejectSharedElecGamma = kTRUE;
1732 fRadiusCut = 5.0; //
1735 fDoRejectSharedElecGamma = kTRUE;
1736 fRadiusCut = 10.0; //
1739 fDoRejectSharedElecGamma = kTRUE;
1740 fRadiusCut = 15.0; //
1743 cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1749 ///__________________________________________________________________________
1750 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1753 switch(BackgroundScheme){
1757 fUseTrackMultiplicityForBG = kFALSE;
1759 case 1: // mixed event with V0 multiplicity
1761 fUseTrackMultiplicityForBG = kFALSE;
1763 case 2: // mixed event with track multiplicity
1764 fUseTrackMultiplicityForBG = kTRUE;
1768 fUseTrackMultiplicityForBG = kFALSE;
1772 fUseTrackMultiplicityForBG = kTRUE;
1775 case 5: fUseTrackMultiplicityForBG = kTRUE;
1780 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1786 ///________________________________________________________________________
1787 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
1789 switch(NumberOfRotations){
1791 fnumberOfRotationEventsForBG = 5;
1794 fnumberOfRotationEventsForBG = 10;
1797 fnumberOfRotationEventsForBG = 15;
1800 fnumberOfRotationEventsForBG = 20;
1803 fnumberOfRotationEventsForBG = 2;
1806 fnumberOfRotationEventsForBG = 50;
1809 fnumberOfRotationEventsForBG = 80;
1812 fnumberOfRotationEventsForBG = 100;
1815 cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
1823 ///________________________________________________________________________
1824 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)
1828 case 0: fDoWeights = kFALSE;
1830 case 1: fDoWeights = kTRUE;
1833 cout<<"Warning: Weights option not defined "<<opc<<endl;
1838 ///________________________________________________________________________
1839 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)
1845 fMassCutPtMin = -999.; //GeV
1846 fMassCutLowPt = 999.; //GeV/c^2
1847 fMassCutHighPt = 999.; //GeV/c^2
1849 fDoMassCut = kFALSE;
1850 fDoMassMinCut = kFALSE;
1853 //fMassCut = 0.135; //GeV/c^2
1854 fMassCutPtMin = -999.; //GeV
1855 fMassCutLowPt = 0.135; //GeV/c^2
1856 fMassCutHighPt = 0.135; //GeV/c^2
1859 fDoMassMinCut = kFALSE;
1862 //fMassCut = 0.100; //GeV/c^2
1863 fMassCutPtMin = -999.; //GeV
1864 fMassCutLowPt = 0.100; //GeV/c^2
1865 fMassCutHighPt = 0.100; //GeV/c^2
1868 fDoMassMinCut = kFALSE;
1871 /*fMassCut = 0.075; //GeV/c^2 Changed from Feb 25
1872 fMassCutPtMin = -999.; //GeV
1873 fMassCutLowPt = 0.075; //GeV/c^2
1874 fMassCutHighPt = 0.075; //GeV/c^2
1876 fDoMassMinCut = kFALSE;*/
1877 fMassCutPtMin = 1.0; //GeV
1878 fMassCutLowPt = 0.015; //GeV/c^2
1879 fMassCutHighPt = 0.035; //GeV/c^2
1880 fMassMinCut = 0.002;
1882 fDoMassMinCut = kTRUE;
1885 //fMassCut = 0.050; //GeV/c^2
1886 fMassCutPtMin = -999.; //GeV
1887 fMassCutLowPt = 0.050; //GeV/c^2
1888 fMassCutHighPt = 0.050; //GeV/c^2
1891 fDoMassMinCut = kFALSE;
1895 fMassCutPtMin = -999.; //GeV
1896 fMassCutLowPt = 0.035; //GeV/c^2
1897 fMassCutHighPt = 0.035; //GeV/c^2
1900 fDoMassMinCut = kFALSE;
1903 fMassCutPtMin = -999.; //GeV
1904 fMassCutLowPt = 0.015; //GeV/c^2
1905 fMassCutHighPt = 0.015; //GeV/c^2
1908 fDoMassMinCut = kFALSE;
1910 case 7: fMassCutPtMin = 1.0; //GeV
1911 fMassCutLowPt = 0.015; //GeV/c^2
1912 fMassCutHighPt = 0.035; //GeV/c^2
1915 fDoMassMinCut = kFALSE;
1917 case 8: fMassCutPtMin = 1.0; //GeV
1918 fMassCutLowPt = 0.015; //GeV/c^2
1919 fMassCutHighPt = 0.050; //GeV/c^2
1922 fDoMassMinCut = kFALSE;
1924 case 9: fMassCutPtMin = 1.0; //GeV
1925 fMassCutLowPt = 0.025; //GeV/c^2
1926 fMassCutHighPt = 0.035; //GeV/c^2
1929 fDoMassMinCut = kFALSE;
1932 cout<<"Warning: MassCut not defined "<<massCut<<endl;
1937 Bool_t AliDalitzElectronCuts::SetUseVPhotonMCPmearing(Int_t useMCPSmearing)
1939 switch(useMCPSmearing){
1942 fUseVPhotonMCPSmearing=kFALSE;
1943 fUseElectronMCPSmearing=kFALSE;
1946 fUseVPhotonMCPSmearing=kTRUE;
1947 fUseElectronMCPSmearing=kFALSE;
1950 fUseVPhotonMCPSmearing=kFALSE;
1951 fUseElectronMCPSmearing=kTRUE;
1955 default: cout<<"Warning: Virtual Photon SMearing not defined "<<useMCPSmearing<<endl;
1964 ///________________________________________________________________________
1965 TString AliDalitzElectronCuts::GetCutNumber(){
1966 // returns TString with current cut number
1968 for(Int_t ii=0;ii<kNCuts;ii++){
1969 a.Append(Form("%d",fCuts[ii]));
1975 ///________________________________________________________________________
1976 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
1977 //Create and return standard 2010 PbPb cuts
1978 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
1979 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1980 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
1984 ///________________________________________________________________________
1985 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
1986 //Create and return standard 2010 PbPb cuts
1987 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
1989 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1990 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}