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),
126 fUseElectronMCPSmearing(kFALSE),
130 hITSdEdxbefore(NULL),
132 hTPCdEdxbefore(NULL),
134 hTPCdEdxSignalbefore(NULL),
135 hTPCdEdxSignalafter(NULL),
138 hTrackDCAxyPtbefore(NULL),
139 hTrackDCAxyPtafter(NULL),
140 hTrackDCAzPtbefore(NULL),
141 hTrackDCAzPtafter(NULL),
142 hTrackNFindClsPtTPCbefore(NULL),
143 hTrackNFindClsPtTPCafter(NULL),
144 hTrackPosEtabeforeDedx(NULL),
145 hTrackNegEtabeforeDedx(NULL),
146 hTrackPosEtaafterDedx(NULL),
147 hTrackNegEtaafterDedx(NULL)
150 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
151 fCutString=new TObjString((GetCutNumber()).Data());
153 //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
154 // Using standard function for setting Cuts
155 Bool_t selectPrimaries=kFALSE;
156 fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
159 //________________________________________________________________________
160 AliDalitzElectronCuts::~AliDalitzElectronCuts() {
162 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
164 // delete fHistograms;
165 // fHistograms = NULL;
167 if(fCutString != NULL){
175 //________________________________________________________________________
176 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
178 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
180 TH1::AddDirectory(kFALSE);
182 TString cutName = "";
185 cutName = GetCutNumber().Data();
188 cutName = cutNumber.Data();
191 if(fHistograms != NULL){
195 if(fHistograms==NULL){
196 fHistograms=new TList();
197 if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
198 else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
202 Int_t kDedxSignalbins = 200;
204 const Int_t kDCABins=62;
206 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};
208 const Int_t kPtBins=110;
209 Double_t binsPtDummy[kPtBins+1];
210 const Int_t kPBins = 109;
211 Double_t binsPDummy[kPBins+1];
215 for(Int_t i=1;i<kPtBins+1;i++)
217 if(binsPtDummy[i-1]+0.05<1.01)
218 binsPtDummy[i]=binsPtDummy[i-1]+0.05;
220 binsPtDummy[i]=binsPtDummy[i-1]+0.1;
223 for(Int_t i=1; i <kPBins+1;i++){
225 if( binsPDummy[i-1]+0.05<1.01)
226 binsPDummy[i] = binsPDummy[i-1]+0.05;
228 binsPDummy[i] = binsPDummy[i-1]+0.1;
234 hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
235 hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
236 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
237 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
238 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
239 hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
240 fHistograms->Add(hCutIndex);
245 hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
246 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
247 hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
248 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
249 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
250 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
251 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
252 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
253 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
254 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
255 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
256 fHistograms->Add(hdEdxCuts);
260 TAxis *AxisBeforeITS = NULL;
261 TAxis *AxisBeforedEdx = NULL;
262 TAxis *AxisBeforeTOF = NULL;
263 TAxis *AxisBeforedEdxSignal = NULL;
268 hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
269 fHistograms->Add(hITSdEdxbefore);
270 AxisBeforeITS = hITSdEdxbefore->GetXaxis();
272 hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
273 fHistograms->Add(hTPCdEdxbefore);
274 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
276 hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
277 fHistograms->Add(hTPCdEdxSignalbefore);
278 AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
280 hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
281 fHistograms->Add(hTOFbefore);
282 AxisBeforeTOF = hTOFbefore->GetXaxis();
284 hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
285 fHistograms->Add(hTrackDCAxyPtbefore);
287 hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
288 fHistograms->Add(hTrackDCAzPtbefore);
290 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);
291 fHistograms->Add(hTrackNFindClsPtTPCbefore);
298 hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
299 fHistograms->Add(hITSdEdxafter);
301 hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
302 fHistograms->Add(hTPCdEdxafter);
304 hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
305 fHistograms->Add(hTPCdEdxSignalafter);
307 hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
308 fHistograms->Add(hTOFafter);
310 hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
311 fHistograms->Add(hTrackDCAxyPtafter);
313 hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
314 fHistograms->Add(hTrackDCAzPtafter);
316 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);
317 fHistograms->Add(hTrackNFindClsPtTPCafter);
319 hTrackPosEtabeforeDedx = new TH1F(Form("hTrack_Pos_Eta_before_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_before_Dedx",600,-1.5,1.5);
320 fHistograms->Add(hTrackPosEtabeforeDedx);
322 hTrackNegEtabeforeDedx = new TH1F(Form("hTrack_Neg_Eta_before_Dedx %s",cutName.Data()),"hTrack_Neg_Eta_before_Dedx",600,-1.5,1.5);
323 fHistograms->Add(hTrackNegEtabeforeDedx);
325 hTrackPosEtaafterDedx = new TH1F(Form("hTrack_Pos_Eta_after_Dedx %s",cutName.Data()),"hTrack_Pos_Eta_after_Dedx",600,-1.5,1.5);
326 fHistograms->Add(hTrackPosEtaafterDedx);
328 hTrackNegEtaafterDedx = new TH1F(Form("hTrack_Neg_Eta_afterDedx %s",cutName.Data()),"hTrack_Neg_Eta_after_Dedx",600,-1.5,1.5);
329 fHistograms->Add(hTrackNegEtaafterDedx);
333 TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
334 Int_t bins = AxisAfter->GetNbins();
335 Double_t from = AxisAfter->GetXmin();
336 Double_t to = AxisAfter->GetXmax();
337 Double_t *newBins = new Double_t[bins+1];
339 Double_t factor = TMath::Power(to/from, 1./bins);
340 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
341 AxisAfter->Set(bins, newBins);
342 AxisAfter = hTOFafter->GetXaxis();
343 AxisAfter->Set(bins, newBins);
344 AxisAfter = hITSdEdxafter->GetXaxis();
345 AxisAfter->Set(bins,newBins);
346 AxisAfter = hTPCdEdxSignalafter->GetXaxis();
347 AxisAfter->Set(bins,newBins);
350 AxisBeforeITS->Set(bins, newBins);
351 AxisBeforedEdx->Set(bins, newBins);
352 AxisBeforedEdxSignal->Set(bins,newBins);
353 AxisBeforeTOF->Set(bins, newBins);
358 TH1::AddDirectory(kTRUE);
360 // Event Cuts and Info
364 //________________________________________________________________________
365 Bool_t AliDalitzElectronCuts::InitPIDResponse(){
367 // Set Pointer to AliPIDResponse
369 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
373 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
374 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
375 if(fPIDResponse)return kTRUE;
381 ///________________________________________________________________________
382 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)
384 if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;
385 if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
387 TParticle* particle = fMCStack->Particle(labelParticle);
389 if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
392 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
401 ///________________________________________________________________________
402 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
404 //Selection of Reconstructed electrons
409 lTrack->GetImpactParameters(b,bCov);
411 if (bCov[0]<=0 || bCov[2]<=0) {
412 AliDebug(1, "Estimated b resolution lower or equal zero!");
413 bCov[0]=0; bCov[2]=0;
418 Float_t dcaToVertexXY = b[0];
419 Float_t dcaToVertexZ = b[1];
420 Double_t clsToF = GetNFindableClustersTPC(lTrack);
422 if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
423 if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
424 if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
428 if(hCutIndex)hCutIndex->Fill(kElectronIn);
431 if(hCutIndex)hCutIndex->Fill(kNoTracks);
435 if ( ! lTrack->GetConstrainedParam() ){
438 AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
442 if( !TrackIsSelected(lTrack) ){
443 if(hCutIndex)hCutIndex->Fill(kTrackCuts);
447 if( lTrack->GetSign() > 0.0 ){
449 if (hTrackPosEtabeforeDedx) hTrackPosEtabeforeDedx->Fill(lTrack->Eta());
453 if(hTrackNegEtabeforeDedx) hTrackNegEtabeforeDedx->Fill(lTrack->Eta());
459 if( ! dEdxCuts( track ) ) {
460 if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
465 if( lTrack->GetSign() > 0.0 ){
467 if( hTrackPosEtaafterDedx) hTrackPosEtaafterDedx->Fill(lTrack->Eta());
471 if( hTrackNegEtaafterDedx) hTrackNegEtaafterDedx->Fill(lTrack->Eta());
477 //Electron passed the cuts
478 if(hCutIndex)hCutIndex->Fill(kElectronOut);
480 if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
481 if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
482 if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
488 ///________________________________________________________________________
489 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
490 // Track Selection for Photon Reconstruction
493 Double_t clsToF = GetNFindableClustersTPC(lTrack);
496 if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
502 if( lTrack->Eta() > (fEtaCut + fEtaShift) || lTrack->Eta() < (-fEtaCut + fEtaShift) ) {
508 if( lTrack->Pt() < fPtMinCut || lTrack->Pt() > fPtMaxCut ) {
516 if( clsToF < fMinClsTPCToF){
524 ///________________________________________________________________________
525 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
527 // Electron Identification Cuts for Photon reconstruction
529 if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
530 if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
534 //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
540 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
541 if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
542 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
543 if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
549 if( fDodEdxSigmaITSCut == kTRUE ){
552 if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
553 fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
555 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
561 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
567 if(fDodEdxSigmaTPCCut == kTRUE){
571 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
572 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
574 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
580 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
581 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
582 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
583 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
585 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
592 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
593 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
594 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
595 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
597 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
608 if( fDoKaonRejectionLowP == kTRUE ){
610 if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
612 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
614 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
622 if( fDoProtonRejectionLowP == kTRUE ){
624 if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
625 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
627 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
634 if(fDoPionRejectionLowP == kTRUE){
635 if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
636 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
638 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
646 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
647 if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
649 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
650 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
651 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
655 if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
657 else if ( fRequireTOF == kTRUE ) {
659 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
664 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
665 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
666 if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
670 ///________________________________________________________________________
673 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
674 //Returns pointer to the track with given ESD label
675 //(Important for AOD implementation, since Track array in AOD data is different
676 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
678 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
680 if(label > event->GetNumberOfTracks() ) return NULL;
681 AliESDtrack * track = esdEvent->GetTrack(label);
685 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
686 AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
689 if(track->GetID() == label) {
696 cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
699 ///________________________________________________________________________
700 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
703 for(Int_t i = 0;i<photons->GetEntries();i++){
705 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
707 Int_t posLabel = photonComp->GetTrackLabelPositive();
708 Int_t negLabel = photonComp->GetTrackLabelNegative();
710 if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
717 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
719 if( pi0CandidatePt < fMassCutPtMin ){
721 if( vphotonCandidateMass < fMassCutLowPt ){
728 if( vphotonCandidateMass < fMassCutHighPt ){
738 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){
743 if( fUseCrossedRows == kFALSE ) {
745 if ( !fUseCorrectedTPCClsInfo ){
746 if(lTrack->GetTPCNclsF()!=0){
748 clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
749 }// Ncluster/Nfindablecluster
753 //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
754 clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
759 Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
761 if ( lTrack->GetTPCNclsF()>0 ) {
762 clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
771 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
774 // This angle is a measure for the contribution of the opening in polar
775 // direction ??0 to the opening angle ?? Pair
777 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
778 // Master Thesis. Thorsten Dahms. 2005
779 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
783 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
784 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
786 TVector3 posDaughter;
787 TVector3 negDaughter;
789 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
790 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
792 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
793 Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
795 if( openingAngle < 1e-20 ) return 0.;
797 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
802 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
805 // Returns true if it is a gamma conversion according to psi pair value
807 return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
808 TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
811 ///________________________________________________________________________
812 Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
813 ///Update the cut string (if it has been created yet)
815 if(fCutString && fCutString->GetString().Length() == kNCuts) {
816 cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
817 fCutString->SetString(GetCutNumber());
819 cout << "fCutString not yet initialized, will not be updated" << endl;
822 // cout << fCutString->GetString().Data() << endl;
826 ///________________________________________________________________________
827 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
828 // Initialize Cuts from a given Cut string
830 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
831 AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
833 if(analysisCutSelection.Length()!=kNCuts) {
834 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
837 if(!analysisCutSelection.IsDigit()){
838 AliError("Cut selection contains characters");
842 const char *cutSelection = analysisCutSelection.Data();
843 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
844 for(Int_t ii=0;ii<kNCuts;ii++){
850 AliError("Analysis Cut Selection does not start with 9");
855 // Set Individual Cuts
856 for(Int_t ii=0;ii<kNCuts;ii++){
857 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
864 ///________________________________________________________________________
865 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
866 ///Set individual cut ID
868 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
872 fCuts[kgoodId] = value;
874 cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
880 case kededxSigmaITSCut:
881 if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
882 fCuts[kededxSigmaITSCut] = value;
883 UpdateCutString(cutID, value);
885 } else return kFALSE;
887 case kededxSigmaTPCCut:
888 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
889 fCuts[kededxSigmaTPCCut] = value;
890 UpdateCutString(cutID, value);
892 } else return kFALSE;
894 case kpidedxSigmaTPCCut:
895 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
896 fCuts[kpidedxSigmaTPCCut] = value;
897 UpdateCutString(cutID, value);
899 } else return kFALSE;
901 case kpiMinMomdedxSigmaTPCCut:
902 if( SetMinMomPiondEdxTPCCut(value)) {
903 fCuts[kpiMinMomdedxSigmaTPCCut] = value;
904 UpdateCutString(cutID, value);
906 } else return kFALSE;
908 case kpiMaxMomdedxSigmaTPCCut:
909 if( SetMaxMomPiondEdxTPCCut(value)) {
910 fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
911 UpdateCutString(cutID, value);
913 } else return kFALSE;
915 case kLowPRejectionSigmaCut:
916 if( SetLowPRejectionCuts(value) ) {
917 fCuts[kLowPRejectionSigmaCut] = value;
918 UpdateCutString(cutID, value);
920 } else return kFALSE;
923 case kTOFelectronPID:
924 if( SetTOFElectronPIDCut(value)) {
925 fCuts[kTOFelectronPID] = value;
926 UpdateCutString(cutID, value);
928 } else return kFALSE;
930 if( SetITSClusterCut(value) ) {
931 fCuts[kclsITSCut] = value;
932 UpdateCutString(cutID, value);
934 } else return kFALSE;
936 if( SetTPCClusterCut(value)) {
937 fCuts[kclsTPCCut] = value;
938 UpdateCutString(cutID, value);
940 } else return kFALSE;
943 if( SetEtaCut(value)) {
944 fCuts[ketaCut] = value;
945 UpdateCutString(cutID, value);
947 } else return kFALSE;
949 if( SetPtCut(value)) {
950 fCuts[kptCut] = value;
951 UpdateCutString(cutID, value);
953 } else return kFALSE;
956 if( SetDCACut(value)) {
957 fCuts[kDCACut] = value;
958 UpdateCutString(cutID, value);
960 } else return kFALSE;
964 if( SetPsiPairCut(value)) {
965 fCuts[kPsiPair] = value;
966 UpdateCutString(cutID, value);
968 } else return kFALSE;
970 case kRejectSharedElecGamma:
971 if( SetRejectSharedElecGamma(value)) {
972 fCuts[kRejectSharedElecGamma] = value;
973 UpdateCutString(cutID, value);
975 } else return kFALSE;
977 case kBackgroundScheme:
978 if( SetBackgroundScheme(value)) {
979 fCuts[kBackgroundScheme] = value;
980 UpdateCutString(cutID, value);
982 } else return kFALSE;
984 case kNumberOfRotations:
985 if( SetNumberOfRotations(value)) {
986 fCuts[kNumberOfRotations] = value;
987 UpdateCutString(cutID, value);
989 } else return kFALSE;
992 if( SetMassCut(value)) {
993 fCuts[kmassCut] = value;
994 UpdateCutString(cutID, value);
996 } else return kFALSE;
998 if( SetDoWeights(value)) {
999 fCuts[kWeights] = value;
1000 UpdateCutString(cutID, value);
1002 } else return kFALSE;
1004 case kuseVPhotonMCPSmearing:
1006 if( SetUseVPhotonMCPmearing(value)) {
1007 fCuts[kuseVPhotonMCPSmearing] = value;
1008 UpdateCutString(cutID, value);
1010 } else return kFALSE;
1013 cout << "Error:: Cut id out of range"<< endl;
1017 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
1024 ///________________________________________________________________________
1026 void AliDalitzElectronCuts::PrintCuts() {
1027 // Print out current Cut Selection
1028 for(Int_t ic = 0; ic < kNCuts; ic++) {
1029 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1034 ///________________________________________________________________________
1035 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
1038 switch(ededxSigmaCut){
1041 fDodEdxSigmaITSCut = kFALSE;
1042 fPIDnSigmaBelowElectronLineITS=-100;
1043 fPIDnSigmaAboveElectronLineITS= 100;
1046 fDodEdxSigmaITSCut = kTRUE;
1047 fPIDnSigmaBelowElectronLineITS=-10;
1048 fPIDnSigmaAboveElectronLineITS=10;
1051 fDodEdxSigmaITSCut = kTRUE;
1052 fPIDnSigmaBelowElectronLineITS=-6;
1053 fPIDnSigmaAboveElectronLineITS=7;
1056 fDodEdxSigmaITSCut = kTRUE;
1057 fPIDnSigmaBelowElectronLineITS=-5;
1058 fPIDnSigmaAboveElectronLineITS=5;
1061 fDodEdxSigmaITSCut = kTRUE;
1062 fPIDnSigmaBelowElectronLineITS=-4;
1063 fPIDnSigmaAboveElectronLineITS=5;
1066 fDodEdxSigmaITSCut = kTRUE;
1067 fPIDnSigmaBelowElectronLineITS=-3;
1068 fPIDnSigmaAboveElectronLineITS=5;
1071 fDodEdxSigmaITSCut = kTRUE;
1072 fPIDnSigmaBelowElectronLineITS=-4;
1073 fPIDnSigmaAboveElectronLineITS=4;
1076 fDodEdxSigmaITSCut = kTRUE;
1077 fPIDnSigmaBelowElectronLineITS=-2.5;
1078 fPIDnSigmaAboveElectronLineITS=4;
1081 fDodEdxSigmaITSCut = kTRUE;
1082 fPIDnSigmaBelowElectronLineITS=-2;
1083 fPIDnSigmaAboveElectronLineITS=3.5;
1086 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1093 ///________________________________________________________________________
1094 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
1096 switch(ededxSigmaCut){
1098 case 0: fDodEdxSigmaTPCCut = kFALSE;
1099 fPIDnSigmaBelowElectronLineTPC=-10;
1100 fPIDnSigmaAboveElectronLineTPC=10;
1103 fDodEdxSigmaTPCCut = kTRUE;
1104 fPIDnSigmaBelowElectronLineTPC=-10;
1105 fPIDnSigmaAboveElectronLineTPC=10;
1108 fDodEdxSigmaTPCCut = kTRUE;
1109 fPIDnSigmaBelowElectronLineTPC=-6;
1110 fPIDnSigmaAboveElectronLineTPC=7;
1113 fDodEdxSigmaTPCCut = kTRUE;
1114 fPIDnSigmaBelowElectronLineTPC=-5;
1115 fPIDnSigmaAboveElectronLineTPC=5;
1118 fDodEdxSigmaTPCCut = kTRUE;
1119 fPIDnSigmaBelowElectronLineTPC=-4;
1120 fPIDnSigmaAboveElectronLineTPC=5;
1123 fDodEdxSigmaTPCCut = kTRUE;
1124 fPIDnSigmaBelowElectronLineTPC=-3;
1125 fPIDnSigmaAboveElectronLineTPC=5;
1128 fDodEdxSigmaTPCCut = kTRUE;
1129 fPIDnSigmaBelowElectronLineTPC=-4;
1130 fPIDnSigmaAboveElectronLineTPC=4;
1133 fDodEdxSigmaTPCCut = kTRUE;
1134 fPIDnSigmaBelowElectronLineTPC=-2.5;
1135 fPIDnSigmaAboveElectronLineTPC=4;
1138 fDodEdxSigmaTPCCut = kTRUE;
1139 fPIDnSigmaBelowElectronLineTPC=-2;
1140 fPIDnSigmaAboveElectronLineTPC=3.5;
1143 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1150 ///________________________________________________________________________
1151 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
1154 switch(pidedxSigmaCut){
1156 case 0: fPIDnSigmaAbovePionLineTPC= 0;
1157 fPIDnSigmaAbovePionLineTPCHighPt=-100;
1160 fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1161 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1164 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1165 fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1168 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1169 fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1172 fPIDnSigmaAbovePionLineTPC=1;
1173 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1176 fPIDnSigmaAbovePionLineTPC=2.;
1177 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1180 fPIDnSigmaAbovePionLineTPC=2.5;
1181 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1184 fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1185 fPIDnSigmaAbovePionLineTPCHighPt = 2.0;
1188 fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1189 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;
1192 fPIDnSigmaAbovePionLineTPC=1.5;
1193 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
1196 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1202 ///________________________________________________________________________
1203 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
1205 switch(piMomdedxSigmaCut){
1207 case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1210 fPIDMinPnSigmaAbovePionLineTPC=50.;
1213 fPIDMinPnSigmaAbovePionLineTPC=20.;
1216 fPIDMinPnSigmaAbovePionLineTPC=1.5;
1219 fPIDMinPnSigmaAbovePionLineTPC=1.;
1222 fPIDMinPnSigmaAbovePionLineTPC=0.5;
1225 fPIDMinPnSigmaAbovePionLineTPC=0.4;
1228 fPIDMinPnSigmaAbovePionLineTPC=0.3;
1231 fPIDMinPnSigmaAbovePionLineTPC=0.25;
1234 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1239 ///________________________________________________________________________
1240 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
1243 if( !fesdTrackCuts ) {
1245 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1251 case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1253 case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1254 break; //1 hit first layer of SPD
1255 case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1256 break; //1 hit in any layer of SPD
1257 case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1258 fesdTrackCuts->SetMinNClustersITS(4);
1259 // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1261 case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1262 fesdTrackCuts->SetMinNClustersITS(3);
1263 // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1265 case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1266 fesdTrackCuts->SetMinNClustersITS(4);
1267 // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1269 case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1270 fesdTrackCuts->SetMinNClustersITS(5);
1271 // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1273 case 7: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1274 fesdTrackCuts->SetMinNClustersITS(4);
1276 case 8: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1278 case 9: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kBoth);
1279 fesdTrackCuts->SetMinNClustersITS(4);
1283 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1290 ///________________________________________________________________________
1291 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1296 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1300 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1304 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1306 case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1307 fMinClsTPCToF = 0.8;
1308 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1309 fesdTrackCuts->SetMinNClustersTPC(0);
1310 fUseCrossedRows = kTRUE;
1312 case 4: // 0% of findable clusters
1314 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1316 fUseCorrectedTPCClsInfo=0;
1318 case 5: // 35% of findable clusters
1320 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1321 fMinClsTPCToF= 0.35;
1322 fUseCorrectedTPCClsInfo=0;
1324 case 6: // 60% of findable clusters
1326 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1328 fUseCorrectedTPCClsInfo=0;
1330 case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1331 // Changed 2014-02-04 before fMinClsTPC = 50.;
1332 fMinClsTPCToF = 0.6;
1333 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1334 fesdTrackCuts->SetMinNClustersTPC(0);
1335 fUseCrossedRows = kTRUE;
1337 case 8: fMinClsTPC = 0.;
1338 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1339 fMinClsTPCToF= 0.35;
1340 fUseCorrectedTPCClsInfo=0;
1342 case 9: // 35% of findable clusters
1344 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1345 fMinClsTPCToF= 0.35;
1346 fUseCorrectedTPCClsInfo=1;
1350 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1356 ///________________________________________________________________________
1357 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
1386 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1390 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1393 case 8: fEtaCut = 0.4;
1396 case 9: fEtaCut = 0.65;
1400 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1406 ///________________________________________________________________________
1407 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)
1410 //0.1GeV, 0.125 GeV, 0.15 GeV
1414 case 0: fPtMinCut = 0.075;
1421 case 2: // 0.125 GeV
1430 case 4: fPtMinCut = 0.5;
1433 case 5: // 0.175 GeV
1438 cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1445 ///________________________________________________________________________
1446 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)
1450 if( !fesdTrackCuts ) {
1452 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1460 fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1461 fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1462 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1466 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1467 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1470 case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1471 fesdTrackCuts->SetMaxDCAToVertexXY(1);
1472 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1475 case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
1476 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1480 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1489 ///________________________________________________________________________
1490 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
1492 switch(piMaxMomdedxSigmaCut){
1495 fPIDMaxPnSigmaAbovePionLineTPC=0.;
1498 fPIDMaxPnSigmaAbovePionLineTPC=100.;
1501 fPIDMaxPnSigmaAbovePionLineTPC=5.;
1504 fPIDMaxPnSigmaAbovePionLineTPC=4.;
1507 fPIDMaxPnSigmaAbovePionLineTPC=3.5;
1510 fPIDMaxPnSigmaAbovePionLineTPC=3.;
1513 cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1519 ///________________________________________________________________________
1520 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
1522 switch(LowPRejectionSigmaCut){
1524 fDoKaonRejectionLowP=kFALSE;
1525 fDoProtonRejectionLowP=kFALSE;
1526 fDoPionRejectionLowP=kFALSE;
1527 fPIDnSigmaAtLowPAroundKaonLine=0;
1528 fPIDnSigmaAtLowPAroundProtonLine=0;
1529 fPIDnSigmaAtLowPAroundPionLine=0;
1530 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1533 fDoKaonRejectionLowP=kTRUE;
1534 fDoProtonRejectionLowP=kTRUE;
1535 fDoPionRejectionLowP=kTRUE;
1536 fPIDnSigmaAtLowPAroundKaonLine=0.5;
1537 fPIDnSigmaAtLowPAroundProtonLine=0.5;
1538 fPIDnSigmaAtLowPAroundPionLine=0.5;
1539 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1542 fDoKaonRejectionLowP=kTRUE;
1543 fDoProtonRejectionLowP=kTRUE;
1544 fDoPionRejectionLowP=kTRUE;
1545 fPIDnSigmaAtLowPAroundKaonLine=1.0;
1546 fPIDnSigmaAtLowPAroundProtonLine=1.0;
1547 fPIDnSigmaAtLowPAroundPionLine=1.0;
1548 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1551 fDoKaonRejectionLowP=kTRUE;
1552 fDoProtonRejectionLowP=kTRUE;
1553 fDoPionRejectionLowP=kTRUE;
1554 fPIDnSigmaAtLowPAroundKaonLine=1.5;
1555 fPIDnSigmaAtLowPAroundProtonLine=1.5;
1556 fPIDnSigmaAtLowPAroundPionLine=1.5;
1557 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1560 fDoKaonRejectionLowP=kTRUE;
1561 fDoProtonRejectionLowP=kTRUE;
1562 fDoPionRejectionLowP=kTRUE;
1563 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1564 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1565 fPIDnSigmaAtLowPAroundPionLine=2.0;
1566 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1569 fDoKaonRejectionLowP=kTRUE;
1570 fDoProtonRejectionLowP=kTRUE;
1571 fDoPionRejectionLowP=kTRUE;
1572 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1573 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1574 fPIDnSigmaAtLowPAroundPionLine=2.5;
1575 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1578 fDoKaonRejectionLowP=kTRUE;
1579 fDoProtonRejectionLowP=kTRUE;
1580 fDoPionRejectionLowP=kTRUE;
1581 fPIDnSigmaAtLowPAroundKaonLine=0.;
1582 fPIDnSigmaAtLowPAroundProtonLine=0.;
1583 fPIDnSigmaAtLowPAroundPionLine=2.;
1584 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1587 fDoKaonRejectionLowP=kFALSE;
1588 fDoProtonRejectionLowP=kFALSE;
1589 fDoPionRejectionLowP=kTRUE;
1590 fPIDnSigmaAtLowPAroundKaonLine=0.0;
1591 fPIDnSigmaAtLowPAroundProtonLine=0.0;
1592 fPIDnSigmaAtLowPAroundPionLine=1.0;
1593 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1596 fDoKaonRejectionLowP=kFALSE;
1597 fDoProtonRejectionLowP=kFALSE;
1598 fDoPionRejectionLowP=kTRUE;
1599 fPIDnSigmaAtLowPAroundKaonLine=0.;
1600 fPIDnSigmaAtLowPAroundProtonLine=0.;
1601 fPIDnSigmaAtLowPAroundPionLine=0.5;
1602 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1605 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1611 ///________________________________________________________________________
1612 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
1614 switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1616 fRequireTOF = kFALSE;
1617 fUseTOFpid = kFALSE;
1618 fTofPIDnSigmaBelowElectronLine=-100;
1619 fTofPIDnSigmaAboveElectronLine=100;
1622 fRequireTOF = kFALSE;
1624 fTofPIDnSigmaBelowElectronLine=-7;
1625 fTofPIDnSigmaAboveElectronLine=7;
1628 fRequireTOF = kFALSE;
1630 fTofPIDnSigmaBelowElectronLine=-5;
1631 fTofPIDnSigmaAboveElectronLine=5;
1634 fRequireTOF = kFALSE;
1636 fTofPIDnSigmaBelowElectronLine=-3;
1637 fTofPIDnSigmaAboveElectronLine=5;
1640 fRequireTOF = kFALSE;
1642 fTofPIDnSigmaBelowElectronLine=-2;
1643 fTofPIDnSigmaAboveElectronLine=3;
1645 case 5: // -3, 3 TOF mandatory
1646 fRequireTOF = kTRUE;
1648 fTofPIDnSigmaBelowElectronLine= -3;
1649 fTofPIDnSigmaAboveElectronLine= 3;
1652 cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1654 } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
1657 ///_______________________________________________________________________________
1659 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
1664 fDoPsiPairCut = kFALSE;
1665 fPsiPairCut = 10000.; //
1666 fDeltaPhiCutMin = -1000.;
1667 fDeltaPhiCutMax = 1000.;
1671 fDoPsiPairCut = kTRUE;
1672 fPsiPairCut = 0.45; // Standard
1673 fDeltaPhiCutMin = 0.0;
1674 fDeltaPhiCutMax = 0.12;
1677 fDoPsiPairCut = kTRUE;
1679 fDeltaPhiCutMin = 0.0;
1680 fDeltaPhiCutMax = 0.12;
1683 fDoPsiPairCut = kTRUE;
1685 fDeltaPhiCutMin = 0.0;
1686 fDeltaPhiCutMax = 0.12;
1689 fDoPsiPairCut = kTRUE;
1691 fDeltaPhiCutMin = 0.0;
1692 fDeltaPhiCutMax = 0.12;
1695 fDoPsiPairCut = kTRUE;
1697 fDeltaPhiCutMin = 0.0;
1698 fDeltaPhiCutMax = 0.06;
1703 cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1710 ///_______________________________________________________________________________
1711 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
1716 fDoRejectSharedElecGamma = kFALSE;
1717 fRadiusCut = 10000; //
1720 fDoRejectSharedElecGamma = kTRUE;
1721 fRadiusCut = 2.0; // cm
1724 fDoRejectSharedElecGamma = kTRUE;
1725 fRadiusCut = 3.0; // Standard
1728 fDoRejectSharedElecGamma = kTRUE;
1729 fRadiusCut = 4.0; //
1732 fDoRejectSharedElecGamma = kTRUE;
1733 fRadiusCut = 5.0; //
1736 fDoRejectSharedElecGamma = kTRUE;
1737 fRadiusCut = 10.0; //
1740 fDoRejectSharedElecGamma = kTRUE;
1741 fRadiusCut = 15.0; //
1744 cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1750 ///__________________________________________________________________________
1751 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1754 switch(BackgroundScheme){
1758 fUseTrackMultiplicityForBG = kFALSE;
1760 case 1: // mixed event with V0 multiplicity
1762 fUseTrackMultiplicityForBG = kFALSE;
1764 case 2: // mixed event with track multiplicity
1765 fUseTrackMultiplicityForBG = kTRUE;
1769 fUseTrackMultiplicityForBG = kFALSE;
1773 fUseTrackMultiplicityForBG = kTRUE;
1776 case 5: fUseTrackMultiplicityForBG = kTRUE;
1781 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1787 ///________________________________________________________________________
1788 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
1790 switch(NumberOfRotations){
1792 fnumberOfRotationEventsForBG = 5;
1795 fnumberOfRotationEventsForBG = 10;
1798 fnumberOfRotationEventsForBG = 15;
1801 fnumberOfRotationEventsForBG = 20;
1804 fnumberOfRotationEventsForBG = 2;
1807 fnumberOfRotationEventsForBG = 50;
1810 fnumberOfRotationEventsForBG = 80;
1813 fnumberOfRotationEventsForBG = 100;
1816 cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
1824 ///________________________________________________________________________
1825 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)
1829 case 0: fDoWeights = kFALSE;
1831 case 1: fDoWeights = kTRUE;
1834 cout<<"Warning: Weights option not defined "<<opc<<endl;
1839 ///________________________________________________________________________
1840 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)
1846 fMassCutPtMin = -999.; //GeV
1847 fMassCutLowPt = 999.; //GeV/c^2
1848 fMassCutHighPt = 999.; //GeV/c^2
1850 fDoMassCut = kFALSE;
1851 fDoMassMinCut = kFALSE;
1854 //fMassCut = 0.135; //GeV/c^2
1855 fMassCutPtMin = -999.; //GeV
1856 fMassCutLowPt = 0.135; //GeV/c^2
1857 fMassCutHighPt = 0.135; //GeV/c^2
1860 fDoMassMinCut = kFALSE;
1863 //fMassCut = 0.100; //GeV/c^2
1864 fMassCutPtMin = -999.; //GeV
1865 fMassCutLowPt = 0.100; //GeV/c^2
1866 fMassCutHighPt = 0.100; //GeV/c^2
1869 fDoMassMinCut = kFALSE;
1872 /*fMassCut = 0.075; //GeV/c^2 Changed from Feb 25
1873 fMassCutPtMin = -999.; //GeV
1874 fMassCutLowPt = 0.075; //GeV/c^2
1875 fMassCutHighPt = 0.075; //GeV/c^2
1877 fDoMassMinCut = kFALSE;*/
1878 fMassCutPtMin = 1.0; //GeV
1879 fMassCutLowPt = 0.015; //GeV/c^2
1880 fMassCutHighPt = 0.035; //GeV/c^2
1881 fMassMinCut = 0.002;
1883 fDoMassMinCut = kTRUE;
1886 //fMassCut = 0.050; //GeV/c^2
1887 fMassCutPtMin = -999.; //GeV
1888 fMassCutLowPt = 0.050; //GeV/c^2
1889 fMassCutHighPt = 0.050; //GeV/c^2
1892 fDoMassMinCut = kFALSE;
1896 fMassCutPtMin = -999.; //GeV
1897 fMassCutLowPt = 0.035; //GeV/c^2
1898 fMassCutHighPt = 0.035; //GeV/c^2
1901 fDoMassMinCut = kFALSE;
1904 fMassCutPtMin = -999.; //GeV
1905 fMassCutLowPt = 0.015; //GeV/c^2
1906 fMassCutHighPt = 0.015; //GeV/c^2
1909 fDoMassMinCut = kFALSE;
1911 case 7: fMassCutPtMin = 1.0; //GeV
1912 fMassCutLowPt = 0.015; //GeV/c^2
1913 fMassCutHighPt = 0.035; //GeV/c^2
1916 fDoMassMinCut = kFALSE;
1918 case 8: fMassCutPtMin = 1.0; //GeV
1919 fMassCutLowPt = 0.015; //GeV/c^2
1920 fMassCutHighPt = 0.050; //GeV/c^2
1923 fDoMassMinCut = kFALSE;
1925 case 9: fMassCutPtMin = 1.0; //GeV
1926 fMassCutLowPt = 0.025; //GeV/c^2
1927 fMassCutHighPt = 0.035; //GeV/c^2
1930 fDoMassMinCut = kFALSE;
1933 cout<<"Warning: MassCut not defined "<<massCut<<endl;
1938 Bool_t AliDalitzElectronCuts::SetUseVPhotonMCPmearing(Int_t useMCPSmearing)
1940 switch(useMCPSmearing){
1943 fUseVPhotonMCPSmearing=kFALSE;
1944 fUseElectronMCPSmearing=kFALSE;
1947 fUseVPhotonMCPSmearing=kTRUE;
1948 fUseElectronMCPSmearing=kFALSE;
1951 fUseVPhotonMCPSmearing=kFALSE;
1952 fUseElectronMCPSmearing=kTRUE;
1956 default: cout<<"Warning: Virtual Photon SMearing not defined "<<useMCPSmearing<<endl;
1965 ///________________________________________________________________________
1966 TString AliDalitzElectronCuts::GetCutNumber(){
1967 // returns TString with current cut number
1969 for(Int_t ii=0;ii<kNCuts;ii++){
1970 a.Append(Form("%d",fCuts[ii]));
1976 ///________________________________________________________________________
1977 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
1978 //Create and return standard 2010 PbPb cuts
1979 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
1980 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1981 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
1985 ///________________________________________________________________________
1986 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
1987 //Create and return standard 2010 PbPb cuts
1988 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
1990 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1991 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}