]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added more cuts to the pi0 analyis (Ana)
authorkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Jun 2010 18:46:49 +0000 (18:46 +0000)
committerkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Jun 2010 18:46:49 +0000 (18:46 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx
PWG4/GammaConv/AliAnalysisTaskGammaConversion.h
PWG4/GammaConv/AliGammaConversionHistograms.cxx
PWG4/GammaConv/AliGammaConversionHistograms.h
PWG4/GammaConv/AliV0Reader.cxx
PWG4/GammaConv/AliV0Reader.h
PWG4/libPWG4GammaConv.pkg
PWG4/macros/ConfigGammaConversion.C

index 20ce08e6d61c1d3ac38715b34036f813d72cf7d8..b008b47fa028adfca6d08ce09c93781b608bfbc6 100644 (file)
 #include "TNtuple.h"
 //#include "AliCFManager.h"  // for CF
 //#include "AliCFContainer.h"   // for CF
+#include "AliESDInputHandler.h"
+#include "AliAnalysisManager.h"
 #include "AliGammaConversionAODObject.h"
 #include "AliGammaConversionBGHandler.h"
 #include "AliESDCaloCluster.h" // for combining PHOS and GammaConv
-
+#include "AliKFVertex.h"
+#include "AliV0.h"
 class AliCFContainer;
 class AliCFManager;
 class AliKFVertex;
@@ -69,8 +72,10 @@ AliAnalysisTaskSE(),
   fDoOmegaMeson(kFALSE),
   fDoJet(kFALSE),
   fDoChic(kFALSE),
+  fRecalculateV0ForGamma(kFALSE),
   fKFReconstructedGammasTClone(NULL),
   fKFReconstructedPi0sTClone(NULL),
+  fKFRecalculatedGammasTClone(NULL),
   fCurrentEventPosElectronTClone(NULL),
   fCurrentEventNegElectronTClone(NULL),
   fKFReconstructedGammasCutTClone(NULL),
@@ -80,6 +85,8 @@ AliAnalysisTaskSE(),
   fElectronv2(),
   fGammav1(),
   fGammav2(),
+  fElectronRecalculatedv1(),
+  fElectronRecalculatedv2(),
   fElectronMass(-1),
   fGammaMass(-1),
   fPi0Mass(-1),
@@ -142,8 +149,10 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fDoOmegaMeson(kFALSE),
   fDoJet(kFALSE),
   fDoChic(kFALSE),
+  fRecalculateV0ForGamma(kFALSE),
   fKFReconstructedGammasTClone(NULL),
   fKFReconstructedPi0sTClone(NULL),
+  fKFRecalculatedGammasTClone(NULL),
   fCurrentEventPosElectronTClone(NULL),
   fCurrentEventNegElectronTClone(NULL),
   fKFReconstructedGammasCutTClone(NULL),
@@ -153,6 +162,8 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fElectronv2(),
   fGammav1(),
   fGammav2(),
+  fElectronRecalculatedv1(),
+  fElectronRecalculatedv2(),
   fElectronMass(-1),
   fGammaMass(-1),
   fPi0Mass(-1),
@@ -195,6 +206,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
        
   // Define standard ESD track cuts for Gamma-hadron correlation 
   SetESDtrackCuts();
+
 }
 
 AliAnalysisTaskGammaConversion::~AliAnalysisTaskGammaConversion() 
@@ -301,6 +313,25 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
 {
   // Execute analysis for current event
 
+  //  Load the esdpid from the esdhandler if exists (tender was applied) otherwise set the Bethe Bloch parameters
+
+  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
+  AliESDInputHandler *esdHandler=0x0;
+  if ( (esdHandler=dynamic_cast<AliESDInputHandler*>(man->GetInputEventHandler())) && esdHandler->GetESDpid() ){
+    AliV0Reader::SetESDpid(esdHandler->GetESDpid());
+  } else {
+    //load esd pid bethe bloch parameters depending on the existance of the MC handler
+    // yes: MC parameters
+    // no:  data parameters
+    if (!AliV0Reader::GetESDpid()){
+      if (fMCEvent ) {
+        AliV0Reader::InitESDpid();
+      } else {
+        AliV0Reader::InitESDpid(1);
+      }
+    }
+  } 
+
 
   if(fV0Reader == NULL){
     // Write warning here cuts and so on are default if this ever happens
@@ -344,6 +375,11 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
   if(fKFReconstructedPi0sTClone == NULL){
     fKFReconstructedPi0sTClone = new TClonesArray("AliKFParticle",0);
   }
+ if(fKFRecalculatedGammasTClone == NULL){
+    fKFRecalculatedGammasTClone = new TClonesArray("AliKFParticle",0);
+  }
+
        
   //clear TClones
   fKFReconstructedGammasTClone->Delete();
@@ -353,6 +389,7 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
   fPreviousEventTLVNegElectronTClone->Delete();
   fPreviousEventTLVPosElectronTClone->Delete();
   fKFReconstructedPi0sTClone->Delete();
+  fKFRecalculatedGammasTClone->Delete();
 
   //clear vectors
   fElectronv1.clear();
@@ -361,6 +398,9 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
   fGammav1.clear();
   fGammav2.clear();
 
+  fElectronRecalculatedv1.clear();
+  fElectronRecalculatedv2.clear();
+
        
   fChargedParticles->Delete(); 
 
@@ -425,7 +465,9 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
 
   //Clear the data in the v0Reader
   fV0Reader->UpdateEventByEventData();
-
+  if(fRecalculateV0ForGamma==kTRUE){
+    RecalculateV0ForGamma();
+  }
   PostData(1, fOutputContainer);
   PostData(2, fCFManager->GetParticleContainer());  // for CF
        
@@ -682,6 +724,7 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
       Int_t rBin    = fHistograms->GetRBin(ePos->R());
       Int_t zBin    = fHistograms->GetZBin(ePos->Vz());
       Int_t phiBin  = fHistograms->GetPhiBin(particle->Phi());
+      Double_t rFMD=30;
 
       TVector3 vtxPos(ePos->Vx(),ePos->Vy(),ePos->Vz());       
       
@@ -714,6 +757,13 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
       //      fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi);
       fHistograms->FillHistogram(nameMCMappingPhiInZ, vtxPos.Phi());
 
+
+      if(ePos->R()<rFMD){
+       TString nameMCMappingFMDPhiInZ="";
+       nameMCMappingFMDPhiInZ.Form("MC_Conversion_Mapping_FMD_Phi_in_Z_%02d",zBin);
+       fHistograms->FillHistogram(nameMCMappingFMDPhiInZ, vtxPos.Phi());
+      }
+
       TString nameMCMappingRInZ="";
       nameMCMappingRInZ.Form("MC_Conversion_Mapping_R_in_Z_%02d",zBin);
       fHistograms->FillHistogram(nameMCMappingRInZ,ePos->R() );
@@ -731,6 +781,14 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
        TString nameMCMappingMidPtPhiInZ="";
        nameMCMappingMidPtPhiInZ.Form("MC_Conversion_Mapping_MidPt_Phi_in_Z_%02d",zBin);
        fHistograms->FillHistogram(nameMCMappingMidPtPhiInZ, vtxPos.Phi());
+
+
+       if(ePos->R()<rFMD){
+         TString nameMCMappingMidPtFMDPhiInZ="";
+         nameMCMappingMidPtFMDPhiInZ.Form("MC_Conversion_Mapping_MidPt_FMD_Phi_in_Z_%02d",zBin);
+         fHistograms->FillHistogram(nameMCMappingMidPtFMDPhiInZ, vtxPos.Phi());
+       }
+
        
        TString nameMCMappingMidPtRInZ="";
        nameMCMappingMidPtRInZ.Form("MC_Conversion_Mapping_MidPt_R_in_Z_%02d",zBin);
@@ -1049,7 +1107,18 @@ void AliAnalysisTaskGammaConversion::ProcessV0sNoCut(){
        fV0Reader->GetPositiveESDTrack()->GetKinkIndex(0) > 0) {                        
       continue;
     }
-
+    if(TMath::Abs(fV0Reader->GetMotherCandidateEta())> fV0Reader->GetEtaCut()){
+      continue;
+    }
+    if(TMath::Abs(fV0Reader->GetPositiveTrackEta())> fV0Reader->GetEtaCut()){
+      continue;
+    }
+    if(TMath::Abs(fV0Reader->GetNegativeTrackEta())> fV0Reader->GetEtaCut()){
+      continue;
+    }
+    if((TMath::Abs(fV0Reader->GetZ())*fV0Reader->GetLineCutZRSlope())-fV0Reader->GetLineCutZValue() > fV0Reader->GetXYRadius() ){ // cuts out regions where we do not reconstruct
+      continue; 
+    }
     if(fDoMCTruth){
                        
       if(fV0Reader->HasSameMCMother() == kFALSE){
@@ -1167,6 +1236,18 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
     fHistograms->FillHistogram("ESD_ConvGamma_E_dEdxP",fV0Reader->GetNegativeTrackP(),fV0Reader->GetNegativeTrackTPCdEdx());
     fHistograms->FillHistogram("ESD_ConvGamma_P_dEdxP",fV0Reader->GetPositiveTrackP(),fV0Reader->GetPositiveTrackTPCdEdx());
     
+    Double_t negPID=0;
+    Double_t posPID=0;
+    fV0Reader->GetPIDProbability(negPID,posPID);
+    fHistograms->FillHistogram("ESD_ConvGamma_E_EProbP",fV0Reader->GetNegativeTrackP(),negPID);
+    fHistograms->FillHistogram("ESD_ConvGamma_P_EProbP",fV0Reader->GetPositiveTrackP(),posPID);
+
+    Double_t negPIDmupi=0;
+    Double_t posPIDmupi=0;
+    fV0Reader->GetPIDProbabilityMuonPion(negPIDmupi,posPIDmupi);
+    fHistograms->FillHistogram("ESD_ConvGamma_E_mupiProbP",fV0Reader->GetNegativeTrackP(),negPIDmupi);
+    fHistograms->FillHistogram("ESD_ConvGamma_P_mupiProbP",fV0Reader->GetPositiveTrackP(),posPIDmupi);
+
     Double_t armenterosQtAlfa[2];
     fV0Reader->GetArmenterosQtAlfa(fV0Reader-> GetNegativeKFParticle(), 
                                   fV0Reader-> GetPositiveKFParticle(), 
@@ -1180,6 +1261,8 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
     Int_t rBin    = fHistograms->GetRBin(fV0Reader->GetXYRadius());
     Int_t zBin    = fHistograms->GetZBin(fV0Reader->GetZ());
     Int_t phiBin  = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi());
+    Double_t rFMD=30;
+
     TVector3 vtxConv(fV0Reader->GetX(),fV0Reader->GetY(), fV0Reader->GetZ());
 
     //    Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta();
@@ -1210,6 +1293,13 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
     //    fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetMotherCandidatePhi());
     fHistograms->FillHistogram(nameESDMappingPhiInZ, vtxConv.Phi());
 
+    if(fV0Reader->GetXYRadius()<rFMD){
+      TString nameESDMappingFMDPhiInZ="";
+      nameESDMappingFMDPhiInZ.Form("ESD_Conversion_Mapping_FMD_Phi_in_Z_%02d",zBin);
+      fHistograms->FillHistogram(nameESDMappingFMDPhiInZ, vtxConv.Phi());
+    }
+
+
     TString nameESDMappingRInZ="";
     nameESDMappingRInZ.Form("ESD_Conversion_Mapping_R_in_Z_%02d",zBin);
     fHistograms->FillHistogram(nameESDMappingRInZ, fV0Reader->GetXYRadius());
@@ -1226,6 +1316,12 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
       TString nameESDMappingMidPtPhiInZ="";
       nameESDMappingMidPtPhiInZ.Form("ESD_Conversion_Mapping_MidPt_Phi_in_Z_%02d",zBin);
       fHistograms->FillHistogram(nameESDMappingMidPtPhiInZ, vtxConv.Phi());
+      if(fV0Reader->GetXYRadius()<rFMD){
+       TString nameESDMappingMidPtFMDPhiInZ="";
+       nameESDMappingMidPtFMDPhiInZ.Form("ESD_Conversion_Mapping_MidPt_FMD_Phi_in_Z_%02d",zBin);
+       fHistograms->FillHistogram(nameESDMappingMidPtFMDPhiInZ, vtxConv.Phi());
+      }
+
       
       TString nameESDMappingMidPtRInZ="";
       nameESDMappingMidPtRInZ.Form("ESD_Conversion_Mapping_MidPt_R_in_Z_%02d",zBin);
@@ -1322,9 +1418,9 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        //resolution
        Double_t mcpt   = fV0Reader->GetMotherMCParticle()->Pt();
        Double_t esdpt  = fV0Reader->GetMotherCandidatePt();
-       Double_t resdPt = 0;
+       Double_t resdPt = 0.;
        if(mcpt > 0){
-         resdPt = ((esdpt - mcpt)/mcpt)*100;
+         resdPt = ((esdpt - mcpt)/mcpt)*100.;
        }
        else if(mcpt < 0){
          cout<<"Pt of MC particle is negative, this will cause wrong calculation of resPt"<<endl; 
@@ -1335,11 +1431,11 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        fHistograms->FillHistogram("Resolution_ESD_Pt", esdpt);
        fHistograms->FillHistogram("Resolution_Gamma_dPt_Phi", fV0Reader->GetMotherCandidatePhi(), resdPt);
                                
-       Double_t resdZ = 0;
+       Double_t resdZ = 0.;
        if(fV0Reader->GetNegativeMCParticle()->Vz() != 0){
-         resdZ = ((fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz())/fV0Reader->GetNegativeMCParticle()->Vz())*100;
+         resdZ = ((fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz())/fV0Reader->GetNegativeMCParticle()->Vz())*100.;
        }
-       Double_t resdZAbs = 0;
+       Double_t resdZAbs = 0.;
        resdZAbs = (fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz());
 
        fHistograms->FillHistogram("Resolution_dZAbs_VS_R", fV0Reader->GetNegativeMCParticle()->R(), resdZAbs);
@@ -1349,9 +1445,9 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
                
        // new for dPt_Pt-histograms for Electron and Positron
        Double_t mcEpt = fV0Reader->GetNegativeMCParticle()->Pt();
-       Double_t resEdPt = 0;
+       Double_t resEdPt = 0.;
        if (mcEpt > 0){ 
-               resEdPt = ((fV0Reader->GetNegativeTrackPt()-mcEpt)/mcEpt)*100;
+               resEdPt = ((fV0Reader->GetNegativeTrackPt()-mcEpt)/mcEpt)*100.;
        }
        UInt_t statusN = fV0Reader->GetNegativeESDTrack()->GetStatus(); 
  //    AliESDtrack * negTrk = fV0Reader->GetNegativeESDTrack();
@@ -1396,7 +1492,7 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        Double_t mcPpt = fV0Reader->GetPositiveMCParticle()->Pt();
        Double_t resPdPt = 0;
        if (mcPpt > 0){ 
-               resPdPt = ((fV0Reader->GetPositiveTrackPt()-mcPpt)/mcPpt)*100;
+               resPdPt = ((fV0Reader->GetPositiveTrackPt()-mcPpt)/mcPpt)*100.;
        }
 
        UInt_t statusP = fV0Reader->GetPositiveESDTrack()->GetStatus(); 
@@ -1440,11 +1536,11 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        }
 
                
-       Double_t resdR = 0;
+       Double_t resdR = 0.;
        if(fV0Reader->GetNegativeMCParticle()->R() != 0){
-         resdR = ((fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R())/fV0Reader->GetNegativeMCParticle()->R())*100;
+         resdR = ((fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R())/fV0Reader->GetNegativeMCParticle()->R())*100.;
        }
-       Double_t resdRAbs = 0;
+       Double_t resdRAbs = 0.;
        resdRAbs = (fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R());
 
        fHistograms->FillHistogram("Resolution_dRAbs_VS_R", fV0Reader->GetNegativeMCParticle()->R(), resdRAbs);
@@ -1453,8 +1549,8 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        fHistograms->FillHistogram("Resolution_ESD_R", fV0Reader->GetXYRadius());
        fHistograms->FillHistogram("Resolution_R_dPt", fV0Reader->GetNegativeMCParticle()->R(), resdPt);
  
-       Double_t resdPhiAbs=0;
-       resdPhiAbs=0;
+       Double_t resdPhiAbs=0.;
+       resdPhiAbs=0.;
        resdPhiAbs= (fV0Reader->GetMotherCandidatePhi()-fV0Reader->GetNegativeMCParticle()->Phi());
        fHistograms->FillHistogram("Resolution_dPhiAbs_VS_R", fV0Reader->GetNegativeMCParticle()->R(), resdPhiAbs);
 
@@ -1656,8 +1752,16 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){
          fHistograms->FillHistogram("ESD_Mother_ZR", twoGammaCandidate->GetZ(), spaceVectorTwoGammaCandidate.Pt());
          fHistograms->FillHistogram("ESD_Mother_XY", twoGammaCandidate->GetX(), twoGammaCandidate->GetY());
          fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt",massTwoGammaCandidate ,momentumVectorTwoGammaCandidate.Pt());
+         if(alfa<fV0Reader->GetAlphaCutMeson()){
+           fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt_alpha",massTwoGammaCandidate ,momentumVectorTwoGammaCandidate.Pt());
+         }
          fHistograms->FillHistogram("ESD_Mother_InvMass",massTwoGammaCandidate);
 
+         if(fCalculateBackground){
+           AliGammaConversionBGHandler * bgHandler = fV0Reader->GetBGHandler();
+           Int_t mbin= bgHandler->GetMultiplicityBinIndex(fV0Reader->CountESDTracks());
+           fHistograms->FillHistogram(Form("%dESD_Mother_InvMass_vs_Pt",mbin),massTwoGammaCandidate ,momentumVectorTwoGammaCandidate.Pt());
+         }
          //      if(fDoNeutralMesonV0MCCheck){
          if(fDoMCTruth){
            //Kenneth: Checking the eta of the gamma to check the difference between 0.9 and 1.2
@@ -1911,7 +2015,12 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
            else rapidity = 0.5*(TMath::Log((backgroundCandidate->GetE() +backgroundCandidate->GetPz()) / (backgroundCandidate->GetE()-backgroundCandidate->GetPz())));
                                        
                                        
-                                       
+           Double_t alfa=0.0;
+           if( (currentEventGoodV0.GetE()+previousGoodV0.GetE()) != 0){
+             alfa=TMath::Abs((currentEventGoodV0.GetE()-previousGoodV0.GetE())
+                             /(currentEventGoodV0.GetE()+previousGoodV0.GetE()));
+           }
+                       
                                        
            if(openingAngleBG < fMinOpeningAngleGhostCut ){
              delete backgroundCandidate;   
@@ -1932,6 +2041,9 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
            fHistograms->FillHistogram("ESD_Background_InvMass_vs_Pt",massBG,momentumVectorbackgroundCandidate.Pt());
            fHistograms->FillHistogram("ESD_Background_InvMass",massBG);
 
+           if(alfa<fV0Reader->GetAlphaCutMeson()){
+             fHistograms->FillHistogram("ESD_Background_InvMass_vs_Pt_alpha",massBG,momentumVectorbackgroundCandidate.Pt());
+           }
            if ( TMath::Abs(currentEventGoodV0.GetEta())<0.9 &&  TMath::Abs(previousGoodV0.GetEta())<0.9 ){
              fHistograms->FillHistogram("ESD_Background_InvMass_vs_Pt_Fiducial",massBG,momentumVectorbackgroundCandidate.Pt());
              fHistograms->FillHistogram("ESD_Background_InvMass_Fiducial",massBG);
@@ -2040,6 +2152,235 @@ void AliAnalysisTaskGammaConversion::CreateListOfChargedParticles(){
     fHistograms->FillHistogram("ESD_NumberOfGoodESDTracksVtx",numberOfESDTracks);
   } 
 }
+void AliAnalysisTaskGammaConversion::RecalculateV0ForGamma(){
+  
+ Double_t massE=0.00051099892;
+ TLorentzVector curElecPos;
+ TLorentzVector curElecNeg;
+ TLorentzVector curGamma;
+
+ TLorentzVector curGammaAt;
+ TLorentzVector curElecPosAt;
+ TLorentzVector curElecNegAt;
+ AliKFVertex primVtxGamma(*(fESDEvent->GetPrimaryVertex()));
+ AliKFVertex primVtxImprovedGamma = primVtxGamma;
+
+ const AliESDVertex *vtxT3D=fESDEvent->GetPrimaryVertex();
+
+ Double_t xPrimaryVertex=vtxT3D->GetXv();
+ Double_t yPrimaryVertex=vtxT3D->GetYv();
+ Double_t zPrimaryVertex=vtxT3D->GetZv();
+ Float_t primvertex[3]={xPrimaryVertex,yPrimaryVertex,zPrimaryVertex};
+
+ Float_t nsigmaTPCtrackPos;
+ Float_t nsigmaTPCtrackNeg;
+ Float_t nsigmaTPCtrackPosToPion;
+ Float_t nsigmaTPCtrackNegToPion;
+ AliKFParticle* negKF=NULL;
+ AliKFParticle* posKF=NULL;
+
+ for(Int_t iTracks = 0; iTracks < fESDEvent->GetNumberOfTracks(); iTracks++){
+   AliESDtrack* posTrack = fESDEvent->GetTrack(iTracks);
+   if(!posTrack){
+     continue;
+   }
+   if (posKF) delete posKF; posKF=NULL;
+   if(posTrack->GetSign()<0) continue;
+   if(!(posTrack->GetStatus() & AliESDtrack::kTPCrefit))continue;
+   if(posTrack->GetKinkIndex(0)>0 ) continue;
+   if(posTrack->GetNcls(1)<50)continue;
+   Double_t momPos[3];
+   //    posTrack->GetConstrainedPxPyPz(momPos);
+   posTrack->GetPxPyPz(momPos);
+   AliESDtrack *ptrk=fESDEvent->GetTrack(iTracks);
+   curElecPos.SetXYZM(momPos[0],momPos[1],momPos[2],massE);
+   if(TMath::Abs(curElecPos.Eta())<0.9) continue;
+   posKF = new AliKFParticle( *(posTrack),-11);
+
+   nsigmaTPCtrackPos = fV0Reader->GetESDpid()->NumberOfSigmasTPC(posTrack,AliPID::kElectron);
+   nsigmaTPCtrackPosToPion = fV0Reader->GetESDpid()->NumberOfSigmasTPC(posTrack,AliPID::kPion);
+
+   if ( nsigmaTPCtrackPos>5.|| nsigmaTPCtrackPos<-2.){
+     continue;
+   }
+  
+   if(pow((momPos[0]*momPos[0]+momPos[1]*momPos[1]+momPos[2]*momPos[2]),0.5)>0.5 && nsigmaTPCtrackPosToPion<1){
+     continue;
+   }
+
+
+
+   for(Int_t jTracks = 0; jTracks < fESDEvent->GetNumberOfTracks(); jTracks++){
+     AliESDtrack* negTrack = fESDEvent->GetTrack(jTracks);
+     if(!negTrack){
+       continue;
+     }
+     if (negKF) delete negKF; negKF=NULL;
+     if(negTrack->GetSign()>0) continue;
+     if(!(negTrack->GetStatus() & AliESDtrack::kTPCrefit))continue;
+     if(negTrack->GetKinkIndex(0)>0 ) continue;
+     if(negTrack->GetNcls(1)<50)continue;
+     Double_t momNeg[3];
+     //    negTrack->GetConstrainedPxPyPz(momNeg);
+     negTrack->GetPxPyPz(momNeg);
+
+     nsigmaTPCtrackNeg = fV0Reader->GetESDpid()->NumberOfSigmasTPC(negTrack,AliPID::kElectron);     
+     nsigmaTPCtrackNegToPion = fV0Reader->GetESDpid()->NumberOfSigmasTPC(negTrack,AliPID::kPion);
+     if ( nsigmaTPCtrackNeg>5. || nsigmaTPCtrackNeg<-2.){
+       continue;
+     }
+     if(pow((momNeg[0]*momNeg[0]+momNeg[1]*momNeg[1]+momNeg[2]*momNeg[2]),0.5)>0.5 && nsigmaTPCtrackNegToPion<1){
+       continue;
+     }
+     AliESDtrack *ntrk=fESDEvent->GetTrack(jTracks);
+     curElecNeg.SetXYZM(momNeg[0],momNeg[1],momNeg[2],massE);
+     if(TMath::Abs(curElecNeg.Eta())<0.9) continue;
+     negKF = new AliKFParticle( *(negTrack) ,11);
+
+     Double_t b=fESDEvent->GetMagneticField();
+     Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
+     AliExternalTrackParam nt(*ntrk), pt(*ptrk);
+     nt.PropagateTo(xn,b); pt.PropagateTo(xp,b);
+
+
+     //--- Like in ITSV0Finder
+     AliExternalTrackParam ntAt0(*ntrk), ptAt0(*ptrk);
+     Double_t xxP,yyP,alphaP;
+     Double_t rP[3];
+
+     //     if (!ptAt0.GetGlobalXYZat(ptAt0->GetX(),xxP,yyP,zzP)) continue;
+     if (!ptAt0.GetXYZAt(ptAt0.GetX(),b,rP)) continue;
+     xxP=rP[0];
+     yyP=rP[1];
+     alphaP = TMath::ATan2(yyP,xxP);
+
+
+     ptAt0.Propagate(alphaP,0,b);
+     Float_t ptfacP  = (1.+100.*TMath::Abs(ptAt0.GetC(b)));
+
+     //     Double_t distP      = ptAt0.GetY();
+     Double_t normP      = ptfacP*TMath::Sqrt(ptAt0.GetSigmaY2());
+     Double_t normdist0P = TMath::Abs(ptAt0.GetY()/normP);
+     Double_t normdist1P = TMath::Abs((ptAt0.GetZ()-zPrimaryVertex)/(ptfacP*TMath::Sqrt(ptAt0.GetSigmaZ2())));
+     Double_t normdistP  = TMath::Sqrt(normdist0P*normdist0P+normdist1P*normdist1P);
+  
+
+     Double_t xxN,yyN,alphaN;
+     Double_t rN[3];
+     //     if (!ntAt0.GetGlobalXYZat(ntAt0->GetX(),xxN,yyN,zzN)) continue;
+     if (!ntAt0.GetXYZAt(ntAt0.GetX(),b,rN)) continue;
+     xxN=rN[0];
+     yyN=rN[1];
+     alphaN = TMath::ATan2(yyN,xxN);
+
+     ntAt0.Propagate(alphaN,0,b);
+
+     Float_t ptfacN  = (1.+100.*TMath::Abs(ntAt0.GetC(b)));
+     //     Double_t distN      = ntAt0.GetY();
+     Double_t normN      = ptfacN*TMath::Sqrt(ntAt0.GetSigmaY2());
+     Double_t normdist0N = TMath::Abs(ntAt0.GetY()/normN);
+     Double_t normdist1N = TMath::Abs((ntAt0.GetZ()-zPrimaryVertex)/(ptfacN*TMath::Sqrt(ntAt0.GetSigmaZ2())));
+     Double_t normdistN  = TMath::Sqrt(normdist0N*normdist0N+normdist1N*normdist1N);
+  
+     //-----------------------------
+
+     Double_t momNegAt[3];
+     nt.GetPxPyPz(momNegAt);
+     curElecNegAt.SetXYZM(momNegAt[0],momNegAt[1],momNegAt[2],massE);
+
+     Double_t momPosAt[3];
+     pt.GetPxPyPz(momPosAt);
+     curElecPosAt.SetXYZM(momPosAt[0],momPosAt[1],momPosAt[2],massE);
+     if(dca>1){
+       continue;
+     }
+
+     //     Double_t dneg= negTrack->GetD(xPrimaryVertex,yPrimaryVertex,b);
+     //     Double_t dpos= posTrack->GetD(xPrimaryVertex,yPrimaryVertex,b);
+     AliESDv0 vertex(nt,jTracks,pt,iTracks);
+    
+
+     Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex);
+
+     AliV0 pvertex;
+     pvertex.SetParamN(nt);
+     pvertex.SetParamP(pt);
+     pvertex.Update(primvertex);
+     Float_t v0Rr=pvertex.GetRr();
+     //  cout<< "v0Rr::"<< v0Rr<<endl;
+     // if (pvertex.GetRr()<0.5){
+     // continue;
+     //}
+     //     cout<<"vertex.GetChi2V0()"<<vertex.GetChi2V0()<<endl;
+     if(cpa<0.9)continue;
+     //     if (vertex.GetChi2V0() > 30) continue;
+     //     cout<<"xp+xn::"<<xp<<" "<<xn<<endl;
+     if ((xn+xp) < 0.4) continue;
+     if (TMath::Abs(ntrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<0.05)
+       if (TMath::Abs(ptrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<0.05) continue;
+
+     //cout<<"pass"<<endl;
+
+     AliKFParticle v0GammaC;
+     v0GammaC+=(*negKF);
+     v0GammaC+=(*posKF);
+     v0GammaC.SetMassConstraint(0,0.001);
+     primVtxImprovedGamma+=v0GammaC;
+     v0GammaC.SetProductionVertex(primVtxImprovedGamma);
+
+
+     curGamma=curElecNeg+curElecPos;
+     curGammaAt=curElecNegAt+curElecPosAt;
+     
+     // invariant mass versus pt of K0short
+     
+     Double_t chi2V0GammaC=100000.;
+     if( v0GammaC.GetNDF() != 0) {
+       chi2V0GammaC = v0GammaC.GetChi2()/v0GammaC.GetNDF();
+     }else{
+       cout<< "ERROR::v0K0C.GetNDF()" << endl;
+     }
+
+     if(chi2V0GammaC<200 &&chi2V0GammaC>0 ){
+       if(fHistograms != NULL){
+        fHistograms->FillHistogram("ESD_RecalculateV0_InvMass",v0GammaC.GetMass());
+        fHistograms->FillHistogram("ESD_RecalculateV0_Pt",v0GammaC.GetPt());
+        fHistograms->FillHistogram("ESD_RecalculateV0_E_dEdxP",curElecNegAt.P(),negTrack->GetTPCsignal());
+        fHistograms->FillHistogram("ESD_RecalculateV0_P_dEdxP",curElecPosAt.P(),posTrack->GetTPCsignal());
+        fHistograms->FillHistogram("ESD_RecalculateV0_cpa",cpa);
+        fHistograms->FillHistogram("ESD_RecalculateV0_dca",dca);
+        fHistograms->FillHistogram("ESD_RecalculateV0_Rr",v0Rr);
+        fHistograms->FillHistogram("ESD_RecalculateV0_normdistP",normdistP);
+        fHistograms->FillHistogram("ESD_RecalculateV0_normdistN",normdistN);
+
+        new((*fKFRecalculatedGammasTClone)[fKFRecalculatedGammasTClone->GetEntriesFast()])  AliKFParticle(v0GammaC);
+        fElectronRecalculatedv1.push_back(iTracks);
+        fElectronRecalculatedv2.push_back(jTracks);
+       }
+     }
+   }
+ }
+ for(Int_t firstGammaIndex=0;firstGammaIndex<fKFRecalculatedGammasTClone->GetEntriesFast();firstGammaIndex++){
+   for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fKFRecalculatedGammasTClone->GetEntriesFast();secondGammaIndex++){
+      AliKFParticle * twoGammaDecayCandidateDaughter0 = (AliKFParticle *)fKFRecalculatedGammasTClone->At(firstGammaIndex);
+      AliKFParticle * twoGammaDecayCandidateDaughter1 = (AliKFParticle *)fKFRecalculatedGammasTClone->At(secondGammaIndex);
+                       
+      if(fElectronRecalculatedv1[firstGammaIndex]==fElectronRecalculatedv1[secondGammaIndex]){
+       continue;
+      }
+      if( fElectronRecalculatedv2[firstGammaIndex]==fElectronRecalculatedv2[secondGammaIndex]){
+       continue;
+      }
+                       
+      AliKFParticle twoGammaCandidate(*twoGammaDecayCandidateDaughter0,*twoGammaDecayCandidateDaughter1);
+      fHistograms->FillHistogram("ESD_RecalculateGG_InvMass",twoGammaCandidate.GetMass());             
+      fHistograms->FillHistogram("ESD_RecalculateGG_InvMass_vs_Pt",twoGammaCandidate.GetMass(),twoGammaCandidate.GetPt());             
+   }
+ }
+}
 void AliAnalysisTaskGammaConversion::CalculateJetCone(Int_t gammaIndex){
   // CaculateJetCone
        
index 7ddcec96e1acb3a12cac074bd146976804501229..33d64415e9383bd113745a2e6db3d42c93321086 100644 (file)
@@ -20,7 +20,9 @@ class AliGammaConversionAODObject;
 class TNtuple;
 class AliGammaConversionHistograms;
 class AliESDv0;
+class AliV0;
 class AliKFParticle;
+class AliKFVertex;
 class AliESDInputHandler;
 class AliESDEvent;
 class AliAODEvent;
@@ -53,7 +55,7 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   void ProcessGammasForNeutralMesonAnalysis();
   void ProcessGammasForOmegaMesonAnalysis();
   void ProcessConvPHOSGammasForNeutralMesonAnalysis();
-               
+  void RecalculateV0ForGamma();
   // for CF
   void SetCFManager(AliCFManager * const io) {fCFManager = io;};
   AliCFManager *GetCFManager() const {return fCFManager;}
@@ -94,7 +96,8 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   void SetDoNeutralMesonV0MCCheck(Bool_t flag){fDoNeutralMesonV0MCCheck=flag;}
   void SetDoJet(Bool_t flag){fDoJet=flag;}
   void SetDoChic(Bool_t flag){fDoChic=flag;}
-               
+  void SetRecalculateV0ForGamma(Bool_t flag){fRecalculateV0ForGamma=flag;}             
+
   void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}
   void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}
   void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}
@@ -173,9 +176,11 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   Bool_t fDoOmegaMeson; // flag
   Bool_t fDoJet; // flag
   Bool_t fDoChic; // flag
+  Bool_t fRecalculateV0ForGamma;//flag
                
   TClonesArray * fKFReconstructedGammasTClone; //! transient
   TClonesArray * fKFReconstructedPi0sTClone; //! transient
+  TClonesArray * fKFRecalculatedGammasTClone; //! transient
   TClonesArray * fCurrentEventPosElectronTClone; //! transient
   TClonesArray * fCurrentEventNegElectronTClone; //! transient
   TClonesArray * fKFReconstructedGammasCutTClone; //! transient
@@ -188,7 +193,11 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
                
   vector<Int_t> fGammav1; // vector containing index of gamma 1
   vector<Int_t> fGammav2; // vector containing index of gamma 2
+
+  vector<Int_t> fElectronRecalculatedv1; // vector containing index of electron 1
+  vector<Int_t> fElectronRecalculatedv2; // vector containing index of electron 2
                
+  //  AliESDpid * fESDpid; // esd pid
 
 
   ///////Chi_c Analysis///////////////////////////
index 59973a444be8cf30cf03b421e0b2fdaf2825f1a9..866b7f3f99597afdaf3d841ac7889889db2bd659 100644 (file)
@@ -26,7 +26,7 @@
 #include "TList.h"
 #include "TH1F.h"
 #include "TH2F.h"
-
+#include "AliLog.h"
 
 using namespace std;
 
@@ -126,7 +126,7 @@ void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString h
   }
 }
 
-void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
+void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle, Int_t logAxis){
   // see header file for documentation
   if( fHistogramMap->Contains(histogramName.Data()) ==  kFALSE ){
     TH2F *tmp = new TH2F(histogramName, histogramTitle,nXBins,firstX,lastX,nYBins,firstY,lastY);
@@ -134,12 +134,70 @@ void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString h
     tmp->GetYaxis()->SetTitle(yAxisTitle);
     TObjString *tobjstring = new TObjString(histogramName.Data());
     fHistogramMap->Add((TObject*)tobjstring,(TObject*)tmp);
+
+    if(logAxis >= 0){
+      BinLogAxis(histogramName.Data(), logAxis);
+    }
   }
   else{
     cout << "Warning: Histogram ( "<<histogramName.Data()<<" ) already exists " << endl;
   }
 }
 
+Bool_t AliGammaConversionHistograms::BinLogAxis(const char* name, Int_t dim){
+
+  //
+  // converts the axis (defined by the dimension) of THx or THnSparse
+  // object to Log scale. Number of bins and bin min and bin max are preserved
+  
+  TObject *o =  fHistogramMap->GetValue(name);
+  TAxis *axis = 0x0;
+  if(o->InheritsFrom("TH1")){
+    axis = (dynamic_cast<TH1F*>(o))->GetXaxis();
+  }
+  if(o->InheritsFrom("TH2")){
+    if(0 == dim){
+      axis = (dynamic_cast<TH2F*>(o))->GetXaxis();
+    }
+    else if(1 == dim){
+      axis = (dynamic_cast<TH2F*>(o))->GetYaxis();
+    }
+     else{
+       //  AliError("Only dim = 0 or 1 possible for TH2F");
+     }
+  }
+  //  if(o->InheritsFrom("THnSparse")){
+  //  axis = (dynamic_cast<THnSparse*>(o))->GetAxis(dim);
+  //}
+
+  if(!axis){
+    //AliError(Form("Axis '%d' could not be identified in the object '%s'\n", dim, name));
+    return kFALSE;
+  }
+
+  Int_t bins = axis->GetNbins();
+
+  Double_t from = axis->GetXmin();
+  if(from <= 0){
+    // AliError(Form(" Log binning not possible for object '%s'because the '%d' axis starts from '%f\n'", name, dim, from));
+    return kFALSE;
+  }
+  Double_t to = axis->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];
+  }
+  axis->Set(bins, newBins);
+  delete newBins;
+
+  return kTRUE;
+
+
+}
+
 void AliGammaConversionHistograms::AddTable(TString tableName,TString tableTitle,Int_t nXBins,const char * axesLabel[]){
   //see header file for documentation
 
@@ -396,7 +454,7 @@ void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_
   fRBinLimits[8]=42.;
   fRBinLimits[9]=55.;
   fRBinLimits[10]=72.;
-  fRBinLimits[11]=81.5;
+  fRBinLimits[11]=79.5; // change from 81.5 to 79.5 to have CE in 1 r bin 81.05
   fRBinLimits[12]=90.;
   fRBinLimits[13]=500.;
 
@@ -620,6 +678,14 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     titleMCPhiInZ.Form("MC Mapping of Phi in Z%02d",z);
     //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
     AddHistogram(nameMCPhiInZ, titleMCPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
+    //Mapping Phi in Z for FMD
+    TString nameMCFMDPhiInZ="";
+    nameMCFMDPhiInZ.Form("MC_Conversion_Mapping_FMD_Phi_in_Z_%02d",z);
+    TString titleMCFMDPhiInZ="";
+    titleMCFMDPhiInZ.Form("MC Mapping FMD of Phi in Z%02d",z);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCFMDPhiInZ, titleMCFMDPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
                
 
     //Mapping R in Z
@@ -638,6 +704,15 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
     AddHistogram(nameMCMidPtPhiInZ, titleMCMidPtPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
                
+   //Mapping Phi in Z Middle Pt for FMD
+    TString nameMCMidPtFMDPhiInZ="";
+    nameMCMidPtFMDPhiInZ.Form("MC_Conversion_Mapping_MidPt_FMD_Phi_in_Z_%02d",z);
+    TString titleMCMidPtFMDPhiInZ="";
+    titleMCMidPtFMDPhiInZ.Form("MC Mapping Middle Pt of Phi in Z%02d",z);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCMidPtFMDPhiInZ, titleMCMidPtFMDPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
+               
+
 
     //Mapping R in Z Middle Pt
     TString nameMCMidPtRInZ="";
@@ -654,10 +729,20 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     TString nameESDPhiInZ="";
     nameESDPhiInZ.Form("ESD_Conversion_Mapping_Phi_in_Z_%02d",z);
     TString titleESDPhiInZ="";
-    titleESDPhiInZ.Form("ESD Mapping of Phi in R%02d",z);
+    titleESDPhiInZ.Form("ESD Mapping of Phi in Z%02d",z);
     //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
     AddHistogram(nameESDPhiInZ, titleESDPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
 
+
+    //Mapping Phi in Z for FMD
+    TString nameESDFMDPhiInZ="";
+    nameESDFMDPhiInZ.Form("ESD_Conversion_Mapping_FMD_Phi_in_Z_%02d",z);
+    TString titleESDFMDPhiInZ="";
+    titleESDFMDPhiInZ.Form("ESD Mapping FMD of Phi in Z%02d",z);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDFMDPhiInZ, titleESDFMDPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
+
+
    //Mapping R in Z
     TString nameESDRInZ="";
     nameESDRInZ.Form("ESD_Conversion_Mapping_R_in_Z_%02d",z);
@@ -675,6 +760,15 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
     AddHistogram(nameESDMidPtPhiInZ, titleESDMidPtPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
 
+   //Mapping Phi in Z Middle Pt for FMD
+    TString nameESDMidPtFMDPhiInZ="";
+    nameESDMidPtFMDPhiInZ.Form("ESD_Conversion_Mapping_MidPt_FMD_Phi_in_Z_%02d",z);
+    TString titleESDMidPtFMDPhiInZ="";
+    titleESDMidPtFMDPhiInZ.Form("ESD Mapping Middle Pt FMD of Phi in Z%02d",z);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDMidPtFMDPhiInZ, titleESDMidPtFMDPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
+
+
    //Mapping R in Z Middle Pt
     TString nameESDMidPtRInZ="";
     nameESDMidPtRInZ.Form("ESD_Conversion_Mapping_MidPt_R_in_Z_%02d",z);
index e040b851452ef878fed65fceff84d4238961a6be..45c64d6c8f8367f1c913d8133e53b3adbdc21316 100644 (file)
@@ -47,7 +47,13 @@ class AliGammaConversionHistograms{
   /*
    * Adds a TH2F histogram to the histogram map and create a key for it 
    */
-  void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="");
+  void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="", Int_t logAxis =-1);
+
+  /*
+   * Create a logx binning suitable for dEdx plots
+   */
+  Bool_t BinLogAxis(const char* name, Int_t dim);
+
 
   /*
    *  Adds a TH1F Table to the table map and create a key for it
index 5126609ab6f05129d2a9efe3ddbea19e57c03e5e..2f65ec1499f5879236e7daf12b9a11824f16d02a 100644 (file)
@@ -46,6 +46,7 @@ using namespace std;
 ClassImp(AliV0Reader)
 
 
+AliESDpid* AliV0Reader::fgESDpid = 0x0;
 
 AliV0Reader::AliV0Reader() :
   TObject(),
@@ -56,7 +57,7 @@ AliV0Reader::AliV0Reader() :
   // fESDHandler(NULL),
   fESDEvent(NULL),
   fCFManager(NULL),
-  fESDpid(NULL),
+  //fESDpid(NULL),
   fHistograms(NULL),
   fCurrentV0IndexNumber(0),
   fCurrentV0(NULL),
@@ -91,6 +92,7 @@ AliV0Reader::AliV0Reader() :
   fLineCutZValue(0.),
   fChi2CutConversion(0.),
   fChi2CutMeson(0.),
+  fAlphaCutMeson(1.),
   fPIDProbabilityCutNegativeParticle(0),
   fPIDProbabilityCutPositiveParticle(0),
   fDodEdxSigmaCut(kFALSE),
@@ -98,6 +100,15 @@ AliV0Reader::AliV0Reader() :
   fPIDnSigmaBelowElectronLine(-100),
   fPIDnSigmaAbovePionLine(-100), 
   fPIDMinPnSigmaAbovePionLine(100), 
+  fDoKaonRejectionLowP(kFALSE),
+  fDoProtonRejectionLowP(kFALSE),
+  fDoPionRejectionLowP(kFALSE),
+  fPIDnSigmaAtLowPAroundKaonLine(0),
+  fPIDnSigmaAtLowPAroundProtonLine(0),
+  fPIDnSigmaAtLowPAroundPionLine(0),
+  fPIDMinPKaonRejectionLowP(0),
+  fPIDMinPProtonRejectionLowP(0),
+  fPIDMinPPionRejectionLowP(0),
   fXVertexCut(0.),
   fYVertexCut(0.),
   fZVertexCut(0.),
@@ -115,7 +126,7 @@ AliV0Reader::AliV0Reader() :
   fEsdTrackCuts(NULL),
   fNumberOfESDTracks(0)
 {
-  fESDpid = new AliESDpid;     
+  //fESDpid = new AliESDpid;   
 }
 
 
@@ -128,7 +139,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   //  fESDHandler(original.fESDHandler),
   fESDEvent(original.fESDEvent),
   fCFManager(original.fCFManager),
-  fESDpid(original.fESDpid),
+  // fESDpid(original.fESDpid),
   fHistograms(original.fHistograms),
   fCurrentV0IndexNumber(original.fCurrentV0IndexNumber),
   fCurrentV0(original.fCurrentV0),
@@ -163,6 +174,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fLineCutZValue(original.fLineCutZValue),
   fChi2CutConversion(original.fChi2CutConversion),
   fChi2CutMeson(original.fChi2CutMeson),
+  fAlphaCutMeson(original.fAlphaCutMeson),
   fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle),
   fPIDProbabilityCutPositiveParticle(original.fPIDProbabilityCutPositiveParticle),
   fDodEdxSigmaCut(original.fDodEdxSigmaCut),
@@ -170,6 +182,15 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fPIDnSigmaBelowElectronLine(original.fPIDnSigmaBelowElectronLine),
   fPIDnSigmaAbovePionLine(original.fPIDnSigmaAbovePionLine), 
   fPIDMinPnSigmaAbovePionLine(original.fPIDMinPnSigmaAbovePionLine), 
+  fDoKaonRejectionLowP(original.fDoKaonRejectionLowP),
+  fDoProtonRejectionLowP(original.fDoProtonRejectionLowP),
+  fDoPionRejectionLowP(original.fDoPionRejectionLowP),
+  fPIDnSigmaAtLowPAroundKaonLine(original.fPIDnSigmaAtLowPAroundKaonLine),
+  fPIDnSigmaAtLowPAroundProtonLine(original.fPIDnSigmaAtLowPAroundProtonLine),
+  fPIDnSigmaAtLowPAroundPionLine(original.fPIDnSigmaAtLowPAroundPionLine),
+  fPIDMinPKaonRejectionLowP(original.fPIDMinPKaonRejectionLowP),
+  fPIDMinPProtonRejectionLowP(original.fPIDMinPProtonRejectionLowP),
+  fPIDMinPPionRejectionLowP(original.fPIDMinPPionRejectionLowP),
   fXVertexCut(original.fXVertexCut),
   fYVertexCut(original.fYVertexCut),
   fZVertexCut(original.fZVertexCut),
@@ -198,9 +219,9 @@ AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/)
 }
 AliV0Reader::~AliV0Reader()
 {
-  if(fESDpid){
-    delete fESDpid;
-  }
+  //  if(fESDpid){
+  // delete fESDpid;
+  //}
 }
 
 //____________________________________________________________________________
@@ -259,19 +280,19 @@ void AliV0Reader::Initialize(){
       //print warning here
     }
     // Better parameters for MonteCarlo from A. Kalweit 2010/01/8
-    fESDpid->GetTPCResponse().SetBetheBlochParameters( 2.15898e+00/50.,
-                                     1.75295e+01,
-                                     3.40030e-09,
-                                     1.96178e+00,
-                                     3.91720e+00);
+//     fESDpid->GetTPCResponse().SetBetheBlochParameters( 2.15898e+00/50.,
+//                                   1.75295e+01,
+//                                   3.40030e-09,
+//                                   1.96178e+00,
+//                                   3.91720e+00);
   }
   else{
     // Better parameters for data from A. Kalweit 2010/01/8
-    fESDpid->GetTPCResponse().SetBetheBlochParameters(0.0283086,
-                                    2.63394e+01,
-                                    5.04114e-11,
-                                    2.12543e+00,
-                                    4.88663e+00);
//    fESDpid->GetTPCResponse().SetBetheBlochParameters(0.0283086,
+//                                  2.63394e+01,
+//                                  5.04114e-11,
+//                                  2.12543e+00,
+//                                  4.88663e+00);
   }
        
   // for CF
@@ -477,10 +498,10 @@ Bool_t AliV0Reader::NextV0(){
        
 
     if(fDodEdxSigmaCut == kTRUE){
-      if( fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
-         fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ||
-         fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
-         fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){
+      if( fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
+         fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ||
+         fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
+         fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){
        //iResult=kFALSE;
        if(fHistograms != NULL ){
          fHistograms->FillHistogram("ESD_CutdEdxSigmaElectronLine_InvMass",GetMotherCandidateMass());
@@ -496,9 +517,9 @@ Bool_t AliV0Reader::NextV0(){
       }
 
       if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine){
-       if(fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
-          fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
-          fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
+       if(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+          fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+          fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
          //      iResult=kFALSE;
          if(fHistograms != NULL){
            fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
@@ -512,9 +533,9 @@ Bool_t AliV0Reader::NextV0(){
       }
       
       if( fCurrentNegativeESDTrack->P()>fPIDMinPnSigmaAbovePionLine){
-       if(fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
-          fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
-          fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
+       if(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+          fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+          fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
          //      iResult=kFALSE;
          if(fHistograms != NULL){
            fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
@@ -531,6 +552,89 @@ Bool_t AliV0Reader::NextV0(){
       }
 
     }
+    //    Float_t fPIDMinPKaonRejectionLowP=1.5;
+    if(fDoKaonRejectionLowP == kTRUE){
+      if( fCurrentNegativeESDTrack->P()<fPIDMinPKaonRejectionLowP ){
+       if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutKaonRejectionLowP_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+      if( fCurrentPositiveESDTrack->P()<fPIDMinPKaonRejectionLowP ){
+       if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutKaonRejectionLowP_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+    }
+    //    Float_t fPIDMinPProtonRejection=2;
+    if(fDoProtonRejectionLowP == kTRUE){
+      if( fCurrentNegativeESDTrack->P()<fPIDMinPProtonRejectionLowP){
+       if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutProtonRejectionLowP_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+      if( fCurrentPositiveESDTrack->P()<fPIDMinPProtonRejectionLowP ){
+       if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutProtonRejectionLowP_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+
+    }
+    //    Float_t fPIDMinPPionRejection=0.3;
+    if(fDoPionRejectionLowP == kTRUE){
+      if( fCurrentNegativeESDTrack->P()<fPIDMinPPionRejectionLowP ){
+       if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutPionRejectionLowP_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+      if( fCurrentPositiveESDTrack->P()<fPIDMinPPionRejectionLowP ){
+       if( TMath::Abs(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutPionRejectionLowP_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+    }
+
     
     //checks if we have a prim vertex
     if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) { 
@@ -809,6 +913,7 @@ Bool_t AliV0Reader::UpdateV0Information(){
     Double_t convpos[2];
     convpos[0]=0;
     convpos[1]=0;
+
     GetConvPosXY(GetPositiveESDTrack(),GetNegativeESDTrack(),GetMagneticField(),convpos);
     fCurrentXValue = convpos[0];
     fCurrentYValue = convpos[1];
@@ -920,11 +1025,19 @@ Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut
        
   Bool_t iResult=kFALSE;
        
-  Double_t *posProbArray = new Double_t[10];
-  Double_t *negProbArray = new Double_t[10];
-  AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());
-  AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());
-       
+  //  Double_t *posProbArray = new Double_t[10];
+  //  Double_t *negProbArray = new Double_t[10];
+  //-AM The TPCpid method expects an array of length kSPECIES that is 5 not 10 
+
+  Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
+  Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
+
+  AliESDtrack* negTrack  = GetNegativeESDTrack();
+  AliESDtrack* posTrack  = GetPositiveESDTrack();
+  //fESDEvent->GetTrack(fCurrentV0->GetNindex());
+    //fESDEvent->GetTrack(fCurrentV0->GetPindex());
+  //-AM for switchtracks==true the above is a bug
+
   negTrack->GetTPCpid(negProbArray);
   posTrack->GetTPCpid(posProbArray);
        
@@ -942,11 +1055,19 @@ Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut
 void AliV0Reader::GetPIDProbability(Double_t &negPIDProb,Double_t & posPIDProb){
   // see header file for documentation
 
-  Double_t *posProbArray = new Double_t[10];
-  Double_t *negProbArray = new Double_t[10];
-  AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());
-  AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());
-       
+  //Double_t *posProbArray = new Double_t[10];
+  // Double_t *negProbArray = new Double_t[10];
+  //-AM The TPCpid method expects an array of length kSPECIES that is 5 not 10 
+  Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
+  Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
+
+//   AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());
+//   AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());
+  //-AM for switchtracks the above is a bug
+  AliESDtrack* negTrack  = GetNegativeESDTrack();
+  AliESDtrack* posTrack  = GetPositiveESDTrack();
+
+
   negTrack->GetTPCpid(negProbArray);
   posTrack->GetTPCpid(posProbArray);
        
@@ -958,6 +1079,31 @@ void AliV0Reader::GetPIDProbability(Double_t &negPIDProb,Double_t & posPIDProb){
   delete [] posProbArray;
   delete [] negProbArray;
 }
+void AliV0Reader::GetPIDProbabilityMuonPion(Double_t &negPIDProb,Double_t & posPIDProb){
+  // see header file for documentation
+
+
+  Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
+  Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
+
+  // AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());
+  // AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());
+  //-AM for switchtracks the above is a bug
+
+  AliESDtrack* negTrack  = GetNegativeESDTrack();
+  AliESDtrack* posTrack  = GetPositiveESDTrack();
+
+  negTrack->GetTPCpid(negProbArray);
+  posTrack->GetTPCpid(posProbArray);
+       
+  //  if(negProbArray!=NULL && posProbArray!=NULL){ // this is not allowed anymore for some reason(RC19)
+  if(negProbArray && posProbArray){
+    negPIDProb = negProbArray[1]+negProbArray[2];
+    posPIDProb = posProbArray[1]+posProbArray[2];
+  }
+  delete [] posProbArray;
+  delete [] negProbArray;
+}
 
 void AliV0Reader::UpdateEventByEventData(){
   //see header file for documentation
index 210e1adf54d53b79d8051db10c3becb102abed85..b6df568637a5cd9e17bb1ce79182d1663973bc6d 100644 (file)
@@ -20,6 +20,7 @@
 #include <vector>
 #include "AliCFManager.h"
 #include "AliGammaConversionBGHandler.h"
+#include "AliESDpid.h"
 
 class TClonesArray; 
 class TFormula;
@@ -39,7 +40,7 @@ class TChain;
 class TChain;
 class AliCFManager;   // for CF
 class AliCFContainer;  // for CF
-class AliESDpid; // for dEdx cut based on nSigma to particle lines 
+//class AliESDpid; // for dEdx cut based on nSigma to particle lines 
 class AliESDtrackCuts; 
 
 class AliV0Reader : public TObject {
@@ -130,12 +131,14 @@ class AliV0Reader : public TObject {
   /*
    * Returns the negative ESD track which belongs to fCurrentV0
    */
-  AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
+  //  AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
+  AliESDtrack* GetNegativeESDTrack(){return fCurrentNegativeESDTrack;}
        
   /*
    * Returns the positive ESD track which belongs to fCurrentV0
    */
-  AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
+  //  AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
+  AliESDtrack* GetPositiveESDTrack(){return fCurrentPositiveESDTrack;}
        
   /*
    * Returns the negative KF particle which belongs to fCurrentV0
@@ -161,6 +164,11 @@ class AliV0Reader : public TObject {
    * Checks if the PID of the two particles are within our cuts.
    */
   void GetPIDProbability(Double_t &negPIDProb, Double_t &posPIDProb);
+
+  /*
+   * Checks if the PID of the two particles are within our cuts.
+   */
+  void GetPIDProbabilityMuonPion(Double_t &negPIDProb, Double_t &posPIDProb);
        
   /*
    *Get the negative MC TParticle from the stack 
@@ -472,6 +480,12 @@ class AliV0Reader : public TObject {
    */
   Double_t GetChi2CutMeson() const{return fChi2CutMeson;}
        
+  /*
+   * Gets the alpha cut value for the mesons.
+   */
+  Double_t GetAlphaCutMeson() const{return fAlphaCutMeson;}
+
+
   Double_t GetPositiveTrackLength() const{return fCurrentPositiveESDTrack->GetIntegratedLength();}
   Double_t GetNegativeTrackLength() const{return fCurrentNegativeESDTrack->GetIntegratedLength();}
        
@@ -525,6 +539,12 @@ class AliV0Reader : public TObject {
    */
   void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;}
        
+  /*
+   * Sets the AlphaCut for the mesons.
+   */
+  void SetAlphaCutMeson(Double_t alpha){fAlphaCutMeson=alpha;}
+       
+
   /*
    * Sets the XVertexCut value.
    */
@@ -596,6 +616,48 @@ class AliV0Reader : public TObject {
 
   void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
 
+  /*
+   * Sets the flag to enable/disable the cut dedx N sigma for Kaon Rejection at low p 
+   */
+  void SetDoKaonRejectionLowP( Bool_t doKaonRejectionLowP){fDoKaonRejectionLowP=doKaonRejectionLowP;}
+  /*
+   * Sets the flag to enable/disable the cut dedx N sigma for Proton Rejection at low p 
+   */
+  void SetDoProtonRejectionLowP( Bool_t doProtonRejectionLowP){fDoProtonRejectionLowP=doProtonRejectionLowP;}
+
+  /*
+   * Sets the flag to enable/disable the cut dedx N sigma for Pion Rejection at low p 
+   */
+  void SetDoPionRejectionLowP( Bool_t doPionRejectionLowP){fDoPionRejectionLowP=doPionRejectionLowP;}
+
+  /*
+   * Sets the PIDMinPnSigmaAroundKaon cut value for the tracks.
+   */
+  void SetPIDnSigmaAtLowPAroundKaonLine(Double_t nSigmaAtLowPAroundKaon){fPIDnSigmaAtLowPAroundKaonLine =nSigmaAtLowPAroundKaon;}
+
+  /*
+   * Sets the PIDMinPnSigmaAroundProton cut value for the tracks.
+   */
+  void SetPIDnSigmaAtLowPAroundProtonLine(Double_t nSigmaAtLowPAroundProton){fPIDnSigmaAtLowPAroundProtonLine =nSigmaAtLowPAroundProton;}
+
+  /*
+   * Sets the PIDMinPnSigmaAroundPion cut value for the tracks.
+   */
+  void SetPIDnSigmaAtLowPAroundPionLine(Double_t nSigmaAtLowPAroundPion){fPIDnSigmaAtLowPAroundPionLine =nSigmaAtLowPAroundPion;}
+
+  /*
+   * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+   */
+  void SetPIDMinPKaonRejectionLowP(Double_t PIDMinPKaonRejectionLowP ){fPIDMinPKaonRejectionLowP=PIDMinPKaonRejectionLowP;}
+
+  /*
+   * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+   */
+  void SetPIDMinPProtonRejectionLowP(Double_t PIDMinPProtonRejectionLowP ){fPIDMinPProtonRejectionLowP=PIDMinPProtonRejectionLowP;}
+  /*
+   * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+   */
+  void SetPIDMinPPionRejectionLowP(Double_t PIDMinPPionRejectionLowP ){fPIDMinPPionRejectionLowP=PIDMinPPionRejectionLowP;}
 
   /*
    * Updates the V0 information of the current V0.
@@ -662,6 +724,12 @@ class AliV0Reader : public TObject {
 
   Bool_t CheckIfPi0IsMother(Int_t label);
 
+  static void InitESDpid(Int_t type=0);
+  static void SetESDpid(AliESDpid * const pid) {fgESDpid=pid;}
+  static AliESDpid* GetESDpid() {return fgESDpid;}
+
+
  private:
   AliStack * fMCStack;           // pointer to MonteCarlo particle stack 
   //  AliMCEventHandler* fMCTruth;   // for CF    pointer to the MC object
@@ -677,7 +745,7 @@ class AliV0Reader : public TObject {
   //  AliCFContainer *container;
        
   // for dEdx cut based on nSigma to a particle line
-  AliESDpid * fESDpid; // esd pid
+  //AliESDpid * fESDpid; // esd pid
        
   AliGammaConversionHistograms *fHistograms; // pointer to histogram handling class
        
@@ -723,6 +791,7 @@ class AliV0Reader : public TObject {
   Double_t fLineCutZValue; //linecut
   Double_t fChi2CutConversion; //chi2cut
   Double_t fChi2CutMeson;  //chi2cut
+  Double_t fAlphaCutMeson;  //alphacut
   Double_t fPIDProbabilityCutNegativeParticle; //pid cut
   Double_t fPIDProbabilityCutPositiveParticle; //pid cut
   Bool_t   fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
@@ -730,6 +799,16 @@ class AliV0Reader : public TObject {
   Double_t fPIDnSigmaBelowElectronLine; // sigma cut
   Double_t fPIDnSigmaAbovePionLine;     // sigma cut
   Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
+  Double_t fDoKaonRejectionLowP;   // Kaon rejection at low p
+  Double_t fDoProtonRejectionLowP; // Proton rejection at low p
+  Double_t fDoPionRejectionLowP;   // Pion rejection at low p
+  Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut
+  Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut
+  Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut
+  Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection
+  Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection
+  Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection
+
   Double_t fXVertexCut; //vertex cut
   Double_t fYVertexCut; //vertex cut
   Double_t fZVertexCut; // vertexcut
@@ -756,9 +835,50 @@ class AliV0Reader : public TObject {
   AliESDtrackCuts *fEsdTrackCuts; // track cuts
   Int_t fNumberOfESDTracks; //track counter
 
+  static AliESDpid* fgESDpid;                 // ESD pid object
+
   ClassDef(AliV0Reader,10)
 };
+
+inline void AliV0Reader::InitESDpid(Int_t type)
+{
+  //
+  // initialize PID parameters
+  // type=0 is simulation
+  // type=1 is data
+
+  if (!fgESDpid) fgESDpid=new AliESDpid;
+  Double_t alephParameters[5];
+  // simulation
+  alephParameters[0] = 2.15898e+00/50.;
+  alephParameters[1] = 1.75295e+01;
+  alephParameters[2] = 3.40030e-09;
+  alephParameters[3] = 1.96178e+00;
+  alephParameters[4] = 3.91720e+00;
+  fgESDpid->GetTOFResponse().SetTimeResolution(80.);
+
+  // data
+  if (type==1){
+    alephParameters[0] = 0.0283086;
+    alephParameters[1] = 2.63394e+01;
+    alephParameters[2] = 5.04114e-11;
+    alephParameters[3] = 2.12543e+00;
+    alephParameters[4] = 4.88663e+00;
+    fgESDpid->GetTOFResponse().SetTimeResolution(130.);
+    fgESDpid->GetTPCResponse().SetMip(47.9);
+  }
+
+  fgESDpid->GetTPCResponse().SetBetheBlochParameters(
+    alephParameters[0],alephParameters[1],alephParameters[2],
+    alephParameters[3],alephParameters[4]);
+
+  fgESDpid->GetTPCResponse().SetSigma(3.79301e-03, 2.21280e+04);
+
+}
+
 #endif
 
 
 
+
+
index e7ea9c1e8059e09dae839039b7c53f653a8d6e83..b6ea83223e9480f0d6e315e27e8d6d54b0f9a7d3 100644 (file)
@@ -1,6 +1,6 @@
 #-*- Mode: Makefile -*-
 
-SRCS = GammaConv/AliV0Reader.cxx GammaConv/AliAnalysisTaskGammaConversion.cxx GammaConv/AliGammaConversionHistograms.cxx GammaConv/AliGammaConversionAODObject.cxx GammaConv/AliGammaConversionBGHandler.cxx
+SRCS = GammaConv/AliAnalysisTaskGammaConversion.cxx GammaConv/AliV0Reader.cxx GammaConv/AliGammaConversionHistograms.cxx GammaConv/AliGammaConversionAODObject.cxx GammaConv/AliGammaConversionBGHandler.cxx
       
 HDRS:= $(SRCS:.cxx=.h) 
 
index 1b9f24771e9159962cbf22dbf3d1fb7449cd4d5d..4abf10b0b0bd102f60bc6e22430ce6ec0a3f3863 100644 (file)
@@ -15,7 +15,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-const int c_array_size = 10;
+const int c_array_size = 12;
 
 class AliAnalysisDataContainer;
 class AliGammaConversionHistograms;
@@ -33,10 +33,10 @@ Bool_t kGCcalculateBackground = kTRUE;
 Bool_t kGCdoNeutralMesonV0MCCheck =kFALSE;
 Bool_t kGCrunOmegaMeson = kFALSE;
 Bool_t kGCrunRES = kFALSE;
-
+Bool_t kGCRecalculateV0ForGamma = kFALSE;
 /** ---------------------------------- define cuts here ------------------------------------*/
 
-TString kGCAnalysisCutSelectionId="9010111000"; // do not cheange here, use -set-cut-selection in argument instead
+TString kGCAnalysisCutSelectionId="900011100010"; // do not cheange here, use -set-cut-selection in argument instead
 
 Int_t kGCpidOfNegativeTrack=11;
 Int_t kGCpidOfPositiveTrack=-11;
@@ -49,6 +49,7 @@ Double_t kGCmaxZCut     = 240.;
 Double_t kGCminClsTPCCut= 0.;
 Double_t kGCchi2CutConversion   = 30.;
 Double_t kGCchi2CutMeson   = 50.;
+Double_t kGCalphaCutMeson   = 0.7;
 
 Double_t kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
 Double_t kGCLineCutZValue = 7.;
@@ -229,6 +230,11 @@ Bool_t kGCplotESDConvGammaEAsymmetryP         = kTRUE;
 Bool_t kGCplotESDConvGammaPAsymmetryP         = kTRUE;
 Bool_t kGCplotESDConvGammaEdEdxP         = kTRUE;
 Bool_t kGCplotESDConvGammaPdEdxP         = kTRUE;
+Bool_t kGCplotESDConvGammaEeProbP         = kTRUE;
+Bool_t kGCplotESDConvGammaPeProbP         = kTRUE;
+Bool_t kGCplotESDConvGammaEmupiProbP         = kTRUE;
+Bool_t kGCplotESDConvGammaPmupiProbP         = kTRUE;
+
 Bool_t kGCplotESDConvGammaQtAlfa         = kTRUE;
 
 
@@ -378,6 +384,9 @@ Bool_t kGCplotESDCutKink          = kTRUE;
 Bool_t kGCplotESDCutPIDProb       = kTRUE;
 Bool_t kGCplotESDCutdedxSigmaElectronLine=kTRUE;
 Bool_t kGCplotESDCutdedxSigmaPionLine=kTRUE;
+Bool_t kGCplotESDCutPionRejectionLowP  =kTRUE;
+Bool_t kGCplotESDCutProtonRejectionLowP=kTRUE;
+Bool_t kGCplotESDCutKaonRejectionLowP  =kTRUE;
 Bool_t kGCplotESDCutR             = kTRUE;
 Bool_t kGCplotESDCutLine          = kTRUE;
 Bool_t kGCplotESDCutZ             = kTRUE;
@@ -391,6 +400,7 @@ Bool_t kGCplotESDCutNDF           = kTRUE;
 Bool_t kGCplotESDCutChi2          = kTRUE;
 Bool_t kGCplotESDCutEta           = kTRUE;
 Bool_t kGCplotESDCutPt            = kTRUE;
+Bool_t kGCplotESDCutSinglePt      = kTRUE;
 Bool_t kGCplotESDTrueConvGammaTrackLength =kFALSE;
 Bool_t kGCplotESDTrueConvGammaTrackLengthVSInvMass =kFALSE;
 
@@ -493,7 +503,7 @@ Double_t kGClastXBinEnergy = 50.;
 
 //P-plots
 Int_t kGCnXBinsP = 200;
-Double_t kGCfirstXBinP = 0.;
+Double_t kGCfirstXBinP = 0.05;
 Double_t kGClastXBinP = 50.;
 
 //dEdx-plots
@@ -501,6 +511,11 @@ Int_t kGCnYBinsdEdx = 200;
 Double_t kGCfirstYBindEdx = 0.;
 Double_t kGClastYBindEdx = 200.;
 
+//EProb-plots
+Int_t kGCnYBinsEProb = 200;
+Double_t kGCfirstYBinEProb = 0.;
+Double_t kGClastYBinEProb = 1.;
+
 //Qt-plots
 Int_t kGCnYBinsQt = 250;
 Double_t kGCfirstYBinQt = 0.;
@@ -556,17 +571,17 @@ Double_t kGClastYBinMapping = 2;
 
 //ResolutionPlots
 //RESdPt
-Int_t kGCnXBinsResdPt=1000;
+Int_t kGCnXBinsResdPt=500;
 Int_t kGCfirstXBinResdPt= 0;
 Int_t kGClastXBinResdPt=100;
-Int_t kGCnYBinsResdPt=500;
+Int_t kGCnYBinsResdPt=200;
 Int_t kGCfirstYBinResdPt= -10;
 Int_t kGClastYBinResdPt=10;
 
 //RESdR
-Int_t kGCnXBinsResdR=500;
+Int_t kGCnXBinsResdR=400;
 Int_t kGCfirstXBinResdR= 0;
-Int_t kGClastXBinResdR=250;
+Int_t kGClastXBinResdR=200;
 Int_t kGCnYBinsResdR=100;
 Int_t kGCfirstYBinResdR= -25;
 Int_t kGClastYBinResdR=25;
@@ -608,7 +623,7 @@ Double_t kGClastXBinGammaMass = 1.;
 Int_t kGCnXBinsPi0Mass = 1000;
 Double_t kGCfirstXBinPi0Mass = 0.;
 Double_t kGClastXBinPi0Mass = 1.;
-Double_t kGCfirstXBinPi0Alpha = -1.;
+Double_t kGCfirstXBinPi0Alpha = 0.;
 Double_t kGClastXBinPi0Alpha = 1.;
 
 
@@ -640,7 +655,8 @@ Int_t kGCnYBinsSpectra = 250;
 Double_t kGCfirstYBinSpectra = 0.;
 Double_t kGClastYBinSpectra = 25.;
 
-Double_t kGCfirstXBinAlpha = -1.;
+Double_t kGCfirstXBinAlphaG = -1.;
+Double_t kGCfirstXBinAlpha = 0.;
 Double_t kGClastXBinAlpha = 1.;
 
 //track length plots
@@ -756,12 +772,25 @@ Bool_t kGCuseESDTrack   = kFALSE;
 /**------------------------------Flag to apply dEdx cut base on sigmas to electron line----------*/
 Bool_t kGCdodEdxSigmaCut= kTRUE;
 /**------------------------------end Flag to apply NsigmadEdx cut ----------*/
+
 Double_t kGCPIDnSigmaAboveElectronLine=5;
 Double_t kGCPIDnSigmaBelowElectronLine=-3;
 Double_t kGCPIDnSigmaAbovePionLine=0;
 Double_t kGCPIDMinPnSigmaAbovePionLine=1;
 
+/**------- Flag to apply rejection at LowP of Kaons, protons , pions------------*/
+Bool_t kGCdoPionRejectionLowP=kTRUE;
+Bool_t kGCdoKaonRejectionLowP=kTRUE;
+Bool_t kGCdoProtonRejectionLowP=kTRUE;
+/**---------------------------------------*/
+
+Double_t kGCPIDnSigmaAtLowPAroundKaonLine=0;
+Double_t kGCPIDnSigmaAtLowPAroundProtonLine=0;
+Double_t kGCPIDnSigmaAtLowPAroundPionLine=0;
+
+Double_t kGCPIDMinPKaonRejectionLowP=1.5;
+Double_t kGCPIDMinPProtonRejectionLowP=2.;
+Double_t kGCPIDMinPPionRejectionLowP=0.5;
 
 
 Bool_t scanArguments(TString arguments){
@@ -855,6 +884,10 @@ Bool_t scanArguments(TString arguments){
        cout<<"Running Resolution"<<endl;
        kGCrunRES = kTRUE;
       }
+      else if (argument.CompareTo("-run-recalculateV0") == 0){
+       cout<<"Running RecalculateV0ForGamma"<<endl;
+       kGCRecalculateV0ForGamma=kTRUE;
+      }
       else if (argument.CompareTo("-jet-off") == 0){
        cout<<"Skipping jet analysis"<<endl;
        kGCrunJet = kFALSE;
@@ -1041,10 +1074,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
                
     AliCFManager *man = new AliCFManager();
     man->SetParticleContainer(container);
-    for(int i = 0;i<nstep;i++){
-      TObjArray *tmp = new TObjArray(0);
-      man->SetParticleCutsList(i,tmp) ;
-    } 
+               
     // end ---------------------------------------------------------------------------
                
                
@@ -1151,24 +1181,23 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   cout<<"Analyis cut selection ID is: "<<kGCAnalysisCutSelectionId.Data()<<endl;
   //  outputfile += Form(":PWG4_GammaConversion_%s",kGCAnalysisCutSelectionId.Data());
   outputfile += Form(":PWG4_GammaConversion");
-  /*  
-  // this is not really needed
-  if(kGCrunNeutralMeson==kTRUE) outputfile +="1";  else outputfile +="0";
 
-  if(kGCrunJet==kTRUE) outputfile +="1"; else outputfile +="0";
+//   if(kGCrunNeutralMeson==kTRUE) outputfile +="1";  else outputfile +="0";
+
+//   if(kGCrunJet==kTRUE) outputfile +="1"; else outputfile +="0";
 
-  if(kGCrunChic==kTRUE) outputfile +="1"; else outputfile +="0";
+//   if(kGCrunChic==kTRUE) outputfile +="1"; else outputfile +="0";
 
-  if(kGCrunCF==kTRUE) outputfile +="1"; else outputfile +="0";
+//   if(kGCrunCF==kTRUE) outputfile +="1"; else outputfile +="0";
 
-  if(kGCcalculateBackground==kTRUE) outputfile +="1"; else outputfile +="0";
+//   if(kGCcalculateBackground==kTRUE) outputfile +="1"; else outputfile +="0";
 
-  if(kGCdoNeutralMesonV0MCCheck==kTRUE) outputfile +="1"; else outputfile +="0";
+//   if(kGCdoNeutralMesonV0MCCheck==kTRUE) outputfile +="1"; else outputfile +="0";
 
-  if(kGCrunOmegaMeson==kTRUE) outputfile +="1"; else outputfile +="0";
+//   if(kGCrunOmegaMeson==kTRUE) outputfile +="1"; else outputfile +="0";
+
+//   if(kGCrunRES==kTRUE) outputfile +="1"; else outputfile +="0";
 
-  if(kGCrunRES==kTRUE) outputfile +="1"; else outputfile +="0";
-  */
   outputfile += Form("_%s",kGCAnalysisCutSelectionId.Data());
 
   cout<<"Ouput file::"<<  outputfile <<endl;
@@ -1213,6 +1242,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   v0Reader->SetMinClsTPCCut(kGCminClsTPCCut);  
   v0Reader->SetChi2CutConversion(kGCchi2CutConversion);
   v0Reader->SetChi2CutMeson(kGCchi2CutMeson);
+  v0Reader->SetAlphaCutMeson(kGCalphaCutMeson);
   v0Reader->SetPIDProbability(kGCprobElectron);
   v0Reader->SetXVertexCut(kGCxVertexCut);
   v0Reader->SetYVertexCut(kGCyVertexCut);
@@ -1234,6 +1264,18 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   v0Reader->SetOnFlyFlag(kGCUseOnFlyV0Finder);
   v0Reader->SetCalculateBackground(kGCcalculateBackground);
 
+  // for the rejection at LowP based on Dedx signal
+
+  v0Reader->SetDoKaonRejectionLowP(kGCdoKaonRejectionLowP);
+  v0Reader->SetDoProtonRejectionLowP(kGCdoProtonRejectionLowP);
+  v0Reader->SetDoPionRejectionLowP(kGCdoPionRejectionLowP);
+  v0Reader->SetPIDnSigmaAtLowPAroundKaonLine(kGCPIDnSigmaAtLowPAroundKaonLine);
+  v0Reader->SetPIDnSigmaAtLowPAroundProtonLine(kGCPIDnSigmaAtLowPAroundProtonLine);
+  v0Reader->SetPIDnSigmaAtLowPAroundPionLine(kGCPIDnSigmaAtLowPAroundPionLine);
+  v0Reader->SetPIDMinPKaonRejectionLowP(kGCPIDMinPKaonRejectionLowP);
+  v0Reader->SetPIDMinPProtonRejectionLowP(kGCPIDMinPProtonRejectionLowP);
+  v0Reader->SetPIDMinPPionRejectionLowP(kGCPIDMinPPionRejectionLowP);
+
 
   // Create the GammaConversionTask
 
@@ -1282,7 +1324,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   gammaconversion->SetDoJet(kGCrunJet);
   gammaconversion->SetDoChic(kGCrunChic);
   gammaconversion->SetDoOmegaMeson(kGCrunOmegaMeson);
-
+  gammaconversion->SetRecalculateV0ForGamma(kGCRecalculateV0ForGamma);
   // for CF
   gammaconversion->SetCFManager(man);
   gammaconversion->SetDoCF(kGCrunCF);
@@ -1337,7 +1379,11 @@ void build() {
   TStopwatch timer;
   timer.Start();
   gSystem->Load("libTree.so");
+  gSystem->Load("libGui.so");
+  gSystem->Load("libMinuit.so");
   gSystem->Load("libGeom");
+  gSystem->Load("libProof");
+  gSystem->Load("libRAWDatabase");
        
   ////
   //Setting up ESD.par//
@@ -1346,6 +1392,10 @@ void build() {
   setupPar("ESD");
   gSystem->Load("libVMC.so");
   gSystem->Load("libESD.so");
+
+
+  gSystem->Load("libCDB.so");
+  gSystem->Load("libSTEER.so");
        
   ////
   ////
@@ -1381,7 +1431,7 @@ void build() {
   ////
   cout<<"compiling CORRFW"<<endl;
   setupPar("CORRFW");
-  gSystem->Load("CORRFW.so");
+  gSystem->Load("libCORRFW.so");
        
   ////
   //Setting up PWG4GammaConv.par//
@@ -1544,10 +1594,15 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
     if(kGCplotESDConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
     if(kGCplotESDConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
-    if(kGCplotESDConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
-    if(kGCplotESDConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
+    if(kGCplotESDConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
+    if(kGCplotESDConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
+
+    if(kGCplotESDConvGammaEeProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_EProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
+    if(kGCplotESDConvGammaPeProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_EProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
+    if(kGCplotESDConvGammaEmupiProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_mupiProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
+    if(kGCplotESDConvGammaPmupiProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_mupiProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
 
-    if(kGCplotESDConvGammaQtAlfa== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlpha, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
+    if(kGCplotESDConvGammaQtAlfa== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlphaG, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
 
 
                
@@ -1577,8 +1632,8 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDTrueConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
     if(kGCplotESDTrueConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
     if(kGCplotESDTrueConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
-    if(kGCplotESDTrueConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
-    if(kGCplotESDTrueConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
+    if(kGCplotESDTrueConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
+    if(kGCplotESDTrueConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
 
                
     if(kGCplotESDTrueConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
@@ -1613,8 +1668,8 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDNoCutConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
 
 
-    if(kGCplotESDNoCutConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
-    if(kGCplotESDNoCutConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
+    if(kGCplotESDNoCutConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
+    if(kGCplotESDNoCutConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
 
     if(kGCplotESDNoCutConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
     if(kGCplotESDNoCutConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
@@ -1724,10 +1779,10 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
                histograms->AddHistogram("Resolution_E_dPt_Pt_ITS5" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
                histograms->AddHistogram("Resolution_E_dPt_Pt_ITS6" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
                histograms->AddHistogram("Resolution_E_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
-               histograms->AddHistogram("Resolution_E_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");
-               histograms->AddHistogram("Resolution_E_nTRDtracklets_MCPt","" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");   
-               histograms->AddHistogram("Resolution_E_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5, -0.5, 201,"", "");
-               histograms->AddHistogram("Resolution_E_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5, -0.5, 201.,"", "");
+               histograms->AddHistogram("Resolution_E_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");
+               histograms->AddHistogram("Resolution_E_nTRDtracklets_MCPt","" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");    
+               histograms->AddHistogram("Resolution_E_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201, -0.5, 200.5,"", "");
+               histograms->AddHistogram("Resolution_E_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201, -0.5, 200.5,"", "");
                //              histograms->AddHistogram("Resolution_E_TRDsignal_ESDPt","", fV0Reader->GetNegativeTrackPt(), fV0Reader->GetNegativeESDTrack()->GetTRDsignal());
                
                // :::::::::::::::::::::::::::::::::::::::: histograms for positrons :::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -1740,10 +1795,10 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
                histograms->AddHistogram("Resolution_P_dPt_Pt_ITS5" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
                histograms->AddHistogram("Resolution_P_dPt_Pt_ITS6" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
                histograms->AddHistogram("Resolution_P_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
-               histograms->AddHistogram("Resolution_P_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");   
-               histograms->AddHistogram("Resolution_P_nTRDtracklets_MCPt","", kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");
-               histograms->AddHistogram("Resolution_P_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5, -0.5, 201.,"", "");
-               histograms->AddHistogram("Resolution_P_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5,-0.5, 201.0,"", "");
+               histograms->AddHistogram("Resolution_P_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");   
+               histograms->AddHistogram("Resolution_P_nTRDtracklets_MCPt","", kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");
+               histograms->AddHistogram("Resolution_P_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201, -0.5, 200.5,"", "");
+               histograms->AddHistogram("Resolution_P_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201,-0.5, 200.5,"", "");
                //              histograms->AddHistogram("Resolution_P_TRDsignal_ESDPt", "",fV0Reader->GetPositiveTrackPt(), fV0Reader->GetPositiveESDTrack()->GetTRDsignal());
     } //end of specific trigger study resolution plots
     } //end if(kGCrunRES=true)
@@ -1766,11 +1821,14 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
 
     if(kGCplotESDCutdedxSigmaElectronLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaElectronLine_InvMass" ,"dedx ElectronLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutdedxSigmaPionLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaPionLine_InvMass" ,"dedx PionLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
-
+    if(kGCplotESDCutPionRejectionLowP==kTRUE){histograms->AddHistogram("ESD_CutPionRejectionLowP_InvMass" ,"dedx PionRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
+    if(kGCplotESDCutKaonRejectionLowP==kTRUE){histograms->AddHistogram("ESD_CutKaonRejectionLowP_InvMass" ,"dedx KaonRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
+    if(kGCplotESDCutProtonRejectionLowP==kTRUE){histograms->AddHistogram("ESD_CutProtonRejectionLowP_InvMass" ,"dedx ProtonRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutR == kTRUE){histograms->AddHistogram("ESD_CutR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutNDF == kTRUE){histograms->AddHistogram("ESD_CutNDF_InvMass" ,"NDF <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutChi2 == kTRUE){histograms->AddHistogram("ESD_CutChi2_InvMass" ,"#chi^{2} > Max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutEta == kTRUE){histograms->AddHistogram("ESD_CutEta_InvMass" ,"Above #eta max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
+    if(kGCplotESDCutSinglePt == kTRUE){histograms->AddHistogram("ESD_CutSinglePt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutPt == kTRUE){histograms->AddHistogram("ESD_CutPt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutLine == kTRUE){histograms->AddHistogram("ESD_CutLine_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutZ == kTRUE){histograms->AddHistogram("ESD_CutZ_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
@@ -1780,7 +1838,7 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDAllV0s == kTRUE){histograms->AddHistogram("ESD_AllV0s_InvMass" ,"All V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDAllV0sCurrentFinder == kTRUE){histograms->AddHistogram("ESD_AllV0sCurrentFinder_InvMass" ,"All V0s Current Finder" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
 
-    if(kGCplotESDAllV0sCurrentFinderQtAlfa== kTRUE){ histograms->AddHistogram("ESD_AllV0sCurrentFinder_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlpha, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
+    if(kGCplotESDAllV0sCurrentFinderQtAlfa== kTRUE){ histograms->AddHistogram("ESD_AllV0sCurrentFinder_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlphaG, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
 
     if(kGCplotESDTrueConvGammaTrackLength == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLength","Track length of TrueConvGamma",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,"","");}
     if(kGCplotESDTrueConvGammaTrackLengthVSInvMass == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass","Track length of TrueConvGamma vs Inv mass",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,"","");}
@@ -1797,9 +1855,10 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     }
 
     if(kGCplotPi0Spectra == kTRUE){
-      histograms->AddHistogram("ESD_Mother_alfa","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinAlpha, kGClastXBinAlpha,"#alfa","Counts");
+      histograms->AddHistogram("ESD_Mother_alfa","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinAlpha, kGClastXBinAlpha,"#alpha","Counts");
 
       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
+histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_alpha" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
       histograms->AddHistogram("ESD_Mother_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
       histograms->AddHistogram("ESD_Mother_InvMass_1212","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
       histograms->AddHistogram("ESD_Mother_InvMass_0912","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
@@ -1846,6 +1905,9 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     }
 
     if(kGCplotPi0Spectra == kTRUE && kGCcalculateBackground == kTRUE){
+      for(Int_t m=0;m<4;m++){
+       histograms->AddHistogram(Form("%dESD_Mother_InvMass_vs_Pt",m) ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
+      }
       for(Int_t z=0;z<8;z++){
        for(Int_t m=0;m<4;m++){
          histograms->AddHistogram(Form("%d%dESD_Background_InvMass_vs_Pt",z,m) ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
@@ -1862,7 +1924,10 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
       }
     
       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt" ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
-      histograms->AddHistogram("ESD_Background_InvMass","Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
+      histograms->AddHistogram("ESD_Background_InvMass_vs_Pt_alpha" ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
+
+    
+  histograms->AddHistogram("ESD_Background_InvMass","Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
 
       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt_Fiducial" ,"Background Invariant Mass vs Pt |eta|<0.9" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
       histograms->AddHistogram("ESD_Background_InvMass_Fiducial","Invariant mass background |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
@@ -2006,6 +2071,24 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     histograms->AddHistogram("ESD_multiplicity_distribution" ,"multiplicity distribution" , 200, 0, 200,"counts","Multiplicity");
     histograms->AddHistogram("ESD_ZvsMultiplicity" ,"Z vs Multiplicity" , 1000, -10, 10,200,0,200,"Z[cm]","Multiplicity");
   }
+  
+  if(kGCRecalculateV0ForGamma==kTRUE){
+    histograms->AddHistogram("ESD_RecalculateV0_InvMass","", kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");
+    histograms->AddHistogram("ESD_RecalculateV0_Pt","",kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
+    histograms->AddHistogram("ESD_RecalculateV0_E_dEdxP","",kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);
+    histograms->AddHistogram("ESD_RecalculateV0_P_dEdxP","",kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);
+    histograms->AddHistogram("ESD_RecalculateV0_cpa","",1000,-1.,1.,"","");
+    histograms->AddHistogram("ESD_RecalculateV0_dca","",100,0.,10.,"","");
+    histograms->AddHistogram("ESD_RecalculateV0_Rr","",250,0.,250.,"","");
+    histograms->AddHistogram("ESD_RecalculateV0_normdistP","",250,0.,250.,"","");
+    histograms->AddHistogram("ESD_RecalculateV0_normdistN","",250,0.,250.,"","");
+
+    histograms->AddHistogram("ESD_RecalculateGG_InvMass","",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
+    histograms->AddHistogram("ESD_RecalculateGG_InvMass_vs_Pt","", kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");            
+
+  }
+  
+
 }
 
 
@@ -2016,7 +2099,7 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   // set the cuts depending on the Cut Selection Id
   // first number is dummy always set to 9 
   //  const char* cutSelection = analysisCutSelection.Data(); 
-  if(analysisCutSelection.Length()!=10){
+  if(analysisCutSelection.Length()!=12){
     cout<<"Cut selection has the wrong length!"<<endl;
     return 0;
   }
@@ -2038,9 +2121,11 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   Int_t singlePtCut=array[7];
   Int_t clsTPCCut=array[8];
   Int_t etaCut=array[9];
+  Int_t chi2MesonCut=array[10];
+  Int_t LowPRejectionSigmaCut=array[11];
 
-
-
+  cout<<"LowPRejectionSigmaCut"<<LowPRejectionSigmaCut<<endl;
+  cout<<"chi2MesonCut: "<< chi2MesonCut<<endl;
   cout<<"etaCut: "<<etaCut<<endl;
   cout<<"clsTPCCut: "<<clsTPCCut<<endl;
   cout<<"singlePtCut: "<<singlePtCut<<endl;
@@ -2067,15 +2152,19 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   default:
     return iResult;
   }
+
   switch(eProbCut){
-  case 0:  // 0.
-    kGCprobElectron = 0.000;
+  case 0:
+    kGCprobElectron=0;
+    break;
+  case 1:
+    kGCprobElectron=0.1;
     break;
-  case 1:  // 0.001
-    kGCprobElectron = 0.001;
+  case 2:
+    kGCprobElectron=0.5;
     break;
-  case 2:  // 0.01
-    kGCprobElectron = 0.01;
+  case 3:
+    kGCprobElectron=0.7;
     break;
   default:
     return iResult;
@@ -2094,6 +2183,10 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
     kGCPIDnSigmaBelowElectronLine=-3;
     kGCPIDnSigmaAboveElectronLine=5;
     break;
+  case 3: // -4,5
+    kGCPIDnSigmaBelowElectronLine=-4;
+    kGCPIDnSigmaAboveElectronLine=5;
+    break;
   default:
     return iResult;
   }
@@ -2108,6 +2201,12 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   case 2:  // 1
     kGCPIDnSigmaAbovePionLine=1;
     break;
+  case 3:  // 1
+    kGCPIDnSigmaAbovePionLine=-1;
+    break;
+  case 4:  // 1
+    kGCPIDnSigmaAbovePionLine=-1.5;
+    break;
   default:
     return iResult;
   }
@@ -2136,6 +2235,15 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   case 2:  // 30
     kGCchi2CutConversion = 30.;
     break;
+  case 3:
+    kGCchi2CutConversion = 200.;
+    break;
+  case 4:
+    kGCchi2CutConversion = 500.;
+    break;
+  case 5:
+    kGCchi2CutConversion = 1000.;
+    break;
   default:
     return iResult;
   }
@@ -2191,6 +2299,55 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
     return iResult;
   }
 
+  switch(chi2MesonCut){
+  case 0:  // 100.
+    kGCchi2CutMeson = 100.;
+    break;
+  case 1:  // 50.
+    kGCchi2CutMeson = 50.;
+    break;
+  case 2:  // 30.
+    kGCchi2CutMeson = 30.;
+    break;
+  case 3:
+    kGCchi2CutMeson = 200.;
+    break;
+  case 4:
+    kGCchi2CutMeson = 500.;
+    break;
+  case 5:
+    kGCchi2CutMeson = 1000.;
+    break;
+  default:
+    return iResult;
+  }
+
+
+  switch(LowPRejectionSigmaCut){
+  case 0:  // 
+    kGCPIDnSigmaAtLowPAroundKaonLine=0;
+    kGCPIDnSigmaAtLowPAroundProtonLine=0;
+    kGCPIDnSigmaAtLowPAroundPionLine=0;
+    break;
+  case 1:  // 
+    kGCPIDnSigmaAtLowPAroundKaonLine=0.5;
+    kGCPIDnSigmaAtLowPAroundProtonLine=0.5;
+    kGCPIDnSigmaAtLowPAroundPionLine=0.5;
+    break;
+  case 2:  // 
+    kGCPIDnSigmaAtLowPAroundKaonLine=1;
+    kGCPIDnSigmaAtLowPAroundProtonLine=1;
+    kGCPIDnSigmaAtLowPAroundPionLine=1;
+    break;
+  case 3:  // 
+    kGCPIDnSigmaAtLowPAroundKaonLine=2.;
+    kGCPIDnSigmaAtLowPAroundProtonLine=2.;
+    kGCPIDnSigmaAtLowPAroundPionLine=2.;
+    break;
+  default:
+    return iResult;
+  }
+
   iResult=1;
   return iResult;
 }
@@ -2210,6 +2367,8 @@ void string2array(const std::string& number, int a[c_array_size])
         ASSIGNARRAY(7);
         ASSIGNARRAY(8);
         ASSIGNARRAY(9);
+        ASSIGNARRAY(10);
+        ASSIGNARRAY(11);
   }
 }