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),
119 fMassCutHighPt(999.),
120 fMassCutPtMin(-100.0),
125 hITSdEdxbefore(NULL),
127 hTPCdEdxbefore(NULL),
129 hTPCdEdxSignalbefore(NULL),
130 hTPCdEdxSignalafter(NULL),
133 hTrackDCAxyPtbefore(NULL),
134 hTrackDCAxyPtafter(NULL),
135 hTrackDCAzPtbefore(NULL),
136 hTrackDCAzPtafter(NULL),
137 hTrackNFindClsPtTPCbefore(NULL),
138 hTrackNFindClsPtTPCafter(NULL)
141 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
142 fCutString=new TObjString((GetCutNumber()).Data());
144 //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
145 // Using standard function for setting Cuts
146 Bool_t selectPrimaries=kFALSE;
147 fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
150 //________________________________________________________________________
151 AliDalitzElectronCuts::~AliDalitzElectronCuts() {
153 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
155 // delete fHistograms;
156 // fHistograms = NULL;
158 if(fCutString != NULL){
166 //________________________________________________________________________
167 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
169 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
171 TString cutName = "";
174 cutName = GetCutNumber().Data();
177 cutName = cutNumber.Data();
180 if(fHistograms != NULL){
184 if(fHistograms==NULL){
185 fHistograms=new TList();
186 if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
187 else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
191 hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
192 hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
193 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
194 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
195 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
196 hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
197 fHistograms->Add(hCutIndex);
202 hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
203 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
204 hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
205 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
206 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
207 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
208 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
209 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
210 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
211 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
212 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
213 fHistograms->Add(hdEdxCuts);
217 TAxis *AxisBeforeITS = NULL;
218 TAxis *AxisBeforedEdx = NULL;
219 TAxis *AxisBeforeTOF = NULL;
220 TAxis *AxisBeforedEdxSignal = NULL;
225 hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,150,0.05,20,400,-10,10);
226 fHistograms->Add(hITSdEdxbefore);
227 AxisBeforeITS = hITSdEdxbefore->GetXaxis();
229 hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,150,0.05,20,400,-10,10);
230 fHistograms->Add(hTPCdEdxbefore);
231 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
233 hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,150,0.05,20.0,800,0.0,200);
234 fHistograms->Add(hTPCdEdxSignalbefore);
235 AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
237 hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,150,0.05,20,400,-6,10);
238 fHistograms->Add(hTOFbefore);
239 AxisBeforeTOF = hTOFbefore->GetXaxis();
241 hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",800,-4.0,4.0,400,0.,10.);
242 fHistograms->Add(hTrackDCAxyPtbefore);
244 hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",800,-4.0,4.0,400,0.,10.);
245 fHistograms->Add(hTrackDCAzPtbefore);
247 hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",100,0,1,400,0.,10.);
248 fHistograms->Add(hTrackNFindClsPtTPCbefore);
255 hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,150,0.05,20,400, -10,10);
256 fHistograms->Add(hITSdEdxafter);
258 hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,150,0.05,20,400, -10,10);
259 fHistograms->Add(hTPCdEdxafter);
261 hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,150,0.05,20.0,800,0.0,200);
262 fHistograms->Add(hTPCdEdxSignalafter);
264 hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,150,0.05,20,400,-6,10);
265 fHistograms->Add(hTOFafter);
267 hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",800,-4.0,4.0,400,0.,10.);
268 fHistograms->Add(hTrackDCAxyPtafter);
270 hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",800,-4.0,4.0,400,0.,10.);
271 fHistograms->Add(hTrackDCAzPtafter);
273 hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",100,0,1,400,0.,10.);
274 fHistograms->Add(hTrackNFindClsPtTPCafter);
278 TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
279 Int_t bins = AxisAfter->GetNbins();
280 Double_t from = AxisAfter->GetXmin();
281 Double_t to = AxisAfter->GetXmax();
282 Double_t *newBins = new Double_t[bins+1];
284 Double_t factor = TMath::Power(to/from, 1./bins);
285 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
286 AxisAfter->Set(bins, newBins);
287 AxisAfter = hTOFafter->GetXaxis();
288 AxisAfter->Set(bins, newBins);
289 AxisAfter = hITSdEdxafter->GetXaxis();
290 AxisAfter->Set(bins,newBins);
291 AxisAfter = hTPCdEdxSignalafter->GetXaxis();
292 AxisAfter->Set(bins,newBins);
295 AxisBeforeITS->Set(bins, newBins);
296 AxisBeforedEdx->Set(bins, newBins);
297 AxisBeforedEdxSignal->Set(bins,newBins);
298 AxisBeforeTOF->Set(bins, newBins);
304 // Event Cuts and Info
308 //________________________________________________________________________
309 Bool_t AliDalitzElectronCuts::InitPIDResponse(){
311 // Set Pointer to AliPIDResponse
313 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
317 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
318 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
319 if(fPIDResponse)return kTRUE;
325 ///________________________________________________________________________
326 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)
328 if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;
329 if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
331 TParticle* particle = fMCStack->Particle(labelParticle);
333 if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
336 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
345 ///________________________________________________________________________
346 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
348 //Selection of Reconstructed electrons
353 lTrack->GetImpactParameters(b,bCov);
355 if (bCov[0]<=0 || bCov[2]<=0) {
356 AliDebug(1, "Estimated b resolution lower or equal zero!");
357 bCov[0]=0; bCov[2]=0;
362 Float_t dcaToVertexXY = b[0];
363 Float_t dcaToVertexZ = b[1];
364 Double_t clsToF = GetNFindableClustersTPC(lTrack);
366 if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
367 if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
368 if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
372 if(hCutIndex)hCutIndex->Fill(kElectronIn);
375 if(hCutIndex)hCutIndex->Fill(kNoTracks);
379 if ( ! lTrack->GetConstrainedParam() ){
382 AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
386 if( !TrackIsSelected(lTrack) ){
387 if(hCutIndex)hCutIndex->Fill(kTrackCuts);
393 if( ! dEdxCuts( track ) ) {
394 if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
399 //Electron passed the cuts
400 if(hCutIndex)hCutIndex->Fill(kElectronOut);
402 if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
403 if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
404 if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
410 ///________________________________________________________________________
411 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
412 // Track Selection for Photon Reconstruction
415 Double_t clsToF = GetNFindableClustersTPC(lTrack);
418 if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
424 if( lTrack->Eta() > (fEtaCut + fEtaShift) || lTrack->Eta() < (-fEtaCut + fEtaShift) ) {
430 if( lTrack->Pt() < fPtCut ) {
438 if( clsToF < fMinClsTPCToF){
446 ///________________________________________________________________________
447 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
449 // Electron Identification Cuts for Photon reconstruction
451 if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
452 if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
456 //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
462 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
463 if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
464 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
465 if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
471 if( fDodEdxSigmaITSCut == kTRUE ){
474 if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
475 fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
477 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
483 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
489 if(fDodEdxSigmaTPCCut == kTRUE){
493 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
494 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
496 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
502 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
503 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
504 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
505 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
507 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
514 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
515 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
516 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
517 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
519 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
530 if( fDoKaonRejectionLowP == kTRUE ){
532 if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
534 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
536 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
544 if( fDoProtonRejectionLowP == kTRUE ){
546 if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
547 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
549 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
556 if(fDoPionRejectionLowP == kTRUE){
557 if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
558 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
560 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
568 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
569 if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
571 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
572 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
573 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
577 if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
579 else if ( fRequireTOF == kTRUE ) {
581 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
586 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
587 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
588 if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
592 ///________________________________________________________________________
595 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
596 //Returns pointer to the track with given ESD label
597 //(Important for AOD implementation, since Track array in AOD data is different
598 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
600 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
602 if(label > event->GetNumberOfTracks() ) return NULL;
603 AliESDtrack * track = esdEvent->GetTrack(label);
607 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
608 AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
611 if(track->GetID() == label) {
618 cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
621 ///________________________________________________________________________
622 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
625 for(Int_t i = 0;i<photons->GetEntries();i++){
627 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
629 Int_t posLabel = photonComp->GetTrackLabelPositive();
630 Int_t negLabel = photonComp->GetTrackLabelNegative();
632 if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
639 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
641 if( pi0CandidatePt < fMassCutPtMin ){
643 if( vphotonCandidateMass < fMassCutLowPt ){
650 if( vphotonCandidateMass < fMassCutHighPt ){
660 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){
665 if( fUseCrossedRows == kFALSE ) {
667 if ( !fUseCorrectedTPCClsInfo ){
668 if(lTrack->GetTPCNclsF()!=0){
670 clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
671 }// Ncluster/Nfindablecluster
675 //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
676 clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
681 Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
683 if ( lTrack->GetTPCNclsF()>0 ) {
684 clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
693 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
696 // This angle is a measure for the contribution of the opening in polar
697 // direction ??0 to the opening angle ?? Pair
699 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
700 // Master Thesis. Thorsten Dahms. 2005
701 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
705 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
706 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
708 TVector3 posDaughter;
709 TVector3 negDaughter;
711 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
712 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
714 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
715 Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
717 if( openingAngle < 1e-20 ) return 0.;
719 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
724 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
727 // Returns true if it is a gamma conversion according to psi pair value
729 return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
730 TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
733 ///________________________________________________________________________
734 Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
735 ///Update the cut string (if it has been created yet)
737 if(fCutString && fCutString->GetString().Length() == kNCuts) {
738 cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
739 fCutString->SetString(GetCutNumber());
741 cout << "fCutString not yet initialized, will not be updated" << endl;
744 // cout << fCutString->GetString().Data() << endl;
748 ///________________________________________________________________________
749 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
750 // Initialize Cuts from a given Cut string
752 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
753 AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
755 if(analysisCutSelection.Length()!=kNCuts) {
756 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
759 if(!analysisCutSelection.IsDigit()){
760 AliError("Cut selection contains characters");
764 const char *cutSelection = analysisCutSelection.Data();
765 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
766 for(Int_t ii=0;ii<kNCuts;ii++){
772 AliError("Analysis Cut Selection does not start with 9");
777 // Set Individual Cuts
778 for(Int_t ii=0;ii<kNCuts;ii++){
779 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
786 ///________________________________________________________________________
787 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
788 ///Set individual cut ID
790 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
794 fCuts[kgoodId] = value;
796 cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
802 case kededxSigmaITSCut:
803 if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
804 fCuts[kededxSigmaITSCut] = value;
805 UpdateCutString(cutID, value);
807 } else return kFALSE;
809 case kededxSigmaTPCCut:
810 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
811 fCuts[kededxSigmaTPCCut] = value;
812 UpdateCutString(cutID, value);
814 } else return kFALSE;
816 case kpidedxSigmaTPCCut:
817 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
818 fCuts[kpidedxSigmaTPCCut] = value;
819 UpdateCutString(cutID, value);
821 } else return kFALSE;
823 case kpiMinMomdedxSigmaTPCCut:
824 if( SetMinMomPiondEdxTPCCut(value)) {
825 fCuts[kpiMinMomdedxSigmaTPCCut] = value;
826 UpdateCutString(cutID, value);
828 } else return kFALSE;
830 case kpiMaxMomdedxSigmaTPCCut:
831 if( SetMaxMomPiondEdxTPCCut(value)) {
832 fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
833 UpdateCutString(cutID, value);
835 } else return kFALSE;
837 case kLowPRejectionSigmaCut:
838 if( SetLowPRejectionCuts(value) ) {
839 fCuts[kLowPRejectionSigmaCut] = value;
840 UpdateCutString(cutID, value);
842 } else return kFALSE;
845 case kTOFelectronPID:
846 if( SetTOFElectronPIDCut(value)) {
847 fCuts[kTOFelectronPID] = value;
848 UpdateCutString(cutID, value);
850 } else return kFALSE;
852 if( SetITSClusterCut(value) ) {
853 fCuts[kclsITSCut] = value;
854 UpdateCutString(cutID, value);
856 } else return kFALSE;
858 if( SetTPCClusterCut(value)) {
859 fCuts[kclsTPCCut] = value;
860 UpdateCutString(cutID, value);
862 } else return kFALSE;
865 if( SetEtaCut(value)) {
866 fCuts[ketaCut] = value;
867 UpdateCutString(cutID, value);
869 } else return kFALSE;
871 if( SetPtCut(value)) {
872 fCuts[kptCut] = value;
873 UpdateCutString(cutID, value);
875 } else return kFALSE;
878 if( SetDCACut(value)) {
879 fCuts[kDCACut] = value;
880 UpdateCutString(cutID, value);
882 } else return kFALSE;
886 if( SetPsiPairCut(value)) {
887 fCuts[kPsiPair] = value;
888 UpdateCutString(cutID, value);
890 } else return kFALSE;
892 case kRejectSharedElecGamma:
893 if( SetRejectSharedElecGamma(value)) {
894 fCuts[kRejectSharedElecGamma] = value;
895 UpdateCutString(cutID, value);
897 } else return kFALSE;
899 case kBackgroundScheme:
900 if( SetBackgroundScheme(value)) {
901 fCuts[kBackgroundScheme] = value;
902 UpdateCutString(cutID, value);
904 } else return kFALSE;
906 case kNumberOfRotations:
907 if( SetNumberOfRotations(value)) {
908 fCuts[kNumberOfRotations] = value;
909 UpdateCutString(cutID, value);
911 } else return kFALSE;
914 if( SetMassCut(value)) {
915 fCuts[kmassCut] = value;
916 UpdateCutString(cutID, value);
918 } else return kFALSE;
920 if( SetDoWeights(value)) {
921 fCuts[kWeights] = value;
922 UpdateCutString(cutID, value);
924 } else return kFALSE;
928 cout << "Error:: Cut id out of range"<< endl;
932 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
939 ///________________________________________________________________________
941 void AliDalitzElectronCuts::PrintCuts() {
942 // Print out current Cut Selection
943 for(Int_t ic = 0; ic < kNCuts; ic++) {
944 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
949 ///________________________________________________________________________
950 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
953 switch(ededxSigmaCut){
956 fDodEdxSigmaITSCut = kFALSE;
957 fPIDnSigmaBelowElectronLineITS=-100;
958 fPIDnSigmaAboveElectronLineITS= 100;
961 fDodEdxSigmaITSCut = kTRUE;
962 fPIDnSigmaBelowElectronLineITS=-10;
963 fPIDnSigmaAboveElectronLineITS=10;
966 fDodEdxSigmaITSCut = kTRUE;
967 fPIDnSigmaBelowElectronLineITS=-6;
968 fPIDnSigmaAboveElectronLineITS=7;
971 fDodEdxSigmaITSCut = kTRUE;
972 fPIDnSigmaBelowElectronLineITS=-5;
973 fPIDnSigmaAboveElectronLineITS=5;
976 fDodEdxSigmaITSCut = kTRUE;
977 fPIDnSigmaBelowElectronLineITS=-4;
978 fPIDnSigmaAboveElectronLineITS=5;
981 fDodEdxSigmaITSCut = kTRUE;
982 fPIDnSigmaBelowElectronLineITS=-3;
983 fPIDnSigmaAboveElectronLineITS=5;
986 fDodEdxSigmaITSCut = kTRUE;
987 fPIDnSigmaBelowElectronLineITS=-4;
988 fPIDnSigmaAboveElectronLineITS=4;
991 fDodEdxSigmaITSCut = kTRUE;
992 fPIDnSigmaBelowElectronLineITS=-2.5;
993 fPIDnSigmaAboveElectronLineITS=4;
996 fDodEdxSigmaITSCut = kTRUE;
997 fPIDnSigmaBelowElectronLineITS=-2;
998 fPIDnSigmaAboveElectronLineITS=3.5;
1001 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1008 ///________________________________________________________________________
1009 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
1011 switch(ededxSigmaCut){
1013 case 0: fDodEdxSigmaTPCCut = kFALSE;
1014 fPIDnSigmaBelowElectronLineTPC=-10;
1015 fPIDnSigmaAboveElectronLineTPC=10;
1018 fDodEdxSigmaTPCCut = kTRUE;
1019 fPIDnSigmaBelowElectronLineTPC=-10;
1020 fPIDnSigmaAboveElectronLineTPC=10;
1023 fDodEdxSigmaTPCCut = kTRUE;
1024 fPIDnSigmaBelowElectronLineTPC=-6;
1025 fPIDnSigmaAboveElectronLineTPC=7;
1028 fDodEdxSigmaTPCCut = kTRUE;
1029 fPIDnSigmaBelowElectronLineTPC=-5;
1030 fPIDnSigmaAboveElectronLineTPC=5;
1033 fDodEdxSigmaTPCCut = kTRUE;
1034 fPIDnSigmaBelowElectronLineTPC=-4;
1035 fPIDnSigmaAboveElectronLineTPC=5;
1038 fDodEdxSigmaTPCCut = kTRUE;
1039 fPIDnSigmaBelowElectronLineTPC=-3;
1040 fPIDnSigmaAboveElectronLineTPC=5;
1043 fDodEdxSigmaTPCCut = kTRUE;
1044 fPIDnSigmaBelowElectronLineTPC=-4;
1045 fPIDnSigmaAboveElectronLineTPC=4;
1048 fDodEdxSigmaTPCCut = kTRUE;
1049 fPIDnSigmaBelowElectronLineTPC=-2.5;
1050 fPIDnSigmaAboveElectronLineTPC=4;
1053 fDodEdxSigmaTPCCut = kTRUE;
1054 fPIDnSigmaBelowElectronLineTPC=-2;
1055 fPIDnSigmaAboveElectronLineTPC=3.5;
1058 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1065 ///________________________________________________________________________
1066 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
1069 switch(pidedxSigmaCut){
1071 case 0: fPIDnSigmaAbovePionLineTPC= 0;
1072 fPIDnSigmaAbovePionLineTPCHighPt=-100;
1075 fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1076 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1079 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1080 fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1083 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1084 fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1087 fPIDnSigmaAbovePionLineTPC=1;
1088 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1091 fPIDnSigmaAbovePionLineTPC=2.;
1092 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1095 fPIDnSigmaAbovePionLineTPC=2.5;
1096 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1099 fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1100 fPIDnSigmaAbovePionLineTPCHighPt = 2.0;
1103 fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1104 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;
1107 fPIDnSigmaAbovePionLineTPC=1.5;
1108 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
1111 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1117 ///________________________________________________________________________
1118 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
1120 switch(piMomdedxSigmaCut){
1122 case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1125 fPIDMinPnSigmaAbovePionLineTPC=50.;
1128 fPIDMinPnSigmaAbovePionLineTPC=20.;
1131 fPIDMinPnSigmaAbovePionLineTPC=1.5;
1134 fPIDMinPnSigmaAbovePionLineTPC=1.;
1137 fPIDMinPnSigmaAbovePionLineTPC=0.5;
1140 fPIDMinPnSigmaAbovePionLineTPC=0.4;
1143 fPIDMinPnSigmaAbovePionLineTPC=0.3;
1146 fPIDMinPnSigmaAbovePionLineTPC=0.25;
1149 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1154 ///________________________________________________________________________
1155 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
1158 if( !fesdTrackCuts ) {
1160 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1166 case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1168 case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1169 break; //1 hit first layer of SPD
1170 case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1171 break; //1 hit in any layer of SPD
1172 case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1173 fesdTrackCuts->SetMinNClustersITS(4);
1174 // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1176 case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1177 fesdTrackCuts->SetMinNClustersITS(3);
1178 // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1180 case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1181 fesdTrackCuts->SetMinNClustersITS(4);
1182 // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1184 case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1185 fesdTrackCuts->SetMinNClustersITS(5);
1186 // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1189 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1196 ///________________________________________________________________________
1197 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1202 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1206 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1210 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1212 case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1213 fMinClsTPCToF = 0.8;
1214 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1215 fesdTrackCuts->SetMinNClustersTPC(0);
1216 fUseCrossedRows = kTRUE;
1218 case 4: // 0% of findable clusters
1220 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1222 fUseCorrectedTPCClsInfo=0;
1224 case 5: // 35% of findable clusters
1226 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1227 fMinClsTPCToF= 0.35;
1228 fUseCorrectedTPCClsInfo=0;
1230 case 6: // 60% of findable clusters
1232 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1234 fUseCorrectedTPCClsInfo=0;
1236 case 7: // 70% of findable clusters
1238 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1240 fUseCorrectedTPCClsInfo=0;
1242 case 8: fMinClsTPC = 0.;
1243 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1244 fMinClsTPCToF= 0.35;
1245 fUseCorrectedTPCClsInfo=0;
1247 case 9: // 35% of findable clusters
1249 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1250 fMinClsTPCToF= 0.35;
1251 fUseCorrectedTPCClsInfo=1;
1255 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1261 ///________________________________________________________________________
1262 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
1291 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1295 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1298 case 8: fEtaCut = 0.4;
1302 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1308 ///________________________________________________________________________
1309 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)
1312 //0.1GeV, 0.125 GeV, 0.15 GeV
1316 case 0: fPtCut = 0.075;
1321 case 2: // 0.125 GeV
1328 cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1335 ///________________________________________________________________________
1336 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)
1340 if( !fesdTrackCuts ) {
1342 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1350 fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1351 fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1352 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1356 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1357 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1360 case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1361 fesdTrackCuts->SetMaxDCAToVertexXY(1);
1362 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1365 case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
1366 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1370 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1379 ///________________________________________________________________________
1380 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
1382 switch(piMaxMomdedxSigmaCut){
1385 fPIDMaxPnSigmaAbovePionLineTPC=0.;
1388 fPIDMaxPnSigmaAbovePionLineTPC=100.;
1391 fPIDMaxPnSigmaAbovePionLineTPC=5.;
1394 fPIDMaxPnSigmaAbovePionLineTPC=4.;
1397 fPIDMaxPnSigmaAbovePionLineTPC=3.5;
1400 fPIDMaxPnSigmaAbovePionLineTPC=3.;
1403 cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1409 ///________________________________________________________________________
1410 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
1412 switch(LowPRejectionSigmaCut){
1414 fDoKaonRejectionLowP=kFALSE;
1415 fDoProtonRejectionLowP=kFALSE;
1416 fDoPionRejectionLowP=kFALSE;
1417 fPIDnSigmaAtLowPAroundKaonLine=0;
1418 fPIDnSigmaAtLowPAroundProtonLine=0;
1419 fPIDnSigmaAtLowPAroundPionLine=0;
1420 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1423 fDoKaonRejectionLowP=kTRUE;
1424 fDoProtonRejectionLowP=kTRUE;
1425 fDoPionRejectionLowP=kTRUE;
1426 fPIDnSigmaAtLowPAroundKaonLine=0.5;
1427 fPIDnSigmaAtLowPAroundProtonLine=0.5;
1428 fPIDnSigmaAtLowPAroundPionLine=0.5;
1429 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1432 fDoKaonRejectionLowP=kTRUE;
1433 fDoProtonRejectionLowP=kTRUE;
1434 fDoPionRejectionLowP=kTRUE;
1435 fPIDnSigmaAtLowPAroundKaonLine=1.0;
1436 fPIDnSigmaAtLowPAroundProtonLine=1.0;
1437 fPIDnSigmaAtLowPAroundPionLine=1.0;
1438 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1441 fDoKaonRejectionLowP=kTRUE;
1442 fDoProtonRejectionLowP=kTRUE;
1443 fDoPionRejectionLowP=kTRUE;
1444 fPIDnSigmaAtLowPAroundKaonLine=1.5;
1445 fPIDnSigmaAtLowPAroundProtonLine=1.5;
1446 fPIDnSigmaAtLowPAroundPionLine=1.5;
1447 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1450 fDoKaonRejectionLowP=kTRUE;
1451 fDoProtonRejectionLowP=kTRUE;
1452 fDoPionRejectionLowP=kTRUE;
1453 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1454 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1455 fPIDnSigmaAtLowPAroundPionLine=2.0;
1456 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1459 fDoKaonRejectionLowP=kTRUE;
1460 fDoProtonRejectionLowP=kTRUE;
1461 fDoPionRejectionLowP=kTRUE;
1462 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1463 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1464 fPIDnSigmaAtLowPAroundPionLine=2.5;
1465 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1468 fDoKaonRejectionLowP=kTRUE;
1469 fDoProtonRejectionLowP=kTRUE;
1470 fDoPionRejectionLowP=kTRUE;
1471 fPIDnSigmaAtLowPAroundKaonLine=0.;
1472 fPIDnSigmaAtLowPAroundProtonLine=0.;
1473 fPIDnSigmaAtLowPAroundPionLine=2.;
1474 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1477 fDoKaonRejectionLowP=kFALSE;
1478 fDoProtonRejectionLowP=kFALSE;
1479 fDoPionRejectionLowP=kTRUE;
1480 fPIDnSigmaAtLowPAroundKaonLine=0.0;
1481 fPIDnSigmaAtLowPAroundProtonLine=0.0;
1482 fPIDnSigmaAtLowPAroundPionLine=1.0;
1483 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1486 fDoKaonRejectionLowP=kFALSE;
1487 fDoProtonRejectionLowP=kFALSE;
1488 fDoPionRejectionLowP=kTRUE;
1489 fPIDnSigmaAtLowPAroundKaonLine=0.;
1490 fPIDnSigmaAtLowPAroundProtonLine=0.;
1491 fPIDnSigmaAtLowPAroundPionLine=0.5;
1492 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1495 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1501 ///________________________________________________________________________
1502 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
1504 switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1506 fRequireTOF = kFALSE;
1507 fUseTOFpid = kFALSE;
1508 fTofPIDnSigmaBelowElectronLine=-100;
1509 fTofPIDnSigmaAboveElectronLine=100;
1512 fRequireTOF = kFALSE;
1514 fTofPIDnSigmaBelowElectronLine=-7;
1515 fTofPIDnSigmaAboveElectronLine=7;
1518 fRequireTOF = kFALSE;
1520 fTofPIDnSigmaBelowElectronLine=-5;
1521 fTofPIDnSigmaAboveElectronLine=5;
1524 fRequireTOF = kFALSE;
1526 fTofPIDnSigmaBelowElectronLine=-3;
1527 fTofPIDnSigmaAboveElectronLine=5;
1530 fRequireTOF = kFALSE;
1532 fTofPIDnSigmaBelowElectronLine=-2;
1533 fTofPIDnSigmaAboveElectronLine=3;
1535 case 5: // -3, 3 TOF mandatory
1536 fRequireTOF = kTRUE;
1538 fTofPIDnSigmaBelowElectronLine= -3;
1539 fTofPIDnSigmaAboveElectronLine= 3;
1542 cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1544 } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
1547 ///_______________________________________________________________________________
1549 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
1554 fDoPsiPairCut = kFALSE;
1555 fPsiPairCut = 10000.; //
1556 fDeltaPhiCutMin = -1000.;
1557 fDeltaPhiCutMax = 1000.;
1561 fDoPsiPairCut = kTRUE;
1562 fPsiPairCut = 0.45; // Standard
1563 fDeltaPhiCutMin = 0.0;
1564 fDeltaPhiCutMax = 0.12;
1567 fDoPsiPairCut = kTRUE;
1569 fDeltaPhiCutMin = 0.0;
1570 fDeltaPhiCutMax = 0.12;
1573 fDoPsiPairCut = kTRUE;
1575 fDeltaPhiCutMin = 0.0;
1576 fDeltaPhiCutMax = 0.12;
1578 fDoPsiPairCut = kTRUE;
1580 fDeltaPhiCutMin = 0.0;
1581 fDeltaPhiCutMax = 0.12;
1585 cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1592 ///_______________________________________________________________________________
1593 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
1598 fDoRejectSharedElecGamma = kFALSE;
1599 fRadiusCut = 10000; //
1602 fDoRejectSharedElecGamma = kTRUE;
1603 fRadiusCut = 2.0; // cm
1606 fDoRejectSharedElecGamma = kTRUE;
1607 fRadiusCut = 3.0; // Standard
1610 fDoRejectSharedElecGamma = kTRUE;
1611 fRadiusCut = 4.0; //
1614 fDoRejectSharedElecGamma = kTRUE;
1615 fRadiusCut = 5.0; //
1618 fDoRejectSharedElecGamma = kTRUE;
1619 fRadiusCut = 10.0; //
1622 fDoRejectSharedElecGamma = kTRUE;
1623 fRadiusCut = 15.0; //
1626 cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1632 ///__________________________________________________________________________
1633 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1636 switch(BackgroundScheme){
1640 fUseTrackMultiplicityForBG = kFALSE;
1642 case 1: // mixed event with V0 multiplicity
1644 fUseTrackMultiplicityForBG = kFALSE;
1646 case 2: // mixed event with track multiplicity
1647 fUseTrackMultiplicityForBG = kTRUE;
1651 fUseTrackMultiplicityForBG = kFALSE;
1655 fUseTrackMultiplicityForBG = kTRUE;
1658 case 5: fUseTrackMultiplicityForBG = kTRUE;
1663 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1669 ///________________________________________________________________________
1670 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
1672 switch(NumberOfRotations){
1674 fnumberOfRotationEventsForBG = 5;
1677 fnumberOfRotationEventsForBG = 10;
1680 fnumberOfRotationEventsForBG = 15;
1683 fnumberOfRotationEventsForBG = 20;
1686 fnumberOfRotationEventsForBG = 2;
1689 fnumberOfRotationEventsForBG = 50;
1692 fnumberOfRotationEventsForBG = 80;
1695 fnumberOfRotationEventsForBG = 100;
1698 cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
1706 ///________________________________________________________________________
1707 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)
1711 case 0: fDoWeights = kFALSE;
1713 case 1: fDoWeights = kTRUE;
1716 cout<<"Warning: Weights option not defined "<<opc<<endl;
1721 ///________________________________________________________________________
1722 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)
1728 fMassCutPtMin = -999.; //GeV
1729 fMassCutLowPt = 999.; //GeV/c^2
1730 fMassCutHighPt = 999.; //GeV/c^2
1731 fDoMassCut = kFALSE;
1734 //fMassCut = 0.135; //GeV/c^2
1735 fMassCutPtMin = -999.; //GeV
1736 fMassCutLowPt = 0.135; //GeV/c^2
1737 fMassCutHighPt = 0.135; //GeV/c^2
1741 //fMassCut = 0.100; //GeV/c^2
1742 fMassCutPtMin = -999.; //GeV
1743 fMassCutLowPt = 0.100; //GeV/c^2
1744 fMassCutHighPt = 0.100; //GeV/c^2
1748 //fMassCut = 0.075; //GeV/c^2
1749 fMassCutPtMin = -999.; //GeV
1750 fMassCutLowPt = 0.075; //GeV/c^2
1751 fMassCutHighPt = 0.075; //GeV/c^2
1755 //fMassCut = 0.050; //GeV/c^2
1756 fMassCutPtMin = -999.; //GeV
1757 fMassCutLowPt = 0.050; //GeV/c^2
1758 fMassCutHighPt = 0.050; //GeV/c^2
1763 fMassCutPtMin = -999.; //GeV
1764 fMassCutLowPt = 0.035; //GeV/c^2
1765 fMassCutHighPt = 0.035; //GeV/c^2
1769 fMassCutPtMin = -999.; //GeV
1770 fMassCutLowPt = 0.015; //GeV/c^2
1771 fMassCutHighPt = 0.015; //GeV/c^2
1774 case 7: fMassCutPtMin = 1.0; //GeV
1775 fMassCutLowPt = 0.015; //GeV/c^2
1776 fMassCutHighPt = 0.035; //GeV/c^2
1780 cout<<"Warning: MassCut not defined "<<massCut<<endl;
1788 ///________________________________________________________________________
1789 TString AliDalitzElectronCuts::GetCutNumber(){
1790 // returns TString with current cut number
1792 for(Int_t ii=0;ii<kNCuts;ii++){
1793 a.Append(Form("%d",fCuts[ii]));
1799 ///________________________________________________________________________
1800 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
1801 //Create and return standard 2010 PbPb cuts
1802 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
1803 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1804 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
1808 ///________________________________________________________________________
1809 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
1810 //Create and return standard 2010 PbPb cuts
1811 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
1813 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1814 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}