sync with GSI svn
authorfbock <fbock@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Apr 2013 13:34:42 +0000 (13:34 +0000)
committerfbock <fbock@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Apr 2013 13:34:42 +0000 (13:34 +0000)
13 files changed:
PWGGA/GammaConv/AliAnalysisTaskConversionQA.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.cxx
PWGGA/GammaConv/AliConversionCuts.cxx
PWGGA/GammaConv/AliConversionCuts.h
PWGGA/GammaConv/AliConversionMesonCuts.cxx
PWGGA/GammaConv/AliDalitzElectronCuts.cxx
PWGGA/GammaConv/AliDalitzElectronCuts.h
PWGGA/GammaConv/AliV0ReaderV1.cxx
PWGGA/GammaConv/macros/AddTask_GammaConvV1.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_2.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_3.C

index b7a69dd..b9bc235 100644 (file)
@@ -229,10 +229,19 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
 //_____________________________________________________________________________
 Bool_t AliAnalysisTaskConversionQA::Notify()
 {
-   if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetDoEtaShift()){
-      if(fConversionCuts->GetDoEtaShift())
-      fConversionCuts->SetEtaShift(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEtaShift());
+   if(!fConversionCuts->GetDoEtaShift()) return kTRUE;; // No Eta Shift requested, continue
+      
+   if(fConversionCuts->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
+      fConversionCuts->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
+      fConversionCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+      return kTRUE;
    }
+   else{
+      printf(" Gamma Conversion QA Task %s :: Eta Shift Manually Set to %f \n\n",
+             (fConversionCuts->GetCutNumber()).Data(),fConversionCuts->GetEtaShift());
+      fConversionCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+   }
+   
    return kTRUE;
 }
 //________________________________________________________________________
@@ -310,7 +319,7 @@ void AliAnalysisTaskConversionQA::ProcessQATree(AliAODConversionPhoton *gamma){
    conversionPoint(0) = gamma->GetConversionX();
    conversionPoint(1) = gamma->GetConversionY();
    conversionPoint(2) = gamma->GetConversionZ();
-   TVectorF daughterProp(18);
+   TVectorF daughterProp(20);
    AliESDtrack * negTrack = fConversionCuts->GetESDTrack(event, gamma->GetTrackLabelNegative());
    AliESDtrack * posTrack = fConversionCuts->GetESDTrack(event, gamma->GetTrackLabelPositive());
 
@@ -379,9 +388,9 @@ void AliAnalysisTaskConversionQA::ProcessQATree(AliAODConversionPhoton *gamma){
    }
 
    daughterProp(6) = (Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()));
-   //posTrack->GetNcls(1)/(Float_t)posTrack->GetTPCNclsF();
+   daughterProp(18) = posTrack->GetNcls(1);
    daughterProp(13) = (Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()));
-   //negTrack->GetNcls(1)/(Float_t)negTrack->GetTPCNclsF();
+   daughterProp(19) = negTrack->GetNcls(1);
 
    if (fStreamQA){
       if(fMCEvent){
index c2e171b..b0d5da4 100644 (file)
@@ -94,12 +94,21 @@ fV0Reader(NULL),
    sESDMotherInvMassPtZM(NULL),
    hESDMotherBackInvMassPt(NULL),
    sESDMotherBackInvMassPtZM(NULL),
+   hMCAllGammaPt(NULL),
+   hMCAllPositronsPt(NULL),
+   hMCAllElectronsPt(NULL),
+   hMCPi0DalitzGammaPt(NULL),
+   hMCPi0DalitzElectronPt(NULL),
+   hMCPi0DalitzPositronPt(NULL),
    hMCPi0Pt(NULL),
    hMCPi0GGPt(NULL),
    hMCEtaPt(NULL),
    hMCEtaGGPt(NULL), 
    hMCPi0InAccPt(NULL),
    hMCEtaInAccPt(NULL),
+   hESDEposEnegTruePi0DalitzInvMassPt(NULL),
+   hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
+   hESDEposEnegTruePhotonInvMassPt(NULL),
    hESDTrueMotherInvMassPt(NULL),
    hESDTrueMotherPi0GGInvMassPt(NULL),
    hESDTruePrimaryMotherInvMassMCPt(NULL),
@@ -110,6 +119,11 @@ fV0Reader(NULL),
    hESDTrueBckContInvMassPt(NULL),
    hESDTrueMotherGGInvMassPt(NULL),
    hESDTrueConvGammaPt(NULL),
+   hESDTruePositronPt(NULL),
+   hESDTrueElectronPt(NULL),
+   hESDTruePi0DalitzConvGammaPt(NULL),
+   hESDTruePi0DalitzPositronPt(NULL),
+   hESDTruePi0DalitzElectronPt(NULL),
    hNEvents(NULL),
    hNGoodESDTracks(NULL),
    fRandom(0),
@@ -166,12 +180,21 @@ AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char*
    sESDMotherInvMassPtZM(NULL),
    hESDMotherBackInvMassPt(NULL),
    sESDMotherBackInvMassPtZM(NULL),
+   hMCAllGammaPt(NULL),
+   hMCAllPositronsPt(NULL),
+   hMCAllElectronsPt(NULL),
+   hMCPi0DalitzGammaPt(NULL),
+   hMCPi0DalitzElectronPt(NULL),
+   hMCPi0DalitzPositronPt(NULL),
    hMCPi0Pt(NULL),
    hMCPi0GGPt(NULL),
    hMCEtaPt(NULL),
    hMCEtaGGPt(NULL),
    hMCPi0InAccPt(NULL),
    hMCEtaInAccPt(NULL),
+   hESDEposEnegTruePi0DalitzInvMassPt(NULL),
+   hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
+   hESDEposEnegTruePhotonInvMassPt(NULL),
    hESDTrueMotherInvMassPt(NULL),
    hESDTrueMotherPi0GGInvMassPt(NULL),
    hESDTruePrimaryMotherInvMassMCPt(NULL),
@@ -182,6 +205,11 @@ AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char*
    hESDTrueBckContInvMassPt(NULL),
    hESDTrueMotherGGInvMassPt(NULL),
    hESDTrueConvGammaPt(NULL),
+   hESDTruePositronPt(NULL),
+   hESDTrueElectronPt(NULL),
+   hESDTruePi0DalitzConvGammaPt(NULL),
+   hESDTruePi0DalitzPositronPt(NULL),
+   hESDTruePi0DalitzElectronPt(NULL),
    hNEvents(NULL),
    hNGoodESDTracks(NULL),
    fRandom(0),
@@ -352,8 +380,6 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
 
 
 
-
-
    fGammasPool                     = new TList*[fnCuts];
    fCutFolder                      = new TList*[fnCuts];
    fESDList                        = new TList*[fnCuts];
@@ -404,7 +430,6 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
 
 
 
-
       if(fIsHeavyIon) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",3000,0,3000);
       else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
       fESDList[iCut]->Add(hNGoodESDTracks[iCut]);
@@ -434,12 +459,11 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
 
       hESDPi0MotherInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_InvMass_Pt","ESD_Pi0Mother_InvMass_Pt",4000,0,4,250,0,25);
       fESDList[iCut]->Add(hESDPi0MotherInvMassPt[iCut]);
-                
+  
       hESDPi0MotherDiffInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_DiffInvMass_Pt","ESD_Pi0Mother_DiffInvMass_Pt",2000,0,2,250,0,25);
       fESDList[iCut]->Add(hESDPi0MotherDiffInvMassPt[iCut]);
 
 
-
       hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_DalitzBackground_InvMass_Pt","ESD_DalitzBackground_InvMass_Pt",1000,0,1,250,0,25);
       fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]);
 
@@ -459,14 +483,31 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
       // True Histogramms
       fTrueList = new TList*[fnCuts];
       hESDTrueConvGammaPt = new TH1F*[fnCuts];
+      hESDTruePositronPt  = new TH1F*[fnCuts];
+      hESDTrueElectronPt  = new TH1F*[fnCuts];
+      hESDTruePi0DalitzConvGammaPt = new TH1F*[fnCuts];
+      hESDTruePi0DalitzPositronPt  = new TH1F*[fnCuts];
+      hESDTruePi0DalitzElectronPt  = new TH1F*[fnCuts];
       //if(fDoMesonAnalysis){
+      hMCAllGammaPt = new TH1F*[fnCuts];
+      hMCAllPositronsPt = new TH1F*[fnCuts];
+      hMCAllElectronsPt = new TH1F*[fnCuts];
+      hMCPi0DalitzGammaPt    = new TH1F*[fnCuts];
+      hMCPi0DalitzElectronPt = new TH1F*[fnCuts];
+      hMCPi0DalitzPositronPt = new TH1F*[fnCuts];
       hMCPi0Pt = new TH1F*[fnCuts];
       hMCPi0GGPt =  new TH1F*[fnCuts];
       hMCEtaPt = new TH1F*[fnCuts];
       hMCEtaGGPt = new TH1F*[fnCuts];
       hMCPi0InAccPt = new TH1F*[fnCuts];
       hMCEtaInAccPt = new TH1F*[fnCuts];
-
+      
+      
+      hESDEposEnegTruePi0DalitzInvMassPt           = new TH2F*[fnCuts];
+      hESDEposEnegTrueEtaDalitzInvMassPt           = new TH2F*[fnCuts];
+      hESDEposEnegTruePhotonInvMassPt              = new TH2F*[fnCuts];
+      
       hESDTrueMotherInvMassPt = new TH2F*[fnCuts];
       hESDTrueMotherPi0GGInvMassPt = new TH2F*[fnCuts];
       hESDTruePrimaryPi0DalitzESDPtMCPt = new TH2F*[fnCuts];
@@ -488,6 +529,26 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
          fMCList[iCut]->SetOwner(kTRUE);
          fCutFolder[iCut]->Add(fMCList[iCut]);
 
+
+                hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
+                fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
+
+                hMCAllPositronsPt[iCut] = new TH1F("MC_AllPositrons_Pt","MC_AllPositrons_Pt",250,0,25);
+                fMCList[iCut]->Add(hMCAllPositronsPt[iCut]);
+
+                hMCAllElectronsPt[iCut] = new TH1F("MC_AllElectrons_Pt","MC_AllElectrons_Pt",250,0,25);
+                fMCList[iCut]->Add(hMCAllElectronsPt[iCut]);
+
+                hMCPi0DalitzGammaPt[iCut] = new TH1F("MC_Pi0DalitzGamma_Pt","MC_Pi0DalitzGamma_Pt",250,0,25);
+                fMCList[iCut]->Add(hMCPi0DalitzGammaPt[iCut]);
+
+                hMCPi0DalitzPositronPt[iCut] = new TH1F("MC_Pi0DalitzPositron_Pt","MC_Pi0DalitzPositron_Pt",250,0,25);
+                fMCList[iCut]->Add(hMCPi0DalitzPositronPt[iCut]);
+
+                hMCPi0DalitzElectronPt[iCut] = new TH1F("MC_Pi0DalitzElectron_Pt","MC_Pi0DalitzElectron_Pt",250,0,25);
+                fMCList[iCut]->Add(hMCPi0DalitzElectronPt[iCut]);
+
+
                 hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25);
                 fMCList[iCut]->Add(hMCPi0Pt[iCut]);
         
@@ -512,9 +573,48 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
          fTrueList[iCut]->SetOwner(kTRUE);
          fCutFolder[iCut]->Add(fTrueList[iCut]);
 
+
+         
+
+
+
+
+
+        
+        
+        hESDEposEnegTruePi0DalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_InvMassPt","ESD_EposEneg_TruePi0Dalitz_InvMassPt",5000,0.,5.,100,0.,10.);
+        fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzInvMassPt[iCut]);
+        
+        hESDEposEnegTrueEtaDalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_InvMassPt","ESD_EposEneg_TrueEtaDalitz_InvMassPt",5000,0.,5.,100,0.,10.);
+        fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzInvMassPt[iCut]);
+        
+        hESDEposEnegTruePhotonInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePhoton_InvMassPt","ESD_EposEneg_TruePhoton_InvMassPt",5000,0.,5.,100,0.,10.);
+        fTrueList[iCut]->Add(hESDEposEnegTruePhotonInvMassPt[iCut]);
+        
+         
+
+         hESDTruePositronPt[iCut] = new TH1F("ESD_TruePositron_Pt","ESD_TruePositron_Pt",250,0,25);
+         fTrueList[iCut]->Add(hESDTruePositronPt[iCut]);
+
+         hESDTrueElectronPt[iCut] = new TH1F("ESD_TrueElectron_Pt","ESD_TrueElectron_Pt",250,0,25);
+         fTrueList[iCut]->Add(hESDTrueElectronPt[iCut]);
+
          hESDTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
          fTrueList[iCut]->Add(hESDTrueConvGammaPt[iCut]);
 
+         hESDTruePi0DalitzConvGammaPt[iCut] = new TH1F("ESD_TruePi0DalitzConvGamma_Pt","ESD_TruePi0DalitzConvGamma_Pt",250,0,25);
+         fTrueList[iCut]->Add(hESDTruePi0DalitzConvGammaPt[iCut]);
+
+         hESDTruePi0DalitzElectronPt[iCut] = new TH1F("ESD_TruePi0DalitzElectron_Pt","ESD_TruePi0DalitzElectron_Pt",250,0,25);
+         fTrueList[iCut]->Add(hESDTruePi0DalitzElectronPt[iCut]);
+
+         hESDTruePi0DalitzPositronPt[iCut] = new TH1F("ESD_TruePi0DalitzPositron_Pt","ESD_TruePi0DalitzPositron_Pt",250,0,25);
+         fTrueList[iCut]->Add(hESDTruePi0DalitzPositronPt[iCut]);
+
+
+
+
+
          hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",1000,0,1,250,0,25);
          fTrueList[iCut]->Add(hESDTrueMotherInvMassPt[iCut]);
 
@@ -645,9 +745,6 @@ void AliAnalysisTaskGammaConvDalitzV1::Terminate(const Option_t *)
       }
    }
 
-
-
-
    for(Int_t iCut = 0; iCut<fnCuts;iCut++){
 
       if( fCutElectronArray ){
@@ -755,6 +852,16 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTruePhotonCandidates(AliAODConvers
 
    // True Photon
    hESDTrueConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+  
+   Int_t labelGamma = TruePhotonCandidate->GetMCParticleLabel(MCStack);
+
+    if( IsPi0DalitzDaughter(labelGamma) == kTRUE ) {
+        hESDTruePi0DalitzConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+     }
+   
+
+
 }
 
 
@@ -774,7 +881,6 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
 
 
 
-
    vector<Int_t> lGoodElectronIndex(0);
    vector<Int_t> lGoodPositronIndex(0);
 
@@ -784,21 +890,40 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
 
       AliESDtrack* electronCandidate = fESDEvent->GetTrack(fSelectorElectronIndex[i]);
       if(! ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelected(electronCandidate) ) continue;
-      lGoodElectronIndex.push_back(   fSelectorElectronIndex[i] );
-      if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->DoPsiPairCut() == kFALSE ){
+         lGoodElectronIndex.push_back(   fSelectorElectronIndex[i] );
          hESDDalitzElectronPt[fiCut]->Fill(electronCandidate->Pt());
-      }
-
+            if( fMCEvent ) {
+                    Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
+                    if( labelelectron < fMCStack->GetNtrack() ){
+                    TParticle* electron = fMCStack->Particle(labelelectron);
+                      if( electron->GetPdgCode() ==  11 ){
+                            hESDTrueElectronPt[fiCut]->Fill(electron->Pt());
+                        if( IsPi0DalitzDaughter(labelelectron) == kTRUE ) {
+                            hESDTruePi0DalitzElectronPt[fiCut]->Fill(electron->Pt());
+                       }
+                     }
+                   }
+            }
    }
 
    for(UInt_t i = 0; i < fSelectorPositronIndex.size(); i++){
 
-      AliESDtrack* positronCandidate = fESDEvent->GetTrack(fSelectorPositronIndex[i]);
+      AliESDtrack* positronCandidate = fESDEvent->GetTrack( fSelectorPositronIndex[i] );
       if(! ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelected(positronCandidate) ) continue;
-      lGoodPositronIndex.push_back(   fSelectorPositronIndex[i] );
-      if( ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->DoPsiPairCut() == kFALSE ){
-         hESDDalitzPositronPt[fiCut]->Fill(positronCandidate->Pt());
-      }
+        lGoodPositronIndex.push_back(   fSelectorPositronIndex[i] );
+        hESDDalitzPositronPt[fiCut]->Fill(positronCandidate->Pt());
+        if( fMCEvent ) {
+                    Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
+                    if( labelpositron < fMCStack->GetNtrack() ) {
+                    TParticle* positron = fMCStack->Particle(labelpositron);
+                      if( positron->GetPdgCode() ==  -11 ){
+                            hESDTruePositronPt[fiCut]->Fill(positron->Pt());
+                        if( IsPi0DalitzDaughter(labelpositron) == kTRUE ) {
+                            hESDTruePi0DalitzPositronPt[fiCut]->Fill(positron->Pt());
+                       }
+                     }
+               }
+        }
 
    }
 
@@ -822,23 +947,6 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
                lElectronPsiIndex[i] = kFALSE;
                lPositronPsiIndex[j] = kFALSE;
             }
-
-         }
-      }
-
-
-      for(UInt_t i = 0; i < lGoodElectronIndex.size(); i++){
-
-         if( lElectronPsiIndex[i] == kTRUE ){
-            AliESDtrack* electronCandidate = fESDEvent->GetTrack(lGoodElectronIndex[i]);
-            hESDDalitzElectronPt[fiCut]->Fill(electronCandidate->Pt());
-         }
-      }
-
-      for(UInt_t i = 0; i < lGoodPositronIndex.size(); i++){
-         if( lPositronPsiIndex[i] == kTRUE ) {
-            AliESDtrack* positronCandidate = fESDEvent->GetTrack(lGoodPositronIndex[i]);
-            hESDDalitzPositronPt[fiCut]->Fill(positronCandidate->Pt());
          }
       }
    }
@@ -863,12 +971,14 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
 
          AliESDtrack *positronCandidate = fESDEvent->GetTrack(lGoodPositronIndex[j]);
          AliKFParticle positronCandidateKF( *positronCandidate->GetConstrainedParam(), ::kPositron );
+        Bool_t isPhoton    = kFALSE;
+        Bool_t isPi0Dalitz = kFALSE;
+        Bool_t isEtaDalitz = kFALSE;
+        
 
          Double_t psiPair = GetPsiPair(positronCandidate,electronCandidate);
          Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->GetConstrainedParam()->Phi()-positronCandidate->GetConstrainedParam()->Phi());
-         hESDEposEnegPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair);
-
-
+         
 
 
          AliKFConversionPhoton* virtualPhoton = new AliKFConversionPhoton(electronCandidateKF,positronCandidateKF);
@@ -890,14 +1000,41 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
             if( fPositiveMCParticle && fNegativeMCParticle) {
                virtualPhoton->SetMCLabelPositive(labelp);
                virtualPhoton->SetMCLabelNegative(labeln);
-            }
-         }
+            
+           }
+            
+            TParticle *mcVgamma=virtualPhoton->GetMCParticle(fMCStack);
+           Int_t labelgamma    = -1;
+           Int_t labelelectron = -1;
+           Int_t labelpositron = -1;
+
+           if(mcVgamma){
+             // Check if it is a true photon
+             if(mcVgamma->GetPdgCode() == 22){
+               isPhoton = kTRUE;
+             }
+             else if( IsDalitz( mcVgamma,labelgamma,labelelectron,labelpositron ) ){
+                 if     ( mcVgamma->GetPdgCode() == 111 ) isPi0Dalitz = kTRUE;
+                 else if( mcVgamma->GetPdgCode() == 221 ) isEtaDalitz = kTRUE;
+             }
+           }
+          }
+
+            
          AliAODConversionPhoton *vphoton = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut
-        // cout<<"Virtual Photon Mass: "<<vphoton->GetMass()<<"  Pt: "<<vphoton->Pt()<<endl;
-    
-         hESDEposEnegInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
 
-         fGoodVirtualGammas->Add(  vphoton );
+         hESDEposEnegPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair);   
+         hESDEposEnegInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+        
+        if( fMCEvent ) {
+           if(isPhoton)        hESDEposEnegTruePhotonInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+           else if(isPi0Dalitz)hESDEposEnegTruePi0DalitzInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+           else if(isEtaDalitz)hESDEposEnegTrueEtaDalitzInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+           
+        }
+        
+        fGoodVirtualGammas->Add(  vphoton );
+                        
       }
    }
    
@@ -1342,60 +1479,138 @@ void AliAnalysisTaskGammaConvDalitzV1::CountESDTracks(){
 void AliAnalysisTaskGammaConvDalitzV1::ProcessMCParticles()
 {
 
-
    // Loop over all primary MC particle
+
    for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) {
       TParticle* particle = (TParticle *)fMCStack->Particle(i);
       if (!particle) continue;
 
 
+    if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
+         hMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
+    }
 
-     if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack)){
+    if(  ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(i,fMCStack)){
+        if( particle->GetPdgCode() == -11)hMCAllPositronsPt[fiCut]->Fill(particle->Pt()); // All positrons
+        if( particle->GetPdgCode() ==  11)hMCAllElectronsPt[fiCut]->Fill(particle->Pt()); // All electrons
+    }
+
+    if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack)){
 
             if(particle->GetPdgCode() == 111)hMCPi0GGPt[fiCut]->Fill( particle->Pt() ); // All MC Pi0 GG decay
             if(particle->GetPdgCode() == 221)hMCEtaGGPt[fiCut]->Fill( particle->Pt() ); // All MC Eta GG decay
-     }
+    }
 
-      if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMCDalitz(particle,fMCStack)){
+    if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMCDalitz(particle,fMCStack)){
+       
          if(particle->GetPdgCode() == 111)hMCPi0Pt[fiCut]->Fill(particle->Pt()); // All MC Pi0
          if(particle->GetPdgCode() == 221)hMCEtaPt[fiCut]->Fill(particle->Pt()); // All MC Eta
-         // Check the acceptance for both gammas
-         if(particle->GetNDaughters() == 3){
-            TParticle* gamma    = 0;
-            TParticle* electron = 0;
-            TParticle* positron = 0;
+
+         // Check the acceptance for gamma and electrons
+        
+        Int_t labelgamma =    -1;
+        Int_t labelelectron = -1;
+        Int_t labelpositron = -1;
+        
+        if( IsDalitz( particle,labelgamma,labelelectron,labelpositron) == kTRUE ) {
+         
+         
+              TParticle *gamma    = fMCStack->Particle(labelgamma);
+              TParticle *electron = fMCStack->Particle(labelelectron);
+              TParticle *positron = fMCStack->Particle(labelpositron);
+        
+                      
+               if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) &&
+                  TMath::Abs( electron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut()  &&
+                  TMath::Abs( positron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut() ){
+                  if(particle->GetPdgCode() == 111){ 
+                        hMCPi0InAccPt[fiCut]->Fill(particle->Pt()); // MC Pi0Dalitz with gamma and e+e- in acc
+                        hMCPi0DalitzGammaPt[fiCut]->Fill( gamma->Pt());
+                        hMCPi0DalitzPositronPt[fiCut]->Fill( positron->Pt());
+                        hMCPi0DalitzElectronPt[fiCut]->Fill( electron->Pt());
+                  }
+                  if(particle->GetPdgCode() == 221)hMCEtaInAccPt[fiCut]->Fill(particle->Pt()); // MC EtaDalitz with gamma and e+e- in acc
+               }
+         }
+      }
+   }
+}
+//_____________________________________________________________________________
+Bool_t AliAnalysisTaskGammaConvDalitzV1::IsDalitz(TParticle *fMCMother,Int_t &labelgamma, Int_t &labelelectron,Int_t &labelpositron)
+{
+
+           if( fMCMother->GetNDaughters() != 3 ) return kFALSE;
+           if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
+           
+           TParticle *positron = 0x0;
+           TParticle *electron = 0x0;
+           TParticle *gamma    = 0x0;
+                   
+             
 
 
-            for(Int_t index=particle->GetFirstDaughter(); index<= particle->GetLastDaughter();index++){
+            for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
 
 
                TParticle* temp = (TParticle*)fMCStack->Particle( index );
 
                switch( temp->GetPdgCode() ) {
                case ::kPositron:
-                  electron = temp;
-                  break;
+                               positron =  temp;
+                               labelpositron = index;
+                               break;
                case ::kElectron:
-                  positron = temp;
-                  break;
+                               electron =  temp;
+                               labelelectron = index;
+                               break;
                case ::kGamma:
-                  gamma    = temp;
-                  break;
+                               gamma    =  temp;
+                               labelgamma = index;
+                               break;
                }
             }
-            if( gamma  && electron && positron ) {
+            
+            if( positron && electron && gamma) return kTRUE;
 
-               if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) &&
-                  TMath::Abs( electron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut()  &&
-                  TMath::Abs( positron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut() ){
-                  if(particle->GetPdgCode() == 111)hMCPi0InAccPt[fiCut]->Fill(particle->Pt()); // MC Pi0Dalitz with gamma and e+e- in acc
-                  if(particle->GetPdgCode() == 221)hMCEtaInAccPt[fiCut]->Fill(particle->Pt()); // MC EtaDalitz with gamma and e+e- in acc
-               }
-            }
-         }
-      }
-   }
+return kFALSE;
 }
+//_____________________________________________________________________________________
+Bool_t AliAnalysisTaskGammaConvDalitzV1::IsPi0DalitzDaughter( Int_t label ) const
+{
+//
+// Returns true if the particle comes from Pi0 -> e+ e- gamma
+//
+        Bool_t ePlusFlag  = kFALSE;
+        Bool_t eMinusFlag = kFALSE;
+        Bool_t gammaFlag  = kFALSE;
+        
+        Int_t motherLabel = fMCStack->Particle( label )->GetMother(0);
+        
+        if( motherLabel < 0 ) return kFALSE;
+        
+        TParticle* mother = fMCStack->Particle( motherLabel );
+        
+        if ( mother->GetPdgCode() != ::kPi0 ) return kFALSE;
+        
+        if ( mother->GetNDaughters() != 3 ) return kFALSE;
+        
+        for( Int_t idx = mother->GetFirstDaughter(); idx <= mother->GetLastDaughter(); ++idx ) {
+                switch( fMCStack->Particle(idx)->GetPdgCode()) {
+                        case ::kPositron:
+                                ePlusFlag  = kTRUE;
+                                break;
+                        case ::kElectron:
+                                eMinusFlag = kTRUE;
+                                break;
+                        case ::kGamma:
+                                gammaFlag  = kTRUE;
+                                break;
+                }
+        }
+        return ( ePlusFlag && eMinusFlag && gammaFlag );
+}
+
+
 //_____________________________________________________________________________
 Double_t AliAnalysisTaskGammaConvDalitzV1::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg ) const
 {
index 6690655..cd3a040 100644 (file)
@@ -66,7 +66,8 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
                 void CalculateBackground();
                 void UpdateEventByEventData();
                 Double_t GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg ) const;
-
+               Bool_t IsDalitz(TParticle *fMCMother,Int_t &labelgamma, Int_t &labelelectron,Int_t &labelpositron);
+                Bool_t IsPi0DalitzDaughter( Int_t label ) const;
                
                
 
@@ -106,12 +107,21 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
     THnSparseF **sESDMotherInvMassPtZM;
     TH2F **hESDMotherBackInvMassPt;
     THnSparseF **sESDMotherBackInvMassPtZM;
+    TH1F **hMCAllGammaPt;
+    TH1F **hMCAllPositronsPt;
+    TH1F **hMCAllElectronsPt;
+    TH1F **hMCPi0DalitzGammaPt;
+    TH1F **hMCPi0DalitzElectronPt;
+    TH1F **hMCPi0DalitzPositronPt;
     TH1F **hMCPi0Pt;
     TH1F **hMCPi0GGPt;
     TH1F **hMCEtaPt;
     TH1F **hMCEtaGGPt;
     TH1F **hMCPi0InAccPt;
     TH1F **hMCEtaInAccPt;
+    TH2F **hESDEposEnegTruePi0DalitzInvMassPt;
+    TH2F **hESDEposEnegTrueEtaDalitzInvMassPt;
+    TH2F **hESDEposEnegTruePhotonInvMassPt;
     TH2F **hESDTrueMotherInvMassPt;
     TH2F **hESDTrueMotherPi0GGInvMassPt;
     TH2F **hESDTruePrimaryMotherInvMassMCPt;
@@ -122,6 +132,14 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
     TH2F **hESDTrueBckContInvMassPt;
     TH2F **hESDTrueMotherGGInvMassPt;
     TH1F **hESDTrueConvGammaPt;
+    TH1F **hESDTruePositronPt;
+    TH1F **hESDTrueElectronPt;
+    TH1F **hESDTruePi0DalitzConvGammaPt;
+    TH1F **hESDTruePi0DalitzPositronPt;
+    TH1F **hESDTruePi0DalitzElectronPt;
+      //if(fDoMesonAnalysis){
+
+
     TH1I **hNEvents;
     TH1I **hNGoodESDTracks;
         
index dbe66b0..aa94ae9 100644 (file)
@@ -690,13 +690,21 @@ void AliAnalysisTaskGammaConvV1::UserCreateOutputObjects()
 //_____________________________________________________________________________
 Bool_t AliAnalysisTaskGammaConvV1::Notify()
 {
-   if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetDoEtaShift()){
-      for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-//          cout << iCut << "\t eta shift \t" <<((AliConversionCuts*)fCutArray->At(iCut))->GetDoEtaShift()<< endl;
-         if(!((AliConversionCuts*)fCutArray->At(iCut))->GetDoEtaShift()) continue;
-         ((AliConversionCuts*)fCutArray->At(iCut))->SetEtaShift(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEtaShift());
+   for(Int_t iCut = 0; iCut<fnCuts;iCut++){
+      if(!((AliConversionCuts*)fCutArray->At(iCut))->GetDoEtaShift()) continue; // No Eta Shift requested, continue
+      
+      if(((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
+         ((AliConversionCuts*)fCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
+         ((AliConversionCuts*)fCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
+         continue;
+      }
+      else{
+         printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
+                (((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift());
+         ((AliConversionCuts*)fCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
       }
    }
+   
    return kTRUE;
 }
 //_____________________________________________________________________________
@@ -731,20 +739,21 @@ void AliAnalysisTaskGammaConvV1::UserExec(Option_t *)
          ((AliConversionCuts*)fCutArray->At(iCut))
          ->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
       if(eventNotAccepted){
-         //                    cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
+         // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
          hNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
          continue;
       }
 
       if(eventQuality != 0){// Event Not Accepted
-         //          cout << "event rejected due to: " <<eventQuality << endl;
+         // cout << "event rejected due to: " <<eventQuality << endl;
          hNEvents[iCut]->Fill(eventQuality);
          continue;
       }
 
       hNEvents[iCut]->Fill(eventQuality); // Should be 0 here
       hNGoodESDTracks[iCut]->Fill(fNumberOfESDTracks);
-      hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C());
+      if(((AliConversionCuts*)fCutArray->At(iCut))->IsHeavyIon() == 2) hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A());
+      else hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C());
 
       if(fMCEvent){ // Process MC Particle
          if(((AliConversionCuts*)fCutArray->At(iCut))->GetSignalRejection() != 0){
index 287f9f0..2d89158 100644 (file)
@@ -176,7 +176,6 @@ AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
    fUtils(NULL),
    fEtaShift(0.0),
    fDoEtaShift(kFALSE),
-   fForceEtaShift(0),
    hdEdxCuts(NULL),
    hTPCdEdxbefore(NULL),
    hTPCdEdxafter(NULL),
@@ -305,7 +304,6 @@ AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) :
    fUtils(NULL),
    fEtaShift(ref.fEtaShift),
    fDoEtaShift(ref.fDoEtaShift),
-   fForceEtaShift(ref.fForceEtaShift),
    hdEdxCuts(NULL),
    hTPCdEdxbefore(NULL),
    hTPCdEdxafter(NULL),
@@ -376,6 +374,7 @@ AliConversionCuts::~AliConversionCuts() {
 void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
 
    // Initialize Cut Histograms for QA (only initialized and filled if function is called)
+   TH1::AddDirectory(kFALSE);
 
    if(fHistograms != NULL){
       delete fHistograms;
@@ -383,6 +382,7 @@ void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
    }
    if(fHistograms==NULL){
       fHistograms=new TList();
+      fHistograms->SetOwner(kTRUE);
       if(name=="")fHistograms->SetName(Form("ConvCuts_%s",GetCutNumber().Data()));
       else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
    }
@@ -603,6 +603,7 @@ void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
       hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
       fHistograms->Add(hTriggerClassSelected);
    }
+   TH1::AddDirectory(kTRUE);
 }
 
 //________________________________________________________________________
@@ -663,6 +664,8 @@ Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMC
       fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND);
       if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32);
    }
+//   cout << "event number " << ((AliESDEvent*)fInputEvent)->GetEventNumberInFile() << " entered"<< endl;
+
 
    // Number of Contributors Cut
    if(GetNumberOfContributorsVtx(fInputEvent)<=0) {
@@ -723,7 +726,7 @@ Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCSt
          if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
             return kFALSE;
       }
-      
+
       if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
          return kFALSE; // no photon as mothers!
       }
@@ -926,7 +929,7 @@ Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliV
    FillPhotonCutIndex(kPhotonIn);
 
    if(event->IsA()==AliESDEvent::Class()) {
-      if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index())) ) ){
+     if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index()))->GetOnFlyStatus() ) ){
          FillPhotonCutIndex(kOnFly);
          return kFALSE;
       }
@@ -1116,7 +1119,7 @@ Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * po
       return kFALSE;
    }
    cutIndex++;
-   
+
    // Acceptance
    if( posTrack->Eta() > (fEtaCut + fEtaShift) || posTrack->Eta() < (-fEtaCut + fEtaShift) ||
        negTrack->Eta() > (fEtaCut + fEtaShift) || negTrack->Eta() < (-fEtaCut + fEtaShift) ){
@@ -1437,7 +1440,7 @@ Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TP
       return kFALSE;
    }
 
-   
+
    if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ){
       return kFALSE;
    }
@@ -1458,7 +1461,7 @@ Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TP
          return kFALSE;
       }
    }
-   
+
    if( ePos->Pt()< fSinglePtCut ||  eNeg->Pt()< fSinglePtCut){
       return kFALSE;
    }
@@ -1874,9 +1877,11 @@ Bool_t AliConversionCuts::SetV0Finder(Int_t v0FinderType)
 {   // Set Cut
    switch (v0FinderType){
    case 0:  // on fly V0 finder
+      cout << "have chosen onfly V0" << endl;
       fUseOnFlyV0Finder=kTRUE;
       break;
    case 1:  // offline V0 finder
+      cout << "have chosen offline V0" << endl;
       fUseOnFlyV0Finder=kFALSE;
       break;
    default:
@@ -1936,7 +1941,7 @@ Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut)
       fEtaCutMin               = -0.1;
       fLineCutZRSlopeMin = 0.;
       break;
-   case 7: 
+   case 7:
       fEtaCut          = 0.3;
       fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
       fEtaCutMin               = -0.1;
@@ -2059,8 +2064,8 @@ Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut)
    case 0: // 0
       fMinClsTPC= 0.;
       break;
-   case 1:  // 70
-      fMinClsTPC= 70.;
+   case 1:  // 60
+      fMinClsTPC= 60.;
       break;
    case 2:  // 80
       fMinClsTPC= 80.;
@@ -2068,9 +2073,9 @@ Bool_t AliConversionCuts::SetTPCClusterCut(Int_t clsTPCCut)
    case 3:  // 100
       fMinClsTPC= 100.;
       break;
-   case 4:  // 60% of findable clusters
-      fMinClsTPCToF= 0.6;
-      fUseCorrectedTPCClsInfo=0;
+   case 4:  // 95% of findable clusters
+      fMinClsTPCToF= 0.95;
+      fUseCorrectedTPCClsInfo=1;
       break;
    case 5:  // 0% of findable clusters
       fMinClsTPCToF= 0.0;
@@ -2684,8 +2689,10 @@ Bool_t AliConversionCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCE
    if(!fIsHeavyIon)return kTRUE;
 
    if(fCentralityMin == 0 && fCentralityMax == 0) return kTRUE;//0-100%
-   if(fCentralityMin >= fCentralityMax) return kTRUE;//0-100%
-
+   if(fCentralityMin >= fCentralityMax ){
+     if(fCentralityMax==0 && fModCentralityClass ==0) fCentralityMax=10; //CentralityRange = fCentralityMin-100%
+     else  return kTRUE;//0-100%
+   }
    Double_t centrality=GetCentrality(event);
    if(centrality<0)return kFALSE;
 
@@ -2712,12 +2719,12 @@ Bool_t AliConversionCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCE
    // Use strict V0 amplitude cut for MC centrality
    Float_t nv0amplitude = event->GetVZEROData()->GetMTotV0A()+event->GetVZEROData()->GetMTotV0C();
    Float_t V0Amplitude10[10] = {9999999.0,13670,9345,6209,3944,2352,1272,611,255, 83};
-   //                                    0    10   20   30   40   50   60  70  80  90%
+   //                                   0    10   20   30   40   50   60  70  80  90%
    Float_t V0Amplitude5a[10] = {9999999.0,16612,13670,11290,9345,7650,6209,4984,3944,3074};
-   //                                    0     5    10    15   20   25   30   35   40   45%
+   //                                   0     5    10    15   20   25   30   35   40   45%
    Float_t V0Amplitude5b[10] = {3074,2352,1725,1272,899,611,402,255,152,83};
    //                             45   50   55   60  65  70  75  80  85 90%
-
+   
    if (fModCentralityClass == 3){
       if(fMCEvent){
          if(nv0amplitude > V0Amplitude10[fCentralityMax] && nv0amplitude <= V0Amplitude10[fCentralityMin])
@@ -2784,15 +2791,18 @@ Int_t AliConversionCuts::GetNumberOfContributorsVtx(AliVEvent *event){
    if(fESDEvent){
       if (fESDEvent->GetPrimaryVertex() != NULL){
          if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
+//         cout << "accepted global" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertex()->GetNContributors() << endl;
             return fESDEvent->GetPrimaryVertex()->GetNContributors();
          }
       }
 
       if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
          if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
+//         cout << "accepted SPD" << fESDEvent->GetEventNumberInFile() << " with NCont: " << fESDEvent->GetPrimaryVertexSPD()->GetNContributors() << endl;
             return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
          }  else {
             AliWarning(Form("Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
+//            cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl;
             return 0;
          }
       }
@@ -2814,7 +2824,7 @@ Int_t AliConversionCuts::GetNumberOfContributorsVtx(AliVEvent *event){
          }
       }
    }
-
+  // cout << "rejected " << fESDEvent->GetEventNumberInFile() << endl;
    return 0;
 }
 
@@ -3195,6 +3205,7 @@ Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *Reade
 
    if(!isHeavyIon && GetIsFromPileup()){
       if(InputEvent->IsPileupFromSPD(3,0.8,3.,2.,5.)){
+
          return 6; // Check Pileup --> Not Accepted => eventQuality = 6
       }
    }
@@ -3210,10 +3221,9 @@ Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *Reade
 
    return 0;
 }
-
+//_________________________________________________________________________
 Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack){
    if (!(period.CompareTo("LHC12f1a") == 0 || period.CompareTo("LHC12f1b") == 0  || period.CompareTo("LHC12i3") == 0 )) return 1.;
-
    Int_t kCaseGen = 0;
    for (Int_t i = 0; i < fnHeaders; i++){
       if (index >= fNotRejectedStart[i] && index < fNotRejectedEnd[i]+1){
@@ -3313,7 +3323,6 @@ Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliSta
    return tsallisData/functionResult;
 //       return
 }
-
 ///________________________________________________________________________
 AliConversionCuts* AliConversionCuts::GetStandardCuts2010PbPb(){
     //Create and return standard 2010 PbPb cuts
@@ -3331,4 +3340,45 @@ AliConversionCuts* AliConversionCuts::GetStandardCuts2010pp(){
        cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
     return cuts;
 }
-
+///________________________________________________________________________
+void AliConversionCuts::GetCorrectEtaShiftFromPeriod(TString periodName){
+
+   if(periodName.CompareTo("LHC12g") == 0 || //pilot run 2012
+      periodName.CompareTo("LHC13b") == 0 || //mainly minimum bias
+      periodName.CompareTo("LHC13c") == 0 || //mainly minimum bias
+      periodName.CompareTo("LHC13d") == 0 || //mainly triggered
+      periodName.CompareTo("LHC13e") == 0 || //mainly triggered
+      periodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e
+      periodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e
+      periodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b
+      periodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c
+      periodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b
+      periodName.CompareTo("LHC13b2") == 0 ||  // MC DPMJET, wrong energy, anchor LHC13b
+      periodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b
+      periodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ?
+      periodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ?
+      periodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g
+      periodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g
+      periodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g
+      periodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g
+      periodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g
+      periodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g
+      periodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g
+      periodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g
+      periodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g
+      periodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g
+      periodName.CompareTo("LHC12g1") == 0 ) // MC ?, anchor LHC12g
+      {
+         printf(" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),-0.465);
+         SetEtaShift(-0.465);
+      }
+   else if(periodName.CompareTo("LHC13f") == 0 ||
+           periodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f
+           periodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f
+           periodName.CompareTo("LHC13c4") == 0 )//MC Starlight, coherent JPsi, UPC muon, anchor LHC13f
+      {
+         printf(" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(GetCutNumber()).Data(),0.465);
+         SetEtaShift(+0.465);
+      }
+   else printf(" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(GetCutNumber()).Data());
+}
index e92be4a..712b0ba 100644 (file)
@@ -34,7 +34,7 @@ using namespace std;
 class AliConversionCuts : public AliAnalysisCuts {
        
  public: 
-
+   
 
   enum cutIds {
        kisHeavyIon,                  
@@ -140,17 +140,22 @@ class AliConversionCuts : public AliAnalysisCuts {
      fLineCutZRSlope = tan(2*atan(exp(-fEtaCut + etaShift)));
      if(fEtaCutMin > -0.1)
         fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin + etaShift)));
-     fDoEtaShift = kTRUE;
+  }
+  void SetEtaShift(TString pPbOrPbp) {
+     Double_t etaShift = 0.0;
+     if(!pPbOrPbp.CompareTo("pPb"))      etaShift = -0.465;
+     else if(!pPbOrPbp.CompareTo("Pbp")) etaShift =  0.465;
+     
+     fEtaShift = etaShift;
+     fLineCutZRSlope = tan(2*atan(exp(-fEtaCut + etaShift)));
+     if(fEtaCutMin > -0.1)
+        fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin + etaShift)));
   }
   Double_t GetEtaShift() {return fEtaShift;}
   Bool_t GetDoEtaShift(){return fDoEtaShift;}
   void DoEtaShift(Bool_t doEtaShift){fDoEtaShift = doEtaShift;}
-  void ForceEtaShift(Int_t forcedShift){
-     fForceEtaShift = forcedShift;
-     if(forcedShift>0)fDoEtaShift = kTRUE;
-  }
-  Int_t IsEtaShiftForced() {return fForceEtaShift;}
-
+  void GetCorrectEtaShiftFromPeriod(TString periodName);
+  
   static AliVTrack * GetTrack(AliVEvent * event, Int_t label);
   static AliESDtrack *GetESDTrack(AliESDEvent * event, Int_t label);
   
@@ -327,7 +332,6 @@ class AliConversionCuts : public AliAnalysisCuts {
   AliAnalysisUtils *fUtils;
   Double_t fEtaShift;
   Bool_t fDoEtaShift;
-  Int_t  fForceEtaShift;
 
   // Histograms
   TH1F *hdEdxCuts;  // bookkeeping for dEdx cuts
index d1d9564..605c51b 100644 (file)
@@ -172,13 +172,15 @@ AliConversionMesonCuts::~AliConversionMesonCuts() {
 void AliConversionMesonCuts::InitCutHistograms(TString name){
 
    // Initialize Cut Histograms for QA (only initialized and filled if function is called)
-
+   TH1::AddDirectory(kFALSE);
+   
    if(fHistograms != NULL){
       delete fHistograms;
       fHistograms=NULL;
    }
    if(fHistograms==NULL){
       fHistograms=new TList();
+      fHistograms->SetOwner(kTRUE);
       if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
       else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
    }
@@ -203,9 +205,10 @@ void AliConversionMesonCuts::InitCutHistograms(TString name){
    hMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
    hMesonBGCuts->GetXaxis()->SetBinLabel(7,"out");
    fHistograms->Add(hMesonBGCuts);
+   
+   TH1::AddDirectory(kTRUE);
 }
 
-
 //________________________________________________________________________
 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
    // Returns true for all pions within acceptance cuts for decay into 2 photons
index 27bbfad..aeaafd3 100644 (file)
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                       *
- * Authors: Svein Lindal, Daniel Lohner                                          *
- * Version 1.0                                                           *
- *                                                                       *
- * Permission to use, copy, modify and distribute this software and its          *
- * documentation strictly for non-commercial purposes is hereby granted          *
- * without fee, provided that the above copyright notice appears in all          *
- * copies and that both the copyright notice and this permission notice          *
- * appear in the supporting documentation. The authors make no claims    *
- * about the suitability of this software for any purpose. It is         *
- * provided "as is" without express or implied warranty.                 *
- **************************************************************************/
-
-////////////////////////////////////////////////
-//--------------------------------------------- 
-// Class handling all kinds of selection cuts for
-// Gamma Conversion analysis
-//---------------------------------------------
-////////////////////////////////////////////////
-
-
-#include "AliDalitzElectronCuts.h"
-#include "AliAODConversionPhoton.h"
-#include "AliKFVertex.h"
-#include "AliAODTrack.h"
-#include "AliESDtrack.h"
-#include "AliAnalysisManager.h"
-#include "AliInputEventHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliAODHandler.h"
-#include "AliPIDResponse.h"
-#include "TH1.h"
-#include "TH2.h"
-#include "AliStack.h"
-#include "TObjString.h"
-#include "AliAODEvent.h"
-#include "AliESDEvent.h"
-#include "TList.h"
-class iostream;
-
-using namespace std;
-
-ClassImp(AliDalitzElectronCuts)
-
-
-const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {
-"GoodId",
-"ededxSigmaITSCut",
-"ededxSigmaTPCCut",
-"pidedxSigmaTPCCut",
-"piMinMomdedxSigmaTPCCut",
-"piMaxMomdedxSigmaTPCCut",
-"LowPRejectionSigmaCut",
-"kTOFelectronPID",
-"clsITSCut",
-"clsTPCCut",
-"EtaCut",
-"PsiPair",
-"RejectSharedElecGamma",
-"BackgroundScheme",
-"NumberOfRotations",
-};
-
-//________________________________________________________________________
-AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),
-    fHistograms(NULL),
-    fPIDResponse(NULL),
-    fesdTrackCuts(NULL),
-    fEtaCut(0.9),
-    fRadiusCut(1000.0),
-    fPsiPairCut(0.45),
-    fDeltaPhiCutMin(0.),
-    fDeltaPhiCutMax(0.12),
-    fMinClsTPC(0), // minimum clusters in the TPC
-    fMinClsTPCToF(0), // minimum clusters to findable clusters
-    fDodEdxSigmaITSCut(kFALSE),
-    fDodEdxSigmaTPCCut(kTRUE),
-    fDoTOFsigmaCut(kFALSE), // RRnewTOF
-    fDoRejectSharedElecGamma(kFALSE),
-    fDoPsiPairCut(kFALSE),
-    fPIDnSigmaAboveElectronLineITS(100),
-    fPIDnSigmaBelowElectronLineITS(-100),
-    fPIDnSigmaAboveElectronLineTPC(100),
-    fPIDnSigmaBelowElectronLineTPC(-100),
-    fPIDnSigmaAbovePionLineTPC(0),
-    fPIDnSigmaAbovePionLineTPCHighPt(-100),
-    fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
-    fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
-    fPIDMinPnSigmaAbovePionLineTPC(0),
-    fPIDMaxPnSigmaAbovePionLineTPC(0),
-    fDoKaonRejectionLowP(kFALSE),
-    fDoProtonRejectionLowP(kFALSE),
-    fDoPionRejectionLowP(kFALSE),
-    fPIDnSigmaAtLowPAroundKaonLine(0),
-    fPIDnSigmaAtLowPAroundProtonLine(0),
-    fPIDnSigmaAtLowPAroundPionLine(0),
-    fPIDMinPKaonRejectionLowP(1.5),
-    fPIDMinPProtonRejectionLowP(2.0),
-    fPIDMinPPionRejectionLowP(0.5),
-    fUseCorrectedTPCClsInfo(kFALSE),
-    fUseTOFpid(kFALSE),
-    fRequireTOF(kFALSE),
-    fUseTrackMultiplicityForBG(kFALSE),
-    fBKGMethod(0),
-    fnumberOfRotationEventsForBG(0),
-    fCutString(NULL),
-    hCutIndex(NULL),
-    hdEdxCuts(NULL),
-    hITSdEdxbefore(NULL),
-    hITSdEdxafter(NULL),
-    hTPCdEdxbefore(NULL),
-    hTPCdEdxafter(NULL),
-    hTPCdEdxSignalafter(NULL),
-    hTOFbefore(NULL),
-    hTOFafter(NULL)
-   {
-    InitPIDResponse();
-    for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
-    fCutString=new TObjString((GetCutNumber()).Data());
-
-
-    //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
-
-   // Using standard function for setting Cuts
-    Bool_t selectPrimaries=kTRUE;
-    fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
-}
-
-//________________________________________________________________________
-AliDalitzElectronCuts::~AliDalitzElectronCuts() {
-    // Destructor
-  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
-  // if(fHistograms)
-  //   delete fHistograms;
-  // fHistograms = NULL;
-
-   if(fCutString != NULL){
-      delete fCutString;
-      fCutString = NULL;
-   }
-
-
-}
-
-//________________________________________________________________________
-void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){
-
-    // Initialize Cut Histograms for QA (only initialized and filled if function is called)
-
-     TString cutName = "";
-    
-     if( cutNumber==""){
-         cutName = GetCutNumber().Data();
-     }
-     else {
-            cutName = cutNumber.Data();
-     } 
-
-    if(fHistograms != NULL){
-       delete fHistograms;
-       fHistograms=NULL;
-    }
-    if(fHistograms==NULL){
-       fHistograms=new TList();
-       if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
-       else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
-    }
-
-
-    hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
-    hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");
-    hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");
-    hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");
-    hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");
-    hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");
-    fHistograms->Add(hCutIndex);
-
-
-
-    // dEdx Cuts
-    hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);
-    hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");
-    hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");
-    hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");
-    hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");
-    hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");
-    hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");
-    hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");
-    hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");
-    hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");
-    hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");
-    fHistograms->Add(hdEdxCuts);
-    
-
-
-    TAxis *AxisBeforeITS = NULL;
-    TAxis *AxisBeforedEdx = NULL;
-    TAxis *AxisBeforeTOF = NULL;
-
-    if(preCut){
-
-
-       hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,150,0.05,20,400,-10,10);
-       fHistograms->Add(hITSdEdxbefore);
-       AxisBeforeITS = hITSdEdxbefore->GetXaxis();
-
-       hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,150,0.05,20,400,-10,10);
-       fHistograms->Add(hTPCdEdxbefore);
-       AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
-
-       hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,150,0.05,20,400,-6,10);
-       fHistograms->Add(hTOFbefore);
-       AxisBeforeTOF = hTOFbefore->GetXaxis();
-
-    }
-
-
-    hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,150,0.05,20,400, -10,10);
-    fHistograms->Add(hITSdEdxafter);
-
-    hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,150,0.05,20,400, -10,10);
-    fHistograms->Add(hTPCdEdxafter);
-
-    hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,150,0.0,3.0,200,0.0,200);
-    fHistograms->Add(hTPCdEdxSignalafter);
-
-    hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,150,0.05,20,400,-6,10);
-    fHistograms->Add(hTOFafter);
-
-    TAxis *AxisAfter = hTPCdEdxafter->GetXaxis(); 
-    Int_t bins = AxisAfter->GetNbins();
-    Double_t from = AxisAfter->GetXmin();
-    Double_t to = AxisAfter->GetXmax();
-    Double_t *newBins = new Double_t[bins+1];
-    newBins[0] = from;
-    Double_t factor = TMath::Power(to/from, 1./bins);
-    for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
-    AxisAfter->Set(bins, newBins);
-    AxisAfter = hTOFafter->GetXaxis(); 
-    AxisAfter->Set(bins, newBins);
-    AxisAfter = hITSdEdxafter->GetXaxis();
-    AxisAfter->Set(bins,newBins); 
-    if(preCut){
-       AxisBeforeITS->Set(bins, newBins);
-       AxisBeforedEdx->Set(bins, newBins);
-       AxisBeforeTOF->Set(bins, newBins);
-    }
-    delete [] newBins;
-
-        
-    // Event Cuts and Info
-}
-
-
-//________________________________________________________________________
-Bool_t AliDalitzElectronCuts::InitPIDResponse(){
-
-// Set Pointer to AliPIDResponse
-
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
-
-  if(man) {
-
-    AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
-    fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
-    if(fPIDResponse)return kTRUE;
-
-  }
-
-  return kFALSE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)
-{
-    //Selection of Reconstructed electrons
-
-    if(hCutIndex)hCutIndex->Fill(kElectronIn);
-
-    if (lTrack == NULL){
-      if(hCutIndex)hCutIndex->Fill(kNoTracks);
-         return kFALSE;  
-    }   
-       
-    if ( ! lTrack->GetConstrainedParam() ){
-        return kFALSE;
-    }
-    AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);
-
-
-    // Track Cuts
-    if( !TrackIsSelected(lTrack) ){
-         if(hCutIndex)hCutIndex->Fill(kTrackCuts);
-         return kFALSE;
-    }
-
-
-    // dEdx Cuts
-    if( ! dEdxCuts( track ) ) {
-         if(hCutIndex)hCutIndex->Fill(kdEdxCuts);
-         return kFALSE;
-
-    }
-
-    //Electron passed the cuts
-    if(hCutIndex)hCutIndex->Fill(kElectronOut);
-
-
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {
-    // Track Selection for Photon Reconstruction
-
-
-
-    if( ! fesdTrackCuts->AcceptTrack(lTrack) ){
-
-        return kFALSE;
-    }
-
-   if(  TMath::Abs( lTrack->Eta()) > fEtaCut ) {
-
-        return kFALSE;
-    }
-
-    if( lTrack->GetNcls(1) < fMinClsTPC ) {
-
-        return kFALSE;
-    }
-
-    //Findable clusters
-
-    Double_t clsToF=0;
-
-
-    if (!fUseCorrectedTPCClsInfo ){
-        if(lTrack->GetTPCNclsF()!=0){
-
-              clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();
-        }// Ncluster/Nfindablecluster
-    }
-    else {
-
-              //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));
-              clsToF = lTrack->GetTPCClusterInfo(2,1); //NOTE ask friederike
-                
-    }
-
-
-    if( clsToF < fMinClsTPCToF){
-    return kFALSE;
-    }
-
-
-
-   return kTRUE;
-}
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
-
-    // Electron Identification Cuts for Photon reconstruction
-
-    if(!fPIDResponse){  InitPIDResponse();  }// Try to reinitialize PID Response
-    if(!fPIDResponse){  AliError("No PID Response"); return kFALSE;}// if still missing fatal error
-
-
-
-    //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;
-
-
-
-    Int_t cutIndex=0;
-
-    if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-    if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
-    if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
-
-
-    cutIndex++;
-
-
-  if( fDodEdxSigmaITSCut == kTRUE ){
-
-
-        if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||
-                fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){
-
-          if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-          return kFALSE;
-      }
-     
-  }
-
- if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));
-
-
-  cutIndex++;
-
-
-  if(fDodEdxSigmaTPCCut == kTRUE){
-
-
-      // TPC Electron Line
-      if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||
-               fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){
-
-         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-         return kFALSE;
-      }
-      cutIndex++;
-
-      // TPC Pion Line
-       if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){
-         if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC     &&
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){
-
-             if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-             return kFALSE;
-         }
-       }
-       cutIndex++;
-   
-       // High Pt Pion rej
-       if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){
-         if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){
-
-                if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-               return kFALSE;
-         }
-       }
-
-       cutIndex++;
-  }
-
-  else{ cutIndex+=3; }
-
-
-  if(   fDoKaonRejectionLowP == kTRUE   ){
-
-        if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){
-
-          if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
-
-              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-
-              return kFALSE;
-          }
-        }
-  }
-  cutIndex++;
-   
-  if(   fDoProtonRejectionLowP == kTRUE    ){
-
-        if( fCurrentTrack->P()  < fPIDMinPProtonRejectionLowP ){
-          if( TMath::Abs(   fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
-
-              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-              return kFALSE;
-          }
-        }
-  }
-   cutIndex++;
-   
-  if(fDoPionRejectionLowP == kTRUE){
-        if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){
-          if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){
-
-              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-                return kFALSE;
-          }
-        }
-  }
-  cutIndex++;
-
-   
-  if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){
-   if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
-     if(fUseTOFpid){
-        if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||
-           fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){
-           if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-           return kFALSE;
-        }
-     }
-     if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));
-  }
-  else if ( fRequireTOF == kTRUE ) {
-
-            if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-            return kFALSE;
-  }
-     cutIndex++;
-
-  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);
-  if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));
-  if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));
-
-  return kTRUE;
-}
-///________________________________________________________________________
-
-
-AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){
-    //Returns pointer to the track with given ESD label
-    //(Important for AOD implementation, since Track array in AOD data is different
-    //from ESD array, but ESD tracklabels are stored in AOD Tracks)
-
-  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);
-  if(esdEvent) {
-       if(label > event->GetNumberOfTracks() ) return NULL;
-       AliESDtrack * track = esdEvent->GetTrack(label);
-       return track;
-       
-  } else { 
-       for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
-         AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
-         
-         if(track) { 
-               if(track->GetID() == label) {
-                 return track;
-               }
-         }
-       }
-    }
-  
-  cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;
-  return NULL;
-}
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){
-
-
-     for(Int_t i = 0;i<photons->GetEntries();i++){
-
-      AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
-
-      Int_t posLabel = photonComp->GetTrackLabelPositive();
-      Int_t negLabel = photonComp->GetTrackLabelNegative();
-
-      if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){
-        return kFALSE;
-      }
-     }
-
-   return kTRUE;
-}
-/*
-Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )
-{
-//
-// This angle is a measure for the contribution of the opening in polar
-// direction ??0 to the opening angle ?? Pair
-//
-// Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
-//      Master Thesis. Thorsten Dahms. 2005
-// https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
-//
-        Double_t momPos[3];
-        Double_t momNeg[3];
-        if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );
-        if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );
-
-        TVector3 posDaughter;
-        TVector3 negDaughter;
-
-        posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );
-        negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );
-
-        Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();
-        Double_t openingAngle =  posDaughter.Angle( negDaughter );  //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );
-
-        if( openingAngle < 1e-20 ) return 0.;
-
-        Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );
-
-        return psiAngle;
-}*/
-
-Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )
-{
-//
-// Returns true if it is a gamma conversion according to psi pair value
-//
-        return ( (deltaPhi > fDeltaPhiCutMin  &&  deltaPhi < fDeltaPhiCutMax) &&
-        TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
-///Update the cut string (if it has been created yet)
-
-  if(fCutString && fCutString->GetString().Length() == kNCuts) {
-//         cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
-       fCutString->SetString(GetCutNumber());
-  } else {
-//         cout << "fCutString not yet initialized, will not be updated" << endl;
-       return kFALSE;
-  }
- // cout << fCutString->GetString().Data() << endl;
-  return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
-   // Initialize Cuts from a given Cut string
-
-//   out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
-  if(analysisCutSelection.Length()!=kNCuts) {
-       AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
-       return kFALSE;
-  }
-  if(!analysisCutSelection.IsDigit()){
-       AliError("Cut selection contains characters");
-       return kFALSE;
-  }
-  
-  const char *cutSelection = analysisCutSelection.Data();
-  #define ASSIGNARRAY(i)       fCuts[i] = cutSelection[i] - '0'
-  for(Int_t ii=0;ii<kNCuts;ii++){
-      ASSIGNARRAY(ii);
-  }
-
-  // TestFlag
-  if(fCuts[0] !=9){
-    AliError("Analysis Cut Selection does not start with 9");
-       PrintCuts();
-    return kFALSE;
-  }
-
-  // Set Individual Cuts
-  for(Int_t ii=0;ii<kNCuts;ii++){
-      if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
-  }
-
-  //PrintCuts();
-
-    return kTRUE;
-}
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
-  ///Set individual cut ID
-
-  //cout << "Updating cut  " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
-
-  switch (cutID) {
-  case kgoodId:
-       fCuts[kgoodId] = value;
-       if(value != 9) {
-         cout << "Error:: First value of cut string is wrong, aborting!!" << endl;
-         return kFALSE;
-       } else {
-         return kTRUE;
-       }
-
-  case kededxSigmaITSCut:
-       if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented 
-         fCuts[kededxSigmaITSCut] = value;
-         UpdateCutString(cutID, value);
-         return kTRUE;
-       } else return kFALSE;
-
- case kededxSigmaTPCCut:
-        if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented 
-          fCuts[kededxSigmaTPCCut] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kpidedxSigmaTPCCut:
-        if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented
-          fCuts[kpidedxSigmaTPCCut] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kpiMinMomdedxSigmaTPCCut:
-       if( SetMinMomPiondEdxTPCCut(value)) {
-         fCuts[kpiMinMomdedxSigmaTPCCut] = value;
-         UpdateCutString(cutID, value);
-         return kTRUE;
-       } else return kFALSE;
-
-  case kpiMaxMomdedxSigmaTPCCut:
-        if( SetMaxMomPiondEdxTPCCut(value)) {
-          fCuts[kpiMaxMomdedxSigmaTPCCut] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kLowPRejectionSigmaCut:
-        if( SetLowPRejectionCuts(value) ) {
-          fCuts[kLowPRejectionSigmaCut] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-
-  case kTOFelectronPID:
-        if( SetTOFElectronPIDCut(value)) {
-          fCuts[kTOFelectronPID] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-  case kclsITSCut:
-       if( SetITSClusterCut(value) ) {
-         fCuts[kclsITSCut] = value;
-         UpdateCutString(cutID, value);
-         return kTRUE;                 
-        } else return kFALSE;
-  case kclsTPCCut:
-       if( SetTPCClusterCut(value)) {
-         fCuts[kclsTPCCut] = value;
-         UpdateCutString(cutID, value);
-         return kTRUE;
-       } else return kFALSE;
-
-  case ketaCut:
-       if( SetEtaCut(value)) {
-         fCuts[ketaCut] = value;
-         UpdateCutString(cutID, value);
-         return kTRUE;
-       } else return kFALSE;
-   case kPsiPair:
-        if( SetPsiPairCut(value)) {
-          fCuts[kPsiPair] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kRejectSharedElecGamma:
-        if( SetRejectSharedElecGamma(value)) {
-          fCuts[kRejectSharedElecGamma] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kBackgroundScheme:
-        if( SetBackgroundScheme(value)) {
-          fCuts[kBackgroundScheme] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kNumberOfRotations:
-        if( SetNumberOfRotations(value)) {
-          fCuts[kNumberOfRotations] = value;
-          UpdateCutString(cutID, value);
-          return kTRUE;
-        } else return kFALSE;
-
-  case kNCuts:
-       cout << "Error:: Cut id out of range"<< endl;
-       return kFALSE;
-  }
-
-  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
-  return kFALSE;
-
-  //PrintCuts();
-  
-}
-
-///________________________________________________________________________
-
-void AliDalitzElectronCuts::PrintCuts() {
-    // Print out current Cut Selection
-  for(Int_t ic = 0; ic < kNCuts; ic++) {
-       printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
-  }
-
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)
-{   // Set Cut
-
-       switch(ededxSigmaCut){
-
-                case 0: 
-                        fDodEdxSigmaITSCut = kFALSE;
-                        fPIDnSigmaBelowElectronLineITS=-100;
-                        fPIDnSigmaAboveElectronLineITS= 100;
-                        break;
-               case 1: // -10,10
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-10;
-                       fPIDnSigmaAboveElectronLineITS=10;
-                       break;
-               case 2: // -6,7
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-6;
-                       fPIDnSigmaAboveElectronLineITS=7;
-                       break;
-               case 3: // -5,5
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-5;
-                       fPIDnSigmaAboveElectronLineITS=5;
-                       break;
-               case 4: // -4,5
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-4;
-                       fPIDnSigmaAboveElectronLineITS=5;
-                       break;
-               case 5: // -3,5
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-3;
-                       fPIDnSigmaAboveElectronLineITS=5;
-                       break;
-               case 6: // -4,4
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-4;
-                       fPIDnSigmaAboveElectronLineITS=4;
-                       break;
-               case 7: // -2.5,4
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-2.5;
-                       fPIDnSigmaAboveElectronLineITS=4;
-                       break;
-               case 8: // -2,3.5
-                        fDodEdxSigmaITSCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineITS=-2;
-                       fPIDnSigmaAboveElectronLineITS=3.5;
-                       break;
-               default:
-                       cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
-                       return kFALSE;
-        
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
-{   // Set Cut
-               switch(ededxSigmaCut){
-
-                case 0: fDodEdxSigmaTPCCut = kFALSE;
-                        fPIDnSigmaBelowElectronLineTPC=-10;
-                        fPIDnSigmaAboveElectronLineTPC=10;
-                        break;
-               case 1: // -10,10
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-10;
-                       fPIDnSigmaAboveElectronLineTPC=10;
-                       break;
-               case 2: // -6,7
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-6;
-                       fPIDnSigmaAboveElectronLineTPC=7;
-                       break;
-               case 3: // -5,5
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-5;
-                       fPIDnSigmaAboveElectronLineTPC=5;
-                       break;
-               case 4: // -4,5
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-4;
-                       fPIDnSigmaAboveElectronLineTPC=5;
-                       break;  
-               case 5: // -3,5
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-3;
-                       fPIDnSigmaAboveElectronLineTPC=5;
-                       break;
-               case 6: // -4,4
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-4;
-                       fPIDnSigmaAboveElectronLineTPC=4;
-                       break;
-               case 7: // -2.5,4
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-2.5;
-                       fPIDnSigmaAboveElectronLineTPC=4;
-                       break;
-               case 8: // -2,3.5
-                        fDodEdxSigmaTPCCut = kTRUE;
-                       fPIDnSigmaBelowElectronLineTPC=-2;
-                       fPIDnSigmaAboveElectronLineTPC=3.5;
-                       break;
-               default:
-                       cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;
-                       return kFALSE;
-        
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
-{   // Set Cut
-
-       switch(pidedxSigmaCut){
-                
-                case 0: fPIDnSigmaAbovePionLineTPC= 0;
-                        fPIDnSigmaAbovePionLineTPCHighPt=-100;
-                        break;
-               case 1:  // -10
-                       fPIDnSigmaAbovePionLineTPC=-10;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 2:  // 1
-                       fPIDnSigmaAbovePionLineTPC=-1;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 3:   // 0
-                       fPIDnSigmaAbovePionLineTPC=0;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 4:  // 1
-                       fPIDnSigmaAbovePionLineTPC=1;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 5:  // 1
-                       fPIDnSigmaAbovePionLineTPC=2.;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 6:  // 1
-                       fPIDnSigmaAbovePionLineTPC=2.5;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 7:
-                       fPIDnSigmaAbovePionLineTPC=3.0; // We need a bit less tight cut on dE/dx
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 8:  // 1
-                       fPIDnSigmaAbovePionLineTPC=3.5;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-10;
-                       break;
-               case 9:  // 1
-                       fPIDnSigmaAbovePionLineTPC=1.5;
-                       fPIDnSigmaAbovePionLineTPCHighPt=-1.0;
-                       break;
-               default:
-                       cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;
-                       return kFALSE;
-       }
-       return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)
-{   // Set Cut
-       switch(piMomdedxSigmaCut){
-                
-                case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
-                        break;
-               case 1:  // 50.0 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=50.;
-                       break;
-               case 2:  // 20.0 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=20.;
-                       break;
-               case 3:  // 1.5 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=1.5;
-                       break;
-               case 4:  // 1. GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=1.;
-                       break;  
-               case 5:  // 0.5 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=0.5;
-                       break;
-               case 6:  // 0.4 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=0.4;
-                       break;    
-               case 7:  // 0.3 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=0.3;
-                       break;
-               case 8:  // 0.25 GeV
-                       fPIDMinPnSigmaAbovePionLineTPC=0.25;
-                       break;
-               default:
-                       cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;
-                       return kFALSE;
-    }
-    return kTRUE;
-}
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){
-
-    
-      if( !fesdTrackCuts ) {
-
-         cout<<"Warning: AliESDtrackCut is not initialized "<<endl;
-        return kFALSE;
-      }
-
-      switch(clsITSCut){
-
-       case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
-               break;
-        case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
-               break;  //1 hit first layer of SPD
-        case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
-               break; //1 hit in any layer of SPD
-       case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);
-               fesdTrackCuts->SetMinNClustersITS(4);
-                // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD  
-                break;
-        case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
-                fesdTrackCuts->SetMinNClustersITS(3);
-                // 3 hits in total in the ITS. At least 1 hit in any layer of SPD
-                break;
-       default:
-        cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;
-        return kFALSE;
-    }
-
-return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)
-{   // Set Cut
-    switch(clsTPCCut){
-    case 0: // 0
-       fMinClsTPC= 0.;
-       break;
-    case 1:  // 70
-       fMinClsTPC= 70.;
-       break;
-    case 2:  // 80
-       fMinClsTPC= 80.;
-       break;
-    case 3:  // 100
-       fMinClsTPC= 100.;
-       break;
-    case 4:  // 0% of findable clusters
-       fMinClsTPCToF= 0.0;
-       fUseCorrectedTPCClsInfo=0;
-       break;
-    case 5:  // 35% of findable clusters
-       fMinClsTPCToF= 0.35;
-       fUseCorrectedTPCClsInfo=0;
-       break;
-    case 6:  // 60% of findable clusters
-       fMinClsTPCToF= 0.6;
-       fUseCorrectedTPCClsInfo=0;
-       break;
-    case 7:  // 70% of findable clusters
-       fMinClsTPCToF= 0.7;
-       fUseCorrectedTPCClsInfo=0;
-       break;
-    default:
-       cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;
-       return kFALSE;
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
-{ 
-  // Set eta Cut
-       switch(etaCut){
-                case 0: fEtaCut         = 100.;
-                        break;
-               case 1: // 1.4
-                       fEtaCut         = 1.4;
-                       break;
-               case 2: // 1.2
-                       fEtaCut         = 1.2;
-                       break;
-               case 3: // 0.9
-                       fEtaCut         = 0.9;
-                       break;
-               case 4: // 0.8
-                       fEtaCut         = 0.8;
-                       break;
-               case 5: // 0.75
-                       fEtaCut         = 0.75;
-                       break;
-               default:
-                       cout<<"Warning: EtaCut not defined "<<etaCut<<endl;
-                       return kFALSE;
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)
-{   // Set Cut
-   switch(piMaxMomdedxSigmaCut){
-
-                case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;
-                        break;
-               case 1:  // 100. GeV
-                       fPIDMaxPnSigmaAbovePionLineTPC=100.;
-                       break;
-               case 2:  // 5. GeV
-                       fPIDMaxPnSigmaAbovePionLineTPC=5.;
-                       break;
-               case 3:  // 4. GeV
-                       fPIDMaxPnSigmaAbovePionLineTPC=4.;
-                       break;
-               case 4:  // 3.5 GeV
-                       fPIDMaxPnSigmaAbovePionLineTPC=3.5;
-                       break;
-               case 5:  // 3. GeV
-                       fPIDMaxPnSigmaAbovePionLineTPC=3.;
-                       break;
-               default:
-                       cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;
-                       return kFALSE;
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
-{   // Set Cut
-    switch(LowPRejectionSigmaCut){
-       case 0:  //
-        fDoKaonRejectionLowP=kFALSE;
-        fDoProtonRejectionLowP=kFALSE;
-        fDoPionRejectionLowP=kFALSE;
-       fPIDnSigmaAtLowPAroundKaonLine=0;
-       fPIDnSigmaAtLowPAroundProtonLine=0;
-       fPIDnSigmaAtLowPAroundPionLine=0;
-       break;
-    case 1:  //
-        fDoKaonRejectionLowP=kTRUE;
-        fDoProtonRejectionLowP=kTRUE;
-        fDoPionRejectionLowP=kTRUE;
-       fPIDnSigmaAtLowPAroundKaonLine=0.5;
-       fPIDnSigmaAtLowPAroundProtonLine=0.5;
-       fPIDnSigmaAtLowPAroundPionLine=0.5;
-       break;
-    case 2:  //
-        fDoKaonRejectionLowP=kTRUE;
-        fDoProtonRejectionLowP=kTRUE;
-        fDoPionRejectionLowP=kTRUE;
-       fPIDnSigmaAtLowPAroundKaonLine=1;
-       fPIDnSigmaAtLowPAroundProtonLine=1;
-       fPIDnSigmaAtLowPAroundPionLine=1;
-       break;
-    case 3:  //
-        fDoKaonRejectionLowP=kTRUE;
-        fDoProtonRejectionLowP=kTRUE;
-        fDoPionRejectionLowP=kTRUE;
-       fPIDnSigmaAtLowPAroundKaonLine=1.5;
-       fPIDnSigmaAtLowPAroundProtonLine=1.5;
-       fPIDnSigmaAtLowPAroundPionLine=1.5;
-       break;
-    case 4:  //
-        fDoKaonRejectionLowP=kTRUE;
-        fDoProtonRejectionLowP=kTRUE;
-        fDoPionRejectionLowP=kTRUE;
-       fPIDnSigmaAtLowPAroundKaonLine=2.0;
-       fPIDnSigmaAtLowPAroundProtonLine=2.0;
-       fPIDnSigmaAtLowPAroundPionLine=2.0;
-       break;
-    case 5:  //
-        fDoKaonRejectionLowP=kTRUE;
-        fDoProtonRejectionLowP=kTRUE;
-        fDoPionRejectionLowP=kTRUE;
-       fPIDnSigmaAtLowPAroundKaonLine=2.0;
-       fPIDnSigmaAtLowPAroundProtonLine=2.0;
-       fPIDnSigmaAtLowPAroundPionLine=2.5;
-       break;
-    case 6:  //
-        fDoKaonRejectionLowP=kTRUE;
-        fDoProtonRejectionLowP=kTRUE;
-        fDoPionRejectionLowP=kTRUE;
-       fPIDnSigmaAtLowPAroundKaonLine=0.;
-       fPIDnSigmaAtLowPAroundProtonLine=0.;
-       fPIDnSigmaAtLowPAroundPionLine=2.;
-       break;
-    case 7: //
-        fDoKaonRejectionLowP=kFALSE;
-        fDoProtonRejectionLowP=kFALSE;
-        fDoPionRejectionLowP=kTRUE;
-        fPIDnSigmaAtLowPAroundKaonLine=0.0;
-        fPIDnSigmaAtLowPAroundProtonLine=0.0;
-        fPIDnSigmaAtLowPAroundPionLine=1.0;
-        break;
-    case 8:
-        fDoKaonRejectionLowP=kFALSE;
-        fDoProtonRejectionLowP=kFALSE;
-        fDoPionRejectionLowP=kTRUE;
-        fPIDnSigmaAtLowPAroundKaonLine=0.;
-        fPIDnSigmaAtLowPAroundProtonLine=0.;
-        fPIDnSigmaAtLowPAroundPionLine=0.5; 
-        break; 
-    default:
-        cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;
-       return kFALSE;
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){
-    // Set Cut
-    switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////
-    case 0: // no cut
-       fUseTOFpid = kFALSE;
-       fTofPIDnSigmaBelowElectronLine=-100;
-       fTofPIDnSigmaAboveElectronLine=100;
-       break;
-    case 1: // -7,7
-       fUseTOFpid = kTRUE;
-       fTofPIDnSigmaBelowElectronLine=-7;
-       fTofPIDnSigmaAboveElectronLine=7;
-       break;
-    case 2: // -5,5
-       fUseTOFpid = kTRUE;
-       fTofPIDnSigmaBelowElectronLine=-5;
-       fTofPIDnSigmaAboveElectronLine=5;
-       break;
-    case 3: // -3,5
-       fUseTOFpid = kTRUE;
-       fTofPIDnSigmaBelowElectronLine=-3;
-       fTofPIDnSigmaAboveElectronLine=5;
-       break;
-    case 4: // -2,3
-       fUseTOFpid = kTRUE;
-       fTofPIDnSigmaBelowElectronLine=-2;
-       fTofPIDnSigmaAboveElectronLine=3;
-       break;
-    case 5: // -3, 3 TOF mandatory
-        fRequireTOF = kTRUE;
-        fUseTOFpid  = kTRUE;
-        fTofPIDnSigmaBelowElectronLine= -3;
-        fTofPIDnSigmaAboveElectronLine=  3;
-        break;
-    default:
-        cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;
-       return kFALSE;
-    } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
-    return kTRUE;
-}
-///_______________________________________________________________________________
-
-Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {
-  
-
-  switch(psiCut) {
-  case 0:
-        fDoPsiPairCut = kFALSE;
-        fPsiPairCut = 10000.; //
-        fDeltaPhiCutMin = -1000.;
-        fDeltaPhiCutMax =  1000.;
-        
-        break;
-  case 1:
-        fDoPsiPairCut = kTRUE;
-        fPsiPairCut = 0.45; // Standard
-        fDeltaPhiCutMin = 0.;
-        fDeltaPhiCutMax = 0.12;
-        break;
-  default:
-      cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;
-      return kFALSE;
-  }
-
-  return kTRUE;
-}
-
-///_______________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {
-  
-
-  switch(RCut) {
-  case 0:
-        fDoRejectSharedElecGamma = kFALSE;
-        fRadiusCut = 10000; // 
-        break;
-  case 1:
-        fDoRejectSharedElecGamma = kTRUE;
-        fRadiusCut = 2.0; // cm 
-        break;
-  case 2:
-        fDoRejectSharedElecGamma = kTRUE;
-        fRadiusCut = 3.0; // Standard
-        break;
-  case 3:
-        fDoRejectSharedElecGamma = kTRUE;
-        fRadiusCut = 4.0; // 
-        break;
-  case 4:
-        fDoRejectSharedElecGamma = kTRUE;
-        fRadiusCut = 5.0; // 
-        break;
-  case 5:
-        fDoRejectSharedElecGamma = kTRUE;
-        fRadiusCut = 10.0; // 
-        break;
-  case 6:
-        fDoRejectSharedElecGamma = kTRUE;
-        fRadiusCut = 15.0; // 
-        break;
-  default:
-      cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;
-      return kFALSE;
-  }
-
-  return kTRUE;
-}
-///__________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){
-
-    // Set Cut
-    switch(BackgroundScheme){
-
-    case 0: //Rotation
-            fBKGMethod = 0;
-            fUseTrackMultiplicityForBG = kFALSE;
-        break;
-    case 1: // mixed event with V0 multiplicity
-            fBKGMethod  = 1;
-            fUseTrackMultiplicityForBG = kFALSE;
-        break;
-    case 2: // mixed event with track multiplicity
-            fUseTrackMultiplicityForBG = kTRUE;
-            fBKGMethod  = 1;
-        break;
-    case 3: //Rotation
-           fUseTrackMultiplicityForBG = kFALSE;
-            fBKGMethod  = 2;
-        break;
-    case 4: //Rotation
-            fUseTrackMultiplicityForBG = kTRUE;
-            fBKGMethod  = 2;
-        break;
-    case 5: fUseTrackMultiplicityForBG = kTRUE;
-            fBKGMethod  = 3;
-        break;
-
-    default:
-        cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
-        return kFALSE;
-    }
-    return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)
-{   // Set Cut
-    switch(NumberOfRotations){
-    case 0:
-        fnumberOfRotationEventsForBG = 5;
-        break;
-    case 1:
-        fnumberOfRotationEventsForBG = 10;
-        break;
-    case 2:
-        fnumberOfRotationEventsForBG = 15;
-        break;
-    case 3:
-        fnumberOfRotationEventsForBG = 20;
-        break;
-    case 4:
-        fnumberOfRotationEventsForBG = 2;
-        break;
-    case 5:
-        fnumberOfRotationEventsForBG = 50;
-        break;
-    case 6:
-        fnumberOfRotationEventsForBG = 80;
-        break;
-    case 7:
-        fnumberOfRotationEventsForBG = 100;
-        break;
-    default:
-        cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;
-        return kFALSE;
-    }
-    return kTRUE;
-}
-///________________________________________________________________________
-TString AliDalitzElectronCuts::GetCutNumber(){
-    // returns TString with current cut number
-  TString a(kNCuts);
-  for(Int_t ii=0;ii<kNCuts;ii++){
-       a.Append(Form("%d",fCuts[ii]));
-  }
-  return a;
-}
-
-
-///________________________________________________________________________
-AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){
-    //Create and return standard 2010 PbPb cuts
-    AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
-    if(!cuts->InitializeCutsFromCutString("9069640364102")){
-       cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
-    return cuts;
-}
-
-///________________________________________________________________________
-AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){
-    //Create and return standard 2010 PbPb cuts
-    AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");
-                                          
-    if(!cuts->InitializeCutsFromCutString("9069640364102")){
-       cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
-     return cuts;
-}
-
+\r
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ *                                                                       *\r
+ * Authors: Svein Lindal, Daniel Lohner                                          *\r
+ * Version 1.0                                                           *\r
+ *                                                                       *\r
+ * Permission to use, copy, modify and distribute this software and its          *\r
+ * documentation strictly for non-commercial purposes is hereby granted          *\r
+ * without fee, provided that the above copyright notice appears in all          *\r
+ * copies and that both the copyright notice and this permission notice          *\r
+ * appear in the supporting documentation. The authors make no claims    *\r
+ * about the suitability of this software for any purpose. It is         *\r
+ * provided "as is" without express or implied warranty.                 *\r
+ **************************************************************************/\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class handling all kinds of selection cuts for\r
+// Gamma Conversion analysis\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
+\r
+\r
+#include "AliDalitzElectronCuts.h"\r
+#include "AliAODConversionPhoton.h"\r
+#include "AliKFVertex.h"\r
+#include "AliAODTrack.h"\r
+#include "AliESDtrack.h"\r
+#include "AliAnalysisManager.h"\r
+#include "AliInputEventHandler.h"\r
+#include "AliMCEventHandler.h"\r
+#include "AliAODHandler.h"\r
+#include "AliPIDResponse.h"\r
+#include "TH1.h"\r
+#include "TH2.h"\r
+#include "AliStack.h"\r
+#include "TObjString.h"\r
+#include "AliAODEvent.h"\r
+#include "AliESDEvent.h"\r
+#include "TList.h"\r
+class iostream;\r
+\r
+using namespace std;\r
+\r
+ClassImp(AliDalitzElectronCuts)\r
+\r
+\r
+const char* AliDalitzElectronCuts::fgkCutNames[AliDalitzElectronCuts::kNCuts] = {\r
+"GoodId",\r
+"ededxSigmaITSCut",\r
+"ededxSigmaTPCCut",\r
+"pidedxSigmaTPCCut",\r
+"piMinMomdedxSigmaTPCCut",\r
+"piMaxMomdedxSigmaTPCCut",\r
+"LowPRejectionSigmaCut",\r
+"kTOFelectronPID",\r
+"clsITSCut",\r
+"clsTPCCut",\r
+"EtaCut",\r
+"PsiPair",\r
+"RejectSharedElecGamma",\r
+"BackgroundScheme",\r
+"NumberOfRotations",\r
+};\r
+\r
+//________________________________________________________________________\r
+AliDalitzElectronCuts::AliDalitzElectronCuts(const char *name,const char *title) : AliAnalysisCuts(name,title),\r
+    fHistograms(NULL),\r
+    fPIDResponse(NULL),\r
+    fesdTrackCuts(NULL),\r
+    fEtaCut(0.9),\r
+    fRadiusCut(1000.0),\r
+    fPsiPairCut(0.45),\r
+    fDeltaPhiCutMin(0.),\r
+    fDeltaPhiCutMax(0.12),\r
+    fMinClsTPC(0), // minimum clusters in the TPC\r
+    fMinClsTPCToF(0), // minimum clusters to findable clusters\r
+    fDodEdxSigmaITSCut(kFALSE),\r
+    fDodEdxSigmaTPCCut(kTRUE),\r
+    fDoTOFsigmaCut(kFALSE), // RRnewTOF\r
+    fDoRejectSharedElecGamma(kFALSE),\r
+    fDoPsiPairCut(kFALSE),\r
+    fPIDnSigmaAboveElectronLineITS(100),\r
+    fPIDnSigmaBelowElectronLineITS(-100),\r
+    fPIDnSigmaAboveElectronLineTPC(100),\r
+    fPIDnSigmaBelowElectronLineTPC(-100),\r
+    fPIDnSigmaAbovePionLineTPC(0),\r
+    fPIDnSigmaAbovePionLineTPCHighPt(-100),\r
+    fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF\r
+    fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF\r
+    fPIDMinPnSigmaAbovePionLineTPC(0),\r
+    fPIDMaxPnSigmaAbovePionLineTPC(0),\r
+    fDoKaonRejectionLowP(kFALSE),\r
+    fDoProtonRejectionLowP(kFALSE),\r
+    fDoPionRejectionLowP(kFALSE),\r
+    fPIDnSigmaAtLowPAroundKaonLine(0),\r
+    fPIDnSigmaAtLowPAroundProtonLine(0),\r
+    fPIDnSigmaAtLowPAroundPionLine(0),\r
+    fPIDMinPKaonRejectionLowP(1.5),\r
+    fPIDMinPProtonRejectionLowP(2.0),\r
+    fPIDMinPPionRejectionLowP(0.5),\r
+    fUseCorrectedTPCClsInfo(kFALSE),\r
+    fUseTOFpid(kFALSE),\r
+    fRequireTOF(kFALSE),\r
+    fUseTrackMultiplicityForBG(kFALSE),\r
+    fBKGMethod(0),\r
+    fnumberOfRotationEventsForBG(0),\r
+    fCutString(NULL),\r
+    hCutIndex(NULL),\r
+    hdEdxCuts(NULL),\r
+    hITSdEdxbefore(NULL),\r
+    hITSdEdxafter(NULL),\r
+    hTPCdEdxbefore(NULL),\r
+    hTPCdEdxafter(NULL),\r
+    hTPCdEdxSignalbefore(NULL),\r
+    hTPCdEdxSignalafter(NULL),\r
+    hTOFbefore(NULL),\r
+    hTOFafter(NULL)\r
+   {\r
+    InitPIDResponse();\r
+    for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}\r
+    fCutString=new TObjString((GetCutNumber()).Data());\r
+\r
+   //fesdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");\r
+   // Using standard function for setting Cuts\r
+    Bool_t selectPrimaries=kTRUE;\r
+    fesdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);\r
+}\r
+\r
+//________________________________________________________________________\r
+AliDalitzElectronCuts::~AliDalitzElectronCuts() {\r
+    // Destructor\r
+  //Deleting fHistograms leads to seg fault it it's added to output collection of a task\r
+  // if(fHistograms)\r
+  //   delete fHistograms;\r
+  // fHistograms = NULL;\r
+\r
+   if(fCutString != NULL){\r
+      delete fCutString;\r
+      fCutString = NULL;\r
+   }\r
+\r
+\r
+}\r
+\r
+//________________________________________________________________________\r
+void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TString cutNumber){\r
+\r
+    // Initialize Cut Histograms for QA (only initialized and filled if function is called)\r
+\r
+     TString cutName = "";\r
+    \r
+     if( cutNumber==""){\r
+         cutName = GetCutNumber().Data();\r
+     }\r
+     else {\r
+            cutName = cutNumber.Data();\r
+     } \r
+\r
+    if(fHistograms != NULL){\r
+       delete fHistograms;\r
+       fHistograms=NULL;\r
+    }\r
+    if(fHistograms==NULL){\r
+       fHistograms=new TList();\r
+       if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));\r
+       else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));\r
+    }\r
+\r
+\r
+    hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);\r
+    hCutIndex->GetXaxis()->SetBinLabel(kElectronIn+1,"in");\r
+    hCutIndex->GetXaxis()->SetBinLabel(kNoTracks+1,"no tracks");\r
+    hCutIndex->GetXaxis()->SetBinLabel(kTrackCuts+1,"Track cuts");\r
+    hCutIndex->GetXaxis()->SetBinLabel(kdEdxCuts+1,"dEdx");\r
+    hCutIndex->GetXaxis()->SetBinLabel(kElectronOut+1,"out");\r
+    fHistograms->Add(hCutIndex);\r
+\r
+\r
+\r
+    // dEdx Cuts\r
+    hdEdxCuts=new TH1F(Form("dEdxCuts %s",cutName.Data()),"dEdxCuts",10,-0.5,9.5);\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(1,"in");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(2,"ITSelectron");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(3,"TPCelectron");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(4,"TPCpion");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(5,"TPCpionhighp");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(6,"TPCkaonlowprej");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(7,"TPCprotonlowprej");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(8,"TPCpionlowprej");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(9,"TOFelectron");\r
+    hdEdxCuts->GetXaxis()->SetBinLabel(10,"out");\r
+    fHistograms->Add(hdEdxCuts);\r
+    \r
+\r
+\r
+    TAxis *AxisBeforeITS  = NULL;\r
+    TAxis *AxisBeforedEdx = NULL;\r
+    TAxis *AxisBeforeTOF  = NULL;\r
+    TAxis *AxisBeforedEdxSignal = NULL;\r
+\r
+    if(preCut){\r
+\r
+\r
+       hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,150,0.05,20,400,-10,10);\r
+       fHistograms->Add(hITSdEdxbefore);\r
+       AxisBeforeITS = hITSdEdxbefore->GetXaxis();\r
+\r
+       hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,150,0.05,20,400,-10,10);\r
+       fHistograms->Add(hTPCdEdxbefore);\r
+       AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();\r
+\r
+       hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,150,0.05,20.0,800,0.0,200);\r
+       fHistograms->Add(hTPCdEdxSignalbefore);\r
+       AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();\r
+\r
+\r
+       hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,150,0.05,20,400,-6,10);\r
+       fHistograms->Add(hTOFbefore);\r
+       AxisBeforeTOF = hTOFbefore->GetXaxis();\r
+\r
+    }\r
+\r
+\r
+    hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,150,0.05,20,400, -10,10);\r
+    fHistograms->Add(hITSdEdxafter);\r
+\r
+    hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,150,0.05,20,400, -10,10);\r
+    fHistograms->Add(hTPCdEdxafter);\r
+\r
+    hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,150,0.05,20.0,800,0.0,200);\r
+    fHistograms->Add(hTPCdEdxSignalafter);\r
+\r
+    hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,150,0.05,20,400,-6,10);\r
+    fHistograms->Add(hTOFafter);\r
+\r
+    TAxis *AxisAfter = hTPCdEdxafter->GetXaxis(); \r
+    Int_t bins = AxisAfter->GetNbins();\r
+    Double_t from = AxisAfter->GetXmin();\r
+    Double_t to = AxisAfter->GetXmax();\r
+    Double_t *newBins = new Double_t[bins+1];\r
+    newBins[0] = from;\r
+    Double_t factor = TMath::Power(to/from, 1./bins);\r
+    for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];\r
+    AxisAfter->Set(bins, newBins);\r
+    AxisAfter = hTOFafter->GetXaxis(); \r
+    AxisAfter->Set(bins, newBins);\r
+    AxisAfter = hITSdEdxafter->GetXaxis();\r
+    AxisAfter->Set(bins,newBins); \r
+    AxisAfter = hTPCdEdxSignalafter->GetXaxis();\r
+    AxisAfter->Set(bins,newBins);\r
+    \r
+    if(preCut){\r
+       AxisBeforeITS->Set(bins, newBins);\r
+       AxisBeforedEdx->Set(bins, newBins);\r
+       AxisBeforedEdxSignal->Set(bins,newBins);\r
+       AxisBeforeTOF->Set(bins, newBins);\r
+       \r
+    }\r
+    delete [] newBins;\r
+\r
+        \r
+    // Event Cuts and Info\r
+}\r
+\r
+\r
+//________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::InitPIDResponse(){\r
+\r
+// Set Pointer to AliPIDResponse\r
+\r
+  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
+\r
+  if(man) {\r
+\r
+    AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
+    fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();\r
+    if(fPIDResponse)return kTRUE;\r
+\r
+  }\r
+\r
+  return kFALSE;\r
+}\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack)\r
+{   \r
+        if( labelParticle < 0 ) return kFALSE;\r
+        if( fMCStack->IsPhysicalPrimary(labelParticle) == kFALSE ) return kFALSE;\r
+\r
+        TParticle* particle = fMCStack->Particle(labelParticle);\r
+\r
+        if( TMath::Abs( particle->GetPdgCode() ) != 11)  return kFALSE;\r
+        if( TMath::Abs( particle->Eta() ) > fEtaCut   )  return kFALSE;\r
+\r
+return kTRUE;\r
+}\r
+\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::ElectronIsSelected(AliESDtrack* lTrack)\r
+{\r
+    //Selection of Reconstructed electrons\r
+\r
+    if(hCutIndex)hCutIndex->Fill(kElectronIn);\r
+\r
+    if (lTrack == NULL){\r
+      if(hCutIndex)hCutIndex->Fill(kNoTracks);\r
+         return kFALSE;  \r
+    }   \r
+       \r
+    if ( ! lTrack->GetConstrainedParam() ){\r
+        return kFALSE;\r
+    }\r
+    AliVTrack * track = dynamic_cast<AliVTrack*>(lTrack);\r
+\r
+\r
+    // Track Cuts\r
+    if( !TrackIsSelected(lTrack) ){\r
+         if(hCutIndex)hCutIndex->Fill(kTrackCuts);\r
+         return kFALSE;\r
+    }\r
+\r
+\r
+    // dEdx Cuts\r
+    if( ! dEdxCuts( track ) ) {\r
+         if(hCutIndex)hCutIndex->Fill(kdEdxCuts);\r
+         return kFALSE;\r
+\r
+    }\r
+\r
+    //Electron passed the cuts\r
+    if(hCutIndex)hCutIndex->Fill(kElectronOut);\r
+\r
+\r
+    return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::TrackIsSelected(AliESDtrack* lTrack) {\r
+    // Track Selection for Photon Reconstruction\r
+\r
+\r
+\r
+    if( ! fesdTrackCuts->AcceptTrack(lTrack) ){\r
+\r
+        return kFALSE;\r
+    }\r
+\r
+   if(  TMath::Abs( lTrack->Eta()) > fEtaCut ) {\r
+\r
+        return kFALSE;\r
+    }\r
+\r
+    if( lTrack->GetNcls(1) < fMinClsTPC ) {\r
+\r
+        return kFALSE;\r
+    }\r
+\r
+    //Findable clusters\r
+\r
+    Double_t clsToF=0;\r
+\r
+\r
+    if (!fUseCorrectedTPCClsInfo ){\r
+        if(lTrack->GetTPCNclsF()!=0){\r
+\r
+              clsToF = (Double_t)lTrack->GetNcls(1)/(Double_t)lTrack->GetTPCNclsF();\r
+        }// Ncluster/Nfindablecluster\r
+    }\r
+    else {\r
+\r
+              //clsToF = lTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(photon->GetConversionRadius()));\r
+              clsToF = lTrack->GetTPCClusterInfo(2,1); //NOTE ask friederike\r
+                \r
+    }\r
+\r
+\r
+    if( clsToF < fMinClsTPCToF){\r
+    return kFALSE;\r
+    }\r
+\r
+\r
+\r
+   return kTRUE;\r
+}\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){\r
+\r
+    // Electron Identification Cuts for Photon reconstruction\r
+\r
+    if(!fPIDResponse){  InitPIDResponse();  }// Try to reinitialize PID Response\r
+    if(!fPIDResponse){  AliError("No PID Response"); return kFALSE;}// if still missing fatal error\r
+\r
+\r
+\r
+    //cout<<"dEdxCuts: //////////////////////////////////////////////////////////////////////////"<<endl;\r
+\r
+\r
+\r
+    Int_t cutIndex=0;\r
+\r
+    if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+    if(hITSdEdxbefore)hITSdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));\r
+    if(hTPCdEdxbefore)hTPCdEdxbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));\r
+    if(hTPCdEdxSignalbefore)hTPCdEdxSignalbefore->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));\r
+\r
+\r
+    cutIndex++;\r
+\r
+\r
+  if( fDodEdxSigmaITSCut == kTRUE ){\r
+\r
+\r
+        if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||\r
+                fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){\r
+\r
+          if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+          return kFALSE;\r
+      }\r
+     \r
+  }\r
+\r
+ if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));\r
+\r
+\r
+  cutIndex++;\r
+\r
+\r
+  if(fDodEdxSigmaTPCCut == kTRUE){\r
+\r
+\r
+      // TPC Electron Line\r
+      if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||\r
+               fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){\r
+\r
+         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+         return kFALSE;\r
+      }\r
+      cutIndex++;\r
+\r
+      // TPC Pion Line\r
+       if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){\r
+         if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC     &&\r
+                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&\r
+                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){\r
+\r
+             if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+             return kFALSE;\r
+         }\r
+       }\r
+       cutIndex++;\r
+   \r
+       // High Pt Pion rej\r
+       if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){\r
+         if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&\r
+                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&\r
+                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){\r
+\r
+                if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+               return kFALSE;\r
+         }\r
+       }\r
+\r
+       cutIndex++;\r
+  }\r
+\r
+  else{ cutIndex+=3; }\r
+\r
+\r
+  if(   fDoKaonRejectionLowP == kTRUE   ){\r
+\r
+        if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){\r
+\r
+          if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){\r
+\r
+              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+\r
+              return kFALSE;\r
+          }\r
+        }\r
+  }\r
+  cutIndex++;\r
+   \r
+  if(   fDoProtonRejectionLowP == kTRUE    ){\r
+\r
+        if( fCurrentTrack->P()  < fPIDMinPProtonRejectionLowP ){\r
+          if( TMath::Abs(   fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){\r
+\r
+              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+              return kFALSE;\r
+          }\r
+        }\r
+  }\r
+   cutIndex++;\r
+   \r
+  if(fDoPionRejectionLowP == kTRUE){\r
+        if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){\r
+          if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){\r
+\r
+              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                return kFALSE;\r
+          }\r
+        }\r
+  }\r
+  cutIndex++;\r
+\r
+   \r
+  if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){\r
+   if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
+     if(fUseTOFpid){\r
+        if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||\r
+           fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){\r
+           if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+           return kFALSE;\r
+        }\r
+     }\r
+     if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
+  }\r
+  else if ( fRequireTOF == kTRUE ) {\r
+\r
+            if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+            return kFALSE;\r
+  }\r
+     cutIndex++;\r
+\r
+  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+  if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));\r
+  if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));\r
+\r
+  return kTRUE;\r
+}\r
+///________________________________________________________________________\r
+\r
+\r
+AliVTrack *AliDalitzElectronCuts::GetTrack(AliVEvent * event, Int_t label){\r
+    //Returns pointer to the track with given ESD label\r
+    //(Important for AOD implementation, since Track array in AOD data is different\r
+    //from ESD array, but ESD tracklabels are stored in AOD Tracks)\r
+\r
+  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(event);\r
+  if(esdEvent) {\r
+       if(label > event->GetNumberOfTracks() ) return NULL;\r
+       AliESDtrack * track = esdEvent->GetTrack(label);\r
+       return track;\r
+       \r
+  } else { \r
+       for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {\r
+         AliVTrack * track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));\r
+         \r
+         if(track) { \r
+               if(track->GetID() == label) {\r
+                 return track;\r
+               }\r
+         }\r
+       }\r
+    }\r
+  \r
+  cout << "track not found " << label << " " << event->GetNumberOfTracks() << endl;\r
+  return NULL;\r
+}\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::RejectSharedElecGamma(TList *photons, Int_t indexEle){\r
+\r
+\r
+     for(Int_t i = 0;i<photons->GetEntries();i++){\r
+\r
+      AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);\r
+\r
+      Int_t posLabel = photonComp->GetTrackLabelPositive();\r
+      Int_t negLabel = photonComp->GetTrackLabelNegative();\r
+\r
+      if( (photonComp->GetConversionRadius() < fRadiusCut) && (posLabel == indexEle || negLabel == indexEle) ){\r
+        return kFALSE;\r
+      }\r
+     }\r
+\r
+   return kTRUE;\r
+}\r
+/*\r
+Double_t AliDalitzElectronCuts::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg )\r
+{\r
+//\r
+// This angle is a measure for the contribution of the opening in polar\r
+// direction ??0 to the opening angle ?? Pair\r
+//\r
+// Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC\r
+//      Master Thesis. Thorsten Dahms. 2005\r
+// https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf\r
+//\r
+        Double_t momPos[3];\r
+        Double_t momNeg[3];\r
+        if( trackPos->GetConstrainedPxPyPz(momPos) == 0 ) trackPos->GetPxPyPz( momPos );\r
+        if( trackNeg->GetConstrainedPxPyPz(momNeg) == 0 ) trackNeg->GetPxPyPz( momNeg );\r
+\r
+        TVector3 posDaughter;\r
+        TVector3 negDaughter;\r
+\r
+        posDaughter.SetXYZ( momPos[0], momPos[1], momPos[2] );\r
+        negDaughter.SetXYZ( momNeg[0], momNeg[1], momNeg[2] );\r
+\r
+        Double_t deltaTheta = negDaughter.Theta() - posDaughter.Theta();\r
+        Double_t openingAngle =  posDaughter.Angle( negDaughter );  //TMath::ACos( posDaughter.Dot(negDaughter)/(negDaughter.Mag()*posDaughter.Mag()) );\r
+\r
+        if( openingAngle < 1e-20 ) return 0.;\r
+\r
+        Double_t psiAngle = TMath::ASin( deltaTheta/openingAngle );\r
+\r
+        return psiAngle;\r
+}*/\r
+\r
+Bool_t AliDalitzElectronCuts::IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi )\r
+{\r
+//\r
+// Returns true if it is a gamma conversion according to psi pair value\r
+//\r
+        return ( (deltaPhi > fDeltaPhiCutMin  &&  deltaPhi < fDeltaPhiCutMax) &&\r
+        TMath::Abs(psiPair) < ( fPsiPairCut - fPsiPairCut/fDeltaPhiCutMax * deltaPhi ) );\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {\r
+///Update the cut string (if it has been created yet)\r
+\r
+  if(fCutString && fCutString->GetString().Length() == kNCuts) {\r
+//         cout << "Updating cut id in spot number " << cutID << " to " << value << endl;\r
+       fCutString->SetString(GetCutNumber());\r
+  } else {\r
+//         cout << "fCutString not yet initialized, will not be updated" << endl;\r
+       return kFALSE;\r
+  }\r
+ // cout << fCutString->GetString().Data() << endl;\r
+  return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {\r
+   // Initialize Cuts from a given Cut string\r
+\r
+//   out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;\r
+  if(analysisCutSelection.Length()!=kNCuts) {\r
+       AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));\r
+       return kFALSE;\r
+  }\r
+  if(!analysisCutSelection.IsDigit()){\r
+       AliError("Cut selection contains characters");\r
+       return kFALSE;\r
+  }\r
+  \r
+  const char *cutSelection = analysisCutSelection.Data();\r
+  #define ASSIGNARRAY(i)       fCuts[i] = cutSelection[i] - '0'\r
+  for(Int_t ii=0;ii<kNCuts;ii++){\r
+      ASSIGNARRAY(ii);\r
+  }\r
+\r
+  // TestFlag\r
+  if(fCuts[0] !=9){\r
+    AliError("Analysis Cut Selection does not start with 9");\r
+       PrintCuts();\r
+    return kFALSE;\r
+  }\r
+\r
+  // Set Individual Cuts\r
+  for(Int_t ii=0;ii<kNCuts;ii++){\r
+      if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;\r
+  }\r
+\r
+  //PrintCuts();\r
+\r
+    return kTRUE;\r
+}\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {\r
+  ///Set individual cut ID\r
+\r
+  //cout << "Updating cut  " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;\r
+\r
+  switch (cutID) {\r
+  case kgoodId:\r
+       fCuts[kgoodId] = value;\r
+       if(value != 9) {\r
+         cout << "Error:: First value of cut string is wrong, aborting!!" << endl;\r
+         return kFALSE;\r
+       } else {\r
+         return kTRUE;\r
+       }\r
+\r
+  case kededxSigmaITSCut:\r
+       if( SetITSdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented \r
+         fCuts[kededxSigmaITSCut] = value;\r
+         UpdateCutString(cutID, value);\r
+         return kTRUE;\r
+       } else return kFALSE;\r
+\r
+ case kededxSigmaTPCCut:\r
+        if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented \r
+          fCuts[kededxSigmaTPCCut] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kpidedxSigmaTPCCut:\r
+        if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented\r
+          fCuts[kpidedxSigmaTPCCut] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kpiMinMomdedxSigmaTPCCut:\r
+       if( SetMinMomPiondEdxTPCCut(value)) {\r
+         fCuts[kpiMinMomdedxSigmaTPCCut] = value;\r
+         UpdateCutString(cutID, value);\r
+         return kTRUE;\r
+       } else return kFALSE;\r
+\r
+  case kpiMaxMomdedxSigmaTPCCut:\r
+        if( SetMaxMomPiondEdxTPCCut(value)) {\r
+          fCuts[kpiMaxMomdedxSigmaTPCCut] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kLowPRejectionSigmaCut:\r
+        if( SetLowPRejectionCuts(value) ) {\r
+          fCuts[kLowPRejectionSigmaCut] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+\r
+  case kTOFelectronPID:\r
+        if( SetTOFElectronPIDCut(value)) {\r
+          fCuts[kTOFelectronPID] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+  case kclsITSCut:\r
+       if( SetITSClusterCut(value) ) {\r
+         fCuts[kclsITSCut] = value;\r
+         UpdateCutString(cutID, value);\r
+         return kTRUE;                 \r
+        } else return kFALSE;\r
+  case kclsTPCCut:\r
+       if( SetTPCClusterCut(value)) {\r
+         fCuts[kclsTPCCut] = value;\r
+         UpdateCutString(cutID, value);\r
+         return kTRUE;\r
+       } else return kFALSE;\r
+\r
+  case ketaCut:\r
+       if( SetEtaCut(value)) {\r
+         fCuts[ketaCut] = value;\r
+         UpdateCutString(cutID, value);\r
+         return kTRUE;\r
+       } else return kFALSE;\r
+   case kPsiPair:\r
+        if( SetPsiPairCut(value)) {\r
+          fCuts[kPsiPair] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kRejectSharedElecGamma:\r
+        if( SetRejectSharedElecGamma(value)) {\r
+          fCuts[kRejectSharedElecGamma] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kBackgroundScheme:\r
+        if( SetBackgroundScheme(value)) {\r
+          fCuts[kBackgroundScheme] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kNumberOfRotations:\r
+        if( SetNumberOfRotations(value)) {\r
+          fCuts[kNumberOfRotations] = value;\r
+          UpdateCutString(cutID, value);\r
+          return kTRUE;\r
+        } else return kFALSE;\r
+\r
+  case kNCuts:\r
+       cout << "Error:: Cut id out of range"<< endl;\r
+       return kFALSE;\r
+  }\r
+\r
+  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;\r
+  return kFALSE;\r
+\r
+  //PrintCuts();\r
+  \r
+}\r
+\r
+///________________________________________________________________________\r
+\r
+void AliDalitzElectronCuts::PrintCuts() {\r
+    // Print out current Cut Selection\r
+  for(Int_t ic = 0; ic < kNCuts; ic++) {\r
+       printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);\r
+  }\r
+\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetITSdEdxCutElectronLine(Int_t ededxSigmaCut)\r
+{   // Set Cut\r
+\r
+       switch(ededxSigmaCut){\r
+\r
+       case 0: \r
+               fDodEdxSigmaITSCut = kFALSE;\r
+               fPIDnSigmaBelowElectronLineITS=-100;\r
+               fPIDnSigmaAboveElectronLineITS= 100;\r
+               break;\r
+       case 1: // -10,10\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-10;\r
+               fPIDnSigmaAboveElectronLineITS=10;\r
+               break;\r
+       case 2: // -6,7\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-6;\r
+               fPIDnSigmaAboveElectronLineITS=7;\r
+               break;\r
+       case 3: // -5,5\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-5;\r
+               fPIDnSigmaAboveElectronLineITS=5;\r
+               break;\r
+       case 4: // -4,5\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-4;\r
+               fPIDnSigmaAboveElectronLineITS=5;\r
+               break;\r
+       case 5: // -3,5\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-3;\r
+               fPIDnSigmaAboveElectronLineITS=5;\r
+               break;\r
+       case 6: // -4,4\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-4;\r
+               fPIDnSigmaAboveElectronLineITS=4;\r
+               break;\r
+       case 7: // -2.5,4\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-2.5;\r
+               fPIDnSigmaAboveElectronLineITS=4;\r
+               break;\r
+       case 8: // -2,3.5\r
+               fDodEdxSigmaITSCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineITS=-2;\r
+               fPIDnSigmaAboveElectronLineITS=3.5;\r
+               break;\r
+       default:\r
+               cout<<"Warning: ITSdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;\r
+               return kFALSE;\r
+    \r
+       }\r
+       return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)\r
+{   // Set Cut\r
+       switch(ededxSigmaCut){\r
+\r
+       case 0: fDodEdxSigmaTPCCut = kFALSE;\r
+               fPIDnSigmaBelowElectronLineTPC=-10;\r
+               fPIDnSigmaAboveElectronLineTPC=10;\r
+               break;\r
+       case 1: // -10,10\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-10;\r
+               fPIDnSigmaAboveElectronLineTPC=10;\r
+               break;\r
+       case 2: // -6,7\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-6;\r
+               fPIDnSigmaAboveElectronLineTPC=7;\r
+               break;\r
+       case 3: // -5,5\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-5;\r
+               fPIDnSigmaAboveElectronLineTPC=5;\r
+               break;\r
+       case 4: // -4,5\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-4;\r
+               fPIDnSigmaAboveElectronLineTPC=5;\r
+               break;  \r
+       case 5: // -3,5\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-3;\r
+               fPIDnSigmaAboveElectronLineTPC=5;\r
+               break;\r
+       case 6: // -4,4\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-4;\r
+               fPIDnSigmaAboveElectronLineTPC=4;\r
+               break;\r
+       case 7: // -2.5,4\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-2.5;\r
+               fPIDnSigmaAboveElectronLineTPC=4;\r
+               break;\r
+       case 8: // -2,3.5\r
+               fDodEdxSigmaTPCCut = kTRUE;\r
+               fPIDnSigmaBelowElectronLineTPC=-2;\r
+               fPIDnSigmaAboveElectronLineTPC=3.5;\r
+               break;\r
+       default:\r
+               cout<<"Warning: TPCdEdxCutElectronLine not defined"<<ededxSigmaCut<<endl;\r
+               return kFALSE;\r
+    \r
+       }\r
+       return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)\r
+{   // Set Cut\r
+\r
+       switch(pidedxSigmaCut){\r
+                \r
+       case 0: fPIDnSigmaAbovePionLineTPC= 0;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-100;\r
+               break;\r
+       case 1:  // -10\r
+               fPIDnSigmaAbovePionLineTPC=-10;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 2:  // 1\r
+               fPIDnSigmaAbovePionLineTPC=-1;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 3:   // 0\r
+               fPIDnSigmaAbovePionLineTPC=0;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 4:  // 1\r
+               fPIDnSigmaAbovePionLineTPC=1;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 5:  // 1\r
+               fPIDnSigmaAbovePionLineTPC=2.;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 6:  // 1\r
+               fPIDnSigmaAbovePionLineTPC=2.5;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 7:\r
+               fPIDnSigmaAbovePionLineTPC=3.0; // We need a bit less tight cut on dE/dx\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 8:  // 1\r
+               fPIDnSigmaAbovePionLineTPC=3.5;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-10;\r
+               break;\r
+       case 9:  // 1\r
+               fPIDnSigmaAbovePionLineTPC=1.5;\r
+               fPIDnSigmaAbovePionLineTPCHighPt=-1.0;\r
+               break;\r
+       default:\r
+               cout<<"Warning: pidedxSigmaCut not defined "<<pidedxSigmaCut<<endl;\r
+               return kFALSE;\r
+       }\r
+       return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetMinMomPiondEdxTPCCut(Int_t piMomdedxSigmaCut)\r
+{   // Set Cut\r
+       switch(piMomdedxSigmaCut){\r
+                \r
+       case 0: fPIDMinPnSigmaAbovePionLineTPC=0.;\r
+               break;\r
+       case 1:  // 50.0 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=50.;\r
+               break;\r
+       case 2:  // 20.0 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=20.;\r
+               break;\r
+       case 3:  // 1.5 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=1.5;\r
+               break;\r
+       case 4:  // 1. GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=1.;\r
+               break;  \r
+       case 5:  // 0.5 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=0.5;\r
+               break;\r
+       case 6:  // 0.4 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=0.4;\r
+               break;    \r
+       case 7:  // 0.3 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=0.3;\r
+               break;\r
+       case 8:  // 0.25 GeV\r
+               fPIDMinPnSigmaAbovePionLineTPC=0.25;\r
+               break;\r
+       default:\r
+               cout<<"Warning: piMomdedxSigmaCut not defined "<<piMomdedxSigmaCut<<endl;\r
+               return kFALSE;\r
+       }\r
+       return kTRUE;\r
+}\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetITSClusterCut(Int_t clsITSCut){\r
+\r
+    \r
+       if( !fesdTrackCuts ) {\r
+\r
+               cout<<"Warning: AliESDtrackCut is not initialized "<<endl;\r
+               return kFALSE;\r
+       }\r
+\r
+       switch(clsITSCut){\r
+\r
+       case 0: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);\r
+               break;\r
+       case 1: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);\r
+               break;  //1 hit first layer of SPD\r
+       case 2: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
+               break; //1 hit in any layer of SPD\r
+       case 3: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kFirst);\r
+               fesdTrackCuts->SetMinNClustersITS(4);\r
+               // 4 hits in total in the ITS. At least 1 hit in the first layer of SPD  \r
+               break;\r
+       case 4: fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
+               fesdTrackCuts->SetMinNClustersITS(3);\r
+               // 3 hits in total in the ITS. At least 1 hit in any layer of SPD\r
+               break;\r
+       default:\r
+               cout<<"Warning: clsITSCut not defined "<<clsITSCut<<endl;\r
+               return kFALSE;\r
+       }\r
+       \r
+return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetTPCClusterCut(Int_t clsTPCCut)\r
+{   // Set Cut\r
+       switch(clsTPCCut){\r
+       case 0: // 0\r
+               fMinClsTPC= 0.;\r
+               break;\r
+       case 1:  // 70\r
+               fMinClsTPC= 70.;\r
+               break;\r
+       case 2:  // 80\r
+               fMinClsTPC= 80.;\r
+               break;\r
+       case 3:  // 100\r
+               fMinClsTPC= 100.;\r
+               break;\r
+       case 4:  // 0% of findable clusters\r
+               fMinClsTPCToF= 0.0;\r
+               fUseCorrectedTPCClsInfo=0;\r
+               break;\r
+       case 5:  // 35% of findable clusters\r
+               fMinClsTPCToF= 0.35;\r
+               fUseCorrectedTPCClsInfo=0;\r
+               break;\r
+       case 6:  // 60% of findable clusters\r
+               fMinClsTPCToF= 0.6;\r
+               fUseCorrectedTPCClsInfo=0;\r
+               break;\r
+       case 7:  // 70% of findable clusters\r
+               fMinClsTPCToF= 0.7;\r
+               fUseCorrectedTPCClsInfo=0;\r
+               break;\r
+       default:\r
+               cout<<"Warning: clsTPCCut not defined "<<clsTPCCut<<endl;\r
+               return kFALSE;\r
+       }\r
+       return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)\r
+{ \r
+  // Set eta Cut\r
+       switch(etaCut){\r
+                case 0: fEtaCut         = 100.;\r
+                        break;\r
+               case 1: // 1.4\r
+                       fEtaCut         = 1.4;\r
+                       break;\r
+               case 2: // 1.2\r
+                       fEtaCut         = 1.2;\r
+                       break;\r
+               case 3: // 0.9\r
+                       fEtaCut         = 0.9;\r
+                       break;\r
+               case 4: // 0.8\r
+                       fEtaCut         = 0.8;\r
+                       break;\r
+               case 5: // 0.75\r
+                       fEtaCut         = 0.75;\r
+                       break;\r
+               default:\r
+                       cout<<"Warning: EtaCut not defined "<<etaCut<<endl;\r
+                       return kFALSE;\r
+    }\r
+    return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetMaxMomPiondEdxTPCCut(Int_t piMaxMomdedxSigmaCut)\r
+{   // Set Cut\r
+   switch(piMaxMomdedxSigmaCut){\r
+\r
+        case 0: \r
+                fPIDMaxPnSigmaAbovePionLineTPC=0.;\r
+                break;\r
+        case 1:  // 100. GeV\r
+                fPIDMaxPnSigmaAbovePionLineTPC=100.;\r
+                break;\r
+        case 2:  // 5. GeV\r
+                fPIDMaxPnSigmaAbovePionLineTPC=5.;\r
+                       break;\r
+        case 3:  // 4. GeV\r
+                fPIDMaxPnSigmaAbovePionLineTPC=4.;\r
+                break;\r
+        case 4:  // 3.5 GeV\r
+                fPIDMaxPnSigmaAbovePionLineTPC=3.5;\r
+                break;\r
+        case 5:  // 3. GeV\r
+                fPIDMaxPnSigmaAbovePionLineTPC=3.;\r
+                break;\r
+        default:\r
+                cout<<"Warning: piMaxMomdedxSigmaCut not defined "<<piMaxMomdedxSigmaCut<<endl;\r
+                return kFALSE;\r
+        }\r
+        return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)\r
+{   // Set Cut\r
+       switch(LowPRejectionSigmaCut){\r
+       case 0:  //\r
+               fDoKaonRejectionLowP=kFALSE;\r
+               fDoProtonRejectionLowP=kFALSE;\r
+               fDoPionRejectionLowP=kFALSE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=0;\r
+               fPIDnSigmaAtLowPAroundProtonLine=0;\r
+               fPIDnSigmaAtLowPAroundPionLine=0;\r
+               break;\r
+       case 1:  //\r
+               fDoKaonRejectionLowP=kTRUE;\r
+               fDoProtonRejectionLowP=kTRUE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=0.5;\r
+               fPIDnSigmaAtLowPAroundProtonLine=0.5;\r
+               fPIDnSigmaAtLowPAroundPionLine=0.5;\r
+               break;\r
+       case 2:  //\r
+               fDoKaonRejectionLowP=kTRUE;\r
+               fDoProtonRejectionLowP=kTRUE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=1;\r
+               fPIDnSigmaAtLowPAroundProtonLine=1;\r
+               fPIDnSigmaAtLowPAroundPionLine=1;\r
+               break;\r
+       case 3:  //\r
+               fDoKaonRejectionLowP=kTRUE;\r
+               fDoProtonRejectionLowP=kTRUE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=1.5;\r
+               fPIDnSigmaAtLowPAroundProtonLine=1.5;\r
+               fPIDnSigmaAtLowPAroundPionLine=1.5;\r
+               break;\r
+       case 4:  //\r
+               fDoKaonRejectionLowP=kTRUE;\r
+               fDoProtonRejectionLowP=kTRUE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=2.0;\r
+               fPIDnSigmaAtLowPAroundProtonLine=2.0;\r
+               fPIDnSigmaAtLowPAroundPionLine=2.0;\r
+               break;\r
+       case 5:  //\r
+               fDoKaonRejectionLowP=kTRUE;\r
+               fDoProtonRejectionLowP=kTRUE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=2.0;\r
+               fPIDnSigmaAtLowPAroundProtonLine=2.0;\r
+               fPIDnSigmaAtLowPAroundPionLine=2.5;\r
+               break;\r
+       case 6:  //\r
+               fDoKaonRejectionLowP=kTRUE;\r
+               fDoProtonRejectionLowP=kTRUE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=0.;\r
+               fPIDnSigmaAtLowPAroundProtonLine=0.;\r
+               fPIDnSigmaAtLowPAroundPionLine=2.;\r
+               break;\r
+       case 7: //\r
+               fDoKaonRejectionLowP=kFALSE;\r
+               fDoProtonRejectionLowP=kFALSE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=0.0;\r
+               fPIDnSigmaAtLowPAroundProtonLine=0.0;\r
+               fPIDnSigmaAtLowPAroundPionLine=1.0;\r
+               break;\r
+       case 8:\r
+               fDoKaonRejectionLowP=kFALSE;\r
+               fDoProtonRejectionLowP=kFALSE;\r
+               fDoPionRejectionLowP=kTRUE;\r
+               fPIDnSigmaAtLowPAroundKaonLine=0.;\r
+               fPIDnSigmaAtLowPAroundProtonLine=0.;\r
+               fPIDnSigmaAtLowPAroundPionLine=0.5; \r
+               break;  \r
+       default:\r
+               cout<<"Warning: LowPRejectionSigmaCut not defined "<<LowPRejectionSigmaCut<<endl;\r
+               return kFALSE;\r
+       }\r
+       return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetTOFElectronPIDCut(Int_t TOFelectronPID){\r
+    // Set Cut\r
+       switch(TOFelectronPID){ // RRnewTOF start //////////////////////////////////////////////////////////////////////////\r
+       case 0: // no cut\r
+               fRequireTOF = kFALSE;\r
+               fUseTOFpid = kFALSE;\r
+               fTofPIDnSigmaBelowElectronLine=-100;\r
+               fTofPIDnSigmaAboveElectronLine=100;\r
+               break;\r
+       case 1: // -7,7\r
+               fRequireTOF = kFALSE;\r
+               fUseTOFpid = kTRUE;\r
+               fTofPIDnSigmaBelowElectronLine=-7;\r
+               fTofPIDnSigmaAboveElectronLine=7;\r
+               break;\r
+       case 2: // -5,5\r
+               fRequireTOF = kFALSE;\r
+               fUseTOFpid = kTRUE;\r
+               fTofPIDnSigmaBelowElectronLine=-5;\r
+               fTofPIDnSigmaAboveElectronLine=5;\r
+               break;\r
+       case 3: // -3,5\r
+               fRequireTOF = kFALSE;\r
+               fUseTOFpid = kTRUE;\r
+               fTofPIDnSigmaBelowElectronLine=-3;\r
+               fTofPIDnSigmaAboveElectronLine=5;\r
+               break;\r
+       case 4: // -2,3\r
+               fRequireTOF = kFALSE;\r
+               fUseTOFpid = kTRUE;\r
+               fTofPIDnSigmaBelowElectronLine=-2;\r
+               fTofPIDnSigmaAboveElectronLine=3;\r
+               break;\r
+       case 5: // -3, 3 TOF mandatory\r
+               fRequireTOF = kTRUE;\r
+               fUseTOFpid  = kTRUE;\r
+               fTofPIDnSigmaBelowElectronLine= -3;\r
+               fTofPIDnSigmaAboveElectronLine=  3;\r
+               break;\r
+       default:\r
+        cout<<"Warning: TOFElectronCut not defined "<<TOFelectronPID<<endl;\r
+       return kFALSE;\r
+    } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////\r
+    return kTRUE;\r
+}\r
+///_______________________________________________________________________________\r
+\r
+Bool_t AliDalitzElectronCuts::SetPsiPairCut(Int_t psiCut) {\r
+  \r
+\r
+  switch(psiCut) {\r
+  case 0:\r
+        fDoPsiPairCut = kFALSE;\r
+        fPsiPairCut = 10000.; //\r
+        fDeltaPhiCutMin = -1000.;\r
+        fDeltaPhiCutMax =  1000.;\r
+        \r
+        break;\r
+  case 1:\r
+        fDoPsiPairCut = kTRUE;\r
+        fPsiPairCut = 0.45; // Standard\r
+        fDeltaPhiCutMin = 0.;\r
+        fDeltaPhiCutMax = 0.12;\r
+        break;\r
+  default:\r
+      cout<<"Warning: PsiPairCut not defined "<<fPsiPairCut<<endl;\r
+      return kFALSE;\r
+  }\r
+\r
+  return kTRUE;\r
+}\r
+\r
+///_______________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetRejectSharedElecGamma(Int_t RCut) {\r
+  \r
+\r
+  switch(RCut) {\r
+  case 0:\r
+        fDoRejectSharedElecGamma = kFALSE;\r
+        fRadiusCut = 10000; // \r
+        break;\r
+  case 1:\r
+        fDoRejectSharedElecGamma = kTRUE;\r
+        fRadiusCut = 2.0; // cm \r
+        break;\r
+  case 2:\r
+        fDoRejectSharedElecGamma = kTRUE;\r
+        fRadiusCut = 3.0; // Standard\r
+        break;\r
+  case 3:\r
+        fDoRejectSharedElecGamma = kTRUE;\r
+        fRadiusCut = 4.0; // \r
+        break;\r
+  case 4:\r
+        fDoRejectSharedElecGamma = kTRUE;\r
+        fRadiusCut = 5.0; // \r
+        break;\r
+  case 5:\r
+        fDoRejectSharedElecGamma = kTRUE;\r
+        fRadiusCut = 10.0; // \r
+        break;\r
+  case 6:\r
+        fDoRejectSharedElecGamma = kTRUE;\r
+        fRadiusCut = 15.0; // \r
+        break;\r
+  default:\r
+      cout<<"Warning: PsiPairCut not defined "<<fDoRejectSharedElecGamma<<endl;\r
+      return kFALSE;\r
+  }\r
+\r
+  return kTRUE;\r
+}\r
+///__________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetBackgroundScheme(Int_t BackgroundScheme){\r
+\r
+    // Set Cut\r
+    switch(BackgroundScheme){\r
+\r
+    case 0: //Rotation\r
+            fBKGMethod = 0;\r
+            fUseTrackMultiplicityForBG = kFALSE;\r
+        break;\r
+    case 1: // mixed event with V0 multiplicity\r
+            fBKGMethod  = 1;\r
+            fUseTrackMultiplicityForBG = kFALSE;\r
+        break;\r
+    case 2: // mixed event with track multiplicity\r
+            fUseTrackMultiplicityForBG = kTRUE;\r
+            fBKGMethod  = 1;\r
+        break;\r
+    case 3: //Rotation\r
+           fUseTrackMultiplicityForBG = kFALSE;\r
+            fBKGMethod  = 2;\r
+        break;\r
+    case 4: //Rotation\r
+            fUseTrackMultiplicityForBG = kTRUE;\r
+            fBKGMethod  = 2;\r
+        break;\r
+    case 5: fUseTrackMultiplicityForBG = kTRUE;\r
+            fBKGMethod  = 3;\r
+        break;\r
+\r
+    default:\r
+        cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;\r
+        return kFALSE;\r
+    }\r
+    return kTRUE;\r
+}\r
+\r
+///________________________________________________________________________\r
+Bool_t AliDalitzElectronCuts::SetNumberOfRotations(Int_t NumberOfRotations)\r
+{   // Set Cut\r
+    switch(NumberOfRotations){\r
+    case 0:\r
+        fnumberOfRotationEventsForBG = 5;\r
+        break;\r
+    case 1:\r
+        fnumberOfRotationEventsForBG = 10;\r
+        break;\r
+    case 2:\r
+        fnumberOfRotationEventsForBG = 15;\r
+        break;\r
+    case 3:\r
+        fnumberOfRotationEventsForBG = 20;\r
+        break;\r
+    case 4:\r
+        fnumberOfRotationEventsForBG = 2;\r
+        break;\r
+    case 5:\r
+        fnumberOfRotationEventsForBG = 50;\r
+        break;\r
+    case 6:\r
+        fnumberOfRotationEventsForBG = 80;\r
+        break;\r
+    case 7:\r
+        fnumberOfRotationEventsForBG = 100;\r
+        break;\r
+    default:\r
+        cout<<"Warning: NumberOfRotations not defined "<<NumberOfRotations<<endl;\r
+        return kFALSE;\r
+    }\r
+    return kTRUE;\r
+}\r
+///________________________________________________________________________\r
+TString AliDalitzElectronCuts::GetCutNumber(){\r
+    // returns TString with current cut number\r
+  TString a(kNCuts);\r
+  for(Int_t ii=0;ii<kNCuts;ii++){\r
+       a.Append(Form("%d",fCuts[ii]));\r
+  }\r
+  return a;\r
+}\r
+\r
+\r
+///________________________________________________________________________\r
+AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010PbPb(){\r
+    //Create and return standard 2010 PbPb cuts\r
+    AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");\r
+    if(!cuts->InitializeCutsFromCutString("9069640364102")){\r
+       cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}\r
+    return cuts;\r
+}\r
+\r
+///________________________________________________________________________\r
+AliDalitzElectronCuts* AliDalitzElectronCuts::GetStandardCuts2010pp(){\r
+    //Create and return standard 2010 PbPb cuts\r
+    AliDalitzElectronCuts *cuts=new AliDalitzElectronCuts("StandardCuts2010pp","StandardCuts2010pp");\r
+                                          \r
+    if(!cuts->InitializeCutsFromCutString("9069640364102")){\r
+       cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;}\r
+     return cuts;\r
+}\r
+\r
index db389b3..9806f7b 100644 (file)
@@ -87,6 +87,7 @@ class AliDalitzElectronCuts : public AliAnalysisCuts {
   TString GetCutNumber();
 
     // Cut Selection
+  Bool_t ElectronIsSelectedMC(Int_t labelParticle,AliStack *fMCStack);
   Bool_t TrackIsSelected(AliESDtrack* lTrack);
   Bool_t ElectronIsSelected(AliESDtrack* lTrack);
   void InitAODpidUtil(Int_t type);
@@ -200,7 +201,8 @@ class AliDalitzElectronCuts : public AliAnalysisCuts {
   TH2F *hITSdEdxafter;
   TH2F *hTPCdEdxbefore; // TPC dEdx before cuts
   TH2F *hTPCdEdxafter; // TPC dEdx after cuts
-  TH2F *hTPCdEdxSignalafter; //TPC dEdx signal
+  TH2F *hTPCdEdxSignalbefore; //TPC dEdx signal before
+  TH2F *hTPCdEdxSignalafter; //TPC dEdx signal  after
   TH2F *hTOFbefore; // TOF after cuts
   TH2F *hTOFafter; // TOF after cuts
   
index df11891..cfda9e6 100644 (file)
@@ -135,7 +135,6 @@ AliV0ReaderV1 &AliV0ReaderV1::operator=(const AliV0ReaderV1 &ref){
 void AliV0ReaderV1::Init()
 {
     // Initialize function to be called once before analysis
-
     if(fConversionCuts==NULL){
        if(fConversionCuts==NULL)AliError("No Cut Selection initialized");
     }
@@ -195,63 +194,24 @@ Bool_t AliV0ReaderV1::Notify()
             }
          }
       }
-
-      if(fConversionCuts->GetDoEtaShift()){
-         if(fPeriodName.CompareTo("LHC12g") == 0 || //pilot run 2012
-            fPeriodName.CompareTo("LHC13b") == 0 || //mainly minimum bias
-            fPeriodName.CompareTo("LHC13c") == 0 || //mainly minimum bias
-            fPeriodName.CompareTo("LHC13d") == 0 || //mainly triggered
-            fPeriodName.CompareTo("LHC13e") == 0 || //mainly triggered
-            fPeriodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e
-            fPeriodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e
-            fPeriodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b
-            fPeriodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c
-            fPeriodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b
-            fPeriodName.CompareTo("LHC13b2") == 0 ||  // MC DPMJET, wrong energy, anchor LHC13b
-            fPeriodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b
-            fPeriodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ?
-            fPeriodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ?
-            fPeriodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g
-            fPeriodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g
-            fPeriodName.CompareTo("LHC12g1") == 0  // MC ?, anchor LHC12g
-            ){
-            cout<<"AliV0ReaderV1 --> pPb Run!!! Eta Shift of "<<-0.465<<endl;
-            fConversionCuts->SetEtaShift(-0.465);
-         }
-         else if(fPeriodName.CompareTo("LHC13f") == 0 ||
-                  fPeriodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f
-                  fPeriodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f
-                  fPeriodName.CompareTo("LHC13c4") == 0 //MC Starlight, coherent JPsi, UPC muon, anchor LHC13f
-                 ){
-            cout<<"AliV0ReaderV1 --> Pbp Run!!! Eta Shift of +"<<0.465<<endl;
-            fConversionCuts->SetEtaShift(+0.465);
-         }
-         else cout<<"AliV0ReaderV1 --> Eta Shift Requested but Period not Known"<<endl;
-      }
-      if(fConversionCuts->IsEtaShiftForced() == 1){
-         cout<<"AliV0ReaderV1 --> Force Eta Shift for non Pbp or pPb Run!!! Eta Shift of "<<-0.465<<endl;
-         fConversionCuts->SetEtaShift(-0.465);
+      if(!fConversionCuts->GetDoEtaShift()) return kTRUE; // No Eta Shift requested, continue
+      if(fConversionCuts->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
+         fConversionCuts->GetCorrectEtaShiftFromPeriod(fPeriodName);
+         fConversionCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+         return kTRUE;
       }
-      else if(fConversionCuts->IsEtaShiftForced() == 2){
-         cout<<"AliV0ReaderV1 --> Force Eta Shift for non Pbp or pPb Run!!! Eta Shift of +"<<0.465<<endl;
-         fConversionCuts->SetEtaShift(0.465);
+      else{
+         printf(" Gamma Conversion Reader %s :: Eta Shift Manually Set to %f \n\n",
+                (fConversionCuts->GetCutNumber()).Data(),fConversionCuts->GetEtaShift());
+         fConversionCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
       }
    }
-   
+
    return kTRUE;
 }
 //________________________________________________________________________
 void AliV0ReaderV1::UserExec(Option_t *option){
 
-
     // Check if correctly initialized
     if(!fConversionGammas)Init();
 
@@ -262,6 +222,7 @@ void AliV0ReaderV1::UserExec(Option_t *option){
 //________________________________________________________________________
 Bool_t AliV0ReaderV1::ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent)
 {
+
     //Reset the TClonesArray
     fConversionGammas->Delete();
 
@@ -336,7 +297,6 @@ const AliExternalTrackParam *AliV0ReaderV1::GetExternalTrackParam(AliESDv0 *fCur
 Bool_t AliV0ReaderV1::ProcessESDV0s()
 {
     // Process ESD V0s for conversion photon reconstruction
-
     AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(fInputEvent);
 
     AliKFConversionPhoton *fCurrentMotherKFCandidate=NULL;
@@ -347,7 +307,8 @@ Bool_t AliV0ReaderV1::ProcessESDV0s()
            AliESDv0 *fCurrentV0=(AliESDv0*)(fESDEvent->GetV0(currentV0Index));
            if(!fCurrentV0){
                printf("Requested V0 does not exist");
-               continue;}
+               continue;
+            }
 
            fCurrentMotherKFCandidate=ReconstructV0(fCurrentV0,currentV0Index);
 
@@ -797,8 +758,6 @@ void AliV0ReaderV1::FindDeltaAODBranchName(){
        }
     }
 }
-
-
 //________________________________________________________________________
 void AliV0ReaderV1::Terminate(Option_t *)
 {
index 6ffff56..48a4167 100644 (file)
@@ -38,8 +38,8 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC    = kFALSE){
    if(IsHeavyIon == 1){
       cutnumber = "1000000002084001001500000";
     } else if (IsHeavyIon==2){
-     cutnumber = "8000000062084001001500000";
-     doEtaShift = kTRUE;
+      cutnumber = "8000000062084001001500000";
+      doEtaShift = kFALSE; // Only needed if Eta Range is small, but default is now +- 5.0
    } else{
       cutnumber = "0000000002084000002200000";
    }
@@ -161,7 +161,10 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC = kFALSE){
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
       if (trainConfig.Contains("pPb")){
          analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
-         if (i<4) analysisCuts[i]->DoEtaShift(1);
+         if (i<4){
+            analysisCuts[i]->DoEtaShift(kTRUE);
+            analysisCuts[i]->SetEtaShift("Pbp");
+         }
       }
       ConvCutList->Add(analysisCuts[i]);
 
@@ -173,7 +176,6 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
       analysisCuts[i]->SetAcceptedHeader(HeaderList);
    }
 
-
    task->SetConversionCutList(numberOfCuts,ConvCutList);
    task->SetMesonCutList(numberOfCuts,MesonCutList);
    task->SetMoveParticleAccordingToVertex(kTRUE);
index 107cc6e..d2faa74 100644 (file)
@@ -38,8 +38,8 @@ void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
    if(IsHeavyIon == 1){
       cutnumber = "1000000002084001001500000";
     } else if (IsHeavyIon==2){
-     cutnumber = "8000000062084001001500000";
-     doEtaShift = kTRUE;
+      cutnumber = "8000000062084001001500000";
+      doEtaShift = kFALSE; // Only needed if Eta Range is small, but default is now +- 5.0
    } else{
       cutnumber = "0000000002084000002200000";
    }
@@ -159,7 +159,10 @@ void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC       = kFALSE){
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
       if (trainConfig.Contains("pPb")){
          analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
-         if (i<1) analysisCuts[i]->DoEtaShift(1);
+         if (i<1){
+            analysisCuts[i]->DoEtaShift(kTRUE);
+            analysisCuts[i]->SetEtaShift("Pbp");
+         }
       }
       ConvCutList->Add(analysisCuts[i]);
 
index 3e987eb..25367c7 100644 (file)
@@ -38,8 +38,8 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
    if(IsHeavyIon == 1){
       cutnumber = "1000000002084001001500000";
     } else if (IsHeavyIon==2){
-     cutnumber = "8000000062084001001500000";
-     doEtaShift = kTRUE;
+      cutnumber = "8000000062084001001500000";
+      doEtaShift = kFALSE; // Only needed if Eta Range is small, but default is now +- 5.0
    } else{
       cutnumber = "0000000002084000002200000";
    }
@@ -122,7 +122,8 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
 
    if(trainConfig.Contains("PbPb")){
       cutarray[ 0] = "1460001042092970023220000"; mesonCutArray[ 0] = "01522065000"; // Standard cut 40-60
-      cutarray[ 1] = "1020003042092370023750000"; mesonCutArray[ 1] = "01522045009";\r// Standard cut gamma 0-20%
+      cutarray[ 1] = "1020003042092370023750000"; mesonCutArray[ 1] = "01522045009";
+// Standard cut gamma 0-20%
       cutarray[ 2] = "1480003042092370023750000"; mesonCutArray[ 2] = "01522065009"; // Standard cut gamma 40-80
    } else if(trainConfig.Contains("pPb")){ //pA needs thighter rapidity cut y < 0.5
      cutarray[ 0] = "8020000072093172023290000"; mesonCutArray[0] = "01627045000";  //standard cut Pi0 Pb 00-20  wo shifted Eta 0.3
@@ -161,7 +162,6 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
       if (trainConfig.Contains("pPb")){
          analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
-//          if (i<4) analysisCuts[i]->DoEtaShift(1);
       }
       ConvCutList->Add(analysisCuts[i]);