Changed to new naming scheme for histograms, added functionality to the analysis...
authorkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 29 Mar 2009 16:36:48 +0000 (16:36 +0000)
committerkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 29 Mar 2009 16:36:48 +0000 (16:36 +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 5df0c83..8e983c9 100644 (file)
@@ -46,7 +46,7 @@ ClassImp(AliAnalysisTaskGammaConversion)
 \r
 \r
 AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion():\r
-  AliAnalysisTaskSE(),\r
+AliAnalysisTaskSE(),\r
   fV0Reader(NULL),\r
   fStack(NULL),\r
   fOutputContainer(NULL),\r
@@ -57,6 +57,9 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion():
   fMCEtas(),\r
   fMCGammaChic(),\r
   fKFReconstructedGammas(),\r
+  fIsTrueReconstructedGammas(),\r
+  electronv1(),\r
+  electronv2(),\r
   fElectronMass(-1),\r
   fGammaMass(-1),\r
   fPi0Mass(-1),\r
@@ -64,6 +67,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion():
   fGammaWidth(-1),\r
   fPi0Width(-1),\r
   fEtaWidth(-1),\r
+  fMinOpeningAngleGhostCut(0.),\r
   fCalculateBackground(kFALSE),\r
   fWriteNtuple(kFALSE),\r
   fGammaNtuple(NULL),\r
@@ -74,7 +78,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion():
   // Common I/O in slot 0\r
   DefineInput (0, TChain::Class());\r
   DefineOutput(0, TTree::Class());\r
-\r
+       \r
   // Your private output\r
   DefineOutput(1, TList::Class());\r
 }\r
@@ -91,6 +95,9 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fMCEtas(),\r
   fMCGammaChic(),\r
   fKFReconstructedGammas(),\r
+  fIsTrueReconstructedGammas(),\r
+  electronv1(),\r
+  electronv2(),\r
   fElectronMass(-1),\r
   fGammaMass(-1),\r
   fPi0Mass(-1),\r
@@ -98,6 +105,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fGammaWidth(-1),\r
   fPi0Width(-1),\r
   fEtaWidth(-1),\r
+  fMinOpeningAngleGhostCut(0.),\r
   fCalculateBackground(kFALSE),\r
   fWriteNtuple(kFALSE),\r
   fGammaNtuple(NULL),\r
@@ -107,7 +115,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   // Common I/O in slot 0\r
   DefineInput (0, TChain::Class());\r
   DefineOutput(0, TTree::Class());\r
-  \r
+       \r
   // Your private output\r
   DefineOutput(1, TList::Class());\r
 }\r
@@ -115,7 +123,7 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
 AliAnalysisTaskGammaConversion::~AliAnalysisTaskGammaConversion() \r
 {\r
   // Remove all pointers\r
\r
+       \r
   if(fOutputContainer){\r
     fOutputContainer->Clear() ; \r
     delete fOutputContainer ;\r
@@ -139,257 +147,416 @@ void AliAnalysisTaskGammaConversion::Init()
 void AliAnalysisTaskGammaConversion::Exec(Option_t */*option*/)\r
 {\r
   // Execute analysis for current event\r
-  \r
+       \r
   ConnectInputData("");\r
-  \r
+       \r
   //clear vectors\r
   fMCAllGammas.clear();\r
   fMCPi0s.clear();\r
   fMCEtas.clear();\r
   fMCGammaChic.clear();\r
-\r
+       \r
   fKFReconstructedGammas.clear();\r
-\r
+  fIsTrueReconstructedGammas.clear();\r
+  electronv1.clear();\r
+  electronv2.clear();\r
+       \r
   //Clear the data in the v0Reader\r
   fV0Reader->UpdateEventByEventData();\r
 \r
+  \r
   // Process the MC information\r
   if(fDoMCTruth){\r
     ProcessMCData();\r
   }\r
-\r
+  \r
+  //Process the v0 information with no cuts\r
+  ProcessV0sNoCut();\r
+  \r
   // Process the v0 information\r
   ProcessV0s();\r
-\r
+  \r
   //calculate background if flag is set\r
   if(fCalculateBackground){\r
     CalculateBackground();\r
   }\r
-\r
+  \r
   // Process reconstructed gammas\r
   ProcessGammasForNeutralMesonAnalysis();\r
-\r
-  PostData(1, fOutputContainer);\r
   \r
+  PostData(1, fOutputContainer);\r
+       \r
 }\r
 \r
 void AliAnalysisTaskGammaConversion::ConnectInputData(Option_t */*option*/){\r
   // see header file for documentation\r
-\r
+       \r
   if(fV0Reader == NULL){\r
     // Write warning here cuts and so on are default if this ever happens\r
   }\r
   fV0Reader->Initialize();\r
 }\r
 \r
+\r
+\r
 void AliAnalysisTaskGammaConversion::ProcessMCData(){\r
   // see header file for documentation\r
-  \r
+       \r
   fStack = fV0Reader->GetMCStack();\r
 \r
+  if(fV0Reader->CheckForPrimaryVertex() == kFALSE){\r
+    return; // aborts if the primary vertex does not have contributors.\r
+  }\r
+\r
   for (Int_t iTracks = 0; iTracks < fStack->GetNtrack(); iTracks++) {\r
     TParticle* particle = (TParticle *)fStack->Particle(iTracks);\r
-\r
+               \r
     if (!particle) {\r
       //print warning here\r
       continue;\r
     }\r
-    \r
-    if(particle->Pt()<fV0Reader->GetPtCut()){\r
-      continue;\r
-    }\r
-    \r
-    if(TMath::Abs(particle->Eta())> fV0Reader->GetEtaCut()){\r
-      continue;\r
-    }\r
-\r
-    if(particle->R()>fV0Reader->GetMaxRCut()){ // cuts on distance from collision point\r
-      continue;\r
-    }\r
 \r
+    if(TMath::Abs(particle->Eta())> fV0Reader->GetEtaCut() )   continue;\r
+                                       \r
+    if(particle->R()>fV0Reader->GetMaxRCut())  continue; // cuts on distance from collision point\r
+               \r
     Double_t tmpPhi=particle->Phi();\r
+               \r
     if(particle->Phi()> TMath::Pi()){\r
       tmpPhi = particle->Phi()-(2*TMath::Pi());\r
     }\r
-\r
-    \r
+               \r
+    Double_t rapidity;\r
+    if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){\r
+      rapidity=0;\r
+    }\r
+    else{\r
+      rapidity = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())));\r
+    }  \r
+               \r
     //process the gammas\r
-    if (particle->GetPdgCode()== 22){\r
-      fMCAllGammas.push_back(particle);\r
-      if(particle->GetMother(0)>-1){ //Means we have a mother\r
-       if( fStack->Particle(particle->GetMother(0))->GetPdgCode() != 22 ){//Checks for a non gamma mother.\r
-         fHistograms->FillHistogram("MC_Gamma_Energy", particle->Energy());\r
-         fHistograms->FillHistogram("MC_Gamma_Pt", particle->Pt());\r
-         fHistograms->FillHistogram("MC_Gamma_Eta", particle->Eta());\r
-         \r
-         fHistograms->FillHistogram("MC_Gamma_Phi", tmpPhi);\r
-\r
-         //adding the conversion points from all gammas with e+e- daughters\r
-         if(particle->GetNDaughters() >= 2){\r
-           TParticle* daughter0 = NULL;\r
-           TParticle* daughter1 = NULL;\r
-           \r
-           for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){\r
-             TParticle *tmpDaughter = fStack->Particle(daughterIndex);\r
-             if(tmpDaughter->GetUniqueID() == 5){\r
-               if(tmpDaughter->GetPdgCode() == 11){\r
-                  daughter0 = tmpDaughter;\r
-               }\r
-               else if(tmpDaughter->GetPdgCode() == -11){\r
-                 daughter1 = tmpDaughter;\r
-               }\r
-             }\r
-           }\r
+    if (particle->GetPdgCode() == 22){\r
+                       \r
+      if(particle->GetMother(0) >-1 && fStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){\r
+       continue; // no photon as mothers!\r
+      }\r
 \r
-           if(daughter0 == NULL || daughter1 == NULL){ // means we do not have two daughters from pair production\r
-             continue;\r
-           }\r
+      if(particle->GetMother(0) >= fStack->GetNprimary()){\r
+       continue; // the gamma has a mother, and it is not a primary particle\r
+      }\r
 \r
-           if(daughter0->R()>fV0Reader->GetMaxRCut() || daughter1->R()>fV0Reader->GetMaxRCut()){\r
-             continue;\r
+      fMCAllGammas.push_back(particle);\r
+                       \r
+      fHistograms->FillHistogram("MC_allGamma_Energy", particle->Energy());\r
+      fHistograms->FillHistogram("MC_allGamma_Pt", particle->Pt());\r
+      fHistograms->FillHistogram("MC_allGamma_Eta", particle->Eta());\r
+      fHistograms->FillHistogram("MC_allGamma_Phi", tmpPhi);\r
+      fHistograms->FillHistogram("MC_allGamma_Rapid", rapidity);\r
+                       \r
+                       \r
+      if(particle->GetMother(0) < 0){   // direct gamma\r
+       fHistograms->FillHistogram("MC_allDirectGamma_Energy",particle->Energy());\r
+       fHistograms->FillHistogram("MC_allDirectGamma_Pt", particle->Pt());\r
+       fHistograms->FillHistogram("MC_allDirectGamma_Eta", particle->Eta());\r
+       fHistograms->FillHistogram("MC_allDirectGamma_Phi", tmpPhi);\r
+       fHistograms->FillHistogram("MC_allDirectGamma_Rapid", rapidity);                                \r
+      }\r
+                       \r
+                       \r
+      // looking for conversion (electron + positron from pairbuilding (= 5) )\r
+      TParticle* ePos = NULL;\r
+      TParticle* eNeg = NULL;\r
+                       \r
+      if(particle->GetNDaughters() >= 2){\r
+       for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){\r
+         TParticle *tmpDaughter = fStack->Particle(daughterIndex);\r
+         if(tmpDaughter->GetUniqueID() == 5){\r
+           if(tmpDaughter->GetPdgCode() == 11){\r
+             eNeg = tmpDaughter;\r
+           }\r
+           else if(tmpDaughter->GetPdgCode() == -11){\r
+             ePos = tmpDaughter;\r
            }\r
-           \r
-           if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode()) == 11 ||\r
-              (daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11)){\r
-\r
-             // begin Mapping \r
-             Int_t rBin    = fHistograms->GetRBin(daughter0->R());\r
-             Int_t phiBin  = fHistograms->GetPhiBin(daughter0->Phi());\r
-             \r
-             TString nameMCMappingPhiR="";\r
-             nameMCMappingPhiR.Form("MC_EP_Mapping-Phi%02d-R%02d",phiBin,rBin);\r
-             fHistograms->FillHistogram(nameMCMappingPhiR, daughter0->Vz(), particle->Eta());\r
-             \r
-             TString nameMCMappingPhi="";\r
-             nameMCMappingPhi.Form("MC_EP_Mapping-Phi%02d",phiBin);\r
-             fHistograms->FillHistogram(nameMCMappingPhi, particle->Eta());\r
-             \r
-             TString nameMCMappingR="";\r
-             nameMCMappingR.Form("MC_EP_Mapping-R%02d",rBin);\r
-             fHistograms->FillHistogram(nameMCMappingR, particle->Eta());\r
-             \r
-             TString nameMCMappingPhiInR="";\r
-             nameMCMappingPhiInR.Form("MC_EP_Mapping_Phi_R-%02d",rBin);\r
-             fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi);\r
-             //end mapping\r
-\r
-             fHistograms->FillHistogram("MC_EP_R",daughter0->R());\r
-             fHistograms->FillHistogram("MC_EP_ZR",daughter0->Vz(),daughter0->R());\r
-             fHistograms->FillHistogram("MC_EP_XY",daughter0->Vx(),daughter0->Vy());\r
-             fHistograms->FillHistogram("MC_EP_OpeningAngle",GetMCOpeningAngle(daughter0, daughter1));\r
-           }// end if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode()) == 11 ||....... approx 20 lines above\r
-         }// end if(particle->GetNDaughters() >= 2){\r
-       } // end if( fStack->Particle(particle->GetMother(0))->GetPdgCode() != 22 )\r
+         }\r
+       }\r
+      }\r
+                       \r
+                       \r
+      if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production\r
+       continue;\r
+      }\r
+                       \r
+                       \r
+      Double_t ePosPhi = ePos->Phi();\r
+      if(ePos->Phi()> TMath::Pi()) ePosPhi = ePos->Phi()-(2*TMath::Pi());\r
+                       \r
+      Double_t eNegPhi = eNeg->Phi();\r
+      if(eNeg->Phi()> TMath::Pi()) eNegPhi = eNeg->Phi()-(2*TMath::Pi());\r
+                       \r
+                       \r
+      if(ePos->Pt()<fV0Reader->GetPtCut() || eNeg->Pt()<fV0Reader->GetPtCut()){\r
+       continue; // no reconstruction below the Pt cut\r
+      }\r
+                                       \r
+      if(TMath::Abs(ePos->Eta())> fV0Reader->GetEtaCut() || TMath::Abs(eNeg->Eta())> fV0Reader->GetEtaCut()){\r
+       continue;\r
+      }        \r
+                               \r
+      if(ePos->R()>fV0Reader->GetMaxRCut()){\r
+       continue; // cuts on distance from collision point\r
+      }\r
+      \r
+      \r
+      if((TMath::Abs(ePos->Vz()) * fV0Reader->GetLineCutZRSlope()) - fV0Reader->GetLineCutZValue()  > ePos->R()){\r
+       continue;               // line cut to exclude regions where we do not reconstruct\r
+      }                \r
+               \r
+      fHistograms->FillHistogram("MC_ConvGamma_Energy", particle->Energy());\r
+      fHistograms->FillHistogram("MC_ConvGamma_Pt", particle->Pt());\r
+      fHistograms->FillHistogram("MC_ConvGamma_Eta", particle->Eta());\r
+      fHistograms->FillHistogram("MC_ConvGamma_Phi", tmpPhi);\r
+      fHistograms->FillHistogram("MC_ConvGamma_Rapid", rapidity);\r
+      fHistograms->FillHistogram("MC_ConvGamma_Pt_Eta", particle->Pt(),particle->Eta());\r
+                       \r
+      fHistograms->FillHistogram("MC_E_Energy", eNeg->Energy());\r
+      fHistograms->FillHistogram("MC_E_Pt", eNeg->Pt());\r
+      fHistograms->FillHistogram("MC_E_Eta", eNeg->Eta());\r
+      fHistograms->FillHistogram("MC_E_Phi", eNegPhi);\r
+                       \r
+      fHistograms->FillHistogram("MC_P_Energy", ePos->Energy());\r
+      fHistograms->FillHistogram("MC_P_Pt", ePos->Pt());\r
+      fHistograms->FillHistogram("MC_P_Eta", ePos->Eta());\r
+      fHistograms->FillHistogram("MC_P_Phi", ePosPhi);\r
+                       \r
+                       \r
+                       \r
+      //cout << "filled histos for converted gamma, ePos, eNeg" << endl;\r
+                       \r
+      // begin Mapping \r
+      Int_t rBin    = fHistograms->GetRBin(ePos->R());\r
+      Int_t phiBin  = fHistograms->GetPhiBin(particle->Phi());\r
+                       \r
+      TString nameMCMappingPhiR="";\r
+      nameMCMappingPhiR.Form("MC_Conversion_Mapping-Phi%02d-R%02d",phiBin,rBin);\r
+      fHistograms->FillHistogram(nameMCMappingPhiR, ePos->Vz(), particle->Eta());\r
+                       \r
+      TString nameMCMappingPhi="";\r
+      nameMCMappingPhi.Form("MC_Conversion_Mapping-Phi%02d",phiBin);\r
+      fHistograms->FillHistogram(nameMCMappingPhi, particle->Eta());\r
+                       \r
+      TString nameMCMappingR="";\r
+      nameMCMappingR.Form("MC_Conversion_Mapping-R%02d",rBin);\r
+      fHistograms->FillHistogram(nameMCMappingR, particle->Eta());\r
+                       \r
+      TString nameMCMappingPhiInR="";\r
+      nameMCMappingPhiInR.Form("MC_Conversion_Mapping_Phi_R-%02d",rBin);\r
+      fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi);\r
+      //end mapping\r
+                       \r
+      fHistograms->FillHistogram("MC_Conversion_R",ePos->R());\r
+      fHistograms->FillHistogram("MC_Conversion_ZR",ePos->Vz(),ePos->R());\r
+      fHistograms->FillHistogram("MC_Conversion_XY",ePos->Vx(),ePos->Vy());\r
+      fHistograms->FillHistogram("MC_Conversion_OpeningAngle",GetMCOpeningAngle(ePos, eNeg));\r
+                       \r
+      //cout << "mapping is done" << endl;\r
+                       \r
+                       \r
+      if(particle->GetMother(0) < 0){ // no mother = direct gamma, still inside converted\r
+       fHistograms->FillHistogram("MC_ConvDirectGamma_Energy",particle->Energy());\r
+       fHistograms->FillHistogram("MC_ConvDirectGamma_Pt", particle->Pt());\r
+       fHistograms->FillHistogram("MC_ConvDirectGamma_Eta", particle->Eta());\r
+       fHistograms->FillHistogram("MC_ConvDirectGamma_Phi", tmpPhi);\r
+       fHistograms->FillHistogram("MC_ConvDirectGamma_Rapid", rapidity);\r
+                               \r
+      } // end direct gamma\r
+      else{   // mother exits \r
        if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==10441 ||//chic0 \r
            fStack->Particle(particle->GetMother(0))->GetPdgCode()==20443 ||//psi2S\r
            fStack->Particle(particle->GetMother(0))->GetPdgCode()==445  //chic2\r
            ){ \r
          fMCGammaChic.push_back(particle);\r
        }\r
-      }// end if(particle->GetMother(0)>-1)\r
-      else{//means we have a primary particle\r
-       fHistograms->FillHistogram("MC_DirectGamma_Energy",particle->Energy());\r
-       fHistograms->FillHistogram("MC_DirectGamma_Pt", particle->Pt());\r
-       fHistograms->FillHistogram("MC_DirectGamma_Eta", particle->Eta());\r
-       fHistograms->FillHistogram("MCDirectGammaPhi", tmpPhi);\r
-\r
-       //adding the conversion points from all gammas with e+e- daughters\r
-       if(particle->GetNDaughters() == 2){\r
-         TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());\r
-         TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());\r
-         if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode() == 11) ||\r
-            (daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11)){\r
-           \r
-           fHistograms->FillHistogram("MC_EP_R",daughter0->R());\r
-           fHistograms->FillHistogram("MC_EP_ZR",daughter0->Vz(),daughter0->R());\r
-           fHistograms->FillHistogram("MC_EP_XY",daughter0->Vx(),daughter0->Vy());\r
-           fHistograms->FillHistogram("MC_EP_OpeningAngle",GetMCOpeningAngle(daughter0, daughter1));\r
-\r
+      }  // end if mother exits\r
+    } // end if particle is a photon\r
+               \r
+    if(particle->GetNDaughters() == 2){\r
+                       \r
+      TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());\r
+      TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());\r
+                       \r
+      if(daughter0->GetPdgCode() != 22 || daughter1->GetPdgCode() != 22) continue; //check for gamma gamma daughters\r
+                       \r
+                       \r
+                       \r
+      // check for conversions now -> have to pass eta and line cut!\r
+      Bool_t daughter0Electron = kFALSE;\r
+      Bool_t daughter0Positron = kFALSE;\r
+      Bool_t daughter1Electron = kFALSE;\r
+      Bool_t daughter1Positron = kFALSE;\r
+                       \r
+                       \r
+                       \r
+      if(daughter0->GetNDaughters() >= 2){\r
+       for(Int_t TrackIndex=daughter0->GetFirstDaughter();TrackIndex<=daughter0->GetLastDaughter();TrackIndex++){\r
+         TParticle *tmpDaughter = fStack->Particle(TrackIndex);\r
+         if(tmpDaughter->GetUniqueID() == 5){\r
+           if(tmpDaughter->GetPdgCode() == 11){\r
+             if( TMath::Abs(tmpDaughter->Eta()) <= fV0Reader->GetEtaCut() ){\r
+               if( ( TMath::Abs(tmpDaughter->Vz()) * fV0Reader->GetLineCutZRSlope()) - fV0Reader->GetLineCutZValue()  < tmpDaughter->R() ){\r
+                 daughter0Electron = kTRUE;\r
+               }\r
+                                                               \r
+             }\r
+           }\r
+           else if(tmpDaughter->GetPdgCode() == -11){\r
+             if( TMath::Abs(tmpDaughter->Eta()) <= fV0Reader->GetEtaCut() ){\r
+               if( ( TMath::Abs(tmpDaughter->Vz()) * fV0Reader->GetLineCutZRSlope()) - fV0Reader->GetLineCutZValue()  < tmpDaughter->R() ){\r
+                 daughter0Positron = kTRUE;\r
+               }\r
+                                                               \r
+             }\r
+                                                       \r
+           }\r
          }\r
        }\r
-      }// end else\r
-    }// end if (particle->GetPdgCode()== 22){\r
-    else if (TMath::Abs(particle->GetPdgCode())== 11){ // Means we have an electron or a positron\r
-      if(particle->GetMother(0)>-1){ // means we have a mother\r
-       if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==22 ){ // Means we have a gamma mother\r
-         if(particle->GetPdgCode() == 11){//electron \r
-           fHistograms->FillHistogram("MC_E_Energy", particle->Energy());\r
-           fHistograms->FillHistogram("MC_E_Pt", particle->Pt());\r
-           fHistograms->FillHistogram("MC_E_Eta", particle->Eta());\r
-           fHistograms->FillHistogram("MC_E_Phi", tmpPhi);\r
-         }\r
-         if(particle->GetPdgCode() == -11){//positron \r
-           fHistograms->FillHistogram("MC_P_Energy", particle->Energy());\r
-           fHistograms->FillHistogram("MC_P_Pt", particle->Pt());\r
-           fHistograms->FillHistogram("MC_P_Eta", particle->Eta());\r
-           fHistograms->FillHistogram("MC_P_Phi", tmpPhi);\r
+      }\r
+                       \r
+                       \r
+       \r
+      if(daughter1->GetNDaughters() >= 2){\r
+       for(Int_t TrackIndex=daughter1->GetFirstDaughter();TrackIndex<=daughter1->GetLastDaughter();TrackIndex++){\r
+         TParticle *tmpDaughter = fStack->Particle(TrackIndex);\r
+         if(tmpDaughter->GetUniqueID() == 5){\r
+           if(tmpDaughter->GetPdgCode() == 11){\r
+             if( TMath::Abs(tmpDaughter->Eta()) <= fV0Reader->GetEtaCut() ){\r
+               if( ( TMath::Abs(tmpDaughter->Vz()) * fV0Reader->GetLineCutZRSlope()) - fV0Reader->GetLineCutZValue()  < tmpDaughter->R() ){\r
+                 daughter1Electron = kTRUE;\r
+               }\r
+                                                               \r
+             }\r
+           }\r
+           else if(tmpDaughter->GetPdgCode() == -11){\r
+             if( TMath::Abs(tmpDaughter->Eta()) <= fV0Reader->GetEtaCut() ){\r
+               if( ( TMath::Abs(tmpDaughter->Vz()) * fV0Reader->GetLineCutZRSlope()) - fV0Reader->GetLineCutZValue()  < tmpDaughter->R() ){\r
+                 daughter1Positron = kTRUE;\r
+               }\r
+                                                               \r
+             }\r
+                                                       \r
+           }\r
          }\r
        }\r
       }\r
-    } // end else if (TMath::Abs(particle->GetPdgCode())== 11)\r
-    else if(particle->GetNDaughters() == 2){\r
-\r
-      TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());\r
-      TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());\r
-      if(daughter0->GetPdgCode() == 22 && daughter1->GetPdgCode() == 22){//check for gamma gamma daughters\r
-       \r
-       if(particle->GetPdgCode()==111){//Pi0\r
-         \r
+                       \r
+                                                                                               \r
+                       \r
+                       \r
+      if(particle->GetPdgCode()==111){     //Pi0\r
+       if( iTracks >= fStack->GetNprimary()){\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_Eta", particle->Eta());\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_Rapid", rapidity);\r
          fHistograms->FillHistogram("MC_Pi0_Secondaries_Phi", tmpPhi);\r
-\r
-         if( iTracks >= fStack->GetNprimary()){\r
-           \r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_Eta", particle->Eta());\r
-\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_Phi", tmpPhi);\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt", particle->Pt());\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_Energy", particle->Energy());\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_R", particle->R());\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_ZR", particle->Vz(),particle->R());\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
-           fHistograms->FillHistogram("MC_Pi0_Secondaries_XY", particle->Vx(),particle->Vy());//only fill from one daughter to avoid multiple filling\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt", particle->Pt());\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_Energy", particle->Energy());\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_R", particle->R());\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_ZR", particle->Vz(),particle->R());\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_XY", particle->Vx(),particle->Vy());//only fill from one daughter to avoid multiple filling\r
+                                       \r
+         if(TMath::Abs(daughter0->Eta()) <= fV0Reader->GetEtaCut() && TMath::Abs(daughter1->Eta()) <= fV0Reader->GetEtaCut() ){\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt_Eta_withinAcceptance", particle->Pt(),particle->Eta());\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt_Rapid_withinAcceptance", particle->Pt(),rapidity);\r
+           if(daughter0Electron && daughter0Positron && daughter1Electron && daughter1Positron){\r
+             fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta());\r
+             fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity);\r
+           }\r
          }\r
-         else{\r
-           fHistograms->FillHistogram("MC_Pi0_Eta", particle->Eta());\r
-\r
-           fHistograms->FillHistogram("MC_Pi0_Phi", tmpPhi);\r
-           fHistograms->FillHistogram("MC_Pi0_Pt", particle->Pt());\r
-           fHistograms->FillHistogram("MC_Pi0_Energy", particle->Energy());\r
-           fHistograms->FillHistogram("MC_Pi0_R", particle->R());\r
-           fHistograms->FillHistogram("MC_Pi0_ZR", particle->Vz(),particle->R());\r
-           fHistograms->FillHistogram("MC_Pi0_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
-           fHistograms->FillHistogram("MC_Pi0_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling\r
+       }\r
+       else{\r
+         fHistograms->FillHistogram("MC_Pi0_Eta", particle->Eta());    \r
+         fHistograms->FillHistogram("MC_Pi0_Rapid", rapidity);\r
+         fHistograms->FillHistogram("MC_Pi0_Phi", tmpPhi);\r
+         fHistograms->FillHistogram("MC_Pi0_Pt", particle->Pt());\r
+         fHistograms->FillHistogram("MC_Pi0_Energy", particle->Energy());\r
+         fHistograms->FillHistogram("MC_Pi0_R", particle->R());\r
+         fHistograms->FillHistogram("MC_Pi0_ZR", particle->Vz(),particle->R());\r
+         fHistograms->FillHistogram("MC_Pi0_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
+         fHistograms->FillHistogram("MC_Pi0_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling\r
+                                       \r
+         if(TMath::Abs(daughter0->Eta()) <= fV0Reader->GetEtaCut() && TMath::Abs(daughter1->Eta()) <= fV0Reader->GetEtaCut() ){\r
+           fHistograms->FillHistogram("MC_Pi0_Pt_Eta_withinAcceptance", particle->Pt(),particle->Eta());\r
+           fHistograms->FillHistogram("MC_Pi0_Pt_Rapid_withinAcceptance", particle->Pt(),rapidity);\r
+           if(daughter0Electron && daughter0Positron && daughter1Electron && daughter1Positron){\r
+             fHistograms->FillHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta());\r
+             fHistograms->FillHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity);\r
+           }\r
          }\r
        }\r
-       else if(particle->GetPdgCode()==221){//Eta\r
-         fHistograms->FillHistogram("MC_Eta_Eta", particle->Eta());\r
-\r
-         fHistograms->FillHistogram("MC_Eta_Phi",tmpPhi);\r
-         fHistograms->FillHistogram("MC_Eta_Pt", particle->Pt());\r
-         fHistograms->FillHistogram("MC_Eta_Energy", particle->Energy());\r
-         fHistograms->FillHistogram("MC_Eta_R", particle->R());\r
-         fHistograms->FillHistogram("MC_Eta_ZR", particle->Vz(),particle->R());\r
-         fHistograms->FillHistogram("MC_Eta_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
-         fHistograms->FillHistogram("MC_Eta_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling\r
+      }\r
+                       \r
+      if(particle->GetPdgCode()==221){   //Eta\r
+       fHistograms->FillHistogram("MC_Eta_Eta", particle->Eta());\r
+       fHistograms->FillHistogram("MC_Eta_Rapid", rapidity);\r
+       fHistograms->FillHistogram("MC_Eta_Phi",tmpPhi);\r
+       fHistograms->FillHistogram("MC_Eta_Pt", particle->Pt());\r
+       fHistograms->FillHistogram("MC_Eta_Energy", particle->Energy());\r
+       fHistograms->FillHistogram("MC_Eta_R", particle->R());\r
+       fHistograms->FillHistogram("MC_Eta_ZR", particle->Vz(),particle->R());\r
+       fHistograms->FillHistogram("MC_Eta_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
+       fHistograms->FillHistogram("MC_Eta_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling\r
+                               \r
+       if(TMath::Abs(daughter0->Eta()) <= fV0Reader->GetEtaCut() && TMath::Abs(daughter1->Eta()) <= fV0Reader->GetEtaCut() ){\r
+         fHistograms->FillHistogram("MC_Eta_Pt_Eta_withinAcceptance", particle->Pt(),particle->Eta());\r
+         fHistograms->FillHistogram("MC_Eta_Pt_Rapid_withinAcceptance", particle->Pt(),rapidity);\r
+         if(daughter0Electron && daughter0Positron && daughter1Electron && daughter1Positron){\r
+           fHistograms->FillHistogram("MC_Eta_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta());\r
+           fHistograms->FillHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity);\r
+         }\r
+                                       \r
        }\r
-       \r
-       //the match data should be filled no matter which mother the gamma-gamma comes from\r
-       fHistograms->FillHistogram("MC_Match_Gamma_R", particle->R());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_ZR", particle->Vz(),particle->R());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_XY", particle->Vx(),particle->Vy());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_Mass", particle->GetCalcMass());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
-       fHistograms->FillHistogram("MC_Match_Gamma_Energy", particle->Energy());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_Pt", particle->Pt());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_Eta", particle->Eta());\r
-       fHistograms->FillHistogram("MC_Match_Gamma_Phi",tmpPhi);\r
+                               \r
+      }\r
+                       \r
+      // all motherparticles with 2 gammas as daughters\r
+      fHistograms->FillHistogram("MC_Mother_R", particle->R());\r
+      fHistograms->FillHistogram("MC_Mother_ZR", particle->Vz(),particle->R());\r
+      fHistograms->FillHistogram("MC_Mother_XY", particle->Vx(),particle->Vy());\r
+      fHistograms->FillHistogram("MC_Mother_Mass", particle->GetCalcMass());\r
+      fHistograms->FillHistogram("MC_Mother_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
+      fHistograms->FillHistogram("MC_Mother_Energy", particle->Energy());\r
+      fHistograms->FillHistogram("MC_Mother_Pt", particle->Pt());\r
+      fHistograms->FillHistogram("MC_Mother_Eta", particle->Eta());\r
+      fHistograms->FillHistogram("MC_Mother_Rapid", rapidity);\r
+      fHistograms->FillHistogram("MC_Mother_Phi",tmpPhi);\r
+      fHistograms->FillHistogram("MC_Mother_InvMass_vs_Pt",particle->GetMass(),particle->Pt());                        \r
+      if(TMath::Abs(daughter0->Eta()) <= fV0Reader->GetEtaCut() && TMath::Abs(daughter1->Eta()) <= fV0Reader->GetEtaCut() ){\r
+       fHistograms->FillHistogram("MC_Mother_Pt_Eta_withinAcceptance", particle->Pt(),particle->Eta());\r
+       fHistograms->FillHistogram("MC_Mother_Pt_Rapid_withinAcceptance", particle->Pt(),rapidity);\r
+       fHistograms->FillHistogram("MC_Mother_InvMass_vs_Pt_withinAcceptance",particle->GetMass(),particle->Pt());                      \r
+       if(daughter0Electron && daughter0Positron && daughter1Electron && daughter1Positron){\r
+         fHistograms->FillHistogram("MC_Mother_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta());\r
+         fHistograms->FillHistogram("MC_Mother_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity);\r
+         fHistograms->FillHistogram("MC_Mother_InvMass_vs_Pt_ConvGamma_withinAcceptance",particle->GetMass(),particle->Pt());                  \r
+\r
+       }\r
+                               \r
+                               \r
       }\r
-    }// end else if(particle->GetNDaughters() == 2)\r
+                       \r
+      //cout << "mother histos are filled" << endl;\r
+                       \r
+    } // end if(particle->GetNDaughters() == 2)\r
+               \r
   }// end for (Int_t iTracks = 0; iTracks < fStack->GetNtrack(); iTracks++)\r
+       \r
+  //cout << "right before the end of processMCdata" << endl;\r
+       \r
 } // end ProcessMCData\r
 \r
-void AliAnalysisTaskGammaConversion::FillNtuple(){\r
 \r
+\r
+void AliAnalysisTaskGammaConversion::FillNtuple(){\r
+       \r
   if(fGammaNtuple == NULL){\r
     return;\r
   }\r
@@ -434,92 +601,194 @@ void AliAnalysisTaskGammaConversion::FillNtuple(){
     fGammaNtuple->Fill(values);\r
   }\r
   fV0Reader->ResetV0IndexNumber();\r
-  \r
+       \r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::ProcessV0sNoCut(){\r
+\r
+  Int_t numberOfV0s = fV0Reader->GetNumberOfV0s();\r
+  for(Int_t i=0;i<numberOfV0s;i++){\r
+    /*AliESDv0 * cV0 = */fV0Reader->GetV0(i);\r
+\r
+    if(fV0Reader->CheckForPrimaryVertex() == kFALSE){\r
+      return;\r
+    }\r
+    \r
+    if(fDoMCTruth){\r
+      \r
+      if(fV0Reader->HasSameMCMother() == kFALSE){\r
+       continue;\r
+      }\r
+               \r
+      TParticle * negativeMC = (TParticle*)fV0Reader->GetNegativeMCParticle();\r
+      TParticle * positiveMC = (TParticle*)fV0Reader->GetPositiveMCParticle();\r
+\r
+      if(TMath::Abs(negativeMC->GetPdgCode())!=11 || TMath::Abs(positiveMC->GetPdgCode())!=11){\r
+       continue;\r
+      }\r
+      if(negativeMC->GetPdgCode()==positiveMC->GetPdgCode()){\r
+       continue;\r
+      }\r
+       \r
+      if(fV0Reader->GetMotherMCParticle()->GetPdgCode() == 22){\r
+      \r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Pt", fV0Reader->GetMotherCandidatePt());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Eta", fV0Reader->GetMotherCandidateEta());                               \r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Mass", fV0Reader->GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Width", fV0Reader->GetMotherCandidateWidth());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Chi2", fV0Reader->GetMotherCandidateChi2());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_NDF", fV0Reader->GetMotherCandidateNDF());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Rapid", fV0Reader->GetMotherCandidateRapidity());\r
+       fHistograms->FillHistogram("ESD_NoCutConvGamma_Pt_Eta", fV0Reader->GetMotherCandidatePt(),fV0Reader->GetMotherCandidateEta());\r
+       \r
+       fHistograms->FillHistogram("ESD_NoCutConversion_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
+       fHistograms->FillHistogram("ESD_NoCutConversion_R", fV0Reader->GetXYRadius());\r
+       fHistograms->FillHistogram("ESD_NoCutConversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+       fHistograms->FillHistogram("ESD_NoCutConversion_OpeningAngle", fV0Reader->GetOpeningAngle());\r
+       \r
+       /*\r
+         ESD_NoCutConvGamma_Pt\r
+         ESD_NoCutConvGamma_Energy\r
+         ESD_NoCutConvGamma_Eta\r
+         ESD_NoCutConvGamma_Phi\r
+         ESD_NoCutConvGamma_Mass\r
+         ESD_NoCutConvGamma_Width\r
+         ESD_NoCutConvGamma_Chi2\r
+         ESD_NoCutConvGamma_NDF\r
+         ESD_NoCutConvGamma_PtvsEta\r
+         ESD_NoCutConversion_XY\r
+         ESD_NoCutConversion_R\r
+         ESD_NoCutConversion_ZR\r
+         ESD_NoCutConversion_OpeningAngle\r
+       */\r
+      }\r
+    }\r
+  }\r
+  fV0Reader->ResetV0IndexNumber();\r
 }\r
 \r
 void AliAnalysisTaskGammaConversion::ProcessV0s(){\r
   // see header file for documentation\r
-\r
+       \r
   if(fWriteNtuple == kTRUE){\r
     FillNtuple();\r
   }\r
-\r
+       \r
   Int_t nSurvivingV0s=0;\r
   while(fV0Reader->NextV0()){\r
     nSurvivingV0s++;\r
+               \r
+               \r
     //-------------------------- filling v0 information -------------------------------------\r
-    fHistograms->FillHistogram("ESD_EP_OpeningAngle", fV0Reader->GetOpeningAngle());    \r
-    fHistograms->FillHistogram("ESD_EP_R", fV0Reader->GetXYRadius());\r
-    fHistograms->FillHistogram("ESD_EP_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
-    fHistograms->FillHistogram("ESD_EP_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
-    \r
-    \r
+    fHistograms->FillHistogram("ESD_Conversion_R", fV0Reader->GetXYRadius());\r
+    fHistograms->FillHistogram("ESD_Conversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+    fHistograms->FillHistogram("ESD_Conversion_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
+    fHistograms->FillHistogram("ESD_Conversion_OpeningAngle", fV0Reader->GetOpeningAngle());    \r
+               \r
     fHistograms->FillHistogram("ESD_E_Energy", fV0Reader->GetNegativeTrackEnergy());\r
     fHistograms->FillHistogram("ESD_E_Pt", fV0Reader->GetNegativeTrackPt());\r
     fHistograms->FillHistogram("ESD_E_Eta", fV0Reader->GetNegativeTrackEta());\r
     fHistograms->FillHistogram("ESD_E_Phi", fV0Reader->GetNegativeTrackPhi());\r
-    \r
+               \r
     fHistograms->FillHistogram("ESD_P_Energy", fV0Reader->GetPositiveTrackEnergy());\r
     fHistograms->FillHistogram("ESD_P_Pt", fV0Reader->GetPositiveTrackPt());\r
     fHistograms->FillHistogram("ESD_P_Eta", fV0Reader->GetPositiveTrackEta());\r
     fHistograms->FillHistogram("ESD_P_Phi", fV0Reader->GetPositiveTrackPhi());\r
-    \r
-    fHistograms->FillHistogram("ESD_Gamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
-    fHistograms->FillHistogram("ESD_Gamma_Pt", fV0Reader->GetMotherCandidatePt());\r
-    fHistograms->FillHistogram("ESD_Gamma_Eta", fV0Reader->GetMotherCandidateEta());\r
-    fHistograms->FillHistogram("ESD_Gamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
-\r
-\r
+               \r
+    fHistograms->FillHistogram("ESD_ConvGamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Pt", fV0Reader->GetMotherCandidatePt());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Eta", fV0Reader->GetMotherCandidateEta());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Mass", fV0Reader->GetMotherCandidateMass());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Width", fV0Reader->GetMotherCandidateWidth());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Chi2", fV0Reader->GetMotherCandidateChi2());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_NDF", fV0Reader->GetMotherCandidateNDF());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Rapid", fV0Reader->GetMotherCandidateRapidity());\r
+    fHistograms->FillHistogram("ESD_ConvGamma_Pt_Eta", fV0Reader->GetMotherCandidatePt(),fV0Reader->GetMotherCandidateEta());\r
+               \r
+               \r
     // begin mapping\r
     Int_t rBin    = fHistograms->GetRBin(fV0Reader->GetXYRadius());\r
     Int_t phiBin  = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi());\r
     Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta();\r
-    \r
+               \r
     TString nameESDMappingPhiR="";\r
-    nameESDMappingPhiR.Form("ESD_EP_Mapping-Phi%02d-R%02d",phiBin,rBin);\r
+    nameESDMappingPhiR.Form("ESD_Conversion_Mapping-Phi%02d-R%02d",phiBin,rBin);\r
     fHistograms->FillHistogram(nameESDMappingPhiR, fV0Reader->GetZ(), motherCandidateEta);\r
-\r
+               \r
     TString nameESDMappingPhi="";\r
-    nameESDMappingPhi.Form("ESD_EP_Mapping-Phi%02d",phiBin);\r
+    nameESDMappingPhi.Form("ESD_Conversion_Mapping-Phi%02d",phiBin);\r
     fHistograms->FillHistogram(nameESDMappingPhi, fV0Reader->GetZ(), motherCandidateEta);\r
-\r
+               \r
     TString nameESDMappingR="";\r
-    nameESDMappingR.Form("ESD_EP_Mapping-R%02d",rBin);\r
+    nameESDMappingR.Form("ESD_Conversion_Mapping-R%02d",rBin);\r
     fHistograms->FillHistogram(nameESDMappingR, fV0Reader->GetZ(), motherCandidateEta);  \r
-\r
+               \r
     TString nameESDMappingPhiInR="";\r
-    nameESDMappingPhiInR.Form("ESD_EP_Mapping_Phi_R-%02d",rBin);\r
+    nameESDMappingPhiInR.Form("ESD_Conversion_Mapping_Phi_R-%02d",rBin);\r
     fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetMotherCandidatePhi());\r
     // end mapping\r
-    \r
+               \r
     fKFReconstructedGammas.push_back(*fV0Reader->GetMotherCandidateKFCombination());\r
+    electronv1.push_back(fV0Reader->GetCurrentV0()->GetPindex());\r
+    electronv2.push_back(fV0Reader->GetCurrentV0()->GetNindex());\r
 \r
+               \r
     //----------------------------------- checking for "real" conversions (MC match) --------------------------------------\r
     if(fDoMCTruth){\r
+                       \r
       if(fV0Reader->HasSameMCMother() == kFALSE){\r
+       fIsTrueReconstructedGammas.push_back(kFALSE);\r
        continue;\r
       }\r
\r
+      \r
+               \r
       TParticle * negativeMC = (TParticle*)fV0Reader->GetNegativeMCParticle();\r
       TParticle * positiveMC = (TParticle*)fV0Reader->GetPositiveMCParticle();\r
 \r
-      if(negativeMC->GetPdgCode()!=11 || positiveMC->GetPdgCode()!=-11){\r
+      if(TMath::Abs(negativeMC->GetPdgCode())!=11 || TMath::Abs(positiveMC->GetPdgCode())!=11){\r
+       fIsTrueReconstructedGammas.push_back(kFALSE);\r
        continue;\r
       }\r
+      if(negativeMC->GetPdgCode()==positiveMC->GetPdgCode()){\r
+       fIsTrueReconstructedGammas.push_back(kFALSE);\r
+       continue;\r
+      }\r
+       \r
       if(fV0Reader->GetMotherMCParticle()->GetPdgCode() == 22){\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_OpeningAngle", fV0Reader->GetOpeningAngle());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Pt", fV0Reader->GetMotherCandidatePt());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Eta", fV0Reader->GetMotherCandidateEta());\r
-\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Mass", fV0Reader->GetMotherCandidateMass());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Width", fV0Reader->GetMotherCandidateWidth());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_Chi2", fV0Reader->GetMotherCandidateChi2());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_NDF", fV0Reader->GetMotherCandidateNDF());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_R", fV0Reader->GetXYRadius());\r
-       fHistograms->FillHistogram("ESD_Match_Gamma_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+       fIsTrueReconstructedGammas.push_back(kTRUE);\r
+                               \r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Pt", fV0Reader->GetMotherCandidatePt());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Eta", fV0Reader->GetMotherCandidateEta());                                \r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Mass", fV0Reader->GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Width", fV0Reader->GetMotherCandidateWidth());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Chi2", fV0Reader->GetMotherCandidateChi2());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_NDF", fV0Reader->GetMotherCandidateNDF());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Pt_Eta", fV0Reader->GetMotherCandidatePt(),fV0Reader->GetMotherCandidateEta());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_Rapid", fV0Reader->GetMotherCandidateRapidity());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_TrackLength", /*fV0Reader->GetNegativeTrackLength()*/fV0Reader->GetNegativeNTPCClusters());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_TrackLength", /*fV0Reader->GetPositiveTrackLength()*/fV0Reader->GetPositiveNTPCClusters());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass",/*fV0Reader->GetNegativeTrackLength()*/fV0Reader->GetNegativeNTPCClusters(),fV0Reader->GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass",/*fV0Reader->GetPositiveTrackLength()*/fV0Reader->GetPositiveNTPCClusters(),fV0Reader->GetMotherCandidateMass());\r
+       \r
+       fHistograms->FillHistogram("ESD_TrueConversion_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
+       fHistograms->FillHistogram("ESD_TrueConversion_R", fV0Reader->GetXYRadius());\r
+       fHistograms->FillHistogram("ESD_TrueConversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+       fHistograms->FillHistogram("ESD_TrueConversion_OpeningAngle", fV0Reader->GetOpeningAngle());\r
+\r
+       \r
+       /*\r
+         fHistograms->FillHistogram("ESD_TrueConversion_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
+         fHistograms->FillHistogram("ESD_TrueConversion_R", fV0Reader->GetXYRadius());\r
+         fHistograms->FillHistogram("ESD_TrueConversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+         fHistograms->FillHistogram("ESD_TrueConversion_OpeningAngle", fV0Reader->GetOpeningAngle());\r
+       */\r
+\r
+\r
 \r
        //resolution\r
        Double_t mcpt   = fV0Reader->GetMotherMCParticle()->Pt();\r
@@ -528,84 +797,114 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
        if(mcpt != 0){\r
          resdPt = ((esdpt - mcpt)/mcpt)*100;\r
        }\r
-\r
+                               \r
        fHistograms->FillHistogram("Resolution_dPt", mcpt, resdPt);\r
        fHistograms->FillHistogram("Resolution_MC_Pt", mcpt);\r
        fHistograms->FillHistogram("Resolution_ESD_Pt", esdpt);\r
-       \r
+                               \r
        Double_t resdZ = 0;\r
        if(fV0Reader->GetNegativeMCParticle()->Vz() != 0){\r
          resdZ = ((fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz())/fV0Reader->GetNegativeMCParticle()->Vz())*100;\r
        }\r
-       \r
+                               \r
        fHistograms->FillHistogram("Resolution_dZ", fV0Reader->GetNegativeMCParticle()->Vz(), resdZ);\r
        fHistograms->FillHistogram("Resolution_MC_Z", fV0Reader->GetNegativeMCParticle()->Vz());\r
        fHistograms->FillHistogram("Resolution_ESD_Z", fV0Reader->GetZ());\r
-       \r
+                               \r
        Double_t resdR = 0;\r
        if(fV0Reader->GetNegativeMCParticle()->R() != 0){\r
          resdR = ((fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R())/fV0Reader->GetNegativeMCParticle()->R())*100;\r
        }\r
+\r
        fHistograms->FillHistogram("Resolution_dR", fV0Reader->GetNegativeMCParticle()->R(), resdR);\r
        fHistograms->FillHistogram("Resolution_MC_R", fV0Reader->GetNegativeMCParticle()->R());\r
        fHistograms->FillHistogram("Resolution_ESD_R", fV0Reader->GetXYRadius());\r
        fHistograms->FillHistogram("Resolution_dR_dPt", resdR, resdPt);\r
+      }//if(fV0Reader->GetMotherMCParticle()->GetPdgCode() == 22)\r
+      else{\r
+       fIsTrueReconstructedGammas.push_back(kFALSE);\r
       }\r
-    }\r
-  }\r
-  fHistograms->FillHistogram("NumberOfSurvivingV0s", nSurvivingV0s);\r
-  fHistograms->FillHistogram("NumberOfV0s", fV0Reader->GetNumberOfV0s());\r
+    }//if(fDoMCTruth)\r
+  }//while(fV0Reader->NextV0)\r
+  fHistograms->FillHistogram("ESD_NumberOfSurvivingV0s", nSurvivingV0s);\r
+  fHistograms->FillHistogram("ESD_NumberOfV0s", fV0Reader->GetNumberOfV0s());\r
+       \r
+  //cout << "nearly at the end of doMCTruth" << endl;\r
+       \r
 }\r
 \r
 void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){\r
   // see header file for documentation\r
-\r
+       \r
   for(UInt_t firstGammaIndex=0;firstGammaIndex<fKFReconstructedGammas.size();firstGammaIndex++){\r
     for(UInt_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fKFReconstructedGammas.size();secondGammaIndex++){\r
+                       \r
       AliKFParticle * twoGammaDecayCandidateDaughter0 = &fKFReconstructedGammas[firstGammaIndex];\r
       AliKFParticle * twoGammaDecayCandidateDaughter1 = &fKFReconstructedGammas[secondGammaIndex];\r
-\r
       \r
-      AliKFParticle *twoGammaCandidate = new AliKFParticle(*twoGammaDecayCandidateDaughter0,*twoGammaDecayCandidateDaughter1);\r
+      if(electronv1[firstGammaIndex]==electronv1[secondGammaIndex] || electronv1[firstGammaIndex]==electronv2[secondGammaIndex]){\r
+       continue;\r
+      }\r
+      if(electronv2[firstGammaIndex]==electronv1[secondGammaIndex] || electronv2[firstGammaIndex]==electronv2[secondGammaIndex]){\r
+       continue;\r
+      }\r
+\r
+      /*\r
+       if(fIsTrueReconstructedGammas[firstGammaIndex] == kFALSE || fIsTrueReconstructedGammas[secondGammaIndex] == kFALSE){\r
+       continue;\r
+       }\r
+      */\r
 \r
-      Double_t massTwoGammaCandidate =0.;\r
+      AliKFParticle *twoGammaCandidate = new AliKFParticle(*twoGammaDecayCandidateDaughter0,*twoGammaDecayCandidateDaughter1);\r
+                       \r
+      Double_t massTwoGammaCandidate = 0.;\r
       Double_t widthTwoGammaCandidate = 0.;\r
       Double_t chi2TwoGammaCandidate =10000.;  \r
       twoGammaCandidate->GetMass(massTwoGammaCandidate,widthTwoGammaCandidate);\r
       if(twoGammaCandidate->GetNDF()>0){\r
        chi2TwoGammaCandidate = twoGammaCandidate->GetChi2()/twoGammaCandidate->GetNDF();\r
-       if(chi2TwoGammaCandidate>0 && chi2TwoGammaCandidate<fV0Reader->GetChi2CutMeson()){\r
-\r
-         TVector3 vectorTwoGammaCandidate(twoGammaCandidate->Px(),twoGammaCandidate->Py(),twoGammaCandidate->Pz());\r
-\r
-         Double_t openingAngleTwoGammaCandidate = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1);\r
-\r
-         //Calculating by hand the radius\r
-         Double_t tmpX= twoGammaCandidate->GetX();\r
-         Double_t tmpY= twoGammaCandidate->GetY();\r
-         \r
-         Double_t radiusTwoGammaCandidate = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);\r
-\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_GammaDaughter_OpeningAngle", openingAngleTwoGammaCandidate);\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_Energy", twoGammaCandidate->GetE());\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_Pt", sqrt(twoGammaCandidate->GetPx()*twoGammaCandidate->GetPx()+twoGammaCandidate->GetPy()*twoGammaCandidate->GetPy()));\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_Eta", vectorTwoGammaCandidate.Eta());\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_Phi", vectorTwoGammaCandidate.Phi());\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_Mass", massTwoGammaCandidate);\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_R", radiusTwoGammaCandidate);\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_ZR", tmpY, radiusTwoGammaCandidate);\r
-         fHistograms->FillHistogram("ESD_TwoGammaCombination_XY", tmpX, tmpY);\r
-         fHistograms->FillHistogram("InvMass_vs_Pt_Spectra",massTwoGammaCandidate ,sqrt(twoGammaCandidate->GetPx()*twoGammaCandidate->GetPx()+twoGammaCandidate->GetPy()*twoGammaCandidate->GetPy()));\r
+                               \r
+       if(chi2TwoGammaCandidate>0 && chi2TwoGammaCandidate<fV0Reader->GetChi2CutMeson()){                                      \r
+                                       \r
+         TVector3 MomentumVectorTwoGammaCandidate(twoGammaCandidate->GetPx(),twoGammaCandidate->GetPy(),twoGammaCandidate->GetPz());\r
+         TVector3 SpaceVectorTwoGammaCandidate(twoGammaCandidate->GetX(),twoGammaCandidate->GetY(),twoGammaCandidate->GetZ());\r
+                                       \r
+         Double_t openingAngleTwoGammaCandidate = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1);                                 \r
+         Double_t rapidity;\r
+         if(twoGammaCandidate->GetE() - twoGammaCandidate->GetPz() == 0 || twoGammaCandidate->GetE() + twoGammaCandidate->GetPz() == 0){\r
+           rapidity=0;\r
+         }\r
+         else{\r
+           rapidity = 0.5*(TMath::Log((twoGammaCandidate->GetE() +twoGammaCandidate->GetPz()) / (twoGammaCandidate->GetE()-twoGammaCandidate->GetPz())));\r
+         }\r
+                                       \r
+         if(openingAngleTwoGammaCandidate < fMinOpeningAngleGhostCut) continue;   // minimum opening angle to avoid using ghosttracks\r
+\r
+         fHistograms->FillHistogram("ESD_Mother_GammaDaughter_OpeningAngle", openingAngleTwoGammaCandidate);\r
+         fHistograms->FillHistogram("ESD_Mother_Energy", twoGammaCandidate->GetE());\r
+         fHistograms->FillHistogram("ESD_Mother_Pt", MomentumVectorTwoGammaCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Mother_Eta", MomentumVectorTwoGammaCandidate.Eta());\r
+         fHistograms->FillHistogram("ESD_Mother_Rapid", rapidity);                                     \r
+         fHistograms->FillHistogram("ESD_Mother_Phi", SpaceVectorTwoGammaCandidate.Phi());\r
+         fHistograms->FillHistogram("ESD_Mother_Mass", massTwoGammaCandidate);\r
+         fHistograms->FillHistogram("ESD_Mother_R", SpaceVectorTwoGammaCandidate.Pt());    // Pt in Space == R!!!\r
+         fHistograms->FillHistogram("ESD_Mother_ZR", twoGammaCandidate->GetZ(), SpaceVectorTwoGammaCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Mother_XY", twoGammaCandidate->GetX(), twoGammaCandidate->GetY());\r
+         fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt",massTwoGammaCandidate ,MomentumVectorTwoGammaCandidate.Pt());\r
        }\r
       }\r
       delete twoGammaCandidate;\r
+                       \r
+      //cout << "nearly at the end of processgamma for neutral meson ..." << endl;\r
+                       \r
+                       \r
     }\r
   }\r
 }\r
 \r
 void AliAnalysisTaskGammaConversion::CalculateBackground(){\r
   // see header file for documentation\r
-\r
+       \r
   vector<AliKFParticle> vectorCurrentEventGoodV0s = fV0Reader->GetCurrentEventGoodV0s();\r
   vector<AliKFParticle> vectorPreviousEventGoodV0s = fV0Reader->GetPreviousEventGoodV0s();\r
   for(UInt_t iCurrent=0;iCurrent<vectorCurrentEventGoodV0s.size();iCurrent++){\r
@@ -614,7 +913,7 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
       AliKFParticle * previousGoodV0 = &vectorPreviousEventGoodV0s.at(iPrevious);\r
 \r
       AliKFParticle *backgroundCandidate = new AliKFParticle(*currentEventGoodV0,*previousGoodV0);\r
-\r
+                       \r
       Double_t massBG =0.;\r
       Double_t widthBG = 0.;\r
       Double_t chi2BG =10000.; \r
@@ -622,30 +921,38 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
       if(backgroundCandidate->GetNDF()>0){\r
        chi2BG = backgroundCandidate->GetChi2()/backgroundCandidate->GetNDF();\r
        if(chi2BG>0 && chi2BG<fV0Reader->GetChi2CutMeson()){\r
-\r
-         TVector3 vectorBGCandidate(backgroundCandidate->Px(),backgroundCandidate->Py(),backgroundCandidate->Pz());\r
-\r
+                                       \r
+         TVector3 MomentumVectorbackgroundCandidate(backgroundCandidate->GetPx(),backgroundCandidate->GetPy(),backgroundCandidate->GetPz());\r
+         TVector3 SpaceVectorbackgroundCandidate(backgroundCandidate->GetX(),backgroundCandidate->GetY(),backgroundCandidate->GetZ());\r
+                                       \r
          Double_t openingAngleBG = currentEventGoodV0->GetAngle(*previousGoodV0);\r
 \r
-         //Calculating by hand the radius (find a better way)\r
-         Double_t tmpX= backgroundCandidate->GetX();\r
-         Double_t tmpY= backgroundCandidate->GetY();\r
-         \r
-         Double_t radiusBG = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);\r
+         Double_t rapidity;\r
+         if(backgroundCandidate->GetE() - backgroundCandidate->GetPz() == 0 || backgroundCandidate->GetE() + backgroundCandidate->GetPz() == 0) rapidity=0;\r
+         else rapidity = 0.5*(TMath::Log((backgroundCandidate->GetE() +backgroundCandidate->GetPz()) / (backgroundCandidate->GetE()-backgroundCandidate->GetPz())));\r
 \r
+                                       \r
+                                       \r
+                                       \r
+         if(openingAngleBG < fMinOpeningAngleGhostCut ) continue;   // minimum opening angle to avoid using ghosttracks\r
+                       \r
+                                       \r
          fHistograms->FillHistogram("ESD_Background_GammaDaughter_OpeningAngle", openingAngleBG);\r
          fHistograms->FillHistogram("ESD_Background_Energy", backgroundCandidate->GetE());\r
-         fHistograms->FillHistogram("ESD_Background_Pt", sqrt(backgroundCandidate->GetPx()*backgroundCandidate->GetPx()+backgroundCandidate->GetPy()*backgroundCandidate->GetPy()));\r
-         fHistograms->FillHistogram("ESD_Background_Eta", vectorBGCandidate.Eta());\r
-         fHistograms->FillHistogram("ESD_Background_Phi", vectorBGCandidate.Phi());\r
+         fHistograms->FillHistogram("ESD_Background_Pt",  MomentumVectorbackgroundCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Background_Eta", MomentumVectorbackgroundCandidate.Eta());\r
+         fHistograms->FillHistogram("ESD_Background_Rapidity", rapidity);\r
+         fHistograms->FillHistogram("ESD_Background_Phi", SpaceVectorbackgroundCandidate.Phi());\r
          fHistograms->FillHistogram("ESD_Background_Mass", massBG);\r
-         fHistograms->FillHistogram("ESD_Background_R", radiusBG);\r
-         fHistograms->FillHistogram("ESD_Background_ZR", tmpY, radiusBG);\r
-         fHistograms->FillHistogram("ESD_Background_XY", tmpX, tmpY);\r
-         fHistograms->FillHistogram("Background_InvMass_vs_Pt_Spectra",massBG,sqrt(backgroundCandidate->GetPx()*backgroundCandidate->GetPx()+backgroundCandidate->GetPy()*backgroundCandidate->GetPy()));\r
+         fHistograms->FillHistogram("ESD_Background_R", SpaceVectorbackgroundCandidate.Pt());  // Pt in Space == R!!!!\r
+         fHistograms->FillHistogram("ESD_Background_ZR", backgroundCandidate->GetZ(), SpaceVectorbackgroundCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Background_XY", backgroundCandidate->GetX(), backgroundCandidate->GetY());\r
+         fHistograms->FillHistogram("ESD_Background_InvMass_vs_Pt",massBG,MomentumVectorbackgroundCandidate.Pt());\r
        }\r
       }\r
       delete backgroundCandidate;   \r
+      //cout << "nearly at the end of background" << endl;\r
+                       \r
     }\r
   }\r
 }\r
@@ -667,11 +974,11 @@ void AliAnalysisTaskGammaConversion::UserCreateOutputObjects()
   if(fOutputContainer == NULL){\r
     fOutputContainer = new TList();\r
   }\r
-  \r
+       \r
   //Adding the histograms to the output container\r
   fHistograms->GetOutputContainer(fOutputContainer);\r
-\r
-  \r
+       \r
+       \r
   if(fWriteNtuple){\r
     if(fGammaNtuple == NULL){\r
       fGammaNtuple = new TNtuple("V0ntuple","V0ntuple","OnTheFly:HasVertex:NegPIDProb:PosPIDProb:X:Y:Z:R:MotherCandidateNDF:MotherCandidateChi2:MotherCandidateEnergy:MotherCandidateEta:MotherCandidatePt:MotherCandidateMass:MotherCandidateWidth:MCMotherCandidatePT:EPOpeningAngle:ElectronEnergy:ElectronPt:ElectronEta:ElectronPhi:PositronEnergy:PositronPt:PositronEta:PositronPhi:HasSameMCMother:MotherMCParticlePIDCode",50000);\r
@@ -684,7 +991,7 @@ void AliAnalysisTaskGammaConversion::UserCreateOutputObjects()
     ntupleTList->Add((TNtuple*)fGammaNtuple);\r
     fOutputContainer->Add(ntupleTList);\r
   }\r
-\r
+       \r
   fOutputContainer->SetName(GetName());\r
 }\r
 \r
index bcff03f..6d44297 100644 (file)
@@ -27,76 +27,84 @@ class AliStack;
 class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE\r
 {\r
  public:\r
-    AliAnalysisTaskGammaConversion();\r
-    AliAnalysisTaskGammaConversion(const char* name);\r
-    virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor\r
+  AliAnalysisTaskGammaConversion();\r
+  AliAnalysisTaskGammaConversion(const char* name);\r
+  virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor\r
  \r
-    // Implementation of interface methods\r
-    virtual void UserCreateOutputObjects();\r
-    virtual void Init();\r
-    virtual void LocalInit() {Init();}\r
-    virtual void Exec(Option_t *option);\r
-    virtual void Terminate(Option_t *option);\r
-    virtual void ConnectInputData(Option_t *);\r
+  // Implementation of interface methods\r
+  virtual void UserCreateOutputObjects();\r
+  virtual void Init();\r
+  virtual void LocalInit() {Init();}\r
+  virtual void Exec(Option_t *option);\r
+  virtual void Terminate(Option_t *option);\r
+  virtual void ConnectInputData(Option_t *);\r
        \r
-    void ProcessMCData();\r
-    void ProcessV0s();\r
-    void ProcessGammasForNeutralMesonAnalysis();\r
-    void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}\r
-    void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}\r
-    void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}\r
-    void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}\r
-    void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}\r
-    void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}\r
-    void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}\r
-    void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}\r
-    void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}\r
-    void SetV0Reader(AliV0Reader* reader){fV0Reader=reader;}\r
-    void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}\r
-    void CalculateBackground();\r
-    void SetWriteNtuple(Bool_t writeNtuple){fWriteNtuple = writeNtuple;}\r
-    void FillNtuple();\r
-    Double_t GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const;\r
+  void ProcessMCData();\r
+  void ProcessV0sNoCut();\r
+  void ProcessV0s();\r
+  void ProcessGammasForNeutralMesonAnalysis();\r
+  void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}\r
+  void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}\r
+  void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}\r
+  void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}\r
+  void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}\r
+  void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}\r
+  void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}\r
+  void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}\r
+  void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}\r
+  void SetMinOpeningAngleGhostCut(Double_t ghostCut){fMinOpeningAngleGhostCut = ghostCut;}\r
+  void SetV0Reader(AliV0Reader* reader){fV0Reader=reader;}\r
+  void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}\r
+  void CalculateBackground();\r
+  void SetWriteNtuple(Bool_t writeNtuple){fWriteNtuple = writeNtuple;}\r
+  void FillNtuple();\r
+  Double_t GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const;\r
 \r
  private:\r
-    AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented\r
-    AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented\r
+  AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented\r
+  AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented\r
 \r
-    AliV0Reader* fV0Reader;\r
+  AliV0Reader* fV0Reader;\r
 \r
-    AliStack * fStack;\r
+  AliStack * fStack;\r
 \r
-    TList * fOutputContainer ; // Histogram container\r
+  TList * fOutputContainer ; // Histogram container\r
 \r
-    AliGammaConversionHistograms *fHistograms;\r
+  AliGammaConversionHistograms *fHistograms;\r
 \r
-    Bool_t fDoMCTruth;\r
+  Bool_t fDoMCTruth;\r
     \r
-    vector<TParticle*> fMCAllGammas;\r
-    vector<TParticle*> fMCPi0s;\r
-    vector<TParticle*> fMCEtas;\r
-    vector<TParticle*> fMCGammaChic;\r
-\r
-    vector<AliKFParticle> fKFReconstructedGammas;\r
-\r
-    //mass defines\r
-    Double_t fElectronMass;\r
-    Double_t fGammaMass;\r
-    Double_t fPi0Mass;\r
-    Double_t fEtaMass;\r
-\r
-    // width defines\r
-    Double_t fGammaWidth;\r
-    Double_t fPi0Width;\r
-    Double_t fEtaWidth;\r
-    Bool_t fCalculateBackground;\r
-    Bool_t fWriteNtuple;\r
-    TNtuple *fGammaNtuple;\r
-    TNtuple *fNeutralMesonNtuple;\r
-\r
-    Int_t fTotalNumberOfAddedNtupleEntries;\r
-\r
-    ClassDef(AliAnalysisTaskGammaConversion, 1); // Analysis task for gamma conversions\r
+  vector<TParticle*> fMCAllGammas;\r
+  vector<TParticle*> fMCPi0s;\r
+  vector<TParticle*> fMCEtas;\r
+  vector<TParticle*> fMCGammaChic;\r
+\r
+  vector<AliKFParticle> fKFReconstructedGammas;\r
+  vector<Bool_t> fIsTrueReconstructedGammas;\r
+  vector<Int_t> electronv1;\r
+  vector<Int_t> electronv2;\r
+\r
+  //mass defines\r
+  Double_t fElectronMass;\r
+  Double_t fGammaMass;\r
+  Double_t fPi0Mass;\r
+  Double_t fEtaMass;\r
+\r
+  // width defines\r
+  Double_t fGammaWidth;\r
+  Double_t fPi0Width;\r
+  Double_t fEtaWidth;\r
+\r
+  Double_t fMinOpeningAngleGhostCut;\r
+\r
+  Bool_t fCalculateBackground;\r
+  Bool_t fWriteNtuple;\r
+  TNtuple *fGammaNtuple;\r
+  TNtuple *fNeutralMesonNtuple;\r
+\r
+  Int_t fTotalNumberOfAddedNtupleEntries;\r
+\r
+  ClassDef(AliAnalysisTaskGammaConversion, 2); // Analysis task for gamma conversions\r
 };\r
  \r
 #endif //ALIANALYSISTASKGAMMA_H\r
index 2ca295f..ea63770 100644 (file)
@@ -88,8 +88,8 @@ AliGammaConversionHistograms & AliGammaConversionHistograms::operator = (const A
 \r
 AliGammaConversionHistograms::~AliGammaConversionHistograms() {\r
   //destructor\r
-\r
-\r
+       \r
+       \r
 }\r
 \r
 void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX,Double_t lastX,TString xAxisTitle, TString yAxisTitle){\r
@@ -114,7 +114,7 @@ void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t
   //see header file for documentation\r
   TH1 *tmp = (TH1*)fHistogramMap->GetValue(histogramName.Data());\r
   if(tmp){\r
-      tmp->Fill(xValue);\r
+    tmp->Fill(xValue);\r
   }\r
 }\r
 \r
@@ -128,12 +128,12 @@ void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t
 \r
 void AliGammaConversionHistograms::GetOutputContainer(TList *fOutputContainer){\r
   //checking if the container is alrerady created\r
-\r
+       \r
   if(fOutputContainer == NULL){\r
     //print warning\r
     return;\r
   }\r
-\r
+       \r
   if(fHistogramMap != NULL){\r
     TIter iter(fHistogramMap);\r
     TObjString *histogramName;\r
@@ -265,7 +265,7 @@ Int_t AliGammaConversionHistograms::GetPhiBin(Double_t phi) const{
 \r
 void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_t nRIndex, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi){\r
   // Initializing the valuse for the mapping\r
-\r
+       \r
   fNPhiIndex = nPhiIndex;\r
   fNRIndex   = nRIndex;\r
   fMinRadius      = minRadius;\r
@@ -284,11 +284,11 @@ void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_
 //mapping\r
 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){\r
   // see header file for documentation\r
-  \r
+       \r
   for(Int_t phi =0; phi<=fNPhiIndex;phi++){\r
-\r
+               \r
     for(Int_t r =0; r<fNRIndex;r++){\r
-\r
+                       \r
       // setting axis to "" changes below\r
       xAxisTitle="";\r
       yAxisTitle="";\r
@@ -296,32 +296,32 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
       if(xAxisTitle.Length() == 0){\r
        xAxisTitle.Form("Phi %02d",phi);\r
       }\r
-      \r
+                       \r
       if(yAxisTitle.Length() == 0){\r
        yAxisTitle.Form("R %02d",phi);\r
       }\r
-\r
+                       \r
       //MC\r
       TString nameMC="";\r
-      nameMC.Form("MC_EP_Mapping-Phi%02d-R%02d",phi,r);\r
+      nameMC.Form("MC_Conversion_Mapping-Phi%02d-R%02d",phi,r);\r
       TString titleMC="";\r
       titleMC.Form("Electron-Positron MC Mapping-Phi%02d-R%02d",phi,r);\r
-\r
+                       \r
       AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);\r
-\r
+                       \r
       //ESD\r
       TString nameESD="";\r
-      nameESD.Form("ESD_EP_Mapping-Phi%02d-R%02d",phi,r);\r
+      nameESD.Form("ESD_Conversion_Mapping-Phi%02d-R%02d",phi,r);\r
       TString titleESD="";\r
       titleESD.Form("Electron-Positron ESD Mapping-Phi%02d-R%02d",phi,r);\r
-\r
+                       \r
       AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);\r
     }\r
   }\r
-\r
-\r
+       \r
+       \r
   for(Int_t phi =0; phi<=nPhiIndex;phi++){ \r
-\r
+               \r
     // setting axis to "" changes below\r
     xAxisTitle="";\r
     yAxisTitle="";\r
@@ -332,27 +332,27 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     if(yAxisTitle.Length() == 0){\r
       yAxisTitle = "Counts";\r
     }\r
-    \r
+               \r
     //MC\r
     TString nameMC="";\r
-    nameMC.Form("MC_EP_Mapping-Phi%02d",phi);\r
+    nameMC.Form("MC_Conversion_Mapping-Phi%02d",phi);\r
     TString titleMC="";\r
     titleMC.Form("Electron-Positron MC Mapping-Phi%02d",phi);\r
-    \r
+               \r
     AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
-\r
+               \r
     //MC\r
     TString nameESD="";\r
-    nameESD.Form("ESD_EP_Mapping-Phi%02d",phi);\r
+    nameESD.Form("ESD_Conversion_Mapping-Phi%02d",phi);\r
     TString titleESD="";\r
     titleESD.Form("Electron-Positron ESD Mapping-Phi%02d",phi);\r
-    \r
+               \r
     AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
   }\r
-\r
-\r
+       \r
+       \r
   for(Int_t r =0; r<=nRIndex;r++){\r
-\r
+               \r
     // setting axis to "" changes below\r
     xAxisTitle="";\r
     yAxisTitle="";\r
@@ -363,33 +363,33 @@ void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t n
     if(yAxisTitle.Length() == 0){\r
       yAxisTitle = "Counts";\r
     }\r
-    \r
+               \r
     //MC\r
     TString nameMC="";\r
-    nameMC.Form("MC_EP_Mapping-R%02d",r);\r
+    nameMC.Form("MC_Conversion_Mapping-R%02d",r);\r
     TString titleMC="";\r
     titleMC.Form("Electron-Positron MC Mapping-R%02d",r);\r
-    \r
+               \r
     AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
-\r
+               \r
     //ESD\r
     TString nameESD="";\r
-    nameESD.Form("ESD_EP_Mapping-R%02d",r);\r
+    nameESD.Form("ESD_Conversion_Mapping-R%02d",r);\r
     TString titleESD="";\r
     titleESD.Form("Electron-Positron ESD Mapping-R%02d",r);\r
-    \r
+               \r
     AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
-\r
+               \r
     //Mapping Phi in R\r
     TString nameMCPhiInR="";\r
-    nameMCPhiInR.Form("MC_EP_Mapping_Phi_R-%02d",r);\r
+    nameMCPhiInR.Form("MC_Conversion_Mapping_Phi_R-%02d",r);\r
     TString titleMCPhiInR="";\r
     titleMCPhiInR.Form("MC Mapping of Phi in R%02d",r);\r
     AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
-\r
+               \r
     //Mapping Phi in R\r
     TString nameESDPhiInR="";\r
-    nameESDPhiInR.Form("ESD_EP_Mapping_Phi_R-%02d",r);\r
+    nameESDPhiInR.Form("ESD_Conversion_Mapping_Phi_R-%02d",r);\r
     TString titleESDPhiInR="";\r
     titleESDPhiInR.Form("ESD Mapping of Phi in R%02d",r);\r
     AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);    \r
index 38ece70..10c7327 100644 (file)
@@ -81,7 +81,7 @@ class AliGammaConversionHistograms{
 \r
   \r
   ClassDef(AliGammaConversionHistograms,1)\r
-} ;\r
+};\r
 \r
 \r
 #endif\r
index b5ecfba..970e4e6 100644 (file)
@@ -26,6 +26,7 @@
 #include "AliV0Reader.h"\r
 #include "AliAnalysisManager.h"\r
 #include "AliESDInputHandler.h"\r
+#include "AliESDtrack.h"\r
 #include "AliMCEvent.h"\r
 #include "AliKFVertex.h"\r
 \r
@@ -43,53 +44,55 @@ ClassImp(AliV0Reader)
 \r
 \r
 \r
-  AliV0Reader::AliV0Reader() :\r
-    TObject(),\r
-    fMCStack(NULL),\r
-    fMCTruth(NULL),\r
-    fChain(NULL),\r
-    fESDHandler(NULL),\r
-    fESDEvent(NULL),\r
-    fHistograms(NULL),\r
-    fCurrentV0IndexNumber(0),\r
-    fCurrentV0(NULL),\r
-    fCurrentNegativeKFParticle(NULL),\r
-    fCurrentPositiveKFParticle(NULL),\r
-    fCurrentMotherKFCandidate(NULL),\r
-    fCurrentNegativeESDTrack(NULL),\r
-    fCurrentPositiveESDTrack(NULL),\r
-    fNegativeTrackLorentzVector(NULL),\r
-    fPositiveTrackLorentzVector(NULL),\r
-    fMotherCandidateLorentzVector(NULL),\r
-    fCurrentXValue(0),\r
-    fCurrentYValue(0),\r
-    fCurrentZValue(0),\r
-    fPositiveTrackPID(0),\r
-    fNegativeTrackPID(0),\r
-    fNegativeMCParticle(NULL),\r
-    fPositiveMCParticle(NULL),\r
-    fMotherMCParticle(NULL),\r
-    fMotherCandidateKFMass(0),\r
-    fMotherCandidateKFWidth(0),\r
-    fUseKFParticle(kTRUE),\r
-    fUseESDTrack(kFALSE),\r
-    fDoMC(kFALSE),\r
-    fMaxR(10000),// 100 meter(outside of ALICE)\r
-    fEtaCut(0.),\r
-    fPtCut(0.),\r
-    fChi2CutConversion(0.),\r
-    fChi2CutMeson(0.),\r
-    fPIDProbabilityCutNegativeParticle(0),\r
-    fPIDProbabilityCutPositiveParticle(0),\r
-    fXVertexCut(0.),\r
-    fYVertexCut(0.),\r
-    fZVertexCut(0.),\r
-    fNSigmaMass(0.),\r
-    fUseImprovedVertex(kFALSE),\r
-    fCurrentEventGoodV0s(),\r
-    fPreviousEventGoodV0s()\r
+AliV0Reader::AliV0Reader() :\r
+TObject(),\r
+  fMCStack(NULL),\r
+  fMCTruth(NULL),\r
+  fChain(NULL),\r
+  fESDHandler(NULL),\r
+  fESDEvent(NULL),\r
+  fHistograms(NULL),\r
+  fCurrentV0IndexNumber(0),\r
+  fCurrentV0(NULL),\r
+  fCurrentNegativeKFParticle(NULL),\r
+  fCurrentPositiveKFParticle(NULL),\r
+  fCurrentMotherKFCandidate(NULL),\r
+  fCurrentNegativeESDTrack(NULL),\r
+  fCurrentPositiveESDTrack(NULL),\r
+  fNegativeTrackLorentzVector(NULL),\r
+  fPositiveTrackLorentzVector(NULL),\r
+  fMotherCandidateLorentzVector(NULL),\r
+  fCurrentXValue(0),\r
+  fCurrentYValue(0),\r
+  fCurrentZValue(0),\r
+  fPositiveTrackPID(0),\r
+  fNegativeTrackPID(0),\r
+  fNegativeMCParticle(NULL),\r
+  fPositiveMCParticle(NULL),\r
+  fMotherMCParticle(NULL),\r
+  fMotherCandidateKFMass(0),\r
+  fMotherCandidateKFWidth(0),\r
+  fUseKFParticle(kTRUE),\r
+  fUseESDTrack(kFALSE),\r
+  fDoMC(kFALSE),\r
+  fMaxR(10000),// 100 meter(outside of ALICE)\r
+  fEtaCut(0.),\r
+  fPtCut(0.),\r
+  fLineCutZRSlope(0.),\r
+  fLineCutZValue(0.),\r
+  fChi2CutConversion(0.),\r
+  fChi2CutMeson(0.),\r
+  fPIDProbabilityCutNegativeParticle(0),\r
+  fPIDProbabilityCutPositiveParticle(0),\r
+  fXVertexCut(0.),\r
+  fYVertexCut(0.),\r
+  fZVertexCut(0.),\r
+  fNSigmaMass(0.),\r
+  fUseImprovedVertex(kFALSE),\r
+  fCurrentEventGoodV0s(),\r
+  fPreviousEventGoodV0s()\r
 {\r
-\r
+       \r
 }\r
 \r
 \r
@@ -127,6 +130,8 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fMaxR(original.fMaxR),\r
   fEtaCut(original.fEtaCut),\r
   fPtCut(original.fPtCut),\r
+  fLineCutZRSlope(original.fLineCutZRSlope),\r
+  fLineCutZValue(original.fLineCutZValue),\r
   fChi2CutConversion(original.fChi2CutConversion),\r
   fChi2CutMeson(original.fChi2CutMeson),\r
   fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle),\r
@@ -139,7 +144,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fCurrentEventGoodV0s(original.fCurrentEventGoodV0s),\r
   fPreviousEventGoodV0s(original.fPreviousEventGoodV0s)\r
 {\r
-\r
+       \r
 }\r
 \r
 \r
@@ -151,171 +156,252 @@ AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/)
 \r
 void AliV0Reader::Initialize(){\r
   //see header file for documentation\r
-\r
+       \r
   // Get the input handler from the manager\r
   fESDHandler = (AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r
   if(fESDHandler == NULL){\r
     //print warning here\r
   }\r
-  \r
+       \r
   // Get pointer to esd event from input handler\r
   fESDEvent = fESDHandler->GetEvent();\r
   if(fESDEvent == NULL){\r
     //print warning here\r
   }\r
-\r
+       \r
   //Get pointer to MCTruth\r
   fMCTruth = (AliMCEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());\r
   if(fMCTruth == NULL){\r
     //print warning here\r
   }\r
-\r
+       \r
   //Get pointer to the mc stack\r
   fMCStack = fMCTruth->MCEvent()->Stack();\r
   if(fMCStack == NULL){\r
     //print warning here\r
   }\r
-\r
+       \r
   AliKFParticle::SetField(fESDEvent->GetMagneticField());\r
-\r
+       \r
 }\r
 \r
 AliESDv0* AliV0Reader::GetV0(Int_t index){\r
   //see header file for documentation\r
-\r
+       \r
   fCurrentV0 = fESDEvent->GetV0(index);\r
   UpdateV0Information();\r
   return fCurrentV0;\r
 }\r
+\r
 Bool_t AliV0Reader::CheckForPrimaryVertex(){\r
   return fESDEvent->GetPrimaryVertex()->GetNContributors()>0;\r
 }\r
 \r
+\r
+\r
 Bool_t AliV0Reader::NextV0(){\r
   //see header file for documentation\r
-\r
+       \r
   Bool_t iResult=kFALSE;\r
   while(fCurrentV0IndexNumber<fESDEvent->GetNumberOfV0s()){\r
     fCurrentV0 = fESDEvent->GetV0(fCurrentV0IndexNumber);\r
-    \r
+               \r
     //checks if on the fly mode is set\r
     if ( !fCurrentV0->GetOnFlyStatus() ){\r
-      fCurrentV0IndexNumber++;\r
       if(fHistograms != NULL){\r
-       fHistograms->FillHistogram("V0MassDebugCut1",GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_CutGetOnFly_InvMass",GetMotherCandidateMass());\r
       }\r
+      fCurrentV0IndexNumber++;\r
       continue;\r
     }\r
-\r
-    if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) {//checks if we have a vertex\r
-      fCurrentV0IndexNumber++;\r
+    \r
+    //checks if we have a prim vertex\r
+    if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) { \r
       if(fHistograms != NULL){\r
-       fHistograms->FillHistogram("V0MassDebugCut2",GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_CutNContributors_InvMass",GetMotherCandidateMass());\r
       }\r
+      fCurrentV0IndexNumber++;\r
       continue;\r
     }\r
-\r
+               \r
+    //Check the pid probability\r
     if(CheckPIDProbability(fPIDProbabilityCutNegativeParticle,fPIDProbabilityCutPositiveParticle)==kFALSE){\r
-      fCurrentV0IndexNumber++;\r
       if(fHistograms != NULL){\r
-       fHistograms->FillHistogram("V0MassDebugCut3",GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_CutPIDProb_InvMass",GetMotherCandidateMass());\r
       }\r
+      fCurrentV0IndexNumber++;\r
       continue;\r
     }\r
-\r
+               \r
+               \r
     fCurrentV0->GetXYZ(fCurrentXValue,fCurrentYValue,fCurrentZValue);\r
\r
+               \r
+               \r
     if(GetXYRadius()>fMaxR){ // cuts on distance from collision point\r
+      if(fHistograms != NULL){\r
+       fHistograms->FillHistogram("ESD_CutR_InvMass",GetMotherCandidateMass());\r
+      }\r
       fCurrentV0IndexNumber++;\r
+      continue;\r
+    }          \r
+               \r
+               \r
+    if((TMath::Abs(fCurrentZValue)*fLineCutZRSlope)-fLineCutZValue > GetXYRadius() ){ // cuts out regions where we do not reconstruct\r
       if(fHistograms != NULL){\r
-       fHistograms->FillHistogram("V0MassDebugCut4",GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_CutLine_InvMass",GetMotherCandidateMass());\r
       }\r
+      fCurrentV0IndexNumber++;\r
+      continue;\r
+    }          \r
+               \r
+               \r
+    if(UpdateV0Information() == kFALSE){\r
+      fCurrentV0IndexNumber++;\r
       continue;\r
     }\r
-\r
-    UpdateV0Information();\r
-        \r
+               \r
     if(fUseKFParticle){\r
       if(fCurrentMotherKFCandidate->GetNDF()<=0){\r
-       fCurrentV0IndexNumber++;\r
        if(fHistograms != NULL){\r
-         fHistograms->FillHistogram("V0MassDebugCut5",GetMotherCandidateMass());\r
+         fHistograms->FillHistogram("ESD_CutNDF_InvMass",GetMotherCandidateMass());\r
        }\r
+       fCurrentV0IndexNumber++;\r
        continue;\r
       }\r
+                       \r
+                       \r
       Double_t chi2V0 = fCurrentMotherKFCandidate->GetChi2()/fCurrentMotherKFCandidate->GetNDF();\r
       if(chi2V0 > fChi2CutConversion || chi2V0 <=0){\r
-       fCurrentV0IndexNumber++;\r
        if(fHistograms != NULL){\r
-         fHistograms->FillHistogram("V0MassDebugCut6",GetMotherCandidateMass());\r
+         fHistograms->FillHistogram("ESD_CutChi2_InvMass",GetMotherCandidateMass());\r
        }\r
-       continue;\r
+       fCurrentV0IndexNumber++;\r
+       continue;\r
       }\r
-      \r
+                       \r
+                       \r
       if(TMath::Abs(fMotherCandidateLorentzVector->Eta())> fEtaCut){\r
-       fCurrentV0IndexNumber++;\r
        if(fHistograms != NULL){\r
-         fHistograms->FillHistogram("V0MassDebugCut7",GetMotherCandidateMass());\r
+         fHistograms->FillHistogram("ESD_CutEta_InvMass",GetMotherCandidateMass());\r
        }\r
+       fCurrentV0IndexNumber++;\r
        continue;\r
       }\r
-      \r
+                       \r
+                       \r
       if(fMotherCandidateLorentzVector->Pt()<fPtCut){\r
-       fCurrentV0IndexNumber++;\r
        if(fHistograms != NULL){\r
-         fHistograms->FillHistogram("V0MassDebugCut8",GetMotherCandidateMass());\r
+         fHistograms->FillHistogram("ESD_CutPt_InvMass",GetMotherCandidateMass());\r
        }\r
+       fCurrentV0IndexNumber++;\r
        continue;\r
       }\r
+                       \r
+                       \r
     }\r
     else if(fUseESDTrack){\r
       //TODO\r
     }\r
 \r
-    iResult=kTRUE;//means we have a v0 who survived all the cuts applied\r
+    fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate);\r
 \r
+    iResult=kTRUE;//means we have a v0 who survived all the cuts applied\r
+               \r
     fCurrentV0IndexNumber++;\r
-    \r
+               \r
     break;\r
   }\r
   return iResult; \r
 }\r
 \r
-void AliV0Reader::UpdateV0Information(){\r
+Bool_t AliV0Reader::UpdateV0Information(){\r
   //see header file for documentation\r
-  \r
+\r
+  Bool_t iResult=kTRUE;                                                // for taking out not refitted, kinks and like sign tracks \r
+\r
+  Bool_t switchTracks = kFALSE;\r
+       \r
+  fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
+  fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
+       \r
+  if(fCurrentNegativeESDTrack->GetSign() == fCurrentPositiveESDTrack->GetSign()){             // avoid like sign\r
+    iResult=kFALSE;\r
+    if(fHistograms != NULL){\r
+      fHistograms->FillHistogram("ESD_CutLikeSign_InvMass",GetMotherCandidateMass());\r
+    }\r
+  }\r
+       \r
+  if(fCurrentPositiveESDTrack->GetSign() == -1 && fCurrentNegativeESDTrack->GetSign() == 1){  // switch wrong signed tracks\r
+    fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
+    fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
+    switchTracks = kTRUE;\r
+  }\r
+\r
+  if( !(fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kTPCrefit) || \r
+      !(fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kTPCrefit) ){\r
+    //  if( !(fCurrentNegativeESDTrack->GetStatus() & AliESDtrack::kITSrefit) || \r
+    //      !(fCurrentPositiveESDTrack->GetStatus() & AliESDtrack::kITSrefit) ){\r
+         \r
+    iResult=kFALSE;\r
+    if(fHistograms != NULL){\r
+      fHistograms->FillHistogram("ESD_CutRefit_InvMass",GetMotherCandidateMass());\r
+    }\r
+  }\r
+       \r
+       \r
+  if( fCurrentNegativeESDTrack->GetKinkIndex(0) > 0 || \r
+      fCurrentPositiveESDTrack->GetKinkIndex(0) > 0) {                 \r
+               \r
+    iResult=kFALSE;\r
+    if(fHistograms != NULL){\r
+      fHistograms->FillHistogram("ESD_CutKink_InvMass",GetMotherCandidateMass());\r
+    }\r
+  }\r
+\r
+\r
+       \r
   if(fCurrentNegativeKFParticle != NULL){\r
     delete fCurrentNegativeKFParticle;\r
   }\r
-  fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fNegativeTrackPID);\r
-  \r
+  if(switchTracks == kFALSE){\r
+    fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fNegativeTrackPID);\r
+  }\r
+  else{\r
+    fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fNegativeTrackPID);\r
+  }\r
+\r
   if(fCurrentPositiveKFParticle != NULL){\r
     delete fCurrentPositiveKFParticle;\r
   }\r
-  fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fPositiveTrackPID);\r
+  if(switchTracks == kFALSE){\r
+    fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fPositiveTrackPID);\r
+  }\r
+  else{\r
+    fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fPositiveTrackPID);\r
+  }\r
     \r
   if(fCurrentMotherKFCandidate != NULL){\r
     delete fCurrentMotherKFCandidate;\r
   }\r
   fCurrentMotherKFCandidate = new AliKFParticle(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle);\r
 \r
-  fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
-\r
-  fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
 \r
   if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){\r
     fCurrentMotherKFCandidate->SetMassConstraint(0,fNSigmaMass);\r
   }\r
-\r
+       \r
+       \r
+       \r
+       \r
   if(fUseImprovedVertex == kTRUE){\r
     AliKFVertex primaryVertexImproved(*GetPrimaryVertex());\r
     primaryVertexImproved+=*fCurrentMotherKFCandidate;\r
     fCurrentMotherKFCandidate->SetProductionVertex(primaryVertexImproved);\r
   }\r
-\r
+       \r
   fCurrentMotherKFCandidate->GetMass(fMotherCandidateKFMass,fMotherCandidateKFWidth);\r
-\r
-\r
+       \r
+       \r
   if(fNegativeTrackLorentzVector != NULL){\r
     delete fNegativeTrackLorentzVector;\r
   }\r
@@ -325,7 +411,7 @@ void AliV0Reader::UpdateV0Information(){
   else if(fUseESDTrack){\r
     fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeESDTrack->Px(),fCurrentNegativeESDTrack->Py(),fCurrentNegativeESDTrack->Pz());\r
   }\r
-\r
+       \r
   if(fPositiveTrackLorentzVector != NULL){\r
     delete fPositiveTrackLorentzVector;\r
   }\r
@@ -335,7 +421,7 @@ void AliV0Reader::UpdateV0Information(){
   else if(fUseESDTrack){\r
     fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveESDTrack->Px(),fCurrentPositiveESDTrack->Py(),fCurrentPositiveESDTrack->Pz());\r
   }\r
-\r
+       \r
   if(fMotherCandidateLorentzVector != NULL){\r
     delete fMotherCandidateLorentzVector;\r
   }\r
@@ -345,11 +431,12 @@ void AliV0Reader::UpdateV0Information(){
   else if(fUseESDTrack){\r
     fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector);\r
   }\r
-\r
+       \r
   if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){\r
     fMotherCandidateLorentzVector->SetXYZM(fMotherCandidateLorentzVector->Px() ,fMotherCandidateLorentzVector->Py(),fMotherCandidateLorentzVector->Pz(),0.); \r
   }\r
     \r
+       \r
   if(fDoMC == kTRUE){\r
     fMotherMCParticle= NULL;\r
     fNegativeMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetNindex())->GetLabel()));\r
@@ -358,12 +445,19 @@ void AliV0Reader::UpdateV0Information(){
       fMotherMCParticle = fMCStack->Particle(fPositiveMCParticle->GetMother(0));\r
     }\r
   }\r
-  fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate);\r
+               \r
+  //  if(iResult==kTRUE){\r
+  //   fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate); // moved it to NextV0() after all the cuts are applied\r
+  //  }\r
+\r
+  return iResult;\r
 }\r
 \r
+\r
+\r
 Bool_t AliV0Reader::HasSameMCMother(){\r
   //see header file for documentation\r
-\r
+       \r
   Bool_t iResult = kFALSE;\r
   if(fDoMC == kTRUE){\r
     if(fNegativeMCParticle != NULL && fPositiveMCParticle != NULL){\r
@@ -378,17 +472,17 @@ Bool_t AliV0Reader::HasSameMCMother(){
 \r
 Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut){\r
   //see header file for documentation\r
-\r
+       \r
   Bool_t iResult=kFALSE;\r
-\r
+       \r
   Double_t *posProbArray = new Double_t[10];\r
   Double_t *negProbArray = new Double_t[10];\r
   AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
   AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
-  \r
+       \r
   negTrack->GetTPCpid(negProbArray);\r
   posTrack->GetTPCpid(posProbArray);\r
-\r
+       \r
   if(negProbArray!=NULL && posProbArray!=NULL){\r
     if(negProbArray[GetSpeciesIndex(-1)]>=negProbCut && posProbArray[GetSpeciesIndex(1)]>=posProbCut){\r
       iResult=kTRUE;\r
@@ -400,15 +494,15 @@ Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut
 }\r
 \r
 void AliV0Reader::GetPIDProbability(Double_t &negPIDProb,Double_t & posPIDProb){\r
-\r
+       \r
   Double_t *posProbArray = new Double_t[10];\r
   Double_t *negProbArray = new Double_t[10];\r
   AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
   AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
-  \r
+       \r
   negTrack->GetTPCpid(negProbArray);\r
   posTrack->GetTPCpid(posProbArray);\r
-\r
+       \r
   if(negProbArray!=NULL && posProbArray!=NULL){\r
     negPIDProb = negProbArray[GetSpeciesIndex(-1)];\r
     posPIDProb = posProbArray[GetSpeciesIndex(1)];\r
@@ -419,19 +513,37 @@ void AliV0Reader::GetPIDProbability(Double_t &negPIDProb,Double_t & posPIDProb){
 \r
 void AliV0Reader::UpdateEventByEventData(){\r
   //see header file for documentation\r
-\r
+       \r
   if(fCurrentEventGoodV0s.size() >0 ){\r
-    fPreviousEventGoodV0s.clear();\r
-    fPreviousEventGoodV0s = fCurrentEventGoodV0s;\r
+    //    fPreviousEventGoodV0s.clear();\r
+    //    fPreviousEventGoodV0s = fCurrentEventGoodV0s;\r
+    if(fPreviousEventGoodV0s.size()>19){\r
+      for(UInt_t nCurrent=0;nCurrent<fCurrentEventGoodV0s.size();nCurrent++){\r
+       fPreviousEventGoodV0s.erase(fPreviousEventGoodV0s.begin());\r
+       fPreviousEventGoodV0s.push_back(fCurrentEventGoodV0s.at(nCurrent));\r
+      }\r
+    }\r
+    else{\r
+      for(UInt_t nCurrent=0;nCurrent<fCurrentEventGoodV0s.size();nCurrent++){\r
+       if(fPreviousEventGoodV0s.size()<20){\r
+         fPreviousEventGoodV0s.push_back(fCurrentEventGoodV0s.at(nCurrent));\r
+       }\r
+       else{\r
+         fPreviousEventGoodV0s.erase(fPreviousEventGoodV0s.begin());\r
+         fPreviousEventGoodV0s.push_back(fCurrentEventGoodV0s.at(nCurrent));\r
+       }\r
+      }\r
+    }\r
   }\r
   fCurrentEventGoodV0s.clear();\r
-  \r
+       \r
   fCurrentV0IndexNumber=0;\r
 }\r
 \r
+\r
 Double_t AliV0Reader::GetNegativeTrackPhi() const{\r
   //see header file for documentation\r
-\r
+       \r
   Double_t offset=0;\r
   if(fNegativeTrackLorentzVector->Phi()> TMath::Pi()){\r
     offset = -2*TMath::Pi();\r
@@ -441,7 +553,7 @@ Double_t AliV0Reader::GetNegativeTrackPhi() const{
 \r
 Double_t AliV0Reader::GetPositiveTrackPhi() const{\r
   //see header file for documentation\r
-\r
+       \r
   Double_t offset=0;\r
   if(fPositiveTrackLorentzVector->Phi()> TMath::Pi()){\r
     offset = -2*TMath::Pi();\r
@@ -451,7 +563,7 @@ Double_t AliV0Reader::GetPositiveTrackPhi() const{
 \r
 Double_t AliV0Reader::GetMotherCandidatePhi() const{\r
   //see header file for documentation\r
-\r
+       \r
   Double_t offset=0;\r
   if(fMotherCandidateLorentzVector->Phi()> TMath::Pi()){\r
     offset = -2*TMath::Pi();\r
@@ -459,11 +571,26 @@ Double_t AliV0Reader::GetMotherCandidatePhi() const{
   return fMotherCandidateLorentzVector->Phi()+offset;\r
 }\r
 \r
-Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){\r
+\r
+Double_t AliV0Reader::GetMotherCandidateRapidity() const{\r
   //see header file for documentation\r
+       \r
+  Double_t rapidity=0;\r
+  if(fMotherCandidateLorentzVector->Energy() - fMotherCandidateLorentzVector->Pz() == 0 || fMotherCandidateLorentzVector->Energy() + fMotherCandidateLorentzVector->Pz() == 0) rapidity=0;\r
+  else rapidity = 0.5*(TMath::Log((fMotherCandidateLorentzVector->Energy() + fMotherCandidateLorentzVector->Pz()) / (fMotherCandidateLorentzVector->Energy()-fMotherCandidateLorentzVector->Pz())));\r
+  return rapidity;\r
+       \r
+}\r
+\r
 \r
-  Int_t iResult = 10; // Unknown particle\r
 \r
+\r
+\r
+Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){\r
+  //see header file for documentation\r
+       \r
+  Int_t iResult = 10; // Unknown particle\r
+       \r
   if(chargeOfTrack==-1){ //negative track\r
     switch(abs(fNegativeTrackPID)){\r
     case 11:       //electron\r
@@ -493,7 +620,7 @@ Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){
     case 311:      //K0\r
       iResult = 8;\r
       break;\r
-      \r
+                               \r
       //Put in here for kSPECIES::kEleCon  ????\r
     }\r
   }\r
@@ -526,7 +653,7 @@ Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){
     case 311:      //K0\r
       iResult = 8;\r
       break;\r
-\r
+                               \r
       //Put in here for kSPECIES::kEleCon  ????\r
     }\r
   }\r
index d6a376d..2fd6517 100644 (file)
@@ -280,6 +280,12 @@ class AliV0Reader : public TObject {
    */\r
   Double_t GetMotherCandidatePhi() const;\r
 \r
+  /*\r
+   * Gets the Rapidity of the mother candidate.\r
+   */\r
+  Double_t GetMotherCandidateRapidity() const;\r
+\r
+\r
   /*\r
    * Update data which need to be updated every event.\r
    */\r
@@ -300,6 +306,12 @@ class AliV0Reader : public TObject {
    */\r
   Double_t GetPtCut() const{return fPtCut;}\r
 \r
+  /*\r
+   * Gets the line cut values.\r
+   */\r
+  Double_t GetLineCutZRSlope() const{return fLineCutZRSlope;}\r
+  Double_t GetLineCutZValue() const{return fLineCutZValue;}\r
+  \r
   /*\r
    * Gets the Chi2 cut value for the conversions.\r
    */\r
@@ -310,6 +322,12 @@ class AliV0Reader : public TObject {
    */\r
   Double_t GetChi2CutMeson() const{return fChi2CutMeson;}\r
 \r
+  Double_t GetPositiveTrackLength() const{return fCurrentPositiveESDTrack->GetIntegratedLength();}\r
+  Double_t GetNegativeTrackLength() const{return fCurrentNegativeESDTrack->GetIntegratedLength();}\r
+\r
+  Double_t GetPositiveNTPCClusters() const{return fCurrentPositiveESDTrack->GetTPCNcls();}\r
+  Double_t GetNegativeNTPCClusters() const{return fCurrentNegativeESDTrack->GetTPCNcls();}\r
+\r
   /*\r
    * Sets the MaxRCut value.\r
    */\r
@@ -325,6 +343,12 @@ class AliV0Reader : public TObject {
    */\r
   void SetPtCut(Double_t ptCut){fPtCut=ptCut;}\r
 \r
+  /*\r
+   * Sets the LineCut values.\r
+   */\r
+  void SetLineCutZRSlope(Double_t LineCutZRSlope){fLineCutZRSlope=LineCutZRSlope;}\r
+  void SetLineCutZValue(Double_t LineCutZValue){fLineCutZValue=LineCutZValue;}\r
+\r
   /*\r
    * Sets the Chi2Cut value for conversions.\r
    */\r
@@ -378,7 +402,7 @@ class AliV0Reader : public TObject {
   /*\r
    * Updates the V0 information of the current V0.\r
    */\r
-  void UpdateV0Information();\r
+  Bool_t UpdateV0Information();\r
 \r
   /*\r
    * Resets the V0 index.\r
@@ -450,6 +474,8 @@ class AliV0Reader : public TObject {
   Double_t fMaxR;\r
   Double_t fEtaCut;\r
   Double_t fPtCut;\r
+  Double_t fLineCutZRSlope;\r
+  Double_t fLineCutZValue;\r
   Double_t fChi2CutConversion;\r
   Double_t fChi2CutMeson;\r
   Double_t fPIDProbabilityCutNegativeParticle;\r
@@ -465,7 +491,7 @@ class AliV0Reader : public TObject {
   vector<AliKFParticle> fCurrentEventGoodV0s;\r
   vector<AliKFParticle> fPreviousEventGoodV0s;\r
 \r
-  ClassDef(AliV0Reader,0)\r
+  ClassDef(AliV0Reader,1)\r
 };\r
 \r
 \r
index 4de0853..a42bc2b 100644 (file)
@@ -1,4 +1,5 @@
 /** VERSION NUMBER 0 */
+/** new Version Kenneth */
 
 Bool_t usePWG4PartCorr = kTRUE;
 
@@ -22,9 +23,12 @@ Int_t numberOfFilesToAnalyze=0;
 Int_t pidOfNegativeTrack=11;
 Int_t pidOfPositiveTrack=-11;
 
-Double_t maxRCut   = 200.;
+Double_t LineCutZRSlope = 0.662487;
+Double_t LineCutZValue = 7.;
+
+Double_t maxRCut   = 160.;
 Double_t etaCut    = 1.2;
-Double_t ptCut     = 0.1;
+Double_t ptCut     = 0.02;
 Double_t chi2CutConversion   = 20.;
 Double_t chi2CutMeson   = 20.;
 
@@ -49,7 +53,9 @@ Double_t pi0Width   = 0.01;
 Double_t etaWidth   = 0.01;
 
 // define the probability of track being an electron
-Double_t probElectron = 0.5;
+Double_t probElectron = 0.002;
+
+Double_t minOpeningAngleGhostCut = 0.01;
 
 /** ----------------------------------end define cuts here----------------------------------*/
 
@@ -63,148 +69,236 @@ Double_t minPhi      = -TMath::Pi();
 Double_t maxPhi      = TMath::Pi();
 /** ------------------------------- end Phi/R Mapping ------------------------------------*/
 
+
+
 /** ------------------- define which histograms to plot here --------------------------------*/
 /**   NB: to change the bin numbers, see below the histogram flags                           */
-Bool_t plotMCEPR                                           = kTRUE;
-Bool_t plotMCEPZR                                          = kTRUE;
-Bool_t plotMCEPXY                                          = kTRUE;
-Bool_t plotMCEPOpeningAngle                                = kTRUE;
-
-Bool_t plotMCEEnergy                                       = kTRUE;
-Bool_t plotMCEPt                                           = kTRUE;
-Bool_t plotMCEEta                                          = kTRUE;
-Bool_t plotMCEPhi                                          = kTRUE;
-
-Bool_t plotMCPEnergy                                       = kTRUE;
-Bool_t plotMCPPt                                           = kTRUE;
-Bool_t plotMCPEta                                          = kTRUE;
-Bool_t plotMCPPhi                                          = kTRUE;
-
-Bool_t plotMCGammaEnergy                                   = kTRUE;
-Bool_t plotMCGammaPt                                       = kTRUE;
-Bool_t plotMCGammaEta                                      = kTRUE;
-Bool_t plotMCGammaPhi                                      = kTRUE;
-
-Bool_t plotMCDirectGammaEnergy                             = kTRUE;
-Bool_t plotMCDirectGammaPt                                 = kTRUE;
-Bool_t plotMCDirectGammaEta                                = kTRUE;
-Bool_t plotMCDirectGammaPhi                                = kTRUE;
-
-Bool_t plotMCMatchGammaEta                                 = kTRUE;
-Bool_t plotMCMatchGammaPhi                                 = kTRUE;
-Bool_t plotMCMatchGammaPt                                  = kTRUE;
-Bool_t plotMCMatchGammaEnergy                              = kTRUE;
-Bool_t plotMCMatchGammaMass                                = kTRUE;
-Bool_t plotMCMatchGammaOpeningAngle                        = kTRUE;
-Bool_t plotMCMatchGammaR                                   = kTRUE;
-Bool_t plotMCMatchGammaZR                                  = kTRUE;
-Bool_t plotMCMatchGammaXY                                  = kTRUE;
-
-Bool_t plotMCPi0Eta                                        = kTRUE;
-Bool_t plotMCPi0Phi                                        = kTRUE;
-Bool_t plotMCPi0Pt                                         = kTRUE;
-Bool_t plotMCPi0Energy                                     = kTRUE;
-Bool_t plotMCPi0Mass                                       = kTRUE;
-Bool_t plotMCPi0OpeningAngle                               = kTRUE;
-Bool_t plotMCPi0R                                          = kTRUE;
-Bool_t plotMCPi0ZR                                         = kTRUE;
-Bool_t plotMCPi0XY                                         = kTRUE;
-
-Bool_t plotMCEtaEta                                        = kTRUE;
-Bool_t plotMCEtaPhi                                        = kTRUE;
-Bool_t plotMCEtaPt                                         = kTRUE;
-Bool_t plotMCEtaEnergy                                     = kTRUE;
-Bool_t plotMCEtaMass                                       = kTRUE;
-Bool_t plotMCEtaOpeningAngleGamma                          = kTRUE;
-Bool_t plotMCEtaR                                          = kTRUE;
-Bool_t plotMCEtaZR                                         = kTRUE;
-Bool_t plotMCEtaXY                                         = kTRUE;
-    
+Bool_t plotMCConversionR             = kTRUE;
+Bool_t plotMCConversionZR            = kTRUE;
+Bool_t plotMCConversionXY            = kTRUE;
+Bool_t plotMCConversionOpeningAngle  = kTRUE;
+
+Bool_t plotMCEEnergy  = kTRUE;
+Bool_t plotMCEPt      = kTRUE;
+Bool_t plotMCEEta     = kTRUE;
+Bool_t plotMCEPhi     = kTRUE;
+
+Bool_t plotMCPEnergy  = kTRUE;
+Bool_t plotMCPPt      = kTRUE;
+Bool_t plotMCPEta     = kTRUE;
+Bool_t plotMCPPhi     = kTRUE;
+
+Bool_t plotMCallGammaEnergy = kTRUE;
+Bool_t plotMCallGammaPt     = kTRUE;
+Bool_t plotMCallGammaEta    = kTRUE;
+Bool_t plotMCallGammaPhi    = kTRUE;
+Bool_t plotMCallGammaRapid  = kTRUE;
+
+
+Bool_t plotMCConvGammaEnergy  = kTRUE;
+Bool_t plotMCConvGammaPt      = kTRUE;
+Bool_t plotMCConvGammaEta     = kTRUE;
+Bool_t plotMCConvGammaPhi     = kTRUE;
+Bool_t plotMCConvGammaRapid   = kTRUE;
+Bool_t plotMCConvGammaPtvsEta = kTRUE;
+
+Bool_t plotMCallDirectGammaEnergy  = kTRUE;
+Bool_t plotMCallDirectGammaPt      = kTRUE;
+Bool_t plotMCallDirectGammaEta     = kTRUE;
+Bool_t plotMCallDirectGammaPhi     = kTRUE;
+Bool_t plotMCallDirectGammaRapid   = kTRUE;
+
+
+Bool_t plotMCConvDirectGammaEnergy  = kTRUE;
+Bool_t plotMCConvDirectGammaPt      = kTRUE;
+Bool_t plotMCConvDirectGammaEta     = kTRUE;
+Bool_t plotMCConvDirectGammaPhi     = kTRUE;
+Bool_t plotMCConvDirectGammaRapid   = kTRUE;
+
+Bool_t plotMCMotherEta                                 = kTRUE;
+Bool_t plotMCMotherRapid                                = kTRUE;
+Bool_t plotMCMotherPhi                                 = kTRUE;
+Bool_t plotMCMotherPt                                  = kTRUE;
+Bool_t plotMCMotherEnergy                              = kTRUE;
+Bool_t plotMCMotherMass                                        = kTRUE;
+Bool_t plotMCMotherOpeningAngle                                = kTRUE;
+Bool_t plotMCMotherR                                   = kTRUE;
+Bool_t plotMCMotherZR                                  = kTRUE;
+Bool_t plotMCMotherXY                                  = kTRUE;
+Bool_t plotMCMotherPtvsEtaWithinAcceptance              = kTRUE;
+Bool_t plotMCMotherPtvsRapidWithinAcceptance            = kTRUE;
+Bool_t plotMCMotherPtvsEtaConvGammaWithinAcceptance     = kTRUE;
+Bool_t plotMCMotherPtvsRapidConvGammaWithinAcceptance   = kTRUE;
+Bool_t plotMCMotherSpectra                             = kTRUE;
+
+Bool_t plotMCPi0Eta                               = kTRUE;
+Bool_t plotMCPi0Rapid                              = kTRUE;
+Bool_t plotMCPi0Phi                                = kTRUE;
+Bool_t plotMCPi0Pt                                 = kTRUE;
+Bool_t plotMCPi0Energy                             = kTRUE;
+Bool_t plotMCPi0Mass                               = kTRUE;
+Bool_t plotMCPi0OpeningAngle                       = kTRUE;
+Bool_t plotMCPi0R                                  = kTRUE;
+Bool_t plotMCPi0ZR                                 = kTRUE;
+Bool_t plotMCPi0XY                                 = kTRUE;
+Bool_t plotMCPi0PtvsEtaWithinAcceptance            = kTRUE;
+Bool_t plotMCPi0PtvsRapidWithinAcceptance          = kTRUE;
+Bool_t plotMCPi0PtvsEtaConvGammaWithinAcceptance   = kTRUE;
+Bool_t plotMCPi0PtvsRapidConvGammaWithinAcceptance = kTRUE;
+
+
+Bool_t plotMCPi0SecondaryEta                                = kTRUE;
+Bool_t plotMCPi0SecondaryRapid                              = kTRUE;
+Bool_t plotMCPi0SecondaryPhi                                = kTRUE;
+Bool_t plotMCPi0SecondaryPt                                 = kTRUE;
+Bool_t plotMCPi0SecondaryEnergy                             = kTRUE;
+Bool_t plotMCPi0SecondaryMass                               = kTRUE;
+Bool_t plotMCPi0SecondaryOpeningAngle                       = kTRUE;
+Bool_t plotMCPi0SecondaryR                                  = kTRUE;
+Bool_t plotMCPi0SecondaryZR                                 = kTRUE;
+Bool_t plotMCPi0SecondaryXY                                 = kTRUE;
+Bool_t plotMCPi0SecondaryPtvsEtaWithinAcceptance            = kTRUE;
+Bool_t plotMCPi0SecondaryPtvsRapidWithinAcceptance          = kTRUE;
+Bool_t plotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance   = kTRUE;
+Bool_t plotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance = kTRUE;
+
+
+Bool_t plotMCEtaEta                                = kTRUE;
+Bool_t plotMCEtaRapid                              = kTRUE;
+Bool_t plotMCEtaPhi                                = kTRUE;
+Bool_t plotMCEtaPt                                 = kTRUE;
+Bool_t plotMCEtaEnergy                             = kTRUE;
+Bool_t plotMCEtaMass                               = kTRUE;
+Bool_t plotMCEtaOpeningAngleGamma                  = kTRUE;
+Bool_t plotMCEtaR                                  = kTRUE;
+Bool_t plotMCEtaZR                                 = kTRUE;
+Bool_t plotMCEtaXY                                 = kTRUE;
+Bool_t plotMCEtaPtvsEtaWithinAcceptance                   = kTRUE;
+Bool_t plotMCEtaPtvsRapidWithinAcceptance         = kTRUE;
+Bool_t plotMCEtaPtvsEtaConvGammaWithinAcceptance   = kTRUE;
+Bool_t plotMCEtaPtvsRapidConvGammaWithinAcceptance = kTRUE;
+
+
 // Histograms from esd tracks
-Bool_t plotESDEPR                                          = kTRUE;
-Bool_t plotESDEPZR                                         = kTRUE;
-Bool_t plotESDEPXY                                         = kTRUE;
-Bool_t plotESDEPOpeningAngle                               = kTRUE;
-
-Bool_t plotESDEEnergy                                      = kTRUE;
-Bool_t plotESDEPt                                          = kTRUE;
-Bool_t plotESDEEta                                         = kTRUE;
-Bool_t plotESDEPhi                                         = kTRUE;
-
-Bool_t plotESDPEnergy                                      = kTRUE;
-Bool_t plotESDPPt                                          = kTRUE;
-Bool_t plotESDPEta                                         = kTRUE;
-Bool_t plotESDPPhi                                         = kTRUE;
-
-Bool_t plotESDGammaEnergy                                  = kTRUE;
-Bool_t plotESDGammaPt                                      = kTRUE;
-Bool_t plotESDGammaEta                                     = kTRUE;
-Bool_t plotESDGammaPhi                                     = kTRUE;
-
-Bool_t plotESDMatchGammaOpeningAngle                       = kTRUE;
-Bool_t plotESDMatchGammaEnergy                             = kTRUE;
-Bool_t plotESDMatchGammaPt                                 = kTRUE;
-Bool_t plotESDMatchGammaEta                                = kTRUE;
-Bool_t plotESDMatchGammaPhi                                = kTRUE;
-Bool_t plotESDMatchGammaMass                               = kTRUE;
-Bool_t plotESDMatchGammaWidth                              = kTRUE;
-Bool_t plotESDMatchGammaChi2                               = kTRUE;
-Bool_t plotESDMatchGammaNDF                                = kTRUE;
-Bool_t plotESDMatchGammaR                                  = kTRUE;
-Bool_t plotESDMatchGammaZR                                 = kTRUE;
-Bool_t plotESDMatchGammaXY                                 = kTRUE;
-
-Bool_t plotESDTwoGammaCombinationOpeningAngleGamma         = kTRUE;
-Bool_t plotESDTwoGammaCombinationEnergy                    = kTRUE;
-Bool_t plotESDTwoGammaCombinationPt                        = kTRUE;
-Bool_t plotESDTwoGammaCombinationEta                       = kTRUE;
-Bool_t plotESDTwoGammaCombinationPhi                       = kTRUE;
-Bool_t plotESDTwoGammaCombinationMass                      = kTRUE;
-Bool_t plotESDTwoGammaCombinationR                         = kTRUE;
-Bool_t plotESDTwoGammaCombinationZR                        = kTRUE;
-Bool_t plotESDTwoGammaCombinationXY                        = kTRUE;
-
-Bool_t plotESDBackgroundOpeningAngleGamma                  = kTRUE;
-Bool_t plotESDBackgroundEnergy                             = kTRUE;
-Bool_t plotESDBackgroundPt                                 = kTRUE;
-Bool_t plotESDBackgroundEta                                = kTRUE;
-Bool_t plotESDBackgroundPhi                                = kTRUE;
-Bool_t plotESDBackgroundMass                               = kTRUE;
-Bool_t plotESDBackgroundR                                  = kTRUE;
-Bool_t plotESDBackgroundZR                                 = kTRUE;
-Bool_t plotESDBackgroundXY                                 = kTRUE;
-
-Bool_t plotMapping                                         = kTRUE;       
-
-Bool_t plotResolutiondPt                                   = kTRUE;
-Bool_t plotResolutiondR                                    = kTRUE;
-Bool_t plotResolutiondZ                                    = kTRUE;
-  
-Bool_t plotResolutiondRdPt                                 = kTRUE;
-
-Bool_t plotResolutionMCPt                                  = kTRUE;
-Bool_t plotResolutionMCR                                   = kTRUE;
-Bool_t plotResolutionMCZ                                   = kTRUE;
-
-Bool_t plotResolutionESDPt                                 = kTRUE;
-Bool_t plotResolutionESDR                                  = kTRUE;
-Bool_t plotResolutionESDZ                                  = kTRUE;
-
-Bool_t plotNumberOfV0s                                     = kTRUE;
-Bool_t plotNumberOfSurvivingV0s                            = kTRUE;
+Bool_t plotESDConversionR            = kTRUE;
+Bool_t plotESDConversionZR           = kTRUE;
+Bool_t plotESDConversionXY           = kTRUE;
+Bool_t plotESDConversionOpeningAngle = kTRUE;
+
+Bool_t plotESDEEnergy = kTRUE;
+Bool_t plotESDEPt     = kTRUE;
+Bool_t plotESDEEta    = kTRUE;
+Bool_t plotESDEPhi    = kTRUE;
+
+Bool_t plotESDPEnergy = kTRUE;
+Bool_t plotESDPPt     = kTRUE;
+Bool_t plotESDPEta    = kTRUE;
+Bool_t plotESDPPhi    = kTRUE;
+
+Bool_t plotESDConvGammaEnergy = kTRUE;
+Bool_t plotESDConvGammaPt     = kTRUE;
+Bool_t plotESDConvGammaEta    = kTRUE;
+Bool_t plotESDConvGammaPhi    = kTRUE;
+Bool_t plotESDConvGammaMass   = kTRUE;
+Bool_t plotESDConvGammaWidth  = kTRUE;
+Bool_t plotESDConvGammaChi2   = kTRUE;
+Bool_t plotESDConvGammaNDF    = kTRUE;
+Bool_t plotESDConvGammaRapid  = kTRUE;
+Bool_t plotESDConvGammaPtvsEta = kTRUE;
+
+Bool_t plotESDTrueConvGammaEnergy         = kTRUE;
+Bool_t plotESDTrueConvGammaPt             = kTRUE;
+Bool_t plotESDTrueConvGammaEta            = kTRUE;
+Bool_t plotESDTrueConvGammaPhi            = kTRUE;
+Bool_t plotESDTrueConvGammaMass           = kTRUE;
+Bool_t plotESDTrueConvGammaWidth          = kTRUE;
+Bool_t plotESDTrueConvGammaChi2           = kTRUE;
+Bool_t plotESDTrueConvGammaNDF            = kTRUE;
+Bool_t plotESDTrueConvGammaRapid          = kTRUE;
+Bool_t plotESDTrueConvGammaPtvsEta        = kTRUE;
+Bool_t plotESDTrueConversionR             = kTRUE;
+Bool_t plotESDTrueConversionZR            = kTRUE;
+Bool_t plotESDTrueConversionXY            = kTRUE;
+Bool_t plotESDTrueConversionOpeningAngle  = kTRUE;
+
+Bool_t plotESDNoCutConvGammaEnergy         = kTRUE;
+Bool_t plotESDNoCutConvGammaPt             = kTRUE;
+Bool_t plotESDNoCutConvGammaEta            = kTRUE;
+Bool_t plotESDNoCutConvGammaPhi            = kTRUE;
+Bool_t plotESDNoCutConvGammaMass           = kTRUE;
+Bool_t plotESDNoCutConvGammaWidth          = kTRUE;
+Bool_t plotESDNoCutConvGammaChi2           = kTRUE;
+Bool_t plotESDNoCutConvGammaNDF            = kTRUE;
+Bool_t plotESDNoCutConvGammaRapid          = kTRUE;
+Bool_t plotESDNoCutConvGammaPtvsEta        = kTRUE;
+Bool_t plotESDNoCutConversionR             = kTRUE;
+Bool_t plotESDNoCutConversionZR            = kTRUE;
+Bool_t plotESDNoCutConversionXY            = kTRUE;
+Bool_t plotESDNoCutConversionOpeningAngle  = kTRUE;
+
+Bool_t plotESDMotherOpeningAngleGamma = kTRUE;
+Bool_t plotESDMotherEnergy            = kTRUE;
+Bool_t plotESDMotherPt                = kTRUE;
+Bool_t plotESDMotherEta               = kTRUE;
+Bool_t plotESDMotherPhi               = kTRUE;
+Bool_t plotESDMotherMass              = kTRUE;
+Bool_t plotESDMotherR                 = kTRUE;
+Bool_t plotESDMotherZR                = kTRUE;
+Bool_t plotESDMotherXY                = kTRUE;
+Bool_t plotESDMotherRapid             = kTRUE;
+
+
+Bool_t plotESDBackgroundOpeningAngleGamma = kTRUE;
+Bool_t plotESDBackgroundEnergy            = kTRUE;
+Bool_t plotESDBackgroundPt                = kTRUE;
+Bool_t plotESDBackgroundEta               = kTRUE;
+Bool_t plotESDBackgroundPhi               = kTRUE;
+Bool_t plotESDBackgroundMass              = kTRUE;
+Bool_t plotESDBackgroundR                 = kTRUE;
+Bool_t plotESDBackgroundZR                = kTRUE;
+Bool_t plotESDBackgroundXY                = kTRUE;
+Bool_t plotESDBackgroundRapid             = kTRUE;
+
+
+
+Bool_t plotMapping = kFALSE;       
+
+Bool_t plotResolutiondPt = kTRUE;
+Bool_t plotResolutiondR  = kTRUE;
+Bool_t plotResolutiondZ  = kTRUE;
+
+Bool_t plotResolutiondRdPt = kTRUE;
+
+Bool_t plotResolutionMCPt = kTRUE;
+Bool_t plotResolutionMCR  = kTRUE;
+Bool_t plotResolutionMCZ  = kTRUE;
+
+Bool_t plotResolutionESDPt = kTRUE;
+Bool_t plotResolutionESDR  = kTRUE;
+Bool_t plotResolutionESDZ  = kTRUE;
+
+Bool_t plotESDNumberOfV0s          = kTRUE;
+Bool_t plotESDNumberOfSurvivingV0s = kTRUE;
 
 //  debug histograms
-Bool_t plotV0MassDebugCut1                                 = kTRUE;
-Bool_t plotV0MassDebugCut2                                 = kTRUE;
-Bool_t plotV0MassDebugCut3                                 = kTRUE;
-Bool_t plotV0MassDebugCut4                                 = kTRUE;
-Bool_t plotV0MassDebugCut5                                 = kTRUE;
-Bool_t plotV0MassDebugCut6                                 = kTRUE;
-Bool_t plotV0MassDebugCut7                                 = kTRUE;
-Bool_t plotV0MassDebugCut8                                 = kTRUE;
-
-Bool_t plotPi0Spectra                                      = kTRUE;
-Bool_t plotEtaSpectra                                      = kTRUE;
+Bool_t plotESDCutGetOnFly      = kTRUE;
+Bool_t plotESDCutNContributors = kTRUE;
+Bool_t plotESDCutLikeSign      = kTRUE;
+Bool_t plotESDCutRefit         = kTRUE;
+Bool_t plotESDCutKink          = kTRUE;
+Bool_t plotESDCutPIDProb       = kTRUE;
+Bool_t plotESDCutR             = kTRUE;
+Bool_t plotESDCutLine          = kTRUE;
+Bool_t plotESDCutNDF           = kTRUE;
+Bool_t plotESDCutChi2          = kTRUE;
+Bool_t plotESDCutEta           = kTRUE;
+Bool_t plotESDCutPt            = kTRUE;
+Bool_t plotESDTrueConvGammaTrackLength =kTRUE;
+Bool_t plotESDTrueConvGammaTrackLengthVSInvMass =kTRUE;
+
+
+Bool_t plotPi0Spectra = kTRUE;
+Bool_t plotEtaSpectra = kTRUE;
 
 
 /** ----------------- end define which histograms to plot here -------------------------------*/
@@ -213,58 +307,63 @@ Bool_t plotEtaSpectra                                      = kTRUE;
 
 /** ----------- Define the binning for the different plot types here -------------------------*/
 //R-plots
-Int_t nXBinsR = 1000;
+Int_t nXBinsR = 500;
 Double_t firstXBinR = 0.;
 Double_t lastXBinR = 250.;
 
 //ZR-plots
-Int_t nXBinsZR = 2000;
-Double_t firstXBinZR = -10.;
-Double_t lastXBinZR = 10.;
-Int_t nYBinsZR = 1000;
+Int_t nXBinsZR = 1200;
+Double_t firstXBinZR = -300.;
+Double_t lastXBinZR = 300.;
+Int_t nYBinsZR = 500;
 Double_t firstYBinZR = 0.;
 Double_t lastYBinZR = 250.;
 
 //XY-plots
-Int_t nXBinsXY = 2000;
+Int_t nXBinsXY = 1000;
 Double_t firstXBinXY = -250.;
 Double_t lastXBinXY = 250.;
-Int_t nYBinsXY = 2000;
+Int_t nYBinsXY = 1000;
 Double_t firstYBinXY = -250.;
 Double_t lastYBinXY = 250.;
 
 //OpenAngle-plots
-Int_t nXBinsOpeningAngle = 200;
+Int_t nXBinsOpeningAngle = 400;
 Double_t firstXBinOpeningAngle = 0.;
-Double_t lastXBinOpeningAngle = TMath::Pi()/2;
+Double_t lastXBinOpeningAngle = TMath::Pi();
 
 //Energy-plots
-Int_t nXBinsEnergy = 500;
+Int_t nXBinsEnergy = 200;
 Double_t firstXBinEnergy = 0.;
-Double_t lastXBinEnergy = 5.;
+Double_t lastXBinEnergy = 50.;
 
 //Pt-plots
-Int_t nXBinsPt = 500;
+Int_t nXBinsPt = 200;
 Double_t firstXBinPt = 0.;
-Double_t lastXBinPt = 5.;
+Double_t lastXBinPt = 50.;
 
 //Eta-plots
-Int_t nXBinsEta = 400;
+Int_t nXBinsEta = 40;
 Double_t firstXBinEta = -2.;
 Double_t lastXBinEta = 2.;
 
+//Rapidity
+Int_t nXBinsRapid = 200;
+Double_t firstXBinRapid = -10.;
+Double_t lastXBinRapid = 10.;
+
 //Phi-plots
-Int_t nXBinsPhi = 720;
+Int_t nXBinsPhi = 72;
 Double_t firstXBinPhi = -TMath::Pi();
 Double_t lastXBinPhi = TMath::Pi();
 
 //Mapping-plots
-Int_t nXBinsMapping = 40;
-Double_t firstXBinMapping = -20.;
-Double_t lastXBinMapping = 20.;
-Int_t nYBinsMapping = 30;
-Double_t firstYBinMapping = -1.5;
-Double_t lastYBinMapping = 1.5;
+Int_t nXBinsMapping = 400;
+Double_t firstXBinMapping = -100.;
+Double_t lastXBinMapping = 100.;
+Int_t nYBinsMapping = 40;
+Double_t firstYBinMapping = -2;
+Double_t lastYBinMapping = 2;
 
 //ResolutionPlots
 //RESdPt
@@ -276,46 +375,46 @@ Int_t firstYBinResdPt= -5;
 Int_t lastYBinResdPt=5;
 
 //RESdR
-Int_t nXBinsResdR=1000;
+Int_t nXBinsResdR=500;
 Int_t firstXBinResdR= 0;
 Int_t lastXBinResdR=250;
-Int_t nYBinsResdR=1000;
+Int_t nYBinsResdR=100;
 Int_t firstYBinResdR= -25;
 Int_t lastYBinResdR=25;
 
 //RESdZ
-Int_t nXBinsResdZ=2000;
+Int_t nXBinsResdZ=80;
 Int_t firstXBinResdZ= -20;
 Int_t lastXBinResdZ=20;
-Int_t nYBinsResdZ=1000;
+Int_t nYBinsResdZ=80;
 Int_t firstYBinResdZ= -20;
 Int_t lastYBinResdZ=20;
 
 //RESdRdPt
-Int_t nXBinsResdRdPt=1000;
+Int_t nXBinsResdRdPt=440;
 Int_t firstXBinResdRdPt= -22;
 Int_t lastXBinResdRdPt=22;
-Int_t nYBinsResdRdPt=1000;
+Int_t nYBinsResdRdPt=100;
 Int_t firstYBinResdRdPt= -5;
 Int_t lastYBinResdRdPt=5;
 
 //RESMCPt
-Int_t nXBinsResPt=500;
+Int_t nXBinsResPt=100;
 Int_t firstXBinResPt= 0;
 Int_t lastXBinResPt=5;
 
 //RESMCR
-Int_t nXBinsResR=1000;
+Int_t nXBinsResR=500;
 Int_t firstXBinResR= 0;
 Int_t lastXBinResR=250;
 
 //RESMCZ
-Int_t nXBinsResZ=1000;
+Int_t nXBinsResZ=500;
 Int_t firstXBinResZ= 0;
 Int_t lastXBinResZ=250;
 
 //GammaMass-plots
-Int_t nXBinsGammaMass = 100;
+Int_t nXBinsGammaMass = 4000;
 Double_t firstXBinGammaMass = 0.;
 Double_t lastXBinGammaMass = 1.;
 
@@ -345,12 +444,17 @@ Double_t firstXBinGammaNDF = 0.;
 Double_t lastXBinGammaNDF = 10.;
 
 //Spectra-plots
-Int_t nXBinsSpectra = 100;
+Int_t nXBinsSpectra = 500;
 Double_t firstXBinSpectra = 0.;
 Double_t lastXBinSpectra = 1.;
-Int_t nYBinsSpectra = 500;
+Int_t nYBinsSpectra = 100;
 Double_t firstYBinSpectra = 0.;
-Double_t lastYBinSpectra = 100.;
+Double_t lastYBinSpectra = 50.;
+
+//track length plots
+Int_t nXBinsTrackLength = 1000;
+Double_t firstXBinTrackLength = 0;
+Double_t lastXBinTrackLength = 500;
 
 /** ---------- end Define the binning for the different plot types here ----------------------*/
 
@@ -369,17 +473,19 @@ Bool_t writeNtuple = kFALSE;
 
 Bool_t scanArguments(TString arguments){
   Bool_t iResult = kTRUE;
-
+       
+  //  cout<<"All arguments: "<<arguments<<endl;
+       
   TString allArgs=arguments;
   TString argument;
   int bMissingParam=0;
-
+       
   TObjArray* pTokens=allArgs.Tokenize(" ");
   if (pTokens) {
-    
+               
     for(int i=0; i<pTokens->GetEntries() && iResult==kTRUE; i++) {
       argument=((TObjString*)pTokens->At(i))->GetString();
-      
+                       
       if(argument.IsNull()) continue;
       // -- deconvolute-time option
       if(argument.CompareTo("-data-list") == 0){
@@ -420,7 +526,7 @@ Bool_t scanArguments(TString arguments){
        }
       }
     }
-
+               
     delete pTokens;
   }
   if (bMissingParam) {
@@ -431,11 +537,11 @@ Bool_t scanArguments(TString arguments){
 }
 
 void ConfigGammaConversion(TString arguments){
-
+       
   if(!scanArguments(arguments)){
     break;
   }
-
+       
   if(numberOfFilesToAnalyze==0){
     ifstream dataInStream;
     dataInStream.open(dataList.Data());
@@ -447,56 +553,86 @@ void ConfigGammaConversion(TString arguments){
     while ( !dataInStream.eof() )
       {
        getline(dataInStream, line);
-       numberOfFilesToAnalyze++;
+       if(line.compare("") != 0){//checks if there is an empty line in the data list
+         numberOfFilesToAnalyze++;
+       }
       }
   }
   cout<<"Number Of files to analyze: "<<numberOfFilesToAnalyze<<endl;
-
+       
   build();//build (if necessary) and load the libraries needed
-
+       
   gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
-
+       
   AliLog::SetGlobalLogLevel(AliLog::kError);
-
+       
   //-------------------------------- Creating the histograms -------------------------------
   AliGammaConversionHistograms * histograms = new AliGammaConversionHistograms();
-
-  if(plotMCEPR == kTRUE){ histograms->AddHistogram("MC_EP_R","Radius of gamma conversion points",nXBinsR, firstXBinR, lastXBinR,"counts","cm");}
-  if(plotMCEPZR == kTRUE){ histograms->AddHistogram("MC_EP_ZR","Radius of gamma conversion points vs Z",nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "cm", "cm");}
-  if(plotMCEPXY == kTRUE){ histograms->AddHistogram("MC_EP_XY","Gamma XY converison point.",nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "cm", "cm");}
-  if(plotMCEPOpeningAngle == kTRUE){ histograms->AddHistogram("MC_EP_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "counts", "cm");}
-
+       
+  if(plotMCConversionR == kTRUE){ histograms->AddHistogram("MC_Conversion_R","Radius of gamma conversion points",nXBinsR, firstXBinR, lastXBinR,"counts","cm");}
+  if(plotMCConversionZR == kTRUE){ histograms->AddHistogram("MC_Conversion_ZR","Radius of gamma conversion points vs Z",nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "cm", "cm");}
+  if(plotMCConversionXY == kTRUE){ histograms->AddHistogram("MC_Conversion_XY","Gamma XY converison point.",nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "cm", "cm");}
+  if(plotMCConversionOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Conversion_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "counts", "cm");}
+       
   if(plotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
   if(plotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
   if(plotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
   if(plotMCEPhi == kTRUE){ histograms->AddHistogram("MC_E_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
+       
   if(plotMCPEnergy == kTRUE){ histograms->AddHistogram("MC_P_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
   if(plotMCPPt == kTRUE){ histograms->AddHistogram("MC_P_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
   if(plotMCPEta == kTRUE){ histograms->AddHistogram("MC_P_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
   if(plotMCPPhi == kTRUE){ histograms->AddHistogram("MC_P_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMCGammaEnergy == kTRUE){ histograms->AddHistogram("MC_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMCGammaPt == kTRUE){ histograms->AddHistogram("MC_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMCGammaEta == kTRUE){ histograms->AddHistogram("MC_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMCGammaPhi == kTRUE){ histograms->AddHistogram("MC_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMCDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMCDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMCDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMCDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMCMatchGammaEta == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMCMatchGammaPhi == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotMCMatchGammaPt == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMCMatchGammaEnergy == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMCMatchGammaMass == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}
-  if(plotMCMatchGammaOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotMCMatchGammaR == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotMCMatchGammaZR == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
-  if(plotMCMatchGammaXY == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-
-  if(plotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+       
+  if(plotMCallGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotMCallGammaPt == kTRUE){ histograms->AddHistogram("MC_allGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotMCallGammaEta == kTRUE){ histograms->AddHistogram("MC_allGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCallGammaPhi == kTRUE){ histograms->AddHistogram("MC_allGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotMCallGammaRapid == kTRUE){ histograms->AddHistogram("MC_allGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+       
+  if(plotMCConvGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotMCConvGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotMCConvGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCConvGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotMCConvGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt_Eta","", nXBinsPt, firstXBinPt, lastXBinPt,nXBinsEta, firstXBinEta, lastXBinEta,"","");}
+       
+  if(plotMCallDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotMCallDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotMCallDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCallDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotMCallDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+       
+  if(plotMCConvDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotMCConvDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotMCConvDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCConvDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotMCConvDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+       
+  if(plotMCMotherEta == kTRUE){ histograms->AddHistogram("MC_Mother_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCMotherPhi == kTRUE){ histograms->AddHistogram("MC_Mother_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotMCMotherRapid == kTRUE){ histograms->AddHistogram("MC_Mother_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCMotherPt == kTRUE){ histograms->AddHistogram("MC_Mother_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotMCMotherEnergy == kTRUE){ histograms->AddHistogram("MC_Mother_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotMCMotherMass == kTRUE){ histograms->AddHistogram("MC_Mother_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}
+  if(plotMCMotherOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Mother_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
+  if(plotMCMotherR == kTRUE){ histograms->AddHistogram("MC_Mother_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
+  if(plotMCMotherZR == kTRUE){ histograms->AddHistogram("MC_Mother_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
+  if(plotMCMotherXY == kTRUE){ histograms->AddHistogram("MC_Mother_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotMCMotherPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCMotherPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCMotherPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCMotherPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+
+  if(plotMCMotherSpectra == kTRUE){ 
+    histograms->AddHistogram("MC_Mother_InvMass_vs_Pt" ,"" ,nXBinsSpectra, firstXBinSpectra, lastXBinSpectra, nYBinsSpectra, firstYBinSpectra, lastYBinSpectra, "", "");
+    histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_withinAcceptance" ,"" ,nXBinsSpectra, firstXBinSpectra, lastXBinSpectra, nYBinsSpectra, firstYBinSpectra, lastYBinSpectra, "", "");
+    histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_ConvGamma_withinAcceptance" ,"" ,nXBinsSpectra, firstXBinSpectra, lastXBinSpectra, nYBinsSpectra, firstYBinSpectra, lastYBinSpectra, "", "");
+  }
+       
+       
+  if(plotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}       
+  if(plotMCPi0Rapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}     
   if(plotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
   if(plotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
   if(plotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
@@ -505,18 +641,31 @@ void ConfigGammaConversion(TString arguments){
   if(plotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
   if(plotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
   if(plotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-
-  if(plotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}
-  if(plotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
-  if(plotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-
+  if(plotMCPi0PtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCPi0PtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCPi0PtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCPi0PtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+       
+       
+  if(plotMCPi0SecondaryEta == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCPi0SecondaryRapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCPi0SecondaryPhi == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotMCPi0SecondaryPt == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotMCPi0SecondaryEnergy == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotMCPi0SecondaryMass == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}
+  if(plotMCPi0SecondaryOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
+  if(plotMCPi0SecondaryR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
+  if(plotMCPi0SecondaryZR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
+  if(plotMCPi0SecondaryXY == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotMCPi0SecondaryPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCPi0SecondaryPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+       
+       
+       
   if(plotMCEtaEta == kTRUE){ histograms->AddHistogram("MC_Eta_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCEtaRapid == kTRUE){ histograms->AddHistogram("MC_Eta_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
   if(plotMCEtaPhi == kTRUE){ histograms->AddHistogram("MC_Eta_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
   if(plotMCEtaPt == kTRUE){ histograms->AddHistogram("MC_Eta_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
   if(plotMCEtaEnergy == kTRUE){ histograms->AddHistogram("MC_Eta_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
@@ -525,51 +674,89 @@ void ConfigGammaConversion(TString arguments){
   if(plotMCEtaR == kTRUE){ histograms->AddHistogram("MC_Eta_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
   if(plotMCEtaZR == kTRUE){ histograms->AddHistogram("MC_Eta_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
   if(plotMCEtaXY == kTRUE){ histograms->AddHistogram("MC_Eta_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-    
-  // Histograms from esd tracks
-  if(plotESDEPR == kTRUE){ histograms->AddHistogram("ESD_EP_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESDEPZR == kTRUE){ histograms->AddHistogram("ESD_EP_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
-  if(plotESDEPXY == kTRUE){ histograms->AddHistogram("ESD_EP_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-  if(plotESDEPOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_EP_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-
+  if(plotMCEtaPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCEtaPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotMCEtaPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotMCEtaPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+       
+       
+  // Histograms from esd tracks        
   if(plotESDEEnergy == kTRUE){ histograms->AddHistogram("ESD_E_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
   if(plotESDEPt == kTRUE){ histograms->AddHistogram("ESD_E_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
   if(plotESDEEta == kTRUE){ histograms->AddHistogram("ESD_E_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
   if(plotESDEPhi == kTRUE){ histograms->AddHistogram("ESD_E_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
+       
   if(plotESDPEnergy == kTRUE){ histograms->AddHistogram("ESD_P_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
   if(plotESDPPt == kTRUE){ histograms->AddHistogram("ESD_P_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
   if(plotESDPEta == kTRUE){ histograms->AddHistogram("ESD_P_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
   if(plotESDPPhi == kTRUE){ histograms->AddHistogram("ESD_P_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotESDGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESDGammaPt == kTRUE){ histograms->AddHistogram("ESD_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESDGammaEta == kTRUE){ histograms->AddHistogram("ESD_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESDGammaPhi == kTRUE){ histograms->AddHistogram("ESD_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotESDMatchGammaOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotESDMatchGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESDMatchGammaPt == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESDMatchGammaEta == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESDMatchGammaPhi == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotESDMatchGammaMass == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}
-  if(plotESDMatchGammaWidth == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Width" ,"" , nXBinsGammaWidth, firstXBinGammaWidth, lastXBinGammaWidth, "", "");}
-  if(plotESDMatchGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Chi2" ,"" , nXBinsGammaChi2, firstXBinGammaChi2, lastXBinGammaChi2, "", "");}
-  if(plotESDMatchGammaNDF == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_NDF" ,"" , nXBinsGammaNDF, firstXBinGammaNDF, lastXBinGammaNDF, "", "");}
-  if(plotESDMatchGammaR == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESDMatchGammaZR == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
-  if(plotESDMatchGammaXY == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-
-  if(plotESDTwoGammaCombinationOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotESDTwoGammaCombinationEnergy == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESDTwoGammaCombinationPt == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESDTwoGammaCombinationEta == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESDTwoGammaCombinationPhi == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotESDTwoGammaCombinationMass == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}
-  if(plotESDTwoGammaCombinationR == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESDTwoGammaCombinationZR == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
-  if(plotESDTwoGammaCombinationXY == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
-
+       
+  if(plotESDConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotESDConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotESDConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotESDConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotESDConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Mass" ,"" ,  nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}
+  if(plotESDConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Width" ,"" , nXBinsGammaWidth, firstXBinGammaWidth, lastXBinGammaWidth, "", "");}
+  if(plotESDConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Chi2" ,"" , nXBinsGammaChi2, firstXBinGammaChi2, lastXBinGammaChi2, "", "");}
+  if(plotESDConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NDF" ,"" , nXBinsGammaNDF, firstXBinGammaNDF, lastXBinGammaNDF, "", "");}
+  if(plotESDConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotESDConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Eta","", nXBinsPt, firstXBinPt, lastXBinPt,nXBinsEta, firstXBinEta, lastXBinEta,"","" );}
+
+  if(plotESDConversionR == kTRUE){ histograms->AddHistogram("ESD_Conversion_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
+  if(plotESDConversionZR == kTRUE){ histograms->AddHistogram("ESD_Conversion_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
+  if(plotESDConversionXY == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotESDConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Conversion_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
+
+
+  if(plotESDTrueConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotESDTrueConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotESDTrueConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotESDTrueConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotESDTrueConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Mass" ,"" ,  nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}
+  if(plotESDTrueConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Width" ,"" , nXBinsGammaWidth, firstXBinGammaWidth, lastXBinGammaWidth, "", "");}
+  if(plotESDTrueConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Chi2" ,"" , nXBinsGammaChi2, firstXBinGammaChi2, lastXBinGammaChi2, "", "");}
+  if(plotESDTrueConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NDF" ,"" , nXBinsGammaNDF, firstXBinGammaNDF, lastXBinGammaNDF, "", "");}
+  if(plotESDTrueConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotESDTrueConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Eta" ,"" , nXBinsPt, firstXBinPt, lastXBinPt,nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+
+  if(plotESDTrueConversionR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
+  if(plotESDTrueConversionZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
+  if(plotESDTrueConversionXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotESDTrueConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
+
+
+
+  if(plotESDNoCutConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotESDNoCutConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotESDNoCutConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotESDNoCutConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotESDNoCutConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Mass" ,"" ,  nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}
+  if(plotESDNoCutConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Width" ,"" , nXBinsGammaWidth, firstXBinGammaWidth, lastXBinGammaWidth, "", "");}
+  if(plotESDNoCutConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Chi2" ,"" , nXBinsGammaChi2, firstXBinGammaChi2, lastXBinGammaChi2, "", "");}
+  if(plotESDNoCutConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NDF" ,"" , nXBinsGammaNDF, firstXBinGammaNDF, lastXBinGammaNDF, "", "");}
+  if(plotESDNoCutConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+  if(plotESDNoCutConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Eta" ,"" , nXBinsPt, firstXBinPt, lastXBinPt,nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+
+  if(plotESDNoCutConversionR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
+  if(plotESDNoCutConversionZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
+  if(plotESDNoCutConversionXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotESDNoCutConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
+
+
+
+
+  if(plotESDMotherOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Mother_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
+  if(plotESDMotherEnergy == kTRUE){ histograms->AddHistogram("ESD_Mother_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
+  if(plotESDMotherPt == kTRUE){ histograms->AddHistogram("ESD_Mother_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
+  if(plotESDMotherEta == kTRUE){ histograms->AddHistogram("ESD_Mother_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
+  if(plotESDMotherPhi == kTRUE){ histograms->AddHistogram("ESD_Mother_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
+  if(plotESDMotherMass == kTRUE){ histograms->AddHistogram("ESD_Mother_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}
+  if(plotESDMotherR == kTRUE){ histograms->AddHistogram("ESD_Mother_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
+  if(plotESDMotherZR == kTRUE){ histograms->AddHistogram("ESD_Mother_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
+  if(plotESDMotherXY == kTRUE){ histograms->AddHistogram("ESD_Mother_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotESDMotherRapid == kTRUE){ histograms->AddHistogram("ESD_Mother_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
+
+       
   if(plotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Background_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
   if(plotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram("ESD_Background_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
   if(plotESDBackgroundPt == kTRUE){ histograms->AddHistogram("ESD_Background_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
@@ -579,87 +766,115 @@ void ConfigGammaConversion(TString arguments){
   if(plotESDBackgroundR == kTRUE){ histograms->AddHistogram("ESD_Background_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}
   if(plotESDBackgroundZR == kTRUE){ histograms->AddHistogram("ESD_Background_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}
   if(plotESDBackgroundXY == kTRUE){ histograms->AddHistogram("ESD_Background_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}
+  if(plotESDBackgroundRapid == kTRUE){ histograms->AddHistogram("ESD_Background_Rapid" ,"" , nXBinsRapid, firstXBinRapid, lastXBinRapid, "", "");}
 
+       
   if(plotMapping == kTRUE){
     histograms->InitializeMappingValues(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);
     histograms->AddMappingHistograms(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);
   }
-
+       
   if(plotResolutiondPt == kTRUE){histograms->AddHistogram("Resolution_dPt" ,"" , nXBinsResdPt, firstXBinResdPt, lastXBinResdPt, nYBinsResdPt, firstYBinResdPt, lastYBinResdPt, "", "");}
   if(plotResolutiondR == kTRUE){histograms->AddHistogram("Resolution_dR" ,"" , nXBinsResdR, firstXBinResdR, lastXBinResdR, nYBinsResdR, firstYBinResdR, lastYBinResdR, "", "");}
   if(plotResolutiondZ == kTRUE){histograms->AddHistogram("Resolution_dZ" ,"" , nXBinsResdZ, firstXBinResdZ, lastXBinResdZ, nYBinsResdZ, firstYBinResdZ, lastYBinResdZ, "", "");}
-  
+       
   if(plotResolutiondRdPt == kTRUE){histograms->AddHistogram("Resolution_dR_dPt" ,"" , nXBinsResdRdPt, firstXBinResdRdPt, lastXBinResdRdPt, nYBinsResdRdPt, firstYBinResdRdPt, lastYBinResdRdPt, "", "");}
-  
+       
   if(plotResolutionMCPt == kTRUE){histograms->AddHistogram("Resolution_MC_Pt" ,"" , nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}
   if(plotResolutionMCR == kTRUE){histograms->AddHistogram("Resolution_MC_R" ,"" , nXBinsResR, firstXBinResR, lastXBinResR,"","");}
   if(plotResolutionMCZ == kTRUE){histograms->AddHistogram("Resolution_MC_Z" ,"" , nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}
-  
+       
   if(plotResolutionESDPt == kTRUE){histograms->AddHistogram("Resolution_ESD_Pt" ,"" , nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}
   if(plotResolutionESDR == kTRUE){histograms->AddHistogram("Resolution_ESD_R" ,"" , nXBinsResR, firstXBinResR, lastXBinResR,"","");}
   if(plotResolutionESDZ == kTRUE){histograms->AddHistogram("Resolution_ESD_Z" ,"" , nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}
-  
-  if(plotNumberOfV0s == kTRUE){histograms->AddHistogram("NumberOfV0s","Number of v0s",100, 0, 100,"","");}
-  if(plotNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("NumberOfSurvivingV0s","Number of surviving v0s",100, 0, 100,"","");}
-
+       
+  if(plotESDNumberOfV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfV0s","Number of v0s",100, 0, 100,"","");}
+  if(plotESDNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfSurvivingV0s","Number of surviving v0s",100, 0, 100,"","");}
+       
   //  debug histograms
-  if(plotV0MassDebugCut1 == kTRUE){histograms->AddHistogram("V0MassDebugCut1" ,"debug1" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut2 == kTRUE){histograms->AddHistogram("V0MassDebugCut2" ,"debug2" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut3 == kTRUE){histograms->AddHistogram("V0MassDebugCut3" ,"debug3" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut4 == kTRUE){histograms->AddHistogram("V0MassDebugCut4" ,"debug4" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut5 == kTRUE){histograms->AddHistogram("V0MassDebugCut5" ,"debug5" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut6 == kTRUE){histograms->AddHistogram("V0MassDebugCut6" ,"debug6" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut7 == kTRUE){histograms->AddHistogram("V0MassDebugCut7" ,"debug7" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-  if(plotV0MassDebugCut8 == kTRUE){histograms->AddHistogram("V0MassDebugCut8" ,"debug8" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
-
-
-  if(plotPi0Spectra == kTRUE){histograms->AddHistogram("InvMass_vs_Pt_Spectra" ,"Invariant Mass vs Pt" , nXBinsSpectra, firstXBinSpectra, lastXBinSpectra,nYBinsSpectra, firstYBinSpectra, lastYBinSpectra,"InvMass [GeV]","Pt [GeV]");}
-
-  if(plotPi0Spectra == kTRUE && calculateBackground == kTRUE){histograms->AddHistogram("Background_InvMass_vs_Pt_Spectra" ,"Background Invariant Mass vs Pt" , nXBinsSpectra, firstXBinSpectra, lastXBinSpectra,nYBinsSpectra, firstYBinSpectra, lastYBinSpectra,"InvMass [GeV]","Pt [GeV]");}
-
-  
-
+  if(plotESDCutGetOnFly == kTRUE){histograms->AddHistogram("ESD_CutGetOnFly_InvMass" ,"Not GetOnFly" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutNContributors == kTRUE){histograms->AddHistogram("ESD_CutNContributors_InvMass" ,"NContributors <= 0" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutLikeSign == kTRUE){histograms->AddHistogram("ESD_CutLikeSign_InvMass" ,"LikeSign" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutRefit == kTRUE){histograms->AddHistogram("ESD_CutRefit_InvMass" ,"No TPC refit" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutKink == kTRUE){histograms->AddHistogram("ESD_CutKink_InvMass" ,"Kinks" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutPIDProb == kTRUE){histograms->AddHistogram("ESD_CutPIDProb_InvMass" ,"wrong TPC PID" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutR == kTRUE){histograms->AddHistogram("ESD_CutR_InvMass" ,"Above RMax" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutNDF == kTRUE){histograms->AddHistogram("ESD_CutNDF_InvMass" ,"NDF <= 0" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutChi2 == kTRUE){histograms->AddHistogram("ESD_CutChi2_InvMass" ,"#chi^{2} > Max" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutEta == kTRUE){histograms->AddHistogram("ESD_CutEta_InvMass" ,"Above #eta max" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutPt == kTRUE){histograms->AddHistogram("ESD_CutPt_InvMass" ,"Below p_{t} min" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDCutLine == kTRUE){histograms->AddHistogram("ESD_CutLine_InvMass" ,"Out of reconstruction area" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}
+  if(plotESDTrueConvGammaTrackLength == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLength","Track length of TrueConvGamma",nXBinsTrackLength,firstXBinTrackLength,lastXBinTrackLength,"","");}
+  if(plotESDTrueConvGammaTrackLengthVSInvMass == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass","Track length of TrueConvGamma vs Inv mass",nXBinsTrackLength,firstXBinTrackLength,lastXBinTrackLength,nXBinsPt, firstXBinPt, lastXBinPt,"","");}
+
+
+  if(plotPi0Spectra == kTRUE){
+histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , nXBinsSpectra, firstXBinSpectra, lastXBinSpectra,nYBinsSpectra, firstYBinSpectra, lastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
+}
+  if(plotPi0Spectra == kTRUE && calculateBackground == kTRUE){
+histograms->AddHistogram("ESD_Background_InvMass_vs_Pt" ,"Background Invariant Mass vs Pt" , nXBinsSpectra, firstXBinSpectra, lastXBinSpectra,nYBinsSpectra, firstYBinSpectra, lastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
+}
+       
+       
+       
   //------------------------------ end Creating the histograms -----------------------------
-
+       
   // Create the Analysis manager
   AliAnalysisManager *mgr  = new AliAnalysisManager("My Manager", "My Analysis");
-
+       
   // Define Input Event Handler 
   AliESDInputHandler* inpHandler = new AliESDInputHandler();
-
+       
   // Define Output Event Handler
   AliAODHandler* aodHandler = new AliAODHandler();
-  aodHandler->SetOutputFileName("aodAliGammaConversion.root");
-  
+  TString fileOutAOD = "AOD_"+ outputFileName + outputFileAppendix + ".root";
+  aodHandler->SetOutputFileName(fileOutAOD);
+  //  aodHandler->SetOutputFileName("aodAliGammaConversion.root");
+       
   // Define MC Truth Event Handler
   AliMCEventHandler* mcHandler = new AliMCEventHandler();
-  
+       
   // Add Handlers to the Task Manager
   mgr->SetInputEventHandler  (inpHandler);
   mgr->SetOutputEventHandler (aodHandler);
   mgr->SetMCtruthEventHandler(mcHandler);
-
+       
   // Be sure you are told what you are doing
-  mgr->SetDebugLevel(10);
-
+  //  mgr->SetDebugLevel(10);
+       
   // Declare Common Input Tchain
-  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
-
+  AliAnalysisDataContainer *cinput1 = NULL;
+  if(usePWG4PartCorr){
+    cinput1 = mgr->CreateContainer("Chain",TChain::Class(),AliAnalysisManager::kInputContainer);
+  }
+  else{
+    cinput1 = mgr->GetCommonInputContainer();
+  }
+       
   // Common Output Tree in common Ã¢\80\98defaultâ\80\99 output file
-  AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
-
+  AliAnalysisDataContainer *coutput1 = NULL;
+  if(usePWG4PartCorr){
+    coutput1 = mgr->CreateContainer("tree",TTree::Class(),AliAnalysisManager::kOutputContainer, "default");
+  }
+  else{
+    coutput1 = mgr->GetCommonOutputContainer();
+  }
+       
   // Private output objects
-  outputFileName.ReplaceAll(".root","");
-  outputFileAppendix..ReplaceAll(".root","");
+  if(outputFileName.Contains(".root")){
+    outputFileName.ReplaceAll(".root","");
+  }
+  if(outputFileAppendix.Contains(".root")){
+    outputFileAppendix.ReplaceAll(".root","");
+  }
   TString fileOut = outputFileName + outputFileAppendix + ".root";
-
+       
   AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, fileOut);
-
-
-
+       
+       
   //------------------------ END: Define input/output handlers ---------------------------------------------------
-
-
+       
+       
   //check for errors in the specified data
   if(useKFParticle == kTRUE && useESDTrack == kTRUE){
     //Print warning, cannot use both
@@ -667,8 +882,8 @@ void ConfigGammaConversion(TString arguments){
   if(useKFParticle == kFALSE && useESDTrack == kFALSE){
     //Print warning, one have to be specified
   }
-
-
+       
+       
   //Create the V0Reader
   AliV0Reader * v0Reader = new AliV0Reader();
   if(useKFParticle){
@@ -682,6 +897,8 @@ void ConfigGammaConversion(TString arguments){
   v0Reader->SetMaxRCut(maxRCut);
   v0Reader->SetEtaCut(etaCut);
   v0Reader->SetPtCut(ptCut);
+  v0Reader->SetLineCutZRSlope(LineCutZRSlope);
+  v0Reader->SetLineCutZValue(LineCutZValue);   
   v0Reader->SetChi2CutConversion(chi2CutConversion);
   v0Reader->SetChi2CutMeson(chi2CutMeson);
   v0Reader->SetPIDProbability(probElectron);
@@ -691,56 +908,58 @@ void ConfigGammaConversion(TString arguments){
   v0Reader->SetSigmaMass(sigmaCutGammaMass);
   v0Reader->SetUseImprovedVertex(useImprovedVertex);
   v0Reader->SetDoMCTruth(doMCTruth);
-
+       
   // Create the GammaConversionTask
   AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");
   gammaconversion->SetDebugLevel(10);
-
+       
   gammaconversion->SetWriteNtuple(writeNtuple);
-
+       
   gammaconversion->SetV0Reader(v0Reader);
   gammaconversion->SetCalculateBackground(calculateBackground);
   gammaconversion->Init();
-  
+       
   gammaconversion->SetElectronMass(electronMass);
   gammaconversion->SetGammaMass(gammaMass);
   gammaconversion->SetPi0Mass(pi0Mass);
   gammaconversion->SetEtaMass(etaMass);
-
+       
   gammaconversion->SetGammaWidth(gammaWidth);
   gammaconversion->SetPi0Width(pi0Width);
   gammaconversion->SetEtaWidth(etaWidth);
 
+  gammaconversion->SetMinOpeningAngleGhostCut(minOpeningAngleGhostCut);
+       
   // define the width constraint used by KF particle.
   Double_t gammaWidth = 0.01;
   Double_t pi0Width   = 0.01;
   Double_t etaWidth   = 0.01;
-
+       
   gammaconversion->SetHistograms(histograms);
   v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts
-  
+       
   gammaconversion->SetDoMCTruth(doMCTruth);
-
-
+       
+       
   // Add task to the manager 
   mgr->AddTask(gammaconversion);
-
+       
   // Connect I/O to the task
   mgr->ConnectInput (gammaconversion, 0, cinput1);
   mgr->ConnectOutput(gammaconversion, 0, coutput1);
   mgr->ConnectOutput(gammaconversion, 1, coutput2);
-
+       
   if(dataList.IsNull()){
     cout<<"Data list is not set, aborting."<<endl;
     return;
   }
-
+       
   TChain* chain= CreateESDChain(dataList,numberOfFilesToAnalyze);
-  
+       
   mgr->InitAnalysis();
-  
+       
   mgr->PrintStatus();
-  
+       
   mgr->StartAnalysis("local",chain);
 }
 
@@ -750,7 +969,7 @@ void build() {
   gSystem->Load("libTree.so");
   gSystem->Load("libGeom");
   //  gSystem->Load("libANALYSISalice");
-
+       
   ////
   //Setting up ESD.par//
   ////
@@ -758,7 +977,7 @@ void build() {
   setupPar("ESD");
   gSystem->Load("libVMC.so");
   gSystem->Load("libESD.so");
-
+       
   ////
   ////
   //Setting up STEERBase.par//
@@ -766,33 +985,33 @@ void build() {
   cout<<"compiling STEERBase"<<endl;
   setupPar("STEERBase");
   gSystem->Load("libSTEERBase.so");
-
+       
   ////
   //Setting up AOD.par//
   ////
   cout<<"compiling AOD"<<endl;
   setupPar("AOD");
   gSystem->Load("libAOD.so");
-                                                                
+       
   ////
   //Setting up ANALYSIS.par//
   ////
   cout<<"compiling ANALYSIS"<<endl;
   setupPar("ANALYSIS");
   gSystem->Load("libANALYSIS.so");
-
+       
   ////
   //Setting up ANALYSISalice.par//
   ////
   cout<<"compiling ANALUSISalice"<<endl;
   setupPar("ANALYSISalice");
   gSystem->Load("libANALYSISalice.so");
-                                                                                                                                  
+       
   ////
   //Setting up PWG4Gamma.par//
   ////
   //  cout<<"compiling GammaConv"<<endl;
-
+       
   if(usePWG4PartCorr == kTRUE){
     cout<<"Using PWG4PartCorr library"<<endl;
     setupPar("PWG4PartCorr");
@@ -815,16 +1034,16 @@ Int_t setupPar(const char* pararchivename) {
     gROOT->ProcessLine(processline);
     const char* ocwd = gSystem->WorkingDirectory();
     gSystem->ChangeDirectory(pararchivename);
-                                                                                                                                               
+               
     // check for BUILD.sh and execute
     if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
       printf("*******************************\n");
       printf("*** Building PAR archive    ***\n");
       printf("*******************************\n");
-                                                                                                                                               
+                       
       if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
-        Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
-        return -1;
+       Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
+       return -1;
       }
     }
     // check for SETUP.C and execute
@@ -834,7 +1053,7 @@ Int_t setupPar(const char* pararchivename) {
       printf("*******************************\n");
       gROOT->Macro("PROOF-INF/SETUP.C");
     }
-                                                                                                                                               
+               
     gSystem->ChangeDirectory("../");
   }                                                                                                                                               
   return 1;