]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG4/PartCorrDep/AliAnaPhoton.cxx
compilation warning
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaPhoton.cxx
index 4248ccb79caa72ff8a34200e11578503cb91dd02..ee214acf1991f680c47aea2be0c166fadbc377a6 100755 (executable)
@@ -53,14 +53,14 @@ ClassImp(AliAnaPhoton)
   AliAnaPhoton::AliAnaPhoton() : 
     AliAnaPartCorrBaseClass(), fCalorimeter(""), 
     fMinDist(0.),fMinDist2(0.),fMinDist3(0.),fRejectTrackMatch(0),
-    fCheckConversion(kFALSE),fAddConvertedPairsToAOD(kFALSE), fMassCut(0),
     fTimeCutMin(-1), fTimeCutMax(9999999), fNCellsCut(0),
-    fConvDEtaCut(2.),fConvDPhiCut(6.),
+    fCheckConversion(kFALSE), fRemoveConvertedPair(kFALSE), fAddConvertedPairsToAOD(kFALSE), fMassCut(0),
+    fConvAsymCut(1.), fConvDEtaCut(2.),fConvDPhiMinCut(-1.), fConvDPhiMaxCut(7.), 
     //fhVertex(0), 
     fhNtraNclu(0), fhNCellsPt(0),
-    fhPtPhoton(0),fhPhiPhoton(0),fhEtaPhoton(0), fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
+    fhEPhoton(0),      fhPtPhoton(0),  fhPhiPhoton(0),  fhEtaPhoton(0),  fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
     fhPtPhotonConv(0), fhEtaPhiPhotonConv(0),fhEtaPhi05PhotonConv(0),
-    fhConvDeltaEta(0),fhConvDeltaPhi(0), fhConvDeltaEtaPhi(0), fhConvAsym(0), fhConvPt(0),
+    fhConvDeltaEta(0), fhConvDeltaPhi(0),    fhConvDeltaEtaPhi(0), fhConvAsym(0),     fhConvPt(0),
     //MC
     fhDeltaE(0), fhDeltaPt(0),fhRatioE(0), fhRatioPt(0),fh2E(0),fh2Pt(0),
     fhPtMCPhoton(0),fhPhiMCPhoton(0),fhEtaMCPhoton(0), 
@@ -69,10 +69,11 @@ ClassImp(AliAnaPhoton)
     fhPtISR(0),fhPhiISR(0),fhEtaISR(0), 
     fhPtPi0Decay(0),fhPhiPi0Decay(0),fhEtaPi0Decay(0), 
     fhPtOtherDecay(0),  fhPhiOtherDecay(0),  fhEtaOtherDecay(0), 
-    fhPtConversion(0),  fhPhiConversion(0),  fhEtaConversion(0),fhPtConversionTagged(0),fhEtaPhiConversion(0),fhEtaPhi05Conversion(0),
+    fhPtConversion(0),  fhPhiConversion(0),  fhEtaConversion(0),fhEtaPhiConversion(0),fhEtaPhi05Conversion(0),
     fhPtAntiNeutron(0), fhPhiAntiNeutron(0), fhEtaAntiNeutron(0),
     fhPtAntiProton(0),  fhPhiAntiProton(0),  fhEtaAntiProton(0), 
     fhPtUnknown(0),     fhPhiUnknown(0),     fhEtaUnknown(0),
+    fhPtConversionTagged(0),        fhPtAntiNeutronTagged(0),       fhPtAntiProtonTagged(0),           fhPtUnknownTagged(0),
     fhConvDeltaEtaMCConversion(0),  fhConvDeltaPhiMCConversion(0),  fhConvDeltaEtaPhiMCConversion(0),  fhConvAsymMCConversion(0),  fhConvPtMCConversion(0),  fhConvDispersionMCConversion(0), fhConvM02MCConversion(0),
     fhConvDeltaEtaMCAntiNeutron(0), fhConvDeltaPhiMCAntiNeutron(0), fhConvDeltaEtaPhiMCAntiNeutron(0), fhConvAsymMCAntiNeutron(0), fhConvPtMCAntiNeutron(0), fhConvDispersionMCAntiNeutron(0),fhConvM02MCAntiNeutron(0),
     fhConvDeltaEtaMCAntiProton(0),  fhConvDeltaPhiMCAntiProton(0),  fhConvDeltaEtaPhiMCAntiProton(0),  fhConvAsymMCAntiProton(0),  fhConvPtMCAntiProton(0),  fhConvDispersionMCAntiProton(0), fhConvM02MCAntiProton(0),
@@ -110,7 +111,8 @@ TObjString *  AliAnaPhoton::GetAnalysisCuts()
   parList+=onePar ;
   snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
   parList+=onePar ;  
-  snprintf(onePar,buffersize,"Conversion Selection: fConvDEtaCut %f fConvDPhiCut %f\n",fConvDEtaCut, fConvDPhiCut) ;
+  snprintf(onePar,buffersize,"Conversion Selection: fConvAsymCut %1.2f, fConvDEtaCut %1.2f fConvDPhiCut (%1.2f,%1.2f)\n",
+           fConvAsymCut, fConvDEtaCut, fConvDPhiMinCut, fConvDPhiMaxCut) ;
   parList+=onePar ; 
   
   //Get parameters set in base class.
@@ -156,24 +158,29 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
   fhNtraNclu->SetYTitle("# of clusters");
   outputContainer->Add(fhNtraNclu);
   
-  fhNCellsPt  = new TH2F ("hNCellsPt","# of tracks vs # of clusters", nptbins,ptmin, ptmax, 10,0,10); 
-  fhNCellsPt->SetXTitle("p_{T}");
+  fhNCellsPt  = new TH2F ("hNCellsPt","# of cells in cluster vs E of clusters", nptbins,ptmin, ptmax, 100,0,100); 
+  fhNCellsPt->SetXTitle("p_{T} (GeV/c)");
   fhNCellsPt->SetYTitle("# of cells in cluster");
   outputContainer->Add(fhNCellsPt);  
   
-  fhPtPhoton  = new TH1F("hPtPhoton","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); 
+  fhEPhoton  = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax); 
+  fhEPhoton->SetYTitle("N");
+  fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
+  outputContainer->Add(fhEPhoton) ;   
+  
+  fhPtPhoton  = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax); 
   fhPtPhoton->SetYTitle("N");
   fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
   outputContainer->Add(fhPtPhoton) ; 
   
   fhPhiPhoton  = new TH2F
-    ("hPhiPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
+    ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
   fhPhiPhoton->SetYTitle("#phi (rad)");
   fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
   outputContainer->Add(fhPhiPhoton) ; 
   
   fhEtaPhoton  = new TH2F
-    ("hEtaPhoton","#eta_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
+    ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
   fhEtaPhoton->SetYTitle("#eta");
   fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
   outputContainer->Add(fhEtaPhoton) ;
@@ -183,62 +190,64 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
   fhEtaPhiPhoton->SetYTitle("#phi (rad)");
   fhEtaPhiPhoton->SetXTitle("#eta");
   outputContainer->Add(fhEtaPhiPhoton) ;
-  
-  fhEtaPhi05Photon  = new TH2F
-  ("hEtaPhi05Photon","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax); 
-  fhEtaPhi05Photon->SetYTitle("#phi (rad)");
-  fhEtaPhi05Photon->SetXTitle("#eta");
-  outputContainer->Add(fhEtaPhi05Photon) ;
-  
+  if(GetMinPt() < 0.5){
+    fhEtaPhi05Photon  = new TH2F
+    ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax); 
+    fhEtaPhi05Photon->SetYTitle("#phi (rad)");
+    fhEtaPhi05Photon->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhi05Photon) ;
+  }
   
   //Conversion
-
-  fhPtPhotonConv  = new TH1F("hPtPhotonConv","Number of #gamma over calorimeter, conversion",nptbins,ptmin,ptmax); 
-  fhPtPhotonConv->SetYTitle("N");
-  fhPtPhotonConv->SetXTitle("p_{T #gamma}(GeV/c)");
-  outputContainer->Add(fhPtPhotonConv) ; 
-  
-  fhEtaPhiPhotonConv  = new TH2F
-  ("hEtaPhiPhotonConv","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax); 
-  fhEtaPhiPhotonConv->SetYTitle("#phi (rad)");
-  fhEtaPhiPhotonConv->SetXTitle("#eta");
-  outputContainer->Add(fhEtaPhiPhotonConv) ;
-  
-  fhEtaPhi05PhotonConv  = new TH2F
-  ("hEtaPhi05PhotonConv","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax); 
-  fhEtaPhi05PhotonConv->SetYTitle("#phi (rad)");
-  fhEtaPhi05PhotonConv->SetXTitle("#eta");
-  outputContainer->Add(fhEtaPhi05PhotonConv) ;
-  
-  fhConvDeltaEta  = new TH2F
-  ("hConvDeltaEta","#Delta #eta of selected conversion pairs",100,0,fMassCut,netabins,-0.5,0.5); 
-  fhConvDeltaEta->SetYTitle("#Delta #eta");
-  fhConvDeltaEta->SetXTitle("Pair Mass (GeV/c^2)");
-  outputContainer->Add(fhConvDeltaEta) ;
-  
-  fhConvDeltaPhi  = new TH2F
-  ("hConvDeltaPhi","#Delta #phi of selected conversion pairs",100,0,fMassCut,nphibins,-0.5,0.5); 
-  fhConvDeltaPhi->SetYTitle("#Delta #phi");
-  fhConvDeltaPhi->SetXTitle("Pair Mass (GeV/c^2)");
-  outputContainer->Add(fhConvDeltaPhi) ;
-  
-  fhConvDeltaEtaPhi  = new TH2F
-  ("hConvDeltaEtaPhi","#Delta #eta vs #Delta #phi of selected conversion pairs",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
-  fhConvDeltaEtaPhi->SetYTitle("#Delta #phi");
-  fhConvDeltaEtaPhi->SetXTitle("#Delta #eta");
-  outputContainer->Add(fhConvDeltaEtaPhi) ;
-  
-  fhConvAsym  = new TH2F
-  ("hConvAsym","Asymmetry of selected conversion pairs",100,0,fMassCut,100,0,1); 
-  fhConvAsym->SetYTitle("Asymmetry");
-  fhConvAsym->SetXTitle("Pair Mass (GeV/c^2)");
-  outputContainer->Add(fhConvAsym) ;  
-  
-  fhConvPt  = new TH2F
-  ("hConvPt","p_{T} of selected conversion pairs",100,0,fMassCut,100,0.,10.); 
-  fhConvPt->SetYTitle("Pair p_{T} (GeV/c)");
-  fhConvPt->SetXTitle("Pair Mass (GeV/c^2)");
-  outputContainer->Add(fhConvPt) ;
+  if(fCheckConversion){
+    fhPtPhotonConv  = new TH1F("hPtPhotonConv","Number of #gamma over calorimeter, conversion",nptbins,ptmin,ptmax); 
+    fhPtPhotonConv->SetYTitle("N");
+    fhPtPhotonConv->SetXTitle("p_{T #gamma}(GeV/c)");
+    outputContainer->Add(fhPtPhotonConv) ; 
+    
+    fhEtaPhiPhotonConv  = new TH2F
+    ("hEtaPhiPhotonConv","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax); 
+    fhEtaPhiPhotonConv->SetYTitle("#phi (rad)");
+    fhEtaPhiPhotonConv->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiPhotonConv) ;
+    if(GetMinPt() < 0.5){
+      fhEtaPhi05PhotonConv  = new TH2F
+      ("hEtaPhi05PhotonConv","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax); 
+      fhEtaPhi05PhotonConv->SetYTitle("#phi (rad)");
+      fhEtaPhi05PhotonConv->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhi05PhotonConv) ;
+    }
+    
+    fhConvDeltaEta  = new TH2F
+    ("hConvDeltaEta","#Delta #eta of selected conversion pairs",100,0,fMassCut,netabins*2,-0.5,0.5); 
+    fhConvDeltaEta->SetYTitle("#Delta #eta");
+    fhConvDeltaEta->SetXTitle("Pair Mass (GeV/c^2)");
+    outputContainer->Add(fhConvDeltaEta) ;
+    
+    fhConvDeltaPhi  = new TH2F
+    ("hConvDeltaPhi","#Delta #phi of selected conversion pairs",100,0,fMassCut,nphibins*2,-0.5,0.5); 
+    fhConvDeltaPhi->SetYTitle("#Delta #phi");
+    fhConvDeltaPhi->SetXTitle("Pair Mass (GeV/c^2)");
+    outputContainer->Add(fhConvDeltaPhi) ;
+    
+    fhConvDeltaEtaPhi  = new TH2F
+    ("hConvDeltaEtaPhi","#Delta #eta vs #Delta #phi of selected conversion pairs",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
+    fhConvDeltaEtaPhi->SetYTitle("#Delta #phi");
+    fhConvDeltaEtaPhi->SetXTitle("#Delta #eta");
+    outputContainer->Add(fhConvDeltaEtaPhi) ;
+    
+    fhConvAsym  = new TH2F
+    ("hConvAsym","Asymmetry of selected conversion pairs",100,0,fMassCut,100,0,1); 
+    fhConvAsym->SetYTitle("Asymmetry");
+    fhConvAsym->SetXTitle("Pair Mass (GeV/c^2)");
+    outputContainer->Add(fhConvAsym) ;  
+    
+    fhConvPt  = new TH2F
+    ("hConvPt","p_{T} of selected conversion pairs",100,0,fMassCut,100,0.,10.); 
+    fhConvPt->SetYTitle("Pair p_{T} (GeV/c)");
+    fhConvPt->SetXTitle("Pair Mass (GeV/c^2)");
+    outputContainer->Add(fhConvPt) ;
+  }
   
   if(IsDataMC()){
     fhDeltaE  = new TH1F ("hDeltaE","MC - Reco E ", 200,-50,50); 
@@ -386,11 +395,6 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     fhEtaConversion->SetXTitle("p_{T #gamma} (GeV/c)");
     outputContainer->Add(fhEtaConversion) ;
     
-    fhPtConversionTagged  = new TH1F("hPtMCConversionTagged","Number of converted #gamma over calorimeter, tagged as converted",nptbins,ptmin,ptmax); 
-    fhPtConversionTagged->SetYTitle("N");
-    fhPtConversionTagged->SetXTitle("p_{T #gamma}(GeV/c)");
-    outputContainer->Add(fhPtConversionTagged) ; 
-    
     fhEtaPhiConversion  = new TH2F
     ("hEtaPhiConversion","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax); 
     fhEtaPhiConversion->SetYTitle("#phi (rad)");
@@ -420,7 +424,7 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     fhEtaAntiNeutron->SetXTitle("p_{T #gamma} (GeV/c)");
     outputContainer->Add(fhEtaAntiNeutron) ;
         
-    fhPtAntiProton  = new TH1F("hPtMCAntiProtonConv","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); 
+    fhPtAntiProton  = new TH1F("hPtMCAntiProton","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); 
     fhPtAntiProton->SetYTitle("N");
     fhPtAntiProton->SetXTitle("p_{T #gamma}(GeV/c)");
     outputContainer->Add(fhPtAntiProton) ; 
@@ -454,174 +458,196 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     fhEtaUnknown->SetXTitle("p_{T #gamma} (GeV/c)");
     outputContainer->Add(fhEtaUnknown) ;
        
-    fhConvDeltaEtaMCConversion  = new TH2F
-    ("hConvDeltaEtaMCConversion","#Delta #eta of selected conversion pairs from real conversions",100,0,fMassCut,netabins,-0.5,0.5); 
-    fhConvDeltaEtaMCConversion->SetYTitle("#Delta #eta");
-    fhConvDeltaEtaMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaEtaMCConversion) ;
-    
-    fhConvDeltaPhiMCConversion  = new TH2F
-    ("hConvDeltaPhiMCConversion","#Delta #phi of selected conversion pairs from real conversions",100,0,fMassCut,nphibins,-0.5,0.5); 
-    fhConvDeltaPhiMCConversion->SetYTitle("#Delta #phi");
-    fhConvDeltaPhiMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaPhiMCConversion) ;
-    
-    fhConvDeltaEtaPhiMCConversion  = new TH2F
-    ("hConvDeltaEtaPhiMCConversion","#Delta #eta vs #Delta #phi of selected conversion pairs, from real conversions",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
-    fhConvDeltaEtaPhiMCConversion->SetYTitle("#Delta #phi");
-    fhConvDeltaEtaPhiMCConversion->SetXTitle("#Delta #eta");
-    outputContainer->Add(fhConvDeltaEtaPhiMCConversion) ;
-    
-    fhConvAsymMCConversion  = new TH2F
-    ("hConvAsymMCConversion","Asymmetry of selected conversion pairs from real conversions",100,0,fMassCut,100,0,1); 
-    fhConvAsymMCConversion->SetYTitle("Asymmetry");
-    fhConvAsymMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvAsymMCConversion) ;
-    
-    fhConvPtMCConversion  = new TH2F
-    ("hConvPtMCConversion","p_{T} of selected conversion pairs from real conversions",100,0,fMassCut,100,0.,10.); 
-    fhConvPtMCConversion->SetYTitle("Pair p_{T} (GeV/c)");
-    fhConvPtMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvPtMCConversion) ;    
-    
-    fhConvDispersionMCConversion  = new TH2F
-    ("hConvDispersionMCConversion","p_{T} of selected conversion pairs from real conversions",100,0.,1.,100,0.,1.); 
-    fhConvDispersionMCConversion->SetYTitle("Dispersion cluster 1");
-    fhConvDispersionMCConversion->SetXTitle("Dispersion cluster 2");
-    outputContainer->Add(fhConvDispersionMCConversion) ;   
-    
-    fhConvM02MCConversion  = new TH2F
-    ("hConvM02MCConversion","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
-    fhConvM02MCConversion->SetYTitle("M02 cluster 1");
-    fhConvM02MCConversion->SetXTitle("M02 cluster 2");
-    outputContainer->Add(fhConvM02MCConversion) ;           
-    
-    fhConvDeltaEtaMCAntiNeutron  = new TH2F
-    ("hConvDeltaEtaMCAntiNeutron","#Delta #eta of selected conversion pairs from anti-neutrons",100,0,fMassCut,netabins,-0.5,0.5); 
-    fhConvDeltaEtaMCAntiNeutron->SetYTitle("#Delta #eta");
-    fhConvDeltaEtaMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaEtaMCAntiNeutron) ;
-    
-    fhConvDeltaPhiMCAntiNeutron  = new TH2F
-    ("hConvDeltaPhiMCAntiNeutron","#Delta #phi of selected conversion pairs from anti-neutrons",100,0,fMassCut,nphibins,-0.5,0.5); 
-    fhConvDeltaPhiMCAntiNeutron->SetYTitle("#Delta #phi");
-    fhConvDeltaPhiMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaPhiMCAntiNeutron) ;
-    
-    fhConvDeltaEtaPhiMCAntiNeutron  = new TH2F
-    ("hConvDeltaEtaPhiMCAntiNeutron","#Delta #eta vs #Delta #phi of selected conversion pairs from anti-neutrons",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
-    fhConvDeltaEtaPhiMCAntiNeutron->SetYTitle("#Delta #phi");
-    fhConvDeltaEtaPhiMCAntiNeutron->SetXTitle("#Delta #eta");
-    outputContainer->Add(fhConvDeltaEtaPhiMCAntiNeutron) ;    
-    
-    fhConvAsymMCAntiNeutron  = new TH2F
-    ("hConvAsymMCAntiNeutron","Asymmetry of selected conversion pairs from anti-neutrons",100,0,fMassCut,100,0,1); 
-    fhConvAsymMCAntiNeutron->SetYTitle("Asymmetry");
-    fhConvAsymMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvAsymMCAntiNeutron) ;
-    
-    fhConvPtMCAntiNeutron  = new TH2F
-    ("hConvPtMCAntiNeutron","p_{T} of selected conversion pairs from anti-neutrons",100,0,fMassCut,100,0.,10.); 
-    fhConvPtMCAntiNeutron->SetYTitle("Pair p_{T} (GeV/c)");
-    fhConvPtMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvPtMCAntiNeutron) ;    
-    
-    fhConvDispersionMCAntiNeutron  = new TH2F
-    ("hConvDispersionMCAntiNeutron","p_{T} of selected conversion pairs from anti-neutrons",100,0.,1.,100,0.,1.); 
-    fhConvDispersionMCAntiNeutron->SetYTitle("Dispersion cluster 1");
-    fhConvDispersionMCAntiNeutron->SetXTitle("Dispersion cluster 2");
-    outputContainer->Add(fhConvDispersionMCAntiNeutron) ;       
-    
-    fhConvM02MCAntiNeutron  = new TH2F
-    ("hConvM02MCAntiNeutron","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
-    fhConvM02MCAntiNeutron->SetYTitle("M02 cluster 1");
-    fhConvM02MCAntiNeutron->SetXTitle("M02 cluster 2");
-    outputContainer->Add(fhConvM02MCAntiNeutron) ;  
-    
-    fhConvDeltaEtaMCAntiProton  = new TH2F
-    ("hConvDeltaEtaMCAntiProton","#Delta #eta of selected conversion pairs from anti-protons",100,0,fMassCut,netabins,-0.5,0.5); 
-    fhConvDeltaEtaMCAntiProton->SetYTitle("#Delta #eta");
-    fhConvDeltaEtaMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaEtaMCAntiProton) ;
-    
-    fhConvDeltaPhiMCAntiProton  = new TH2F
-    ("hConvDeltaPhiMCAntiProton","#Delta #phi of selected conversion pairs from anti-protons",100,0,fMassCut,nphibins,-0.5,0.5); 
-    fhConvDeltaPhiMCAntiProton->SetYTitle("#Delta #phi");
-    fhConvDeltaPhiMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaPhiMCAntiProton) ;
-    
-    fhConvDeltaEtaPhiMCAntiProton  = new TH2F
-    ("hConvDeltaEtaPhiMCAntiProton","#Delta #eta vs #Delta #phi of selected conversion pairs from anti-protons",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
-    fhConvDeltaEtaPhiMCAntiProton->SetYTitle("#Delta #phi");
-    fhConvDeltaEtaPhiMCAntiProton->SetXTitle("#Delta #eta");
-    outputContainer->Add(fhConvDeltaEtaPhiMCAntiProton) ;    
-    
-    fhConvAsymMCAntiProton  = new TH2F
-    ("hConvAsymMCAntiProton","Asymmetry of selected conversion pairs from anti-protons",100,0,fMassCut,100,0,1); 
-    fhConvAsymMCAntiProton->SetYTitle("Asymmetry");
-    fhConvAsymMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvAsymMCAntiProton) ;
-    
-    fhConvPtMCAntiProton  = new TH2F
-    ("hConvPtMCAntiProton","p_{T} of selected conversion pairs from anti-protons",100,0,fMassCut,100,0.,10.); 
-    fhConvPtMCAntiProton->SetYTitle("Pair p_{T} (GeV/c)");
-    fhConvPtMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvPtMCAntiProton) ;
-    
-    fhConvDispersionMCAntiProton  = new TH2F
-    ("hConvDispersionMCAntiProton","p_{T} of selected conversion pairs from anti-protons",100,0.,1.,100,0.,1.); 
-    fhConvDispersionMCAntiProton->SetYTitle("Dispersion cluster 1");
-    fhConvDispersionMCAntiProton->SetXTitle("Dispersion cluster 2");
-    outputContainer->Add(fhConvDispersionMCAntiProton) ;       
-    
-    fhConvM02MCAntiProton  = new TH2F
-    ("hConvM02MCAntiProton","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
-    fhConvM02MCAntiProton->SetYTitle("M02 cluster 1");
-    fhConvM02MCAntiProton->SetXTitle("M02 cluster 2");
-    outputContainer->Add(fhConvM02MCAntiProton) ;       
-    
-    fhConvDeltaEtaMCString  = new TH2F
-    ("hConvDeltaEtaMCString","#Delta #eta of selected conversion pairs from string",100,0,fMassCut,netabins,-0.5,0.5); 
-    fhConvDeltaEtaMCString->SetYTitle("#Delta #eta");
-    fhConvDeltaEtaMCString->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaEtaMCString) ;
-    
-    fhConvDeltaPhiMCString  = new TH2F
-    ("hConvDeltaPhiMCString","#Delta #phi of selected conversion pairs from string",100,0,fMassCut,nphibins,-0.5,0.5); 
-    fhConvDeltaPhiMCString->SetYTitle("#Delta #phi");
-    fhConvDeltaPhiMCString->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvDeltaPhiMCString) ;
-    
-    fhConvDeltaEtaPhiMCString  = new TH2F
-    ("hConvDeltaEtaPhiMCString","#Delta #eta vs #Delta #phi of selected conversion pairs from string",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
-    fhConvDeltaEtaPhiMCString->SetYTitle("#Delta #phi");
-    fhConvDeltaEtaPhiMCString->SetXTitle("#Delta #eta");
-    outputContainer->Add(fhConvDeltaEtaPhiMCString) ;    
-    
-    fhConvAsymMCString  = new TH2F
-    ("hConvAsymMCString","Asymmetry of selected conversion pairs from string",100,0,fMassCut,100,0,1); 
-    fhConvAsymMCString->SetYTitle("Asymmetry");
-    fhConvAsymMCString->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvAsymMCString) ;
-    
-    fhConvPtMCString  = new TH2F
-    ("hConvPtMCString","p_{T} of selected conversion pairs from string",100,0,fMassCut,100,0.,10.); 
-    fhConvPtMCString->SetYTitle("Pair p_{T} (GeV/c)");
-    fhConvPtMCString->SetXTitle("Pair Mass (GeV/c^2)");
-    outputContainer->Add(fhConvPtMCString) ;
-    
-    fhConvDispersionMCString  = new TH2F
-    ("hConvDispersionMCString","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
-    fhConvDispersionMCString->SetYTitle("Dispersion cluster 1");
-    fhConvDispersionMCString->SetXTitle("Dispersion cluster 2");
-    outputContainer->Add(fhConvDispersionMCString) ;       
-    
-    fhConvM02MCString  = new TH2F
-    ("hConvM02MCString","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
-    fhConvM02MCString->SetYTitle("M02 cluster 1");
-    fhConvM02MCString->SetXTitle("M02 cluster 2");
-    outputContainer->Add(fhConvM02MCString) ;       
-    
+    if(fCheckConversion){  
+      fhPtConversionTagged  = new TH1F("hPtMCConversionTagged","Number of converted #gamma over calorimeter, tagged as converted",nptbins,ptmin,ptmax); 
+      fhPtConversionTagged->SetYTitle("N");
+      fhPtConversionTagged->SetXTitle("p_{T #gamma}(GeV/c)");
+      outputContainer->Add(fhPtConversionTagged) ; 
+      
+      
+      fhPtAntiNeutronTagged  = new TH1F("hPtMCAntiNeutronTagged","Number of AntiNeutron id as Photon over calorimeter, tagged as converted",nptbins,ptmin,ptmax); 
+      fhPtAntiNeutronTagged->SetYTitle("N");
+      fhPtAntiNeutronTagged->SetXTitle("p_{T #gamma}(GeV/c)");
+      outputContainer->Add(fhPtAntiNeutronTagged) ; 
+      
+      fhPtAntiProtonTagged  = new TH1F("hPtMCAntiProtonTagged","Number of AntiProton id as Photon over calorimeter, tagged as converted",nptbins,ptmin,ptmax); 
+      fhPtAntiProtonTagged->SetYTitle("N");
+      fhPtAntiProtonTagged->SetXTitle("p_{T #gamma}(GeV/c)");
+      outputContainer->Add(fhPtAntiProtonTagged) ; 
+      
+      fhPtUnknownTagged  = new TH1F("hPtMCUnknownTagged","Number of Unknown id as Photon over calorimeter, tagged as converted",nptbins,ptmin,ptmax); 
+      fhPtUnknownTagged->SetYTitle("N");
+      fhPtUnknownTagged->SetXTitle("p_{T #gamma}(GeV/c)");
+      outputContainer->Add(fhPtUnknownTagged) ;     
+      
+      fhConvDeltaEtaMCConversion  = new TH2F
+      ("hConvDeltaEtaMCConversion","#Delta #eta of selected conversion pairs from real conversions",100,0,fMassCut,netabins,-0.5,0.5); 
+      fhConvDeltaEtaMCConversion->SetYTitle("#Delta #eta");
+      fhConvDeltaEtaMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaEtaMCConversion) ;
+      
+      fhConvDeltaPhiMCConversion  = new TH2F
+      ("hConvDeltaPhiMCConversion","#Delta #phi of selected conversion pairs from real conversions",100,0,fMassCut,nphibins,-0.5,0.5); 
+      fhConvDeltaPhiMCConversion->SetYTitle("#Delta #phi");
+      fhConvDeltaPhiMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaPhiMCConversion) ;
+      
+      fhConvDeltaEtaPhiMCConversion  = new TH2F
+      ("hConvDeltaEtaPhiMCConversion","#Delta #eta vs #Delta #phi of selected conversion pairs, from real conversions",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
+      fhConvDeltaEtaPhiMCConversion->SetYTitle("#Delta #phi");
+      fhConvDeltaEtaPhiMCConversion->SetXTitle("#Delta #eta");
+      outputContainer->Add(fhConvDeltaEtaPhiMCConversion) ;
+      
+      fhConvAsymMCConversion  = new TH2F
+      ("hConvAsymMCConversion","Asymmetry of selected conversion pairs from real conversions",100,0,fMassCut,100,0,1); 
+      fhConvAsymMCConversion->SetYTitle("Asymmetry");
+      fhConvAsymMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvAsymMCConversion) ;
+      
+      fhConvPtMCConversion  = new TH2F
+      ("hConvPtMCConversion","p_{T} of selected conversion pairs from real conversions",100,0,fMassCut,100,0.,10.); 
+      fhConvPtMCConversion->SetYTitle("Pair p_{T} (GeV/c)");
+      fhConvPtMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvPtMCConversion) ;    
+      
+      fhConvDispersionMCConversion  = new TH2F
+      ("hConvDispersionMCConversion","p_{T} of selected conversion pairs from real conversions",100,0.,1.,100,0.,1.); 
+      fhConvDispersionMCConversion->SetYTitle("Dispersion cluster 1");
+      fhConvDispersionMCConversion->SetXTitle("Dispersion cluster 2");
+      outputContainer->Add(fhConvDispersionMCConversion) ;   
+      
+      fhConvM02MCConversion  = new TH2F
+      ("hConvM02MCConversion","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
+      fhConvM02MCConversion->SetYTitle("M02 cluster 1");
+      fhConvM02MCConversion->SetXTitle("M02 cluster 2");
+      outputContainer->Add(fhConvM02MCConversion) ;           
+      
+      fhConvDeltaEtaMCAntiNeutron  = new TH2F
+      ("hConvDeltaEtaMCAntiNeutron","#Delta #eta of selected conversion pairs from anti-neutrons",100,0,fMassCut,netabins,-0.5,0.5); 
+      fhConvDeltaEtaMCAntiNeutron->SetYTitle("#Delta #eta");
+      fhConvDeltaEtaMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaEtaMCAntiNeutron) ;
+      
+      fhConvDeltaPhiMCAntiNeutron  = new TH2F
+      ("hConvDeltaPhiMCAntiNeutron","#Delta #phi of selected conversion pairs from anti-neutrons",100,0,fMassCut,nphibins,-0.5,0.5); 
+      fhConvDeltaPhiMCAntiNeutron->SetYTitle("#Delta #phi");
+      fhConvDeltaPhiMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaPhiMCAntiNeutron) ;
+      
+      fhConvDeltaEtaPhiMCAntiNeutron  = new TH2F
+      ("hConvDeltaEtaPhiMCAntiNeutron","#Delta #eta vs #Delta #phi of selected conversion pairs from anti-neutrons",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
+      fhConvDeltaEtaPhiMCAntiNeutron->SetYTitle("#Delta #phi");
+      fhConvDeltaEtaPhiMCAntiNeutron->SetXTitle("#Delta #eta");
+      outputContainer->Add(fhConvDeltaEtaPhiMCAntiNeutron) ;    
+      
+      fhConvAsymMCAntiNeutron  = new TH2F
+      ("hConvAsymMCAntiNeutron","Asymmetry of selected conversion pairs from anti-neutrons",100,0,fMassCut,100,0,1); 
+      fhConvAsymMCAntiNeutron->SetYTitle("Asymmetry");
+      fhConvAsymMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvAsymMCAntiNeutron) ;
+      
+      fhConvPtMCAntiNeutron  = new TH2F
+      ("hConvPtMCAntiNeutron","p_{T} of selected conversion pairs from anti-neutrons",100,0,fMassCut,100,0.,10.); 
+      fhConvPtMCAntiNeutron->SetYTitle("Pair p_{T} (GeV/c)");
+      fhConvPtMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvPtMCAntiNeutron) ;    
+      
+      fhConvDispersionMCAntiNeutron  = new TH2F
+      ("hConvDispersionMCAntiNeutron","p_{T} of selected conversion pairs from anti-neutrons",100,0.,1.,100,0.,1.); 
+      fhConvDispersionMCAntiNeutron->SetYTitle("Dispersion cluster 1");
+      fhConvDispersionMCAntiNeutron->SetXTitle("Dispersion cluster 2");
+      outputContainer->Add(fhConvDispersionMCAntiNeutron) ;       
+      
+      fhConvM02MCAntiNeutron  = new TH2F
+      ("hConvM02MCAntiNeutron","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
+      fhConvM02MCAntiNeutron->SetYTitle("M02 cluster 1");
+      fhConvM02MCAntiNeutron->SetXTitle("M02 cluster 2");
+      outputContainer->Add(fhConvM02MCAntiNeutron) ;  
+      
+      fhConvDeltaEtaMCAntiProton  = new TH2F
+      ("hConvDeltaEtaMCAntiProton","#Delta #eta of selected conversion pairs from anti-protons",100,0,fMassCut,netabins,-0.5,0.5); 
+      fhConvDeltaEtaMCAntiProton->SetYTitle("#Delta #eta");
+      fhConvDeltaEtaMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaEtaMCAntiProton) ;
+      
+      fhConvDeltaPhiMCAntiProton  = new TH2F
+      ("hConvDeltaPhiMCAntiProton","#Delta #phi of selected conversion pairs from anti-protons",100,0,fMassCut,nphibins,-0.5,0.5); 
+      fhConvDeltaPhiMCAntiProton->SetYTitle("#Delta #phi");
+      fhConvDeltaPhiMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaPhiMCAntiProton) ;
+      
+      fhConvDeltaEtaPhiMCAntiProton  = new TH2F
+      ("hConvDeltaEtaPhiMCAntiProton","#Delta #eta vs #Delta #phi of selected conversion pairs from anti-protons",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
+      fhConvDeltaEtaPhiMCAntiProton->SetYTitle("#Delta #phi");
+      fhConvDeltaEtaPhiMCAntiProton->SetXTitle("#Delta #eta");
+      outputContainer->Add(fhConvDeltaEtaPhiMCAntiProton) ;    
+      
+      fhConvAsymMCAntiProton  = new TH2F
+      ("hConvAsymMCAntiProton","Asymmetry of selected conversion pairs from anti-protons",100,0,fMassCut,100,0,1); 
+      fhConvAsymMCAntiProton->SetYTitle("Asymmetry");
+      fhConvAsymMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvAsymMCAntiProton) ;
+      
+      fhConvPtMCAntiProton  = new TH2F
+      ("hConvPtMCAntiProton","p_{T} of selected conversion pairs from anti-protons",100,0,fMassCut,100,0.,10.); 
+      fhConvPtMCAntiProton->SetYTitle("Pair p_{T} (GeV/c)");
+      fhConvPtMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvPtMCAntiProton) ;
+      
+      fhConvDispersionMCAntiProton  = new TH2F
+      ("hConvDispersionMCAntiProton","p_{T} of selected conversion pairs from anti-protons",100,0.,1.,100,0.,1.); 
+      fhConvDispersionMCAntiProton->SetYTitle("Dispersion cluster 1");
+      fhConvDispersionMCAntiProton->SetXTitle("Dispersion cluster 2");
+      outputContainer->Add(fhConvDispersionMCAntiProton) ;       
+      
+      fhConvM02MCAntiProton  = new TH2F
+      ("hConvM02MCAntiProton","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
+      fhConvM02MCAntiProton->SetYTitle("M02 cluster 1");
+      fhConvM02MCAntiProton->SetXTitle("M02 cluster 2");
+      outputContainer->Add(fhConvM02MCAntiProton) ;       
+      
+      fhConvDeltaEtaMCString  = new TH2F
+      ("hConvDeltaEtaMCString","#Delta #eta of selected conversion pairs from string",100,0,fMassCut,netabins,-0.5,0.5); 
+      fhConvDeltaEtaMCString->SetYTitle("#Delta #eta");
+      fhConvDeltaEtaMCString->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaEtaMCString) ;
+      
+      fhConvDeltaPhiMCString  = new TH2F
+      ("hConvDeltaPhiMCString","#Delta #phi of selected conversion pairs from string",100,0,fMassCut,nphibins,-0.5,0.5); 
+      fhConvDeltaPhiMCString->SetYTitle("#Delta #phi");
+      fhConvDeltaPhiMCString->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvDeltaPhiMCString) ;
+      
+      fhConvDeltaEtaPhiMCString  = new TH2F
+      ("hConvDeltaEtaPhiMCString","#Delta #eta vs #Delta #phi of selected conversion pairs from string",netabins,-0.5,0.5,nphibins,-0.5,0.5); 
+      fhConvDeltaEtaPhiMCString->SetYTitle("#Delta #phi");
+      fhConvDeltaEtaPhiMCString->SetXTitle("#Delta #eta");
+      outputContainer->Add(fhConvDeltaEtaPhiMCString) ;    
+      
+      fhConvAsymMCString  = new TH2F
+      ("hConvAsymMCString","Asymmetry of selected conversion pairs from string",100,0,fMassCut,100,0,1); 
+      fhConvAsymMCString->SetYTitle("Asymmetry");
+      fhConvAsymMCString->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvAsymMCString) ;
+      
+      fhConvPtMCString  = new TH2F
+      ("hConvPtMCString","p_{T} of selected conversion pairs from string",100,0,fMassCut,100,0.,10.); 
+      fhConvPtMCString->SetYTitle("Pair p_{T} (GeV/c)");
+      fhConvPtMCString->SetXTitle("Pair Mass (GeV/c^2)");
+      outputContainer->Add(fhConvPtMCString) ;
+      
+      fhConvDispersionMCString  = new TH2F
+      ("hConvDispersionMCString","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
+      fhConvDispersionMCString->SetYTitle("Dispersion cluster 1");
+      fhConvDispersionMCString->SetXTitle("Dispersion cluster 2");
+      outputContainer->Add(fhConvDispersionMCString) ;       
+      
+      fhConvM02MCString  = new TH2F
+      ("hConvM02MCString","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.); 
+      fhConvM02MCString->SetYTitle("M02 cluster 1");
+      fhConvM02MCString->SetXTitle("M02 cluster 2");
+      outputContainer->Add(fhConvM02MCString) ;       
+    }
     
   }//Histos with MC
     
@@ -666,6 +692,7 @@ void AliAnaPhoton::InitParameters()
        
   fRejectTrackMatch       = kTRUE ;
   fCheckConversion        = kFALSE;
+  fRemoveConvertedPair    = kFALSE;
   fAddConvertedPairsToAOD = kFALSE;
        
 }
@@ -695,10 +722,13 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
   TLorentzVector mom, mom2 ;
   Int_t nCaloClusters = pl->GetEntriesFast();
   //List to be used in conversion analysis, to tag the cluster as candidate for conversion
-  Bool_t * indexConverted = new Bool_t[nCaloClusters];
-  for (Int_t i = 0; i < nCaloClusters; i++) 
-    indexConverted[i] = kFALSE;
-       
+  Bool_t * indexConverted = 0x0;
+  if(fCheckConversion){
+    indexConverted = new Bool_t[nCaloClusters];
+    for (Int_t i = 0; i < nCaloClusters; i++) 
+      indexConverted[i] = kFALSE;
+       }
+  
   if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
 
   //----------------------------------------------------
@@ -749,8 +779,8 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
  
     //.......................................
     //If too small or big pt, skip it
-    if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ; 
-    if(GetDebug() > 2) printf("\t Cluster %d Pass Pt Cut \n",icalo);
+    if(mom.E() < GetMinPt() || mom.E() > GetMaxPt() ) continue ; 
+    if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",icalo);
     
     //.......................................
     // TOF cut, BE CAREFUL WITH THIS CUT
@@ -870,7 +900,8 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     //Check origin of the candidates
     if(IsDataMC()){
       aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), aodph.GetInputFileIndex()));
-      if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
+      if(GetDebug() > 0)
+        printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
     }//Work with stack also   
     
     //--------------------------------------------------------------------------------------
@@ -880,12 +911,12 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     //--------------------------------------------------------------------------------------
 
     // Do analysis only if there are more than one cluster
-    if( nCaloClusters > 1){
+    if( nCaloClusters > 1 && fCheckConversion){
       Bool_t bConverted = kFALSE;
       Int_t id2 = -1;
                  
       //Check if set previously as converted couple, if so skip its use.
-      if (fCheckConversion && indexConverted[icalo]) continue;
+      if (indexConverted[icalo]) continue;
                  
       // Second cluster loop
       for(Int_t jcalo = icalo + 1 ; jcalo < nCaloClusters ; jcalo++) {
@@ -916,33 +947,43 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
         
         //................................................
         //Get mass of pair, if small, take this pair.
-        //printf("\t both in calo, mass %f, cut %f\n",(mom+mom2).M(),fMassCut);
-        if((mom+mom2).M() < fMassCut){  
-          
+        Float_t pairM     = (mom+mom2).M();
+        //printf("\t both in calo, mass %f, cut %f\n",pairM,fMassCut);
+        if(pairM < fMassCut){  
+          aodph.SetTagged(kFALSE);
           id2 = calo2->GetID();
           indexConverted[icalo]=kTRUE;
           indexConverted[jcalo]=kTRUE;
           
+          Float_t asymmetry = TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E());
+          Float_t dPhi      = mom.Phi()-mom2.Phi();
+          Float_t dEta      = mom.Eta()-mom2.Eta();          
+          
           if(GetDebug() > 2)
-            printf("AliAnaPhoton::MakeAnalysisFillAOD(): Pair with mass %f < %2.4f; \n    cluster1 id %d, e %2.3f  SM %d, eta %2.3f, phi %2.3f ; \n    cluster2 id %d, e %2.3f, SM %d,eta %2.3f, phi %2.3f\n",
-                   (mom+mom2).M(),fMassCut,
+            printf("AliAnaPhoton::MakeAnalysisFillAOD(): Pair with mass %2.3f < %2.3f, %1.2f < dPhi %2.2f < %2.2f, dEta %f < %2.2f, asymmetry %2.2f< %2.2f; \n    cluster1 id %d, e %2.3f  SM %d, eta %2.3f, phi %2.3f ; \n    cluster2 id %d, e %2.3f, SM %d,eta %2.3f, phi %2.3f\n",
+                   pairM,fMassCut,fConvDPhiMinCut, dPhi, fConvDPhiMaxCut, dEta, fConvDEtaCut, asymmetry, fConvAsymCut,
                    calo->GetID(),calo->E(),GetCaloUtils()->GetModuleNumber(calo), mom.Eta(), mom.Phi(),
                    id2, calo2->E(), GetCaloUtils()->GetModuleNumber(calo2),mom2.Eta(), mom2.Phi());
           
           //...............................................
           //Fill few histograms with kinematics of the pair
           //FIXME, move all this to MakeAnalysisFillHistograms ...
-          fhConvDeltaEta   ->Fill( (mom+mom2).M(), mom.Eta()-mom2.Eta() );
-          fhConvDeltaPhi   ->Fill( (mom+mom2).M(), mom.Phi()-mom2.Phi() );
-          fhConvAsym       ->Fill( (mom+mom2).M(), TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
-          fhConvDeltaEtaPhi->Fill( mom.Eta()-mom2.Eta(), mom.Phi()-mom2.Phi() );
-          fhConvPt         ->Fill( (mom+mom2).M(), (mom+mom2).Pt());
+
+          fhConvDeltaEta   ->Fill( pairM, dPhi      );
+          fhConvDeltaPhi   ->Fill( pairM, dEta      );
+          fhConvAsym       ->Fill( pairM, asymmetry );
+          fhConvDeltaEtaPhi->Fill( dEta , dPhi      );
+          fhConvPt         ->Fill( pairM, (mom+mom2).Pt());
           
           //...............................................
           //Select pairs in a eta-phi window
-          if(TMath::Abs(mom.Eta()-mom2.Eta()) < fConvDEtaCut && TMath::Abs(mom.Phi()-mom2.Phi()) < fConvDPhiCut )
-            bConverted = kTRUE;          
-          
+          if(TMath::Abs(dEta) < fConvDEtaCut    && 
+             TMath::Abs(dPhi) < fConvDPhiMaxCut &&
+             TMath::Abs(dPhi) > fConvDPhiMinCut && 
+             asymmetry        < fConvAsymCut       ){
+              bConverted = kTRUE;          
+          }
+          //printf("Accepted? %d\n",bConverted);
           //...........................................
           //Fill more histograms, simulated data
           //FIXME, move all this to MakeAnalysisFillHistograms ...
@@ -961,11 +1002,11 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
             Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(calo2->GetLabels(),calo2->GetNLabels(),GetReader(), 0);
             if(GetMCAnalysisUtils()->CheckTagBit(aodph.GetTag(),AliMCAnalysisUtils::kMCConversion)){
               if(GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCConversion) && (ancPDG==22 || TMath::Abs(ancPDG)==11) && ancLabel > -1){
-                fhConvDeltaEtaMCConversion   ->Fill( (mom+mom2).M(), mom.Eta()-mom2.Eta());
-                fhConvDeltaPhiMCConversion   ->Fill( (mom+mom2).M(), mom.Phi()-mom2.Phi());
-                fhConvAsymMCConversion       ->Fill( (mom+mom2).M(), TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
-                fhConvDeltaEtaPhiMCConversion->Fill( mom.Eta()-mom2.Eta(), mom.Phi()-mom2.Phi() );
-                fhConvPtMCConversion         ->Fill( (mom+mom2).M(), (mom+mom2).Pt());
+                fhConvDeltaEtaMCConversion   ->Fill( pairM, dEta      );
+                fhConvDeltaPhiMCConversion   ->Fill( pairM, dPhi      );
+                fhConvAsymMCConversion       ->Fill( pairM, asymmetry );
+                fhConvDeltaEtaPhiMCConversion->Fill( dEta , dPhi      );
+                fhConvPtMCConversion         ->Fill( pairM, (mom+mom2).Pt());
                 fhConvDispersionMCConversion ->Fill( calo->GetDispersion(), calo2->GetDispersion());
                 fhConvM02MCConversion        ->Fill( calo->GetM02(), calo2->GetM02());
 
@@ -973,22 +1014,22 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
             }
             else if(GetMCAnalysisUtils()->CheckTagBit(aodph.GetTag(),AliMCAnalysisUtils::kMCAntiNeutron)){
               if(GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCAntiNeutron) && ancPDG==-2112 && ancLabel > -1){
-                fhConvDeltaEtaMCAntiNeutron    ->Fill( (mom+mom2).M(), mom.Eta()-mom2.Eta());
-                fhConvDeltaPhiMCAntiNeutron    ->Fill( (mom+mom2).M(), mom.Phi()-mom2.Phi());
-                fhConvAsymMCAntiNeutron        ->Fill( (mom+mom2).M(), TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
-                fhConvDeltaEtaPhiMCAntiNeutron ->Fill( mom.Eta()-mom2.Eta(), mom.Phi()-mom2.Phi() );
-                fhConvPtMCAntiNeutron          ->Fill( (mom+mom2).M(), (mom+mom2).Pt());
+                fhConvDeltaEtaMCAntiNeutron    ->Fill( pairM, dEta      );
+                fhConvDeltaPhiMCAntiNeutron    ->Fill( pairM, dPhi      );
+                fhConvAsymMCAntiNeutron        ->Fill( pairM, asymmetry );
+                fhConvDeltaEtaPhiMCAntiNeutron ->Fill( dEta , dPhi      );
+                fhConvPtMCAntiNeutron          ->Fill( pairM, (mom+mom2).Pt());
                 fhConvDispersionMCAntiNeutron  ->Fill( calo->GetDispersion(), calo2->GetDispersion());
                 fhConvM02MCAntiNeutron         ->Fill( calo->GetM02(), calo2->GetM02());
               }
             }
             else if(GetMCAnalysisUtils()->CheckTagBit(aodph.GetTag(),AliMCAnalysisUtils::kMCAntiProton)){
               if(GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCAntiProton) && ancPDG==-2212 && ancLabel > -1){
-                fhConvDeltaEtaMCAntiProton    ->Fill( (mom+mom2).M(), mom.Eta()-mom2.Eta());
-                fhConvDeltaPhiMCAntiProton    ->Fill( (mom+mom2).M(), mom.Phi()-mom2.Phi());
-                fhConvAsymMCAntiProton        ->Fill( (mom+mom2).M(), TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
-                fhConvDeltaEtaPhiMCAntiProton ->Fill( mom.Eta()-mom2.Eta(), mom.Phi()-mom2.Phi() );
-                fhConvPtMCAntiProton          ->Fill( (mom+mom2).M(), (mom+mom2).Pt());
+                fhConvDeltaEtaMCAntiProton    ->Fill( pairM, dEta      );
+                fhConvDeltaPhiMCAntiProton    ->Fill( pairM, dPhi      );
+                fhConvAsymMCAntiProton        ->Fill( pairM, asymmetry );
+                fhConvDeltaEtaPhiMCAntiProton ->Fill( dEta , dPhi      );
+                fhConvPtMCAntiProton          ->Fill( pairM, (mom+mom2).Pt());
                 fhConvDispersionMCAntiProton  ->Fill( calo->GetDispersion(), calo2->GetDispersion());
                 fhConvM02MCAntiProton         ->Fill( calo->GetM02(), calo2->GetM02());
               }
@@ -996,11 +1037,11 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
             
             //Pairs coming from fragmenting pairs.
             if(ancPDG < 22 && ancLabel > 7 && (ancStatus == 11 || ancStatus == 12) ){
-              fhConvDeltaEtaMCString    ->Fill( (mom+mom2).M(), mom.Eta()-mom2.Eta());
-              fhConvDeltaPhiMCString    ->Fill( (mom+mom2).M(), mom.Phi()-mom2.Phi());
-              fhConvAsymMCString        ->Fill( (mom+mom2).M(), TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
-              fhConvDeltaEtaPhiMCString ->Fill( mom.Eta()-mom2.Eta(), mom.Phi()-mom2.Phi() );
-              fhConvPtMCString          ->Fill( (mom+mom2).M(), (mom+mom2).Pt());
+              fhConvDeltaEtaMCString    ->Fill( pairM, dPhi);
+              fhConvDeltaPhiMCString    ->Fill( pairM, dPhi);
+              fhConvAsymMCString        ->Fill( pairM, TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
+              fhConvDeltaEtaPhiMCString ->Fill( dPhi, dPhi );
+              fhConvPtMCString          ->Fill( pairM, (mom+mom2).Pt());
               fhConvDispersionMCString  ->Fill( calo->GetDispersion(), calo2->GetDispersion());
               fhConvM02MCString         ->Fill( calo->GetM02(), calo2->GetM02());
             }
@@ -1036,7 +1077,7 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
         }
         
         //Do not add the current calocluster
-        if(fCheckConversion) continue;
+        if(fRemoveConvertedPair) continue;
         else {
           //printf("TAGGED\n");
           //Tag this cluster as likely conversion
@@ -1133,25 +1174,25 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
          Float_t etacluster = ph->Eta();
          Float_t ecluster   = ph->E();
          
+    fhEPhoton   ->Fill(ecluster);
          fhPtPhoton  ->Fill(ptcluster);
-    if(ph->IsTagged())fhPtPhotonConv->Fill(ptcluster);
          fhPhiPhoton ->Fill(ptcluster,phicluster);
-         fhEtaPhoton ->Fill(ptcluster,etacluster);
-    if(ptcluster > 0.5){
-      fhEtaPhiPhoton ->Fill(etacluster, phicluster);
-      if(ph->IsTagged())fhEtaPhiPhotonConv->Fill(etacluster, phicluster);
+         fhEtaPhoton ->Fill(ptcluster,etacluster);    
+    if(ecluster > 0.5)         fhEtaPhiPhoton ->Fill(etacluster, phicluster);
+    else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
+    
+    if(fCheckConversion &&ph->IsTagged()){
+      fhPtPhotonConv->Fill(ptcluster);
+      if(ecluster > 0.5)        fhEtaPhiPhotonConv  ->Fill(etacluster, phicluster);
+      else if(GetMinPt() < 0.5) fhEtaPhi05PhotonConv->Fill(etacluster, phicluster);
     }
-    else {
-      fhEtaPhi05Photon ->Fill(etacluster, phicluster);
-      if(ph->IsTagged())fhEtaPhi05PhotonConv->Fill(etacluster, phicluster);
-    }
-
+    
     //.......................................
          //Play with the MC data if available
          if(IsDataMC()){
            
            Int_t tag =ph->GetTag();
-           
+
            if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
       {
         fhPtMCPhoton  ->Fill(ptcluster);
@@ -1203,17 +1244,23 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
         fhPtAntiNeutron  ->Fill(ptcluster);
         fhPhiAntiNeutron ->Fill(ptcluster,phicluster);
         fhEtaAntiNeutron ->Fill(ptcluster,etacluster);
+        if(ph->IsTagged() && fCheckConversion) fhPtAntiNeutronTagged ->Fill(ptcluster);
+
       }
       else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton))
       {
         fhPtAntiProton  ->Fill(ptcluster);
         fhPhiAntiProton ->Fill(ptcluster,phicluster);
         fhEtaAntiProton ->Fill(ptcluster,etacluster);
+        if(ph->IsTagged() && fCheckConversion) fhPtAntiProtonTagged ->Fill(ptcluster);
+
       }      
            else{
              fhPtUnknown  ->Fill(ptcluster);
              fhPhiUnknown ->Fill(ptcluster,phicluster);
              fhEtaUnknown ->Fill(ptcluster,etacluster);
+        if(ph->IsTagged() && fCheckConversion) fhPtUnknownTagged ->Fill(ptcluster);
+
              
         //              printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
         //                                     ph->GetLabel(),ph->Pt());
@@ -1318,6 +1365,8 @@ void AliAnaPhoton::Print(const Option_t * opt) const
   printf("Check Pair Conversion                = %d\n",fCheckConversion);
   printf("Add conversion pair to AOD           = %d\n",fAddConvertedPairsToAOD);
   printf("Conversion pair mass cut             = %f\n",fMassCut);
+  printf("Conversion selection cut : A < %1.2f; %1.3f < Dphi < %1.3f; Deta < %1.3f\n",
+         fConvAsymCut,fConvDPhiMinCut, fConvDPhiMaxCut, fConvDEtaCut);
   printf("Time Cut: %3.1f < TOF  < %3.1f\n", fTimeCutMin, fTimeCutMax);
   printf("Number of cells in cluster is        > %d \n", fNCellsCut);
   printf("    \n") ;