2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Authors: Svein Lindal, Daniel Lohner *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 ////////////////////////////////////////////////
18 //---------------------------------------------
19 // Class handling all kinds of selection cuts for
20 // Gamma Conversion analysis
21 //---------------------------------------------
22 ////////////////////////////////////////////////
25 #include "AliDalitzElectronCuts.h"
26 #include "AliAODConversionPhoton.h"
27 #include "AliKFVertex.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
30 #include "AliAnalysisManager.h"
31 #include "AliInputEventHandler.h"
32 #include "AliMCEventHandler.h"
33 #include "AliAODHandler.h"
34 #include "AliPIDResponse.h"
38 #include "TObjString.h"
39 #include "AliAODEvent.h"
40 #include "AliESDEvent.h"
46 ClassImp(AliDalitzElectronCuts)
49 const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {
54 "piMinMomdedxSigmaTPCCut",
55 "piMaxMomdedxSigmaTPCCut",
56 "LowPRejectionSigmaCut",
62 "RejectSharedElecGamma",
71 //________________________________________________________________________
72 AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),
84 fDeltaPhiCutMax(0.12),
85 fMinClsTPC(0), // minimum clusters in the TPC
86 fMinClsTPCToF(0), // minimum clusters to findable clusters
87 fDodEdxSigmaITSCut(kFALSE),
88 fDodEdxSigmaTPCCut(kTRUE),
89 fDoTOFsigmaCut(kFALSE), // RRnewTOF
90 fDoRejectSharedElecGamma(kFALSE),
91 fDoPsiPairCut(kFALSE),
92 fPIDnSigmaAboveElectronLineITS(100),
93 fPIDnSigmaBelowElectronLineITS(-100),
94 fPIDnSigmaAboveElectronLineTPC(100),
95 fPIDnSigmaBelowElectronLineTPC(-100),
96 fPIDnSigmaAbovePionLineTPC(0),
97 fPIDnSigmaAbovePionLineTPCHighPt(-100),
98 fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
99 fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
100 fPIDMinPnSigmaAbovePionLineTPC(0),
101 fPIDMaxPnSigmaAbovePionLineTPC(0),
102 fDoKaonRejectionLowP(kFALSE),
103 fDoProtonRejectionLowP(kFALSE),
104 fDoPionRejectionLowP(kFALSE),
105 fPIDnSigmaAtLowPAroundKaonLine(0),
106 fPIDnSigmaAtLowPAroundProtonLine(0),
107 fPIDnSigmaAtLowPAroundPionLine(0),
108 fPIDMinPKaonRejectionLowP(1.5),
109 fPIDMinPProtonRejectionLowP(2.0),
110 fPIDMinPPionRejectionLowP(0.5),
111 fUseCorrectedTPCClsInfo(kFALSE),
112 fUseCrossedRows(kFALSE),
115 fUseTrackMultiplicityForBG(kFALSE),
117 fnumberOfRotationEventsForBG(0),
119 fDoMassMinCut(kFALSE),
121 fMassCutHighPt(999.),
122 fMassCutPtMin(-100.0),
128 hITSdEdxbefore(NULL),
130 hTPCdEdxbefore(NULL),
132 hTPCdEdxSignalbefore(NULL),
133 hTPCdEdxSignalafter(NULL),
136 hTrackDCAxyPtbefore(NULL),
137 hTrackDCAxyPtafter(NULL),
138 hTrackDCAzPtbefore(NULL),
139 hTrackDCAzPtafter(NULL),
140 hTrackNFindClsPtTPCbefore(NULL),
141 hTrackNFindClsPtTPCafter(NULL)
144 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
145 fCutString=new TObjString((GetCutNumber()).Data());
147 //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
148 // Using standard function for setting Cuts
149 Bool_t selectPrimaries=kFALSE;
150 fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
153 //________________________________________________________________________
154 AliDalitzElectronCuts::~AliDalitzElectronCuts() {
156 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
158 // delete fHistograms;
159 // fHistograms = NULL;
161 if(fCutString != NULL){
169 //________________________________________________________________________
170 void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
172 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
174 TH1::AddDirectory(kFALSE);
176 TString cutName = "";
179 cutName = GetCutNumber().Data();
182 cutName = cutNumber.Data();
185 if(fHistograms != NULL){
189 if(fHistograms==NULL){
190 fHistograms=new TList();
191 if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
192 else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
196 Int_t kDedxSignalbins = 200;
198 const Int_t kDCABins=62;
200 Double_t binsDCADummy[63]={-3.0,-2.7,-2.4,-2.1,-1.8,-1.5,-1.2,-0.9,-0.6,-0.3,-0.25,-0.2,-0.19,-0.18,-0.17,-0.16,-0.15,-0.14,-0.13,-0.12,-0.11,-0.10,-0.09,-0.08,-0.07,-0.06,-0.05,-0.04,-0.03,-0.02,-0.01,0.0,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.25,0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3.0};
202 const Int_t kPtBins=110;
203 Double_t binsPtDummy[kPtBins+1];
204 const Int_t kPBins = 109;
205 Double_t binsPDummy[kPBins+1];
209 for(Int_t i=1;i<kPtBins+1;i++)
211 if(binsPtDummy[i-1]+0.05<1.01)
212 binsPtDummy[i]=binsPtDummy[i-1]+0.05;
214 binsPtDummy[i]=binsPtDummy[i-1]+0.1;
217 for(Int_t i=1; i <kPBins+1;i++){
219 if( binsPDummy[i-1]+0.05<1.01)
220 binsPDummy[i] = binsPDummy[i-1]+0.05;
222 binsPDummy[i] = binsPDummy[i-1]+0.1;
228 hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
229 hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
230 hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
231 hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
232 hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
233 hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
234 fHistograms->Add(hCutIndex);
239 hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
240 hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
241 hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
242 hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
243 hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
244 hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
245 hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
246 hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
247 hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
248 hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
249 hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
250 fHistograms->Add(hdEdxCuts);
254 TAxis *AxisBeforeITS = NULL;
255 TAxis *AxisBeforedEdx = NULL;
256 TAxis *AxisBeforeTOF = NULL;
257 TAxis *AxisBeforedEdxSignal = NULL;
262 hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
263 fHistograms->Add(hITSdEdxbefore);
264 AxisBeforeITS = hITSdEdxbefore->GetXaxis();
266 hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
267 fHistograms->Add(hTPCdEdxbefore);
268 AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
270 hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
271 fHistograms->Add(hTPCdEdxSignalbefore);
272 AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
274 hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
275 fHistograms->Add(hTOFbefore);
276 AxisBeforeTOF = hTOFbefore->GetXaxis();
278 hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
279 fHistograms->Add(hTrackDCAxyPtbefore);
281 hTrackDCAzPtbefore = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
282 fHistograms->Add(hTrackDCAzPtbefore);
284 hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",60,0,1.5,kPtBins,binsPtDummy);
285 fHistograms->Add(hTrackNFindClsPtTPCbefore);
292 hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
293 fHistograms->Add(hITSdEdxafter);
295 hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
296 fHistograms->Add(hTPCdEdxafter);
298 hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
299 fHistograms->Add(hTPCdEdxSignalafter);
301 hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
302 fHistograms->Add(hTOFafter);
304 hTrackDCAxyPtafter = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
305 fHistograms->Add(hTrackDCAxyPtafter);
307 hTrackDCAzPtafter = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
308 fHistograms->Add(hTrackDCAzPtafter);
310 hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",60,0,1.5,kPtBins,binsPtDummy);
311 fHistograms->Add(hTrackNFindClsPtTPCafter);
315 TAxis *AxisAfter = hTPCdEdxafter->GetXaxis();
316 Int_t bins = AxisAfter->GetNbins();
317 Double_t from = AxisAfter->GetXmin();
318 Double_t to = AxisAfter->GetXmax();
319 Double_t *newBins = new Double_t[bins+1];
321 Double_t factor = TMath::Power(to/from, 1./bins);
322 for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
323 AxisAfter->Set(bins, newBins);
324 AxisAfter = hTOFafter->GetXaxis();
325 AxisAfter->Set(bins, newBins);
326 AxisAfter = hITSdEdxafter->GetXaxis();
327 AxisAfter->Set(bins,newBins);
328 AxisAfter = hTPCdEdxSignalafter->GetXaxis();
329 AxisAfter->Set(bins,newBins);
332 AxisBeforeITS->Set(bins, newBins);
333 AxisBeforedEdx->Set(bins, newBins);
334 AxisBeforedEdxSignal->Set(bins,newBins);
335 AxisBeforeTOF->Set(bins, newBins);
340 TH1::AddDirectory(kTRUE);
342 // Event Cuts and Info
346 //________________________________________________________________________
347 Bool_t AliDalitzElectronCuts::InitPIDResponse(){
349 // Set Pointer to AliPIDResponse
351 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
355 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
356 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
357 if(fPIDResponse)return kTRUE;
363 ///________________________________________________________________________
364 Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)
366 if( labelParticle < 0 || labelParticle >= fMCStack->GetNtrack() ) return kFALSE;
367 if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE; //Ask Ana
369 TParticle* particle = fMCStack->Particle(labelParticle);
371 if( TMath::Abs( particle->GetPdgCode() ) != 11 ) return kFALSE;
374 if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
383 ///________________________________________________________________________
384 Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
386 //Selection of Reconstructed electrons
391 lTrack->GetImpactParameters(b,bCov);
393 if (bCov[0]<=0 || bCov[2]<=0) {
394 AliDebug(1, "Estimated b resolution lower or equal zero!");
395 bCov[0]=0; bCov[2]=0;
400 Float_t dcaToVertexXY = b[0];
401 Float_t dcaToVertexZ = b[1];
402 Double_t clsToF = GetNFindableClustersTPC(lTrack);
404 if( hTrackDCAxyPtbefore) hTrackDCAxyPtbefore->Fill(dcaToVertexXY,lTrack->Pt());
405 if( hTrackDCAzPtbefore ) hTrackDCAzPtbefore->Fill( dcaToVertexZ, lTrack->Pt());
406 if( hTrackNFindClsPtTPCbefore ) hTrackNFindClsPtTPCbefore->Fill( clsToF, lTrack->Pt());
410 if(hCutIndex)hCutIndex->Fill(kElectronIn);
413 if(hCutIndex)hCutIndex->Fill(kNoTracks);
417 if ( ! lTrack->GetConstrainedParam() ){
420 AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
424 if( !TrackIsSelected(lTrack) ){
425 if(hCutIndex)hCutIndex->Fill(kTrackCuts);
431 if( ! dEdxCuts( track ) ) {
432 if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
437 //Electron passed the cuts
438 if(hCutIndex)hCutIndex->Fill(kElectronOut);
440 if( hTrackDCAxyPtafter) hTrackDCAxyPtafter->Fill(dcaToVertexXY,lTrack->Pt());
441 if( hTrackDCAzPtafter ) hTrackDCAzPtafter->Fill(dcaToVertexZ,lTrack->Pt());
442 if( hTrackNFindClsPtTPCafter ) hTrackNFindClsPtTPCafter->Fill( clsToF, lTrack->Pt());
448 ///________________________________________________________________________
449 Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
450 // Track Selection for Photon Reconstruction
453 Double_t clsToF = GetNFindableClustersTPC(lTrack);
456 if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
462 if( lTrack->Eta() > (fEtaCut + fEtaShift) || lTrack->Eta() < (-fEtaCut + fEtaShift) ) {
468 if( lTrack->Pt() < fPtMinCut || lTrack->Pt() > fPtMaxCut ) {
476 if( clsToF < fMinClsTPCToF){
484 ///________________________________________________________________________
485 Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
487 // Electron Identification Cuts for Photon reconstruction
489 if(!fPIDResponse){ InitPIDResponse(); }// Try to reinitialize PID Response
490 if(!fPIDResponse){ AliError("No PID Response"); return kFALSE;}// if still missing fatal error
494 //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
500 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
501 if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
502 if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
503 if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
509 if( fDodEdxSigmaITSCut == kTRUE ){
512 if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
513 fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
515 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
521 if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
527 if(fDodEdxSigmaTPCCut == kTRUE){
531 if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
532 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
534 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
540 if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
541 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
542 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
543 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
545 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
552 if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
553 if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
554 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
555 fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
557 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
568 if( fDoKaonRejectionLowP == kTRUE ){
570 if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
572 if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
574 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
582 if( fDoProtonRejectionLowP == kTRUE ){
584 if( fCurrentTrack->P() < fPIDMinPProtonRejectionLowP ){
585 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
587 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
594 if(fDoPionRejectionLowP == kTRUE){
595 if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
596 if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
598 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
606 if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
607 if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
609 if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
610 fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
611 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
615 if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
617 else if ( fRequireTOF == kTRUE ) {
619 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
624 if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
625 if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
626 if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
630 ///________________________________________________________________________
633 AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
634 //Returns pointer to the track with given ESD label
635 //(Important for AOD implementation, since Track array in AOD data is different
636 //from ESD array, but ESD tracklabels are stored in AOD Tracks)
638 AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
640 if(label > event->GetNumberOfTracks() ) return NULL;
641 AliESDtrack * track = esdEvent->GetTrack(label);
645 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
646 AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
649 if(track->GetID() == label) {
656 cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
659 ///________________________________________________________________________
660 Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
663 for(Int_t i = 0;i<photons->GetEntries();i++){
665 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
667 Int_t posLabel = photonComp->GetTrackLabelPositive();
668 Int_t negLabel = photonComp->GetTrackLabelNegative();
670 if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
677 Bool_t AliDalitzElectronCuts::MassCut(Double_t pi0CandidatePt , Double_t vphotonCandidateMass){
679 if( pi0CandidatePt < fMassCutPtMin ){
681 if( vphotonCandidateMass < fMassCutLowPt ){
688 if( vphotonCandidateMass < fMassCutHighPt ){
698 Double_t AliDalitzElectronCuts::GetNFindableClustersTPC(AliESDtrack* lTrack){
703 if( fUseCrossedRows == kFALSE ) {
705 if ( !fUseCorrectedTPCClsInfo ){
706 if(lTrack->GetTPCNclsF()!=0){
708 clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
709 }// Ncluster/Nfindablecluster
713 //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
714 clsToF = lTrack->GetTPCClusterInfo(2,0); //NOTE ask friederike
719 Float_t nCrossedRowsTPC = lTrack->GetTPCCrossedRows();
721 if ( lTrack->GetTPCNclsF()>0 ) {
722 clsToF = nCrossedRowsTPC / lTrack->GetTPCNclsF();
731 Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
734 // This angle is a measure for the contribution of the opening in polar
735 // direction ??0 to the opening angle ?? Pair
737 // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
738 // Master Thesis. Thorsten Dahms. 2005
739 // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
743 if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
744 if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
746 TVector3 posDaughter;
747 TVector3 negDaughter;
749 posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
750 negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
752 Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
753 Double_t openingAngle = posDaughter.Angle( negDaughter ); //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
755 if( openingAngle < 1e-20 ) return 0.;
757 Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
762 Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
765 // Returns true if it is a gamma conversion according to psi pair value
767 return ( (deltaPhi > fDeltaPhiCutMin && deltaPhi < fDeltaPhiCutMax) &&
768 TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
771 ///________________________________________________________________________
772 Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
773 ///Update the cut string (if it has been created yet)
775 if(fCutString && fCutString->GetString().Length() == kNCuts) {
776 cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
777 fCutString->SetString(GetCutNumber());
779 cout << "fCutString not yet initialized, will not be updated" << endl;
782 // cout << fCutString->GetString().Data() << endl;
786 ///________________________________________________________________________
787 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
788 // Initialize Cuts from a given Cut string
790 // out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
791 AliInfo(Form("Set ElectronCuts Number: %s",analysisCutSelection.Data()));
793 if(analysisCutSelection.Length()!=kNCuts) {
794 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
797 if(!analysisCutSelection.IsDigit()){
798 AliError("Cut selection contains characters");
802 const char *cutSelection = analysisCutSelection.Data();
803 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
804 for(Int_t ii=0;ii<kNCuts;ii++){
810 AliError("Analysis Cut Selection does not start with 9");
815 // Set Individual Cuts
816 for(Int_t ii=0;ii<kNCuts;ii++){
817 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
824 ///________________________________________________________________________
825 Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
826 ///Set individual cut ID
828 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
832 fCuts[kgoodId] = value;
834 cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
840 case kededxSigmaITSCut:
841 if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
842 fCuts[kededxSigmaITSCut] = value;
843 UpdateCutString(cutID, value);
845 } else return kFALSE;
847 case kededxSigmaTPCCut:
848 if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented
849 fCuts[kededxSigmaTPCCut] = value;
850 UpdateCutString(cutID, value);
852 } else return kFALSE;
854 case kpidedxSigmaTPCCut:
855 if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
856 fCuts[kpidedxSigmaTPCCut] = value;
857 UpdateCutString(cutID, value);
859 } else return kFALSE;
861 case kpiMinMomdedxSigmaTPCCut:
862 if( SetMinMomPiondEdxTPCCut(value)) {
863 fCuts[kpiMinMomdedxSigmaTPCCut] = value;
864 UpdateCutString(cutID, value);
866 } else return kFALSE;
868 case kpiMaxMomdedxSigmaTPCCut:
869 if( SetMaxMomPiondEdxTPCCut(value)) {
870 fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
871 UpdateCutString(cutID, value);
873 } else return kFALSE;
875 case kLowPRejectionSigmaCut:
876 if( SetLowPRejectionCuts(value) ) {
877 fCuts[kLowPRejectionSigmaCut] = value;
878 UpdateCutString(cutID, value);
880 } else return kFALSE;
883 case kTOFelectronPID:
884 if( SetTOFElectronPIDCut(value)) {
885 fCuts[kTOFelectronPID] = value;
886 UpdateCutString(cutID, value);
888 } else return kFALSE;
890 if( SetITSClusterCut(value) ) {
891 fCuts[kclsITSCut] = value;
892 UpdateCutString(cutID, value);
894 } else return kFALSE;
896 if( SetTPCClusterCut(value)) {
897 fCuts[kclsTPCCut] = value;
898 UpdateCutString(cutID, value);
900 } else return kFALSE;
903 if( SetEtaCut(value)) {
904 fCuts[ketaCut] = value;
905 UpdateCutString(cutID, value);
907 } else return kFALSE;
909 if( SetPtCut(value)) {
910 fCuts[kptCut] = value;
911 UpdateCutString(cutID, value);
913 } else return kFALSE;
916 if( SetDCACut(value)) {
917 fCuts[kDCACut] = value;
918 UpdateCutString(cutID, value);
920 } else return kFALSE;
924 if( SetPsiPairCut(value)) {
925 fCuts[kPsiPair] = value;
926 UpdateCutString(cutID, value);
928 } else return kFALSE;
930 case kRejectSharedElecGamma:
931 if( SetRejectSharedElecGamma(value)) {
932 fCuts[kRejectSharedElecGamma] = value;
933 UpdateCutString(cutID, value);
935 } else return kFALSE;
937 case kBackgroundScheme:
938 if( SetBackgroundScheme(value)) {
939 fCuts[kBackgroundScheme] = value;
940 UpdateCutString(cutID, value);
942 } else return kFALSE;
944 case kNumberOfRotations:
945 if( SetNumberOfRotations(value)) {
946 fCuts[kNumberOfRotations] = value;
947 UpdateCutString(cutID, value);
949 } else return kFALSE;
952 if( SetMassCut(value)) {
953 fCuts[kmassCut] = value;
954 UpdateCutString(cutID, value);
956 } else return kFALSE;
958 if( SetDoWeights(value)) {
959 fCuts[kWeights] = value;
960 UpdateCutString(cutID, value);
962 } else return kFALSE;
966 cout << "Error:: Cut id out of range"<< endl;
970 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
977 ///________________________________________________________________________
979 void AliDalitzElectronCuts::PrintCuts() {
980 // Print out current Cut Selection
981 for(Int_t ic = 0; ic < kNCuts; ic++) {
982 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
987 ///________________________________________________________________________
988 Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
991 switch(ededxSigmaCut){
994 fDodEdxSigmaITSCut = kFALSE;
995 fPIDnSigmaBelowElectronLineITS=-100;
996 fPIDnSigmaAboveElectronLineITS= 100;
999 fDodEdxSigmaITSCut = kTRUE;
1000 fPIDnSigmaBelowElectronLineITS=-10;
1001 fPIDnSigmaAboveElectronLineITS=10;
1004 fDodEdxSigmaITSCut = kTRUE;
1005 fPIDnSigmaBelowElectronLineITS=-6;
1006 fPIDnSigmaAboveElectronLineITS=7;
1009 fDodEdxSigmaITSCut = kTRUE;
1010 fPIDnSigmaBelowElectronLineITS=-5;
1011 fPIDnSigmaAboveElectronLineITS=5;
1014 fDodEdxSigmaITSCut = kTRUE;
1015 fPIDnSigmaBelowElectronLineITS=-4;
1016 fPIDnSigmaAboveElectronLineITS=5;
1019 fDodEdxSigmaITSCut = kTRUE;
1020 fPIDnSigmaBelowElectronLineITS=-3;
1021 fPIDnSigmaAboveElectronLineITS=5;
1024 fDodEdxSigmaITSCut = kTRUE;
1025 fPIDnSigmaBelowElectronLineITS=-4;
1026 fPIDnSigmaAboveElectronLineITS=4;
1029 fDodEdxSigmaITSCut = kTRUE;
1030 fPIDnSigmaBelowElectronLineITS=-2.5;
1031 fPIDnSigmaAboveElectronLineITS=4;
1034 fDodEdxSigmaITSCut = kTRUE;
1035 fPIDnSigmaBelowElectronLineITS=-2;
1036 fPIDnSigmaAboveElectronLineITS=3.5;
1039 cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1046 ///________________________________________________________________________
1047 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
1049 switch(ededxSigmaCut){
1051 case 0: fDodEdxSigmaTPCCut = kFALSE;
1052 fPIDnSigmaBelowElectronLineTPC=-10;
1053 fPIDnSigmaAboveElectronLineTPC=10;
1056 fDodEdxSigmaTPCCut = kTRUE;
1057 fPIDnSigmaBelowElectronLineTPC=-10;
1058 fPIDnSigmaAboveElectronLineTPC=10;
1061 fDodEdxSigmaTPCCut = kTRUE;
1062 fPIDnSigmaBelowElectronLineTPC=-6;
1063 fPIDnSigmaAboveElectronLineTPC=7;
1066 fDodEdxSigmaTPCCut = kTRUE;
1067 fPIDnSigmaBelowElectronLineTPC=-5;
1068 fPIDnSigmaAboveElectronLineTPC=5;
1071 fDodEdxSigmaTPCCut = kTRUE;
1072 fPIDnSigmaBelowElectronLineTPC=-4;
1073 fPIDnSigmaAboveElectronLineTPC=5;
1076 fDodEdxSigmaTPCCut = kTRUE;
1077 fPIDnSigmaBelowElectronLineTPC=-3;
1078 fPIDnSigmaAboveElectronLineTPC=5;
1081 fDodEdxSigmaTPCCut = kTRUE;
1082 fPIDnSigmaBelowElectronLineTPC=-4;
1083 fPIDnSigmaAboveElectronLineTPC=4;
1086 fDodEdxSigmaTPCCut = kTRUE;
1087 fPIDnSigmaBelowElectronLineTPC=-2.5;
1088 fPIDnSigmaAboveElectronLineTPC=4;
1091 fDodEdxSigmaTPCCut = kTRUE;
1092 fPIDnSigmaBelowElectronLineTPC=-2;
1093 fPIDnSigmaAboveElectronLineTPC=3.5;
1096 cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
1103 ///________________________________________________________________________
1104 Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
1107 switch(pidedxSigmaCut){
1109 case 0: fPIDnSigmaAbovePionLineTPC= 0;
1110 fPIDnSigmaAbovePionLineTPCHighPt=-100;
1113 fPIDnSigmaAbovePionLineTPC=3.0; //Update Sep-05-2013 from -10 to 3
1114 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1117 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from -1 to 2
1118 fPIDnSigmaAbovePionLineTPCHighPt=-1; //Update Sep-09-2013 from -10 to -1
1121 fPIDnSigmaAbovePionLineTPC=2; //Update Sep-09-2013 from 0 to 2
1122 fPIDnSigmaAbovePionLineTPCHighPt=0; //Update Sep-09-2013 from -10 to 0
1125 fPIDnSigmaAbovePionLineTPC=1;
1126 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1129 fPIDnSigmaAbovePionLineTPC=2.;
1130 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1133 fPIDnSigmaAbovePionLineTPC=2.5;
1134 fPIDnSigmaAbovePionLineTPCHighPt=-10;
1137 fPIDnSigmaAbovePionLineTPC = 2.0; // We need a bit less tight cut on dE/dx //Updated from 3.0 and -10 to +2.0 , +2.0
1138 fPIDnSigmaAbovePionLineTPCHighPt = 2.0;
1141 fPIDnSigmaAbovePionLineTPC = 1.5; // Updated May-16-2013 from 3.5 and -10 to +1.5, +1
1142 fPIDnSigmaAbovePionLineTPCHighPt = 1.0;
1145 fPIDnSigmaAbovePionLineTPC=1.5;
1146 fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
1149 cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
1155 ///________________________________________________________________________
1156 Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
1158 switch(piMomdedxSigmaCut){
1160 case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
1163 fPIDMinPnSigmaAbovePionLineTPC=50.;
1166 fPIDMinPnSigmaAbovePionLineTPC=20.;
1169 fPIDMinPnSigmaAbovePionLineTPC=1.5;
1172 fPIDMinPnSigmaAbovePionLineTPC=1.;
1175 fPIDMinPnSigmaAbovePionLineTPC=0.5;
1178 fPIDMinPnSigmaAbovePionLineTPC=0.4;
1181 fPIDMinPnSigmaAbovePionLineTPC=0.3;
1184 fPIDMinPnSigmaAbovePionLineTPC=0.25;
1187 cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
1192 ///________________________________________________________________________
1193 Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
1196 if( !fesdTrackCuts ) {
1198 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1204 case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
1206 case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1207 break; //1 hit first layer of SPD
1208 case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1209 break; //1 hit in any layer of SPD
1210 case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
1211 fesdTrackCuts->SetMinNClustersITS(4);
1212 // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD
1214 case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1215 fesdTrackCuts->SetMinNClustersITS(3);
1216 // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
1218 case 5: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1219 fesdTrackCuts->SetMinNClustersITS(4);
1220 // 4 hits in total in the ITS. At least 1 hit in any layer of SPD
1222 case 6: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
1223 fesdTrackCuts->SetMinNClustersITS(5);
1224 // 5 hits in total in the ITS. At least 1 hit in any layer of SPD
1227 cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
1234 ///________________________________________________________________________
1235 Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
1240 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1244 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1248 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1250 case 3: // Changed 2014-02-04 before fMinClsTPC = 50.;
1251 fMinClsTPCToF = 0.8;
1252 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1253 fesdTrackCuts->SetMinNClustersTPC(0);
1254 fUseCrossedRows = kTRUE;
1256 case 4: // 0% of findable clusters
1258 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1260 fUseCorrectedTPCClsInfo=0;
1262 case 5: // 35% of findable clusters
1264 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1265 fMinClsTPCToF= 0.35;
1266 fUseCorrectedTPCClsInfo=0;
1268 case 6: // 60% of findable clusters
1270 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1272 fUseCorrectedTPCClsInfo=0;
1274 case 7: // 60% Changed 2014-02-04 before fMinClsTPC = 0.7 fUseCorrectedTPCClsInfo = 0
1275 // Changed 2014-02-04 before fMinClsTPC = 50.;
1276 fMinClsTPCToF = 0.6;
1277 fesdTrackCuts->SetMinNCrossedRowsTPC(70);
1278 fesdTrackCuts->SetMinNClustersTPC(0);
1279 fUseCrossedRows = kTRUE;
1281 case 8: fMinClsTPC = 0.;
1282 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1283 fMinClsTPCToF= 0.35;
1284 fUseCorrectedTPCClsInfo=0;
1286 case 9: // 35% of findable clusters
1288 fesdTrackCuts->SetMinNClustersTPC(fMinClsTPC);
1289 fMinClsTPCToF= 0.35;
1290 fUseCorrectedTPCClsInfo=1;
1294 cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
1300 ///________________________________________________________________________
1301 Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
1330 fEtaCut = 0.6; //changed from 0.4 to 0.6 2013.06.10
1334 fEtaCut = 0.5; //changed from 0.3 to 0.5 2013.06.10
1337 case 8: fEtaCut = 0.4;
1340 case 9: fEtaCut = 0.65;
1344 cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
1350 ///________________________________________________________________________
1351 Bool_t AliDalitzElectronCuts::SetPtCut(Int_t ptCut)
1354 //0.1GeV, 0.125 GeV, 0.15 GeV
1358 case 0: fPtMinCut = 0.075;
1365 case 2: // 0.125 GeV
1374 case 4: fPtMinCut = 0.5;
1378 cout<<"Warning: PtCut not defined "<<ptCut<<endl;
1385 ///________________________________________________________________________
1386 Bool_t AliDalitzElectronCuts::SetDCACut(Int_t dcaCut)
1390 if( !fesdTrackCuts ) {
1392 cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
1400 fesdTrackCuts->SetMaxDCAToVertexZ(1000);
1401 fesdTrackCuts->SetMaxDCAToVertexXY(1000);
1402 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1406 fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
1407 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1410 case 2: fesdTrackCuts->SetMaxDCAToVertexZ(2);
1411 fesdTrackCuts->SetMaxDCAToVertexXY(1);
1412 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1415 case 3: fesdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
1416 fesdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
1420 cout<<"Warning: dcaCut not defined "<<dcaCut<<endl;
1429 ///________________________________________________________________________
1430 Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
1432 switch(piMaxMomdedxSigmaCut){
1435 fPIDMaxPnSigmaAbovePionLineTPC=0.;
1438 fPIDMaxPnSigmaAbovePionLineTPC=100.;
1441 fPIDMaxPnSigmaAbovePionLineTPC=5.;
1444 fPIDMaxPnSigmaAbovePionLineTPC=4.;
1447 fPIDMaxPnSigmaAbovePionLineTPC=3.5;
1450 fPIDMaxPnSigmaAbovePionLineTPC=3.;
1453 cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
1459 ///________________________________________________________________________
1460 Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
1462 switch(LowPRejectionSigmaCut){
1464 fDoKaonRejectionLowP=kFALSE;
1465 fDoProtonRejectionLowP=kFALSE;
1466 fDoPionRejectionLowP=kFALSE;
1467 fPIDnSigmaAtLowPAroundKaonLine=0;
1468 fPIDnSigmaAtLowPAroundProtonLine=0;
1469 fPIDnSigmaAtLowPAroundPionLine=0;
1470 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1473 fDoKaonRejectionLowP=kTRUE;
1474 fDoProtonRejectionLowP=kTRUE;
1475 fDoPionRejectionLowP=kTRUE;
1476 fPIDnSigmaAtLowPAroundKaonLine=0.5;
1477 fPIDnSigmaAtLowPAroundProtonLine=0.5;
1478 fPIDnSigmaAtLowPAroundPionLine=0.5;
1479 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1482 fDoKaonRejectionLowP=kTRUE;
1483 fDoProtonRejectionLowP=kTRUE;
1484 fDoPionRejectionLowP=kTRUE;
1485 fPIDnSigmaAtLowPAroundKaonLine=1.0;
1486 fPIDnSigmaAtLowPAroundProtonLine=1.0;
1487 fPIDnSigmaAtLowPAroundPionLine=1.0;
1488 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1491 fDoKaonRejectionLowP=kTRUE;
1492 fDoProtonRejectionLowP=kTRUE;
1493 fDoPionRejectionLowP=kTRUE;
1494 fPIDnSigmaAtLowPAroundKaonLine=1.5;
1495 fPIDnSigmaAtLowPAroundProtonLine=1.5;
1496 fPIDnSigmaAtLowPAroundPionLine=1.5;
1497 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1500 fDoKaonRejectionLowP=kTRUE;
1501 fDoProtonRejectionLowP=kTRUE;
1502 fDoPionRejectionLowP=kTRUE;
1503 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1504 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1505 fPIDnSigmaAtLowPAroundPionLine=2.0;
1506 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1509 fDoKaonRejectionLowP=kTRUE;
1510 fDoProtonRejectionLowP=kTRUE;
1511 fDoPionRejectionLowP=kTRUE;
1512 fPIDnSigmaAtLowPAroundKaonLine=2.0;
1513 fPIDnSigmaAtLowPAroundProtonLine=2.0;
1514 fPIDnSigmaAtLowPAroundPionLine=2.5;
1515 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1518 fDoKaonRejectionLowP=kTRUE;
1519 fDoProtonRejectionLowP=kTRUE;
1520 fDoPionRejectionLowP=kTRUE;
1521 fPIDnSigmaAtLowPAroundKaonLine=0.;
1522 fPIDnSigmaAtLowPAroundProtonLine=0.;
1523 fPIDnSigmaAtLowPAroundPionLine=2.;
1524 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1527 fDoKaonRejectionLowP=kFALSE;
1528 fDoProtonRejectionLowP=kFALSE;
1529 fDoPionRejectionLowP=kTRUE;
1530 fPIDnSigmaAtLowPAroundKaonLine=0.0;
1531 fPIDnSigmaAtLowPAroundProtonLine=0.0;
1532 fPIDnSigmaAtLowPAroundPionLine=1.0;
1533 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1536 fDoKaonRejectionLowP=kFALSE;
1537 fDoProtonRejectionLowP=kFALSE;
1538 fDoPionRejectionLowP=kTRUE;
1539 fPIDnSigmaAtLowPAroundKaonLine=0.;
1540 fPIDnSigmaAtLowPAroundProtonLine=0.;
1541 fPIDnSigmaAtLowPAroundPionLine=0.5;
1542 fPIDMinPPionRejectionLowP = fPIDMinPnSigmaAbovePionLineTPC;
1545 cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
1551 ///________________________________________________________________________
1552 Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
1554 switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
1556 fRequireTOF = kFALSE;
1557 fUseTOFpid = kFALSE;
1558 fTofPIDnSigmaBelowElectronLine=-100;
1559 fTofPIDnSigmaAboveElectronLine=100;
1562 fRequireTOF = kFALSE;
1564 fTofPIDnSigmaBelowElectronLine=-7;
1565 fTofPIDnSigmaAboveElectronLine=7;
1568 fRequireTOF = kFALSE;
1570 fTofPIDnSigmaBelowElectronLine=-5;
1571 fTofPIDnSigmaAboveElectronLine=5;
1574 fRequireTOF = kFALSE;
1576 fTofPIDnSigmaBelowElectronLine=-3;
1577 fTofPIDnSigmaAboveElectronLine=5;
1580 fRequireTOF = kFALSE;
1582 fTofPIDnSigmaBelowElectronLine=-2;
1583 fTofPIDnSigmaAboveElectronLine=3;
1585 case 5: // -3, 3 TOF mandatory
1586 fRequireTOF = kTRUE;
1588 fTofPIDnSigmaBelowElectronLine= -3;
1589 fTofPIDnSigmaAboveElectronLine= 3;
1592 cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
1594 } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
1597 ///_______________________________________________________________________________
1599 Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
1604 fDoPsiPairCut = kFALSE;
1605 fPsiPairCut = 10000.; //
1606 fDeltaPhiCutMin = -1000.;
1607 fDeltaPhiCutMax = 1000.;
1611 fDoPsiPairCut = kTRUE;
1612 fPsiPairCut = 0.45; // Standard
1613 fDeltaPhiCutMin = 0.0;
1614 fDeltaPhiCutMax = 0.12;
1617 fDoPsiPairCut = kTRUE;
1619 fDeltaPhiCutMin = 0.0;
1620 fDeltaPhiCutMax = 0.12;
1623 fDoPsiPairCut = kTRUE;
1625 fDeltaPhiCutMin = 0.0;
1626 fDeltaPhiCutMax = 0.12;
1628 fDoPsiPairCut = kTRUE;
1630 fDeltaPhiCutMin = 0.0;
1631 fDeltaPhiCutMax = 0.12;
1635 cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
1642 ///_______________________________________________________________________________
1643 Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
1648 fDoRejectSharedElecGamma = kFALSE;
1649 fRadiusCut = 10000; //
1652 fDoRejectSharedElecGamma = kTRUE;
1653 fRadiusCut = 2.0; // cm
1656 fDoRejectSharedElecGamma = kTRUE;
1657 fRadiusCut = 3.0; // Standard
1660 fDoRejectSharedElecGamma = kTRUE;
1661 fRadiusCut = 4.0; //
1664 fDoRejectSharedElecGamma = kTRUE;
1665 fRadiusCut = 5.0; //
1668 fDoRejectSharedElecGamma = kTRUE;
1669 fRadiusCut = 10.0; //
1672 fDoRejectSharedElecGamma = kTRUE;
1673 fRadiusCut = 15.0; //
1676 cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
1682 ///__________________________________________________________________________
1683 Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1686 switch(BackgroundScheme){
1690 fUseTrackMultiplicityForBG = kFALSE;
1692 case 1: // mixed event with V0 multiplicity
1694 fUseTrackMultiplicityForBG = kFALSE;
1696 case 2: // mixed event with track multiplicity
1697 fUseTrackMultiplicityForBG = kTRUE;
1701 fUseTrackMultiplicityForBG = kFALSE;
1705 fUseTrackMultiplicityForBG = kTRUE;
1708 case 5: fUseTrackMultiplicityForBG = kTRUE;
1713 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1719 ///________________________________________________________________________
1720 Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
1722 switch(NumberOfRotations){
1724 fnumberOfRotationEventsForBG = 5;
1727 fnumberOfRotationEventsForBG = 10;
1730 fnumberOfRotationEventsForBG = 15;
1733 fnumberOfRotationEventsForBG = 20;
1736 fnumberOfRotationEventsForBG = 2;
1739 fnumberOfRotationEventsForBG = 50;
1742 fnumberOfRotationEventsForBG = 80;
1745 fnumberOfRotationEventsForBG = 100;
1748 cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
1756 ///________________________________________________________________________
1757 Bool_t AliDalitzElectronCuts::SetDoWeights(Int_t opc)
1761 case 0: fDoWeights = kFALSE;
1763 case 1: fDoWeights = kTRUE;
1766 cout<<"Warning: Weights option not defined "<<opc<<endl;
1771 ///________________________________________________________________________
1772 Bool_t AliDalitzElectronCuts::SetMassCut(Int_t massCut)
1778 fMassCutPtMin = -999.; //GeV
1779 fMassCutLowPt = 999.; //GeV/c^2
1780 fMassCutHighPt = 999.; //GeV/c^2
1782 fDoMassCut = kFALSE;
1783 fDoMassMinCut = kFALSE;
1786 //fMassCut = 0.135; //GeV/c^2
1787 fMassCutPtMin = -999.; //GeV
1788 fMassCutLowPt = 0.135; //GeV/c^2
1789 fMassCutHighPt = 0.135; //GeV/c^2
1792 fDoMassMinCut = kFALSE;
1795 //fMassCut = 0.100; //GeV/c^2
1796 fMassCutPtMin = -999.; //GeV
1797 fMassCutLowPt = 0.100; //GeV/c^2
1798 fMassCutHighPt = 0.100; //GeV/c^2
1801 fDoMassMinCut = kFALSE;
1804 /*fMassCut = 0.075; //GeV/c^2 Changed from Feb 25
1805 fMassCutPtMin = -999.; //GeV
1806 fMassCutLowPt = 0.075; //GeV/c^2
1807 fMassCutHighPt = 0.075; //GeV/c^2
1809 fDoMassMinCut = kFALSE;*/
1810 fMassCutPtMin = 1.0; //GeV
1811 fMassCutLowPt = 0.015; //GeV/c^2
1812 fMassCutHighPt = 0.035; //GeV/c^2
1813 fMassMinCut = 0.002;
1815 fDoMassMinCut = kTRUE;
1818 //fMassCut = 0.050; //GeV/c^2
1819 fMassCutPtMin = -999.; //GeV
1820 fMassCutLowPt = 0.050; //GeV/c^2
1821 fMassCutHighPt = 0.050; //GeV/c^2
1824 fDoMassMinCut = kFALSE;
1828 fMassCutPtMin = -999.; //GeV
1829 fMassCutLowPt = 0.035; //GeV/c^2
1830 fMassCutHighPt = 0.035; //GeV/c^2
1833 fDoMassMinCut = kFALSE;
1836 fMassCutPtMin = -999.; //GeV
1837 fMassCutLowPt = 0.015; //GeV/c^2
1838 fMassCutHighPt = 0.015; //GeV/c^2
1841 fDoMassMinCut = kFALSE;
1843 case 7: fMassCutPtMin = 1.0; //GeV
1844 fMassCutLowPt = 0.015; //GeV/c^2
1845 fMassCutHighPt = 0.035; //GeV/c^2
1848 fDoMassMinCut = kFALSE;
1850 case 8: fMassCutPtMin = 1.0; //GeV
1851 fMassCutLowPt = 0.015; //GeV/c^2
1852 fMassCutHighPt = 0.050; //GeV/c^2
1855 fDoMassMinCut = kFALSE;
1857 case 9: fMassCutPtMin = 1.0; //GeV
1858 fMassCutLowPt = 0.025; //GeV/c^2
1859 fMassCutHighPt = 0.035; //GeV/c^2
1862 fDoMassMinCut = kFALSE;
1865 cout<<"Warning: MassCut not defined "<<massCut<<endl;
1873 ///________________________________________________________________________
1874 TString AliDalitzElectronCuts::GetCutNumber(){
1875 // returns TString with current cut number
1877 for(Int_t ii=0;ii<kNCuts;ii++){
1878 a.Append(Form("%d",fCuts[ii]));
1884 ///________________________________________________________________________
1885 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
1886 //Create and return standard 2010 PbPb cuts
1887 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
1888 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1889 cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
1893 ///________________________________________________________________________
1894 AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
1895 //Create and return standard 2010 PbPb cuts
1896 AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
1898 if(!cuts->InitializeCutsFromCutString("9069640364102")){
1899 cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}