Added extra histograms and some functions to fill them. (Ana)
authorkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Oct 2009 22:07:21 +0000 (22:07 +0000)
committerkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Oct 2009 22:07:21 +0000 (22:07 +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/macros/ConfigGammaConversion.C

index d74e60f..6d98107 100644 (file)
@@ -87,7 +87,7 @@ AliAnalysisTaskSE(),
   fPi0Width(-1),
   fEtaWidth(-1),
   fMinOpeningAngleGhostCut(0.),
-  fEsdTrackCuts(0),
+  fEsdTrackCuts(NULL),
   fCalculateBackground(kFALSE),
   fWriteNtuple(kFALSE),
   fGammaNtuple(NULL),
@@ -102,6 +102,8 @@ AliAnalysisTaskSE(),
   fMinPtGamChargedCorr(0.5),
   fMinPtJetCone(0.5),
   fLeadingChargedIndex(-1),
+  fLowPtMapping(1.),
+  fHighPtMapping(3.),
   fAODBranch(NULL),
   fAODBranchName("GammaConv")//,
   //  fAODObjects(NULL)
@@ -154,7 +156,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fPi0Width(-1),
   fEtaWidth(-1),
   fMinOpeningAngleGhostCut(0.),
-  fEsdTrackCuts(0),
+  fEsdTrackCuts(NULL),
   fCalculateBackground(kFALSE),
   fWriteNtuple(kFALSE),
   fGammaNtuple(NULL),
@@ -169,6 +171,8 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fMinPtGamChargedCorr(0.5),
   fMinPtJetCone(0.5),
   fLeadingChargedIndex(-1),
+  fLowPtMapping(1.),
+  fHighPtMapping(3.),
   fAODBranch(NULL),
   fAODBranchName("GammaConv")//,
   // fAODObjects(NULL)
@@ -205,7 +209,11 @@ AliAnalysisTaskGammaConversion::~AliAnalysisTaskGammaConversion()
   if(fCFManager){
     delete fCFManager;
   }
-       
+
+  if(fEsdTrackCuts){
+    delete fEsdTrackCuts;
+  }
+
   if (fAODBranch) {
     fAODBranch->Clear();
     delete fAODBranch ;
@@ -221,7 +229,9 @@ void AliAnalysisTaskGammaConversion::Init()
 void AliAnalysisTaskGammaConversion::SetESDtrackCuts()
 {
   // SetESDtrackCuts
-       
+  if (fEsdTrackCuts!=NULL){
+    delete fEsdTrackCuts;
+  }
   fEsdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
   //standard cuts from:
   //http://aliceinfo.cern.ch/alicvs/viewvc/PWG0/dNdEta/CreateCuts.C?revision=1.4&view=markup
@@ -567,30 +577,74 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
                        
       // begin Mapping 
       Int_t rBin    = fHistograms->GetRBin(ePos->R());
+      Int_t zBin    = fHistograms->GetZBin(ePos->Vz());
       Int_t phiBin  = fHistograms->GetPhiBin(particle->Phi());
-                       
+
+      TVector3 vtxPos(ePos->Vx(),ePos->Vy(),ePos->Vz());       
+      
       TString nameMCMappingPhiR="";
       nameMCMappingPhiR.Form("MC_Conversion_Mapping_Phi%02d_R%02d",phiBin,rBin);
       fHistograms->FillHistogram(nameMCMappingPhiR, ePos->Vz(), particle->Eta());
                        
       TString nameMCMappingPhi="";
       nameMCMappingPhi.Form("MC_Conversion_Mapping_Phi%02d",phiBin);
-      fHistograms->FillHistogram(nameMCMappingPhi, particle->Eta());
+      //      fHistograms->FillHistogram(nameMCMappingPhi, particle->Eta());
+      fHistograms->FillHistogram(nameMCMappingPhi, ePos->Vz(), particle->Eta());
                        
       TString nameMCMappingR="";
       nameMCMappingR.Form("MC_Conversion_Mapping_R%02d",rBin);
-      fHistograms->FillHistogram(nameMCMappingR, particle->Eta());
+      //      fHistograms->FillHistogram(nameMCMappingR, particle->Eta());
+      fHistograms->FillHistogram(nameMCMappingR,ePos->Vz(), particle->Eta());
                        
       TString nameMCMappingPhiInR="";
       nameMCMappingPhiInR.Form("MC_Conversion_Mapping_Phi_in_R_%02d",rBin);
-      fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi);
+      //      fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi);
+      fHistograms->FillHistogram(nameMCMappingPhiInR, vtxPos.Phi());
+
+      TString nameMCMappingZInR="";
+      nameMCMappingZInR.Form("MC_Conversion_Mapping_Z_in_R_%02d",rBin);
+      fHistograms->FillHistogram(nameMCMappingZInR,ePos->Vz() );
+
+
+      TString nameMCMappingPhiInZ="";
+      nameMCMappingPhiInZ.Form("MC_Conversion_Mapping_Phi_in_Z_%02d",zBin);
+      //      fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi);
+      fHistograms->FillHistogram(nameMCMappingPhiInZ, vtxPos.Phi());
+
+      TString nameMCMappingRInZ="";
+      nameMCMappingRInZ.Form("MC_Conversion_Mapping_R_in_Z_%02d",zBin);
+      fHistograms->FillHistogram(nameMCMappingRInZ,ePos->R() );
+
+      if(particle->Pt() > fLowPtMapping && particle->Pt()< fHighPtMapping){
+       TString nameMCMappingMidPtPhiInR="";
+       nameMCMappingMidPtPhiInR.Form("MC_Conversion_Mapping_MidPt_Phi_in_R_%02d",rBin);
+       fHistograms->FillHistogram(nameMCMappingMidPtPhiInR, vtxPos.Phi());
+       
+       TString nameMCMappingMidPtZInR="";
+       nameMCMappingMidPtZInR.Form("MC_Conversion_Mapping_MidPt_Z_in_R_%02d",rBin);
+       fHistograms->FillHistogram(nameMCMappingMidPtZInR,ePos->Vz() );
+       
+       
+       TString nameMCMappingMidPtPhiInZ="";
+       nameMCMappingMidPtPhiInZ.Form("MC_Conversion_Mapping_MidPt_Phi_in_Z_%02d",zBin);
+       fHistograms->FillHistogram(nameMCMappingMidPtPhiInZ, vtxPos.Phi());
+       
+       TString nameMCMappingMidPtRInZ="";
+       nameMCMappingMidPtRInZ.Form("MC_Conversion_Mapping_MidPt_R_in_Z_%02d",zBin);
+       fHistograms->FillHistogram(nameMCMappingMidPtRInZ,ePos->R() );
+
+      }
+
       //end mapping
                        
       fHistograms->FillHistogram("MC_Conversion_R",ePos->R());
       fHistograms->FillHistogram("MC_Conversion_ZR",ePos->Vz(),ePos->R());
       fHistograms->FillHistogram("MC_Conversion_XY",ePos->Vx(),ePos->Vy());
       fHistograms->FillHistogram("MC_Conversion_OpeningAngle",GetMCOpeningAngle(ePos, eNeg));
-                       
+      fHistograms->FillHistogram("MC_ConvGamma_E_AsymmetryP",particle->P(),eNeg->P()/particle->P());
+      fHistograms->FillHistogram("MC_ConvGamma_P_AsymmetryP",particle->P(),ePos->P()/particle->P());
+
+
       if(particle->GetMother(0) < 0){ // no mother = direct gamma, still inside converted
        fHistograms->FillHistogram("MC_ConvDirectGamma_Energy",particle->Energy());
        fHistograms->FillHistogram("MC_ConvDirectGamma_Pt", particle->Pt());
@@ -864,6 +918,15 @@ void AliAnalysisTaskGammaConversion::ProcessV0sNoCut(){
     if(fV0Reader->CheckForPrimaryVertex() == kFALSE){
       return;
     }
+
+    if( !fV0Reader->GetV0(i)->GetOnFlyStatus()){
+      return;
+    }
+
+    if( !(fV0Reader->GetNegativeESDTrack()->GetStatus() & AliESDtrack::kTPCrefit) || 
+        !(fV0Reader->GetPositiveESDTrack()->GetStatus() & AliESDtrack::kTPCrefit) ){
+      return;
+    }
                
     if(fDoMCTruth){
                        
@@ -905,7 +968,16 @@ void AliAnalysisTaskGammaConversion::ProcessV0sNoCut(){
        fHistograms->FillHistogram("ESD_NoCutConversion_R", fV0Reader->GetXYRadius());
        fHistograms->FillHistogram("ESD_NoCutConversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());
        fHistograms->FillHistogram("ESD_NoCutConversion_OpeningAngle", fV0Reader->GetOpeningAngle());
-                               
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_CosPointingAngle", fV0Reader->GetCosPointingAngle());
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_DcaDaughters", fV0Reader->GetDcaDaughters());
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_NormDcaDistDaughters", fV0Reader->GetNormDcaDistDaughters());
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_LikelihoodAP", fV0Reader->GetLikelihoodAP());
+
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_E_AsymmetryP",fV0Reader->GetMotherCandidateP(),fV0Reader->GetNegativeTrackP()/fV0Reader->GetMotherCandidateP());
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_P_AsymmetryP",fV0Reader->GetMotherCandidateP(),fV0Reader->GetPositiveTrackP()/fV0Reader->GetMotherCandidateP());
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_E_dEdxP",fV0Reader->GetNegativeTrackP(),fV0Reader->GetNegativeTrackTPCdEdx());
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_P_dEdxP",fV0Reader->GetPositiveTrackP(),fV0Reader->GetPositiveTrackTPCdEdx());
+
        //store MCTruth properties
        fHistograms->FillHistogram("ESD_NoCutConvGamma_MC_Pt_Eta", fV0Reader->GetMotherMCParticle()->Pt(),fV0Reader->GetMotherMCParticle()->Eta());
        fHistograms->FillHistogram("ESD_NoCutConversion_MC_ZR", negativeMC->Vz(),negativeMC->R());
@@ -957,11 +1029,25 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
                
     fHistograms->FillHistogram("ESD_ConvGamma_Pt_Chi2", fV0Reader->GetMotherCandidatePt(), fV0Reader->GetMotherCandidateChi2());
     fHistograms->FillHistogram("ESD_ConvGamma_Eta_Chi2", fV0Reader->GetMotherCandidateEta(), fV0Reader->GetMotherCandidateChi2());
+    
+    fHistograms->FillHistogram("ESD_ConvGamma_CosPointingAngle", fV0Reader->GetCosPointingAngle());
+    fHistograms->FillHistogram("ESD_ConvGamma_DcaDaughters", fV0Reader->GetDcaDaughters());
+    fHistograms->FillHistogram("ESD_ConvGamma_NormDcaDistDaughters", fV0Reader->GetNormDcaDistDaughters());
+    fHistograms->FillHistogram("ESD_ConvGamma_LikelihoodAP", fV0Reader->GetLikelihoodAP());
+    
+    fHistograms->FillHistogram("ESD_ConvGamma_E_AsymmetryP",fV0Reader->GetMotherCandidateP(),fV0Reader->GetNegativeTrackP()/fV0Reader->GetMotherCandidateP());
+    fHistograms->FillHistogram("ESD_ConvGamma_P_AsymmetryP",fV0Reader->GetMotherCandidateP(),fV0Reader->GetPositiveTrackP()/fV0Reader->GetMotherCandidateP());
+    fHistograms->FillHistogram("ESD_ConvGamma_E_dEdxP",fV0Reader->GetNegativeTrackP(),fV0Reader->GetNegativeTrackTPCdEdx());
+    fHistograms->FillHistogram("ESD_ConvGamma_P_dEdxP",fV0Reader->GetPositiveTrackP(),fV0Reader->GetPositiveTrackTPCdEdx());
+    
                
                
     // begin mapping
     Int_t rBin    = fHistograms->GetRBin(fV0Reader->GetXYRadius());
+    Int_t zBin    = fHistograms->GetZBin(fV0Reader->GetZ());
     Int_t phiBin  = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi());
+    TVector3 vtxConv(fV0Reader->GetX(),fV0Reader->GetY(), fV0Reader->GetZ());
+
     Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta();
                
     TString nameESDMappingPhiR="";
@@ -978,7 +1064,42 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
                
     TString nameESDMappingPhiInR="";
     nameESDMappingPhiInR.Form("ESD_Conversion_Mapping_Phi_in_R_%02d",rBin);
-    fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetMotherCandidatePhi());
+    //    fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetMotherCandidatePhi());
+    fHistograms->FillHistogram(nameESDMappingPhiInR, vtxConv.Phi());
+
+    TString nameESDMappingZInR="";
+    nameESDMappingZInR.Form("ESD_Conversion_Mapping_Z_in_R_%02d",rBin);
+    fHistograms->FillHistogram(nameESDMappingZInR, fV0Reader->GetZ());
+
+    TString nameESDMappingPhiInZ="";
+    nameESDMappingPhiInZ.Form("ESD_Conversion_Mapping_Phi_in_Z_%02d",zBin);
+    //    fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetMotherCandidatePhi());
+    fHistograms->FillHistogram(nameESDMappingPhiInZ, vtxConv.Phi());
+
+    TString nameESDMappingRInZ="";
+    nameESDMappingRInZ.Form("ESD_Conversion_Mapping_R_in_Z_%02d",zBin);
+    fHistograms->FillHistogram(nameESDMappingRInZ, fV0Reader->GetXYRadius());
+
+    if(fV0Reader->GetMotherCandidatePt() > fLowPtMapping && fV0Reader->GetMotherCandidatePt()< fHighPtMapping){
+      TString nameESDMappingMidPtPhiInR="";
+      nameESDMappingMidPtPhiInR.Form("ESD_Conversion_Mapping_MidPt_Phi_in_R_%02d",rBin);
+      fHistograms->FillHistogram(nameESDMappingMidPtPhiInR, vtxConv.Phi());
+      
+      TString nameESDMappingMidPtZInR="";
+      nameESDMappingMidPtZInR.Form("ESD_Conversion_Mapping_MidPt_Z_in_R_%02d",rBin);
+      fHistograms->FillHistogram(nameESDMappingMidPtZInR, fV0Reader->GetZ());
+      
+      TString nameESDMappingMidPtPhiInZ="";
+      nameESDMappingMidPtPhiInZ.Form("ESD_Conversion_Mapping_MidPt_Phi_in_Z_%02d",zBin);
+      fHistograms->FillHistogram(nameESDMappingMidPtPhiInZ, vtxConv.Phi());
+      
+      TString nameESDMappingMidPtRInZ="";
+      nameESDMappingMidPtRInZ.Form("ESD_Conversion_Mapping_MidPt_R_in_Z_%02d",zBin);
+      fHistograms->FillHistogram(nameESDMappingMidPtRInZ, fV0Reader->GetXYRadius());
+
+    }
+
+
     // end mapping
                
     new((*fKFReconstructedGammasTClone)[fKFReconstructedGammasTClone->GetEntriesFast()])  AliKFParticle(*fV0Reader->GetMotherCandidateKFCombination());
@@ -1034,6 +1155,18 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        fHistograms->FillHistogram("ESD_TrueConversion_R", fV0Reader->GetXYRadius());
        fHistograms->FillHistogram("ESD_TrueConversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());
        fHistograms->FillHistogram("ESD_TrueConversion_OpeningAngle", fV0Reader->GetOpeningAngle());
+
+       fHistograms->FillHistogram("ESD_TrueConvGamma_CosPointingAngle", fV0Reader->GetCosPointingAngle());
+       fHistograms->FillHistogram("ESD_TrueConvGamma_DcaDaughters", fV0Reader->GetDcaDaughters());
+       fHistograms->FillHistogram("ESD_TrueConvGamma_NormDcaDistDaughters", fV0Reader->GetNormDcaDistDaughters());
+       fHistograms->FillHistogram("ESD_TrueConvGamma_LikelihoodAP", fV0Reader->GetLikelihoodAP());
+
+       fHistograms->FillHistogram("ESD_TrueConvGamma_E_AsymmetryP",fV0Reader->GetMotherCandidateP(),fV0Reader->GetNegativeTrackP()/fV0Reader->GetMotherCandidateP());
+       fHistograms->FillHistogram("ESD_TrueConvGamma_P_AsymmetryP",fV0Reader->GetMotherCandidateP(),fV0Reader->GetPositiveTrackP()/fV0Reader->GetMotherCandidateP());
+       fHistograms->FillHistogram("ESD_TrueConvGamma_E_dEdxP",fV0Reader->GetNegativeTrackP(),fV0Reader->GetNegativeTrackTPCdEdx());
+       fHistograms->FillHistogram("ESD_TrueConvGamma_P_dEdxP",fV0Reader->GetPositiveTrackP(),fV0Reader->GetPositiveTrackTPCdEdx());
+
+
                                
        //store MCTruth properties
        fHistograms->FillHistogram("ESD_TrueConvGamma_MC_Pt_Eta", fV0Reader->GetMotherMCParticle()->Pt(),fV0Reader->GetMotherMCParticle()->Eta());
@@ -1175,6 +1308,11 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){
          fHistograms->FillHistogram("ESD_Mother_XY", twoGammaCandidate->GetX(), twoGammaCandidate->GetY());
          fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt",massTwoGammaCandidate ,momentumVectorTwoGammaCandidate.Pt());
          fHistograms->FillHistogram("ESD_Mother_InvMass",massTwoGammaCandidate);
+
+         if ( TMath::Abs(twoGammaDecayCandidateDaughter0->GetEta())<0.9 &&  TMath::Abs(twoGammaDecayCandidateDaughter1->GetEta())<0.9 ){
+           fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt_Fiducial",massTwoGammaCandidate ,momentumVectorTwoGammaCandidate.Pt());
+           fHistograms->FillHistogram("ESD_Mother_InvMass_Fiducial",massTwoGammaCandidate);
+         }
        }
       }
       delete twoGammaCandidate;
@@ -1230,6 +1368,12 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
          fHistograms->FillHistogram("ESD_Background_XY", backgroundCandidate->GetX(), backgroundCandidate->GetY());
          fHistograms->FillHistogram("ESD_Background_InvMass_vs_Pt",massBG,momentumVectorbackgroundCandidate.Pt());
          fHistograms->FillHistogram("ESD_Background_InvMass",massBG);
+
+         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);
+         }
+
        }
       }
       delete backgroundCandidate;   
index 3ed9eef..93df382 100644 (file)
@@ -78,6 +78,10 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   void SetMinPtIsoCone(Double_t minPtIsoCone){fMinPtIsoCone=minPtIsoCone;}
   void SetMinPtGamChargedCorr(Double_t minPtGamChargedCorr){fMinPtGamChargedCorr=minPtGamChargedCorr;}
   void SetMinPtJetCone(Double_t minPtJetCone){fMinPtJetCone=minPtJetCone;}
+
+  void SetLowPtMapping(Double_t lowPtMapping){fLowPtMapping=lowPtMapping;}
+  void SetHighPtMapping(Double_t highPtMapping){fHighPtMapping=highPtMapping;}
+
                
   void SetHistograms(AliGammaConversionHistograms *const histograms){fHistograms=histograms;}
   void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}
@@ -208,6 +212,9 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   Double_t fMinPtGamChargedCorr; //! transient
   Double_t fMinPtJetCone; //! transient
   Int_t    fLeadingChargedIndex; //! transient
+  Double_t fLowPtMapping;
+  Double_t fHighPtMapping;
+
                
   TClonesArray* fAODBranch ;        //! selected particles branch
   TString fAODBranchName; // New AOD branch name
index 522882c..30ca65c 100644 (file)
@@ -37,6 +37,7 @@ AliGammaConversionHistograms::AliGammaConversionHistograms() :
   fHistogramMap(new TMap()),
   fNPhiIndex(0),
   fNRIndex(0),
+  fNZIndex(0),
   fMinRadius(0.),
   fMaxRadius(0.),
   fDeltaR(0.),
@@ -61,6 +62,7 @@ AliGammaConversionHistograms::AliGammaConversionHistograms(const AliGammaConvers
   fHistogramMap(original.fHistogramMap),
   fNPhiIndex(original.fNPhiIndex),
   fNRIndex(original.fNRIndex),
+  fNZIndex(original.fNZIndex),
   fMinRadius(original.fMinRadius),
   fMaxRadius(original.fMaxRadius),
   fDeltaR(original.fDeltaR),
@@ -278,12 +280,33 @@ void AliGammaConversionHistograms::GetOutputContainer(TList *fOutputContainer){
 Int_t AliGammaConversionHistograms::GetRBin(Double_t radius) const{
   // see header file for documentation
   Int_t iResult=0;
-  if(fDeltaR>0){
-    iResult = (Int_t)((radius - fMinRadius)/fDeltaR);
+//   if(fDeltaR>0){
+//     iResult = (Int_t)((radius - fMinRadius)/fDeltaR);
+//   }
+  for(Int_t i=0;i<fNRIndex;i++){
+    //    cout<<"Test-limits::"<< fRBinLimits[i]<<endl;
+    if( radius>=fRBinLimits[i] && radius<fRBinLimits[i+1] ){
+      iResult=i;
+    }
   }
   return iResult;
 }
 
+Int_t AliGammaConversionHistograms::GetZBin(Double_t zPos) const{
+  // see header file for documentation
+  Int_t iResult=0;
+
+  for(Int_t i=0;i<fNZIndex;i++){
+    //    cout<<"Test-limits::"<< fZBinLimits[i]<<endl;
+    if( TMath::Abs(zPos)>=fZBinLimits[i] && TMath::Abs(zPos)<fZBinLimits[i+1] ){
+      iResult=i;
+    }
+  }
+  return iResult;
+}
+
+
+
 Int_t AliGammaConversionHistograms::GetPhiBin(Double_t phi) const{
   // see header file for documentation
   Int_t iResult=0;
@@ -303,6 +326,28 @@ void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_
        
   fNPhiIndex = nPhiIndex;
   fNRIndex   = nRIndex;
+  fNZIndex = 6;
+
+  fRBinLimits= new Double_t[8];
+  fRBinLimits[0]=0.;
+  fRBinLimits[1]=12.;
+  fRBinLimits[2]=22.;
+  fRBinLimits[3]=35.;
+  fRBinLimits[4]=55.;
+  fRBinLimits[5]=72.;
+  fRBinLimits[6]=90.;
+  fRBinLimits[7]=500.;
+
+  fZBinLimits= new Double_t[7];
+  fZBinLimits[0]=0.;
+  fZBinLimits[1]=15.;
+  fZBinLimits[2]=30.;
+  fZBinLimits[3]=50.;
+  fZBinLimits[4]=100.;
+  fZBinLimits[5]=200.;
+  fZBinLimits[6]=500.;
+
+
   fMinRadius      = minRadius;
   fMaxRadius      = maxRadius;
   if(nBinsR>0 && nRIndex!=0){
@@ -320,7 +365,7 @@ void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_
 void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t nRIndex,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
   // see header file for documentation
        
-  for(Int_t phi =0; phi<=fNPhiIndex;phi++){
+  for(Int_t phi =0; phi<fNPhiIndex;phi++){
                
     for(Int_t r =0; r<fNRIndex;r++){
                        
@@ -375,7 +420,7 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     TString titleMC="";
     titleMC.Form("Electron-Positron MC Mapping-Phi%02d",phi);
                
-    AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);
                
     //MC
     TString nameESD="";
@@ -383,11 +428,11 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     TString titleESD="";
     titleESD.Form("Electron-Positron ESD Mapping-Phi%02d",phi);
                
-    AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameESD, titleESD, nXBins, firstX, lastX,nYBins, firstY, lastY, xAxisTitle, yAxisTitle);
   }
        
        
-  for(Int_t r =0; r<=nRIndex;r++){
+  for(Int_t r =0; r<nRIndex;r++){
                
     // setting axis to "" changes below
     xAxisTitle="#phi";
@@ -406,7 +451,7 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     TString titleMC="";
     titleMC.Form("Electron-Positron MC Mapping-R%02d",r);
                
-    AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);
                
     //ESD
     TString nameESD="";
@@ -414,20 +459,159 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     TString titleESD="";
     titleESD.Form("Electron-Positron ESD Mapping-R%02d",r);
                
-    AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameESD, titleESD, nXBins, firstX, lastX,nYBins, firstY, lastY, xAxisTitle, yAxisTitle);
                
     //Mapping Phi in R
     TString nameMCPhiInR="";
     nameMCPhiInR.Form("MC_Conversion_Mapping_Phi_in_R_%02d",r);
     TString titleMCPhiInR="";
     titleMCPhiInR.Form("MC Mapping of Phi in R%02d",r);
-    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
                
+
+    //Mapping Z in R
+    TString nameMCZInR="";
+    nameMCZInR.Form("MC_Conversion_Mapping_Z_in_R_%02d",r);
+    TString titleMCZInR="";
+    titleMCZInR.Form("MC Mapping of Z in R%02d",r);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCZInR, titleMCZInR, nXBins, -300, 300, xAxisTitle, yAxisTitle);
+
+
+   //Mapping Phi in R Middle Pt
+    TString nameMCMidPtPhiInR="";
+    nameMCMidPtPhiInR.Form("MC_Conversion_Mapping_MidPt_Phi_in_R_%02d",r);
+    TString titleMCMidPtPhiInR="";
+    titleMCMidPtPhiInR.Form("MC Mapping Middle Pt of Phi in R%02d",r);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCMidPtPhiInR, titleMCMidPtPhiInR, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
+               
+
+    //Mapping Z in R Middle Pt
+    TString nameMCMidPtZInR="";
+    nameMCMidPtZInR.Form("MC_Conversion_Mapping_MidPt_Z_in_R_%02d",r);
+    TString titleMCMidPtZInR="";
+    titleMCMidPtZInR.Form("MC Mapping Middle Pt of Z in R%02d",r);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCMidPtZInR, titleMCMidPtZInR, nXBins, -300, 300, xAxisTitle, yAxisTitle);
+
+
+
+
     //Mapping Phi in R
     TString nameESDPhiInR="";
     nameESDPhiInR.Form("ESD_Conversion_Mapping_Phi_in_R_%02d",r);
     TString titleESDPhiInR="";
     titleESDPhiInR.Form("ESD Mapping of Phi in R%02d",r);
-    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
+
+   //Mapping Z in R
+    TString nameESDZInR="";
+    nameESDZInR.Form("ESD_Conversion_Mapping_Z_in_R_%02d",r);
+    TString titleESDZInR="";
+    titleESDZInR.Form("ESD Mapping of Z in R%02d",r);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDZInR, titleESDZInR, nXBins, -300, 300, xAxisTitle, yAxisTitle);    
+
+    //Mapping Phi in R Middle Pt 
+    TString nameESDMidPtPhiInR="";
+    nameESDMidPtPhiInR.Form("ESD_Conversion_Mapping_MidPt_Phi_in_R_%02d",r);
+    TString titleESDMidPtPhiInR="";
+    titleESDMidPtPhiInR.Form("ESD Mapping Middle Pt of Phi in R%02d",r);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDMidPtPhiInR, titleESDMidPtPhiInR, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
+
+   //Mapping Z in R Middle Pt
+    TString nameESDMidPtZInR="";
+    nameESDMidPtZInR.Form("ESD_Conversion_Mapping_MidPt_Z_in_R_%02d",r);
+    TString titleESDMidPtZInR="";
+    titleESDMidPtZInR.Form("ESD Mapping Middle Pt of Z in R%02d",r);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDMidPtZInR, titleESDMidPtZInR, nXBins, -300, 300, xAxisTitle, yAxisTitle);    
+
+
+  }
+
+
+
+  for(Int_t z =0; z<fNZIndex;z++){
+    //Mapping Phi in Z
+    TString nameMCPhiInZ="";
+    nameMCPhiInZ.Form("MC_Conversion_Mapping_Phi_in_Z_%02d",z);
+    TString titleMCPhiInZ="";
+    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 R in Z
+    TString nameMCRInZ="";
+    nameMCRInZ.Form("MC_Conversion_Mapping_R_in_Z_%02d",z);
+    TString titleMCRInZ="";
+    titleMCRInZ.Form("MC Mapping of R in Z%02d",z);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCRInZ, titleMCRInZ, nXBins, fMinRadius, fMaxRadius, xAxisTitle, yAxisTitle);
+
+   //Mapping Phi in Z Middle Pt
+    TString nameMCMidPtPhiInZ="";
+    nameMCMidPtPhiInZ.Form("MC_Conversion_Mapping_MidPt_Phi_in_Z_%02d",z);
+    TString titleMCMidPtPhiInZ="";
+    titleMCMidPtPhiInZ.Form("MC Mapping Middle Pt of Phi in Z%02d",z);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCMidPtPhiInZ, titleMCMidPtPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);
+               
+
+    //Mapping R in Z Middle Pt
+    TString nameMCMidPtRInZ="";
+    nameMCMidPtRInZ.Form("MC_Conversion_Mapping_MidPt_R_in_Z_%02d",z);
+    TString titleMCMidPtRInZ="";
+    titleMCMidPtRInZ.Form("MC Mapping Middle Pt of R in Z%02d",z);
+    //    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);
+    AddHistogram(nameMCMidPtRInZ, titleMCMidPtRInZ, nXBins, fMinRadius, fMaxRadius, xAxisTitle, yAxisTitle);
+
+
+
+
+    //Mapping Phi in Z
+    TString nameESDPhiInZ="";
+    nameESDPhiInZ.Form("ESD_Conversion_Mapping_Phi_in_Z_%02d",z);
+    TString titleESDPhiInZ="";
+    titleESDPhiInZ.Form("ESD Mapping of Phi in R%02d",z);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDPhiInZ, titleESDPhiInZ, nXBins, -TMath::Pi(), TMath::Pi(), xAxisTitle, yAxisTitle);    
+
+   //Mapping R in Z
+    TString nameESDRInZ="";
+    nameESDRInZ.Form("ESD_Conversion_Mapping_R_in_Z_%02d",z);
+    TString titleESDRInZ="";
+    titleESDRInZ.Form("ESD Mapping of R in Z%02d",z);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDRInZ, titleESDRInZ, nXBins, fMinRadius, fMaxRadius, xAxisTitle, yAxisTitle);    
+
+
+   //Mapping Phi in Z Middle Pt
+    TString nameESDMidPtPhiInZ="";
+    nameESDMidPtPhiInZ.Form("ESD_Conversion_Mapping_MidPt_Phi_in_Z_%02d",z);
+    TString titleESDMidPtPhiInZ="";
+    titleESDMidPtPhiInZ.Form("ESD Mapping Middle Ptof Phi in R%02d",z);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDMidPtPhiInZ, titleESDMidPtPhiInZ, 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);
+    TString titleESDMidPtRInZ="";
+    titleESDMidPtRInZ.Form("ESD Mapping Middle Pt of R in Z%02d",z);
+    //    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    
+    AddHistogram(nameESDMidPtRInZ, titleESDMidPtRInZ, nXBins, fMinRadius, fMaxRadius, xAxisTitle, yAxisTitle);    
+
+
+
   }
+
+
+
 }
index 2a6ff9b..ef3f2ad 100644 (file)
@@ -33,7 +33,8 @@ class AliGammaConversionHistograms{
   
   Int_t GetRBin(Double_t radius) const;
   Int_t GetPhiBin(Double_t phi) const;
-
+  Int_t GetZBin(Double_t radius) const;
   void InitializeMappingValues(Int_t nPhiHistograms, Int_t nRHistograms, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi);
 
   void AddMappingHistograms(Int_t nPhiHistograms, Int_t nRHistograms,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="");
@@ -71,9 +72,14 @@ class AliGammaConversionHistograms{
 
  private:
   TMap* fHistogramMap; // histogram map
+  
+
 
   Int_t fNPhiIndex; //phi index
   Int_t fNRIndex; //r index
+  Int_t fNZIndex; //z index
+  Double_t * fRBinLimits; // Limits of the radius bins
+  Double_t * fZBinLimits; // Limits of the Z bins
   Double_t fMinRadius; //min radius cut
   Double_t fMaxRadius; //max radius cut
   Double_t fDeltaR; // delta r
index f584625..6a99950 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "AliStack.h"
 #include "AliMCEventHandler.h"
-
+#include "AliTPCpidESD.h"
 
 class iostream;
 class AliESDv0;
@@ -53,6 +53,7 @@ AliV0Reader::AliV0Reader() :
   fESDHandler(NULL),
   fESDEvent(NULL),
   fCFManager(NULL),
+  fTPCpid(NULL),
   fHistograms(NULL),
   fCurrentV0IndexNumber(0),
   fCurrentV0(NULL),
@@ -87,6 +88,11 @@ AliV0Reader::AliV0Reader() :
   fChi2CutMeson(0.),
   fPIDProbabilityCutNegativeParticle(0),
   fPIDProbabilityCutPositiveParticle(0),
+  fDodEdxSigmaCut(kFALSE),
+  fPIDnSigmaAboveElectronLine(100),
+  fPIDnSigmaBelowElectronLine(-100),
+  fPIDnSigmaAbovePionLine(-100), 
+  fPIDMinPnSigmaAbovePionLine(100), 
   fXVertexCut(0.),
   fYVertexCut(0.),
   fZVertexCut(0.),
@@ -96,7 +102,7 @@ AliV0Reader::AliV0Reader() :
   fCurrentEventGoodV0s(),
   fPreviousEventGoodV0s()
 {
-       
+  fTPCpid = new AliTPCpidESD;  
 }
 
 
@@ -109,6 +115,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fESDHandler(original.fESDHandler),
   fESDEvent(original.fESDEvent),
   fCFManager(original.fCFManager),
+  fTPCpid(original.fTPCpid),
   fHistograms(original.fHistograms),
   fCurrentV0IndexNumber(original.fCurrentV0IndexNumber),
   fCurrentV0(original.fCurrentV0),
@@ -143,6 +150,11 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fChi2CutMeson(original.fChi2CutMeson),
   fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle),
   fPIDProbabilityCutPositiveParticle(original.fPIDProbabilityCutPositiveParticle),
+  fDodEdxSigmaCut(original.fDodEdxSigmaCut),
+  fPIDnSigmaAboveElectronLine(original.fPIDnSigmaAboveElectronLine),
+  fPIDnSigmaBelowElectronLine(original.fPIDnSigmaBelowElectronLine),
+  fPIDnSigmaAbovePionLine(original.fPIDnSigmaAbovePionLine), 
+  fPIDMinPnSigmaAbovePionLine(original.fPIDMinPnSigmaAbovePionLine), 
   fXVertexCut(original.fXVertexCut),
   fYVertexCut(original.fYVertexCut),
   fZVertexCut(original.fZVertexCut),
@@ -161,6 +173,12 @@ AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/)
   // assignment operator
   return *this;
 }
+AliV0Reader::~AliV0Reader()
+{
+  if(fTPCpid){
+    delete fTPCpid;
+  }
+}
 
 void AliV0Reader::Initialize(){
   //see header file for documentation
@@ -317,6 +335,7 @@ Bool_t AliV0Reader::NextV0(){
        continue;
        }
     */
+
                
     if(fUseKFParticle){
       if(fCurrentMotherKFCandidate->GetNDF()<=0){
@@ -364,7 +383,11 @@ Bool_t AliV0Reader::NextV0(){
     else if(fUseESDTrack){
       //TODO
     }
-               
+
+    if(fHistograms != NULL){
+      fHistograms->FillHistogram("ESD_GoodV0s_InvMass",GetMotherCandidateMass());
+    }
+
     fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate);
                
     iResult=kTRUE;//means we have a v0 who survived all the cuts applied
@@ -418,6 +441,43 @@ Bool_t AliV0Reader::UpdateV0Information(){
       fHistograms->FillHistogram("ESD_CutKink_InvMass",GetMotherCandidateMass());
     }
   }
+
+  if(fDodEdxSigmaCut == kTRUE){
+
+    if( fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
+       fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ||
+       fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
+       fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){
+      iResult=kFALSE;
+      if(fHistograms != NULL){
+       fHistograms->FillHistogram("ESD_CutdEdxSigmaElectronLine_InvMass",GetMotherCandidateMass());
+      }
+    }
+    if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine){
+      if(fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+        fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+        fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
+       iResult=kFALSE;
+       if(fHistograms != NULL){
+         fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
+       }
+      }
+    }
+
+    if( fCurrentNegativeESDTrack->P()>fPIDMinPnSigmaAbovePionLine){
+      if(fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+        fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+        fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
+       iResult=kFALSE;
+       if(fHistograms != NULL){
+         fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
+       }
+      }
+    }
+  }
+
+
+
        
   if(fCurrentNegativeKFParticle != NULL){
     delete fCurrentNegativeKFParticle;
index af3e253..17460cd 100644 (file)
@@ -39,7 +39,7 @@ class TChain;
 class TChain;
 class AliCFManager;   // for CF
 class AliCFContainer;  // for CF
-
+class AliTPCpidESD; // for dEdx cut based on nSigma to particle lines 
 
 
 class AliV0Reader : public TObject {
@@ -71,7 +71,8 @@ class AliV0Reader : public TObject {
   AliV0Reader();                                        //constructor
   AliV0Reader(const AliV0Reader & g);                   //copy constructor
   AliV0Reader & operator = (const AliV0Reader & g);     //assignment operator
-  virtual ~AliV0Reader() {;}                            //virtual destructor
+  //  virtual ~AliV0Reader() {;}                            //virtual destructor
+  virtual ~AliV0Reader();                            //virtual destructor
   /*
    *Initialize the reader
    */
@@ -256,7 +257,27 @@ class AliV0Reader : public TObject {
    * Get the opening angle between the two tracks
    */
   Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}
-       
+
+  /*
+   * Get the Cos Pointing angle between the two tracks
+   */
+  Double_t GetCosPointingAngle(){return fCurrentV0->GetV0CosineOfPointingAngle();}
+
+  /*
+   * Get the DCA between the two tracks
+   */
+  Double_t GetDcaDaughters(){return fCurrentV0->GetDcaV0Daughters();}
+
+  /*
+   * Get the Normalized DCA between the two tracks
+   */
+  Double_t GetNormDcaDistDaughters(){return fCurrentV0->GetDcaV0Daughters()/fCurrentV0->GetDistSigma();}
+
+  /*
+   * Get the Likelihood for a Conversion
+   */
+  Double_t GetLikelihoodAP(){return fCurrentV0->GetLikelihoodAP(0,0);}
+      
   /*
    * Gets the Energy of the negative track.
    */
@@ -282,11 +303,19 @@ class AliV0Reader : public TObject {
    */
   Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();}
        
+
   /*
    * Gets the Pt of the mother candidate.
    */
   Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();}
+
+
+  /*
+   * Gets the P of the mother candidate.
+   */
+  Double_t GetMotherCandidateP() const{return fMotherCandidateLorentzVector->P();}
        
+
   /*
    * Gets the Eta of the negative track.
    */
@@ -340,6 +369,26 @@ class AliV0Reader : public TObject {
    */
   Double_t GetMotherCandidateRapidity() const;
        
+
+  /*
+   * Gets the P of the negative track.
+   */
+  Double_t GetNegativeTrackP() const{return fNegativeTrackLorentzVector->P();}
+       
+  /*
+   * Gets the P of the positive track.
+   */
+  Double_t GetPositiveTrackP() const{return fPositiveTrackLorentzVector->P();}
+
+  /*
+   * Gets the dE/dx in the TPC of the negative track.
+   */
+  Double_t GetNegativeTrackTPCdEdx() const{return fCurrentNegativeESDTrack->GetTPCsignal();}
+       
+  /*
+   * Gets the dE/dx in the TPC of the positive track.
+   */
+  Double_t GetPositiveTrackTPCdEdx() const{return fCurrentPositiveESDTrack->GetTPCsignal();}
        
   /*
    * Update data which need to be updated every event.
@@ -457,8 +506,28 @@ class AliV0Reader : public TObject {
    * Sets the PIDProbability cut value for the positive track.
    */
   void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
+
+  /*
+   * Sets the PIDnSigmaAboveElectron cut value for the tracks.
+   */
+  void SetPIDnSigmaAboveElectronLine(Double_t nSigmaAbove){fPIDnSigmaAboveElectronLine=nSigmaAbove;}
+       
+  /*
+   * Sets the PIDnSigmaBelowElectron cut value for the tracks.
+   */
+  void SetPIDnSigmaBelowElectronLine(Double_t nSigmaBelow){fPIDnSigmaBelowElectronLine=nSigmaBelow;}
        
   /*
+   * Sets the PIDnSigmaAbovePion cut value for the tracks.
+   */
+  void SetPIDnSigmaAbovePionLine(Double_t nSigmaAbovePion){fPIDnSigmaAbovePionLine=nSigmaAbovePion;}
+
+  /*
+   * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+   */
+  void SetPIDMinPnSigmaAbovePionLine(Double_t MinPnSigmaAbovePion){fPIDMinPnSigmaAbovePionLine=MinPnSigmaAbovePion;}
+
+  /*
    * Sets the SigmaMassCut value.
    */
   void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
@@ -469,6 +538,13 @@ class AliV0Reader : public TObject {
   void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;}
        
   /*
+   * Sets the flag to enable/disable the cut dedx N sigma 
+   */
+
+  void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
+
+
+  /*
    * Updates the V0 information of the current V0.
    */
   Bool_t UpdateV0Information();
@@ -520,6 +596,8 @@ class AliV0Reader : public TObject {
   AliCFManager *fCFManager; // pointer to the cf manager
   //  AliCFContainer *container;
        
+  // for dEdx cut based on nSigma to a particle line
+  AliTPCpidESD * fTPCpid; 
        
   AliGammaConversionHistograms *fHistograms; //! pointer to histogram handling class
        
@@ -565,6 +643,11 @@ class AliV0Reader : public TObject {
   Double_t fChi2CutMeson;  //chi2cut
   Double_t fPIDProbabilityCutNegativeParticle; //pid cut
   Double_t fPIDProbabilityCutPositiveParticle; //pid cut
+  Bool_t   fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
+  Double_t fPIDnSigmaAboveElectronLine;
+  Double_t fPIDnSigmaBelowElectronLine;
+  Double_t fPIDnSigmaAbovePionLine;
+  Double_t fPIDMinPnSigmaAbovePionLine;
   Double_t fXVertexCut; //vertex cut
   Double_t fYVertexCut; //vertex cut
   Double_t fZVertexCut; // vertexcut
index 8b5b195..5cba718 100644 (file)
@@ -24,8 +24,8 @@ Double_t kGCmaxRCut   = 180.;
 Double_t kGCetaCut    = 1.2;
 Double_t kGCptCut     = 0.02;
 Double_t kGCmaxZCut     = 240.;
-Double_t kGCchi2CutConversion   = 20.;
-Double_t kGCchi2CutMeson   = 20.;
+Double_t kGCchi2CutConversion   = 30.;
+Double_t kGCchi2CutMeson   = 50.;
 
 Double_t kGCxVertexCut = 0.;
 Double_t kGCyVertexCut = 0.;
@@ -56,7 +56,7 @@ Double_t kGCminOpeningAngleGhostCut = 0.01;
 
 /** -------------------------------- Phi/R Mapping ---------------------------------------*/
 Int_t kGCnPhiIndex = 8;
-Int_t kGCnRIndex   = 4;
+Int_t kGCnRIndex   = 7;
 
 Double_t kGCminRadius   = 0.;
 Double_t kGCmaxRadius   = 200.;
@@ -76,6 +76,9 @@ Bool_t kGCplotMCConversionR             = kTRUE;
 Bool_t kGCplotMCConversionZR            = kTRUE;
 Bool_t kGCplotMCConversionXY            = kTRUE;
 Bool_t kGCplotMCConversionOpeningAngle  = kTRUE;
+Bool_t kGCplotMCConvGammaEAsymmetryP    = kTRUE;
+Bool_t kGCplotMCConvGammaPAsymmetryP    = kTRUE;
+
 
 Bool_t kGCplotMCEEnergy  = kTRUE;
 Bool_t kGCplotMCEPt      = kTRUE;
@@ -177,10 +180,19 @@ Bool_t kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance = kTRUE;
 Bool_t kGCplotMCEtaZRConvGammaWithinAcceptance = kTRUE;
 
 // Histograms from esd tracks
-Bool_t kGCplotESDConversionR            = kTRUE;
-Bool_t kGCplotESDConversionZR           = kTRUE;
-Bool_t kGCplotESDConversionXY           = kTRUE;
-Bool_t kGCplotESDConversionOpeningAngle = kTRUE;
+Bool_t kGCplotESDConversionR                   = kTRUE;
+Bool_t kGCplotESDConversionZR                  = kTRUE;
+Bool_t kGCplotESDConversionXY                  = kTRUE;
+Bool_t kGCplotESDConversionOpeningAngle        = kTRUE;
+Bool_t kGCplotESDConvGammaCosPointingAngle     = kTRUE;
+Bool_t kGCplotESDConvGammaDcaDaugthers         = kTRUE;
+Bool_t kGCplotESDConvGammaNormDcaDistDaugthers = kTRUE;
+Bool_t kGCplotESDConvGammaLikelihoodAP         = kTRUE;
+Bool_t kGCplotESDConvGammaEAsymmetryP         = kTRUE;
+Bool_t kGCplotESDConvGammaPAsymmetryP         = kTRUE;
+Bool_t kGCplotESDConvGammaEdEdxP         = kTRUE;
+Bool_t kGCplotESDConvGammaPdEdxP         = kTRUE;
+
 
 Bool_t kGCplotESDEEnergy = kTRUE;
 Bool_t kGCplotESDEPt     = kTRUE;
@@ -205,6 +217,8 @@ Bool_t kGCplotESDConvGammaPtvsEta = kTRUE;
 Bool_t kGCplotESDConvGammaPtvsChi2 = kTRUE;
 Bool_t kGCplotESDConvGammaEtavsChi2 = kTRUE;
 
+
+
 Bool_t kGCplotESDTrueConvGammaEnergy         = kTRUE;
 Bool_t kGCplotESDTrueConvGammaPt             = kTRUE;
 Bool_t kGCplotESDTrueConvGammaEta            = kTRUE;
@@ -219,6 +233,16 @@ Bool_t kGCplotESDTrueConversionR             = kTRUE;
 Bool_t kGCplotESDTrueConversionZR            = kTRUE;
 Bool_t kGCplotESDTrueConversionXY            = kTRUE;
 Bool_t kGCplotESDTrueConversionOpeningAngle  = kTRUE;
+Bool_t kGCplotESDTrueConvGammaCosPointingAngle     = kTRUE;
+Bool_t kGCplotESDTrueConvGammaDcaDaugthers         = kTRUE;
+Bool_t kGCplotESDTrueConvGammaNormDcaDistDaugthers = kTRUE;
+Bool_t kGCplotESDTrueConvGammaLikelihoodAP         = kTRUE;
+Bool_t kGCplotESDTrueConvGammaEAsymmetryP         = kTRUE;
+Bool_t kGCplotESDTrueConvGammaPAsymmetryP         = kTRUE;
+Bool_t kGCplotESDTrueConvGammaEdEdxP         = kTRUE;
+Bool_t kGCplotESDTrueConvGammaPdEdxP         = kTRUE;
+
+
 Bool_t kGCplotESDTrueConvGammaPtvsChi2       = kTRUE;
 Bool_t kGCplotESDTrueConvGammaEtavsChi2      = kTRUE;
 Bool_t kGCplotESDTrueConvGammaMCPtEta        = kTRUE;
@@ -239,6 +263,15 @@ Bool_t kGCplotESDNoCutConversionR             = kTRUE;
 Bool_t kGCplotESDNoCutConversionZR            = kTRUE;
 Bool_t kGCplotESDNoCutConversionXY            = kTRUE;
 Bool_t kGCplotESDNoCutConversionOpeningAngle  = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaCosPointingAngle     = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaDcaDaugthers         = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaNormDcaDistDaugthers = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaLikelihoodAP         = kTRUE;
+
+Bool_t kGCplotESDNoCutConvGammaEAsymmetryP         = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaPAsymmetryP         = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaEdEdxP         = kTRUE;
+Bool_t kGCplotESDNoCutConvGammaPdEdxP         = kTRUE;
 Bool_t kGCplotESDNoCutConvGammaPtvsChi2       = kTRUE;
 Bool_t kGCplotESDNoCutConvGammaEtavsChi2      = kTRUE;
 Bool_t kGCplotESDNoCutConvGammaMCPtEta        = kTRUE;
@@ -293,8 +326,11 @@ Bool_t kGCplotESDCutLikeSign      = kTRUE;
 Bool_t kGCplotESDCutRefit         = kTRUE;
 Bool_t kGCplotESDCutKink          = kTRUE;
 Bool_t kGCplotESDCutPIDProb       = kTRUE;
+Bool_t kGCplotESDCutdedxSigmaElectronLine=kTRUE;
+Bool_t kGCplotESDCutdedxSigmaPionLine=kTRUE;
 Bool_t kGCplotESDCutR             = kTRUE;
 Bool_t kGCplotESDCutLine          = kTRUE;
+Bool_t kGCplotESDGoodV0s          = kTRUE;
 Bool_t kGCplotESDCutNDF           = kTRUE;
 Bool_t kGCplotESDCutChi2          = kTRUE;
 Bool_t kGCplotESDCutEta           = kTRUE;
@@ -372,11 +408,48 @@ Int_t kGCnXBinsOpeningAngle = 400;
 Double_t kGCfirstXBinOpeningAngle = 0.;
 Double_t kGClastXBinOpeningAngle = TMath::Pi();
 
+//CosPointingAngle-plots
+Int_t kGCnXBinsCosPointingAngle = 400;
+Double_t kGCfirstXBinCosPointingAngle = 0.99;
+Double_t kGClastXBinCosPointingAngle = 1.01;
+
+//DCA Daugthers-plots
+Int_t kGCnXBinsDcaDaughters = 400;
+Double_t kGCfirstXBinDcaDaughters= 0.;
+Double_t kGClastXBinDcaDaughters = 5.;
+
+//Norm DCA dist Daugthers-plots
+Int_t kGCnXBinsNormDcaDistDaughters = 400;
+Double_t kGCfirstXBinNormDcaDistDaughters= 0.;
+Double_t kGClastXBinNormDcaDistDaughters = 10.;
+
+//LikelihoodAP Plots
+Int_t kGCnXBinsLikelihoodAP = 400;
+Double_t kGCfirstXBinLikelihoodAP= 0.;
+Double_t kGClastXBinLikelihoodAP = 2.;
+
+
 //Energy-plots
 Int_t kGCnXBinsEnergy = 200;
 Double_t kGCfirstXBinEnergy = 0.;
 Double_t kGClastXBinEnergy = 50.;
 
+//P-plots
+Int_t kGCnXBinsP = 200;
+Double_t kGCfirstXBinP = 0.;
+Double_t kGClastXBinP = 50.;
+
+//dEdx-plots
+Int_t kGCnYBinsdEdx = 400;
+Double_t kGCfirstYBindEdx = 0.;
+Double_t kGClastYBindEdx = 400.;
+
+//Asymmetry-plots
+Int_t kGCnYBinsAsymmetry = 200;
+Double_t kGCfirstYBinAsymmetry = 0.;
+Double_t kGClastYBinAsymmetry = 1.;
+
+
 //Pt-plots
 Int_t kGCnXBinsPt = 200;
 Double_t kGCfirstXBinPt = 0.;
@@ -597,6 +670,15 @@ Bool_t kGCuseKFParticle = kTRUE;
 Bool_t kGCuseESDTrack   = kFALSE;
 /** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/
 
+/**------------------------------Flag to apply dEdx cut base on sigmas to electron line----------*/
+Bool_t kGCdodEdxSigmaCut= kTRUE;
+/**------------------------------end Flag to apply NsigmadEdx cut ----------*/
+Double_t kGCPIDnSigmaAboveElectronLine=6;
+Double_t kGCPIDnSigmaBelowElectronLine=-4;
+Double_t kGCPIDnSigmaAbovePionLine=0;
+Double_t kGCPIDMinPnSigmaAbovePionLine=5;
+
 
 Bool_t kGCcalculateBackground = kTRUE;
 
@@ -769,9 +851,11 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments,AliAnaly
     build();//build (if necessary) and load the libraries needed
                
     gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
+  }
                
-    //    AliLog::SetGlobalLogLevel(AliLog::kError);
-               
+
+    AliLog::SetGlobalDebugLevel(0);
+    AliLog::SetGlobalLogLevel(AliLog::kError);
                
     // ------------------------------------------------------------------------
                
@@ -826,7 +910,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments,AliAnaly
     // end ---------------------------------------------------------------------------
                
                
-  }
+
        
   AliGammaConversionHistograms* histograms = new AliGammaConversionHistograms();  
   AddHistograms(histograms);
@@ -973,6 +1057,13 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments,AliAnaly
   // for CF
   v0Reader->SetCFManager(man);
        
+  // for dEdx N sigma Cut
+  v0Reader->SetDodEdxSigmaCut(kGCdodEdxSigmaCut);
+  v0Reader->SetPIDnSigmaAboveElectronLine(kGCPIDnSigmaAboveElectronLine);
+  v0Reader->SetPIDnSigmaBelowElectronLine(kGCPIDnSigmaBelowElectronLine);
+  v0Reader->SetPIDnSigmaAbovePionLine(kGCPIDnSigmaAbovePionLine);
+  v0Reader->SetPIDMinPnSigmaAbovePionLine(kGCPIDMinPnSigmaAbovePionLine);
        
   // Create the GammaConversionTask
   AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");
@@ -1215,7 +1306,10 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotMCConversionZR == kTRUE){ histograms->AddHistogram("MC_Conversion_ZR","Radius of gamma conversion points vs Z",kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "cm", "cm");}
     if(kGCplotMCConversionXY == kTRUE){ histograms->AddHistogram("MC_Conversion_XY","Gamma XY converison point.",kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "cm", "cm");}
     if(kGCplotMCConversionOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Conversion_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "counts", "cm");}
+    if(kGCplotMCConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
+    if(kGCplotMCConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
                
+
     if(kGCplotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
     if(kGCplotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
     if(kGCplotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
@@ -1354,6 +1448,17 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDConversionZR == kTRUE){ histograms->AddHistogram("ESD_Conversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
     if(kGCplotESDConversionXY == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
     if(kGCplotESDConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Conversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
+
+    if(kGCplotESDConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
+    if(kGCplotESDConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
+    if(kGCplotESDConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
+    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(kGCplotESDTrueConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
@@ -1373,6 +1478,16 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDTrueConversionZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
     if(kGCplotESDTrueConversionXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
     if(kGCplotESDTrueConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
+
+    if(kGCplotESDTrueConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
+    if(kGCplotESDTrueConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
+    if(kGCplotESDTrueConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
+    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(kGCplotESDTrueConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
     if(kGCplotESDTrueConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
@@ -1397,7 +1512,18 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDNoCutConversionZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
     if(kGCplotESDNoCutConversionXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
     if(kGCplotESDNoCutConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
-               
+
+    if(kGCplotESDNoCutConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
+    if(kGCplotESDNoCutConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
+    if(kGCplotESDNoCutConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
+    if(kGCplotESDNoCutConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
+    if(kGCplotESDNoCutConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
+    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(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, "", "");}
     if(kGCplotESDNoCutConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
@@ -1430,7 +1556,8 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
                
     if(kGCplotMapping == kTRUE){
       histograms->InitializeMappingValues(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
-      histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
+      histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCfirstXBinMapping,kGClastXBinMapping,kGCnYBinsMapping,kGCfirstYBinMapping,kGClastYBinMapping);
+      //      histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
     }
                
     if(kGCplotResolutiondPt == kTRUE){histograms->AddHistogram("Resolution_dPt" ,"" , kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");}
@@ -1457,12 +1584,18 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDCutRefit == kTRUE){histograms->AddHistogram("ESD_CutRefit_InvMass" ,"No TPC refit" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutKink == kTRUE){histograms->AddHistogram("ESD_CutKink_InvMass" ,"Kinks" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutPIDProb == kTRUE){histograms->AddHistogram("ESD_CutPIDProb_InvMass" ,"wrong TPC PID" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
+
+    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(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(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(kGCplotESDGoodV0s == kTRUE){histograms->AddHistogram("ESD_GoodV0s_InvMass" ,"Good V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
+
     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,"","");}
                
@@ -1470,10 +1603,19 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotPi0Spectra == kTRUE){
       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","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
+
+      histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_Fiducial" ,"Invariant Mass vs Pt |eta|<0.9" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
+      histograms->AddHistogram("ESD_Mother_InvMass_Fiducial","Invariant mass |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
+
+
     }
     if(kGCplotPi0Spectra == kTRUE && kGCcalculateBackground == kTRUE){
       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_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");
+
     }
   }// end kGCrunNeutralMeson
 }