]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adapt to updates in AliEMCALRecoUtils
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 May 2011 17:46:48 +0000 (17:46 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 May 2011 17:46:48 +0000 (17:46 +0000)
PWG4/CaloCalib/AliAnalysisTaskCaloFilter.cxx
PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.cxx
PWG4/PartCorrBase/AliCaloTrackReader.cxx
PWG4/PartCorrBase/AliCaloTrackReader.h
PWG4/PartCorrBase/AliCalorimeterUtils.cxx
PWG4/PartCorrBase/AliCalorimeterUtils.h
PWG4/PartCorrDep/AliAnaPi0.cxx
PWG4/PartCorrDep/AliAnaPi0.h

index 3edb199e7f3858582350d45dd6efe9d6df3d4a64..fbccca26623392914c68df15443fb676daeeba75 100644 (file)
@@ -394,7 +394,7 @@ void AliAnalysisTaskCaloFilter::UserExec(Option_t */*option*/)
       
     }
     //Recalculate track-matching
-    fEMCALRecoUtils->FindMatches(event);
+    fEMCALRecoUtils->FindMatches(event,0,fEMCALGeo);
     
   } // corrections in EMCAL
   
@@ -423,11 +423,14 @@ void AliAnalysisTaskCaloFilter::UserExec(Option_t */*option*/)
       if(DebugLevel() > 2)
         printf("Check cluster %d for bad channels and close to border\n",cluster->GetID());
       if(fEMCALRecoUtils->ClusterContainsBadChannel(fEMCALGeo,cluster->GetCellsAbsId(), cluster->GetNCells())) continue;       
+      
       //      if(!fEMCALRecoUtils->CheckCellFiducialRegion(fEMCALGeo, cluster, event->GetEMCALCells())) {
       //        printf("Finally reject\n");
       //        continue;
       //      }
-      
+
+      if(fEMCALRecoUtils->IsRejectExoticCluster() && fEMCALRecoUtils->IsExoticCluster(cluster)) continue;      
+
       fEMCALRecoUtils->GetMatchedResiduals(cluster->GetID(),dR,dZ);
       cluster->SetTrackDistance(dR,dZ);
     }
index 4aed964dfe3cc28eb0e156ca0711b7f86ff2621d..8908bc0f77f38d630bed7b0d943fa1651d46ff70 100644 (file)
@@ -623,7 +623,7 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
   }
   
   //Recalculate track-matching for the new clusters, only with ESDs
-  if(esdevent)fRecoUtils->FindMatches(esdevent,fCaloClusterArr);
+  fRecoUtils->FindMatches(esdevent,fCaloClusterArr,fGeom);
 
   
   //-------------------------------------------------------------------------------------
index 4a8429288f2f39b1e2c716af140de2309d987f2a..2fc846b452793165e9366ea96c939168f043bd5d 100755 (executable)
@@ -65,7 +65,8 @@ ClassImp(AliCaloTrackReader)
     fInputEvent(0x0), fOutputEvent(0x0),fMC(0x0),
     fFillCTS(0),fFillEMCAL(0),fFillPHOS(0),
     fFillEMCALCells(0),fFillPHOSCells(0),  fSelectEmbeddedClusters(kFALSE),
-    fRemoveSuspiciousClusters(kFALSE), fSmearClusterEnergy(kFALSE), fRandom(),
+//    fRemoveSuspiciousClusters(kFALSE), 
+    fSmearClusterEnergy(kFALSE), fRandom(),
 //    fSecondInputAODTree(0x0), fSecondInputAODEvent(0x0),
 //    fSecondInputFileName(""),fSecondInputFirstEvent(0), 
 //    fCTSTracksNormalInputEntries(0), fEMCALClustersNormalInputEntries(0), 
@@ -787,25 +788,28 @@ void AliCaloTrackReader::FillInputEMCALAlgorithm(AliVCluster * clus, const Int_t
   if (fMixedEvent) 
     vindex = fMixedEvent->EventIndexForCaloCluster(iclus);
   
-  //Check if the cluster contains any bad channel and if close to calorimeter borders
-  if(GetCaloUtils()->ClusterContainsBadChannel("EMCAL",clus->GetCellsAbsId(), clus->GetNCells())) 
-    return;
-  if(!GetCaloUtils()->CheckCellFiducialRegion(clus, (AliVCaloCells*)fInputEvent->GetEMCALCells(), fInputEvent, vindex)) 
-    return;
   
-  //Remove suspicious clusters
-  if(fRemoveSuspiciousClusters){
-    Int_t ncells      = clus->GetNCells();
-    Float_t energy    = clus->E();
-    Float_t minNCells = 1+energy/3;//-x*x*0.0033
-    if(ncells < minNCells) {
-      //if(energy > 2)printf("AliCaloTrackReader::FillInputEMCALAlgorithm() - Remove cluster: e %2.2f, Ncells %d, min Ncells %2.1f\n",energy,ncells,minNCells);
-      return;
-    }
-//    else {
-//      if(energy > 2)printf("AliCaloTrackReader::FillInputEMCALAlgorithm() - Keep cluster: e %2.2f, Ncells %d, min Ncells %2.1f\n",energy,ncells,minNCells);
+  //Reject clusters with bad channels, close to borders and exotic;
+  if(!GetCaloUtils()->GetEMCALRecoUtils()->IsGoodCluster(clus,GetCaloUtils()->GetEMCALGeometry(),GetEMCALCells())) return;
+//  //Check if the cluster contains any bad channel and if close to calorimeter borders
+//  if(GetCaloUtils()->ClusterContainsBadChannel("EMCAL",clus->GetCellsAbsId(), clus->GetNCells())) 
+//    return;
+//  if(!GetCaloUtils()->CheckCellFiducialRegion(clus, (AliVCaloCells*)fInputEvent->GetEMCALCells(), fInputEvent, vindex)) 
+//    return;
+//  
+//  //Remove suspicious clusters
+//  if(fRemoveSuspiciousClusters){
+//    Int_t ncells      = clus->GetNCells();
+//    Float_t energy    = clus->E();
+//    Float_t minNCells = 1+energy/3;//-x*x*0.0033
+//    if(ncells < minNCells) {
+//      //if(energy > 2)printf("AliCaloTrackReader::FillInputEMCALAlgorithm() - Remove cluster: e %2.2f, Ncells %d, min Ncells %2.1f\n",energy,ncells,minNCells);
+//      return;
 //    }
-  }//Suspicious
+////    else {
+////      if(energy > 2)printf("AliCaloTrackReader::FillInputEMCALAlgorithm() - Keep cluster: e %2.2f, Ncells %d, min Ncells %2.1f\n",energy,ncells,minNCells);
+////    }
+//  }//Suspicious
   
   if(fSelectEmbeddedClusters){
     if(clus->GetNLabels()==0 || clus->GetLabel() < 0) return;
@@ -890,7 +894,7 @@ void AliCaloTrackReader::FillInputEMCAL() {
     }// cluster loop
     
     //Recalculate track matching
-    if(fDataType==kESD)GetCaloUtils()->RecalculateClusterTrackMatching(fInputEvent);
+    GetCaloUtils()->RecalculateClusterTrackMatching(fInputEvent);
     
   }//Get the clusters from the input event
   else {
index f026af9e4d03f1d6d6c93dc4e90538c8f6ed21b3..64c69e71f921280b31811e0d26d4d6f9cf988de3 100755 (executable)
@@ -267,9 +267,9 @@ public:
   AliCalorimeterUtils * GetCaloUtils()            const { return fCaloUtils                       ; }
   void   SetCaloUtils(AliCalorimeterUtils * caloutils)  { fCaloUtils = caloutils                  ; }  
   
-  void   SwitchOnSuspiciousClustersRemoval()            { fRemoveSuspiciousClusters = kTRUE       ; }
-  void   SwitchOffSuspiciousClustersRemoval()           { fRemoveSuspiciousClusters = kFALSE      ; }
-  Bool_t IsSuspiciousClustersRemovalOn()          const { return fRemoveSuspiciousClusters        ; } 
+  void   SwitchOnSuspiciousClustersRemoval()            { GetCaloUtils()->GetEMCALRecoUtils()->SwitchOnRejectExoticCluster() ; }//fRemoveSuspiciousClusters = kTRUE       ; }
+  void   SwitchOffSuspiciousClustersRemoval()           { GetCaloUtils()->GetEMCALRecoUtils()->SwitchOffRejectExoticCluster(); }//fRemoveSuspiciousClusters = kFALSE      ; }
+  Bool_t IsSuspiciousClustersRemovalOn()          const { return GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster(); }//fRemoveSuspiciousClusters        ; } 
   
   //Use only for MC
   void    SwitchOnClusterEnergySmearing()               { fSmearClusterEnergy = kTRUE             ; }
@@ -367,7 +367,7 @@ public:
   Bool_t           fFillEMCALCells; // use data from EMCAL
   Bool_t           fFillPHOSCells;  // use data from PHOS
   Bool_t           fSelectEmbeddedClusters;   // Use only simulated clusters that come from embedding.
-  Bool_t           fRemoveSuspiciousClusters; // Remove high energy clusters with low number of cells
+  //Bool_t           fRemoveSuspiciousClusters; // Remove high energy clusters with low number of cells
   Bool_t           fSmearClusterEnergy;       // Smear cluster energy, to be done only for simulated data to match real data
   Float_t          fSmearClusterParam[3];     // Smearing parameters
   TRandom3         fRandom;                   // Random generator
@@ -420,7 +420,7 @@ public:
   Int_t            fCentralityOpt;       // Option for the returned value of the centrality, possible options 5, 10, 100
   Int_t            fCentralityBin[2];    // Minimum and maximum value of the centrality for the analysis
   
-  ClassDef(AliCaloTrackReader,29)
+  ClassDef(AliCaloTrackReader,30)
 } ;
 
 
index 960f38f470169c9a08b7620b0f91dac5e3449999..b03ac2ebf2e8c1fb9419f6624332782410b3d8af 100755 (executable)
@@ -483,7 +483,7 @@ void AliCalorimeterUtils::InitEMCALGeometry()
 {
        //Initialize EMCAL geometry if it did not exist previously
        if (!fEMCALGeo){
-               fEMCALGeo = new AliEMCALGeoUtils(fEMCALGeoName);
+               fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName);
                if(fDebug > 0){
                        printf("AliCalorimeterUtils::InitEMCALGeometry()");
                        if (!gGeoManager) printf(" - Careful!, gGeoManager not loaded, load misalign matrices");
index f22cfabb62ee64069a827d5d53a498656b86ed35..49b19d4721a2ca182fb4fa080f1511cf0f54d6ee 100755 (executable)
@@ -48,7 +48,7 @@ class AliCalorimeterUtils : public TObject {
   //virtual void Init();
        
   //Calorimeters Geometry Methods
-  AliEMCALGeoUtils * GetEMCALGeometry() const { return fEMCALGeo;}
+  AliEMCALGeometry * GetEMCALGeometry() const { return fEMCALGeo;}
   TString  EMCALGeometryName()          const { return fEMCALGeoName ; }  
   void  SetEMCALGeometryName(TString name)    { fEMCALGeoName = name ; }
   void InitEMCALGeometry() ; 
@@ -177,12 +177,12 @@ class AliCalorimeterUtils : public TObject {
   void RecalculateClusterPID(AliVCluster* clu) {fEMCALRecoUtils->RecalculateClusterPID(clu);}
 
   //Track matching recalculation
-  void RecalculateClusterTrackMatching(AliVEvent * event)         {if (fRecalculateMatching) fEMCALRecoUtils->FindMatches(event);}
+  void RecalculateClusterTrackMatching(AliVEvent * event)         {if (fRecalculateMatching) fEMCALRecoUtils->FindMatches(event,0,fEMCALGeo);}
   void GetMatchedResiduals(Int_t index, Float_t &dR, Float_t &dZ) {if (fRecalculateMatching) fEMCALRecoUtils->GetMatchedResiduals(index,dR,dZ);}
   //This could be used for PHOS ...
-  void SwitchOnRecalculateClusterTrackMatching()      { fRecalculateMatching = kTRUE; } 
-  void SwitchOffRecalculateClusterTrackMatching()     { fRecalculateMatching = kFALSE; } 
-  Bool_t IsRecalculationOfClusterTrackMatchingOn()  const { return fRecalculateMatching ; }
+  void SwitchOnRecalculateClusterTrackMatching()          { fRecalculateMatching = kTRUE ; } 
+  void SwitchOffRecalculateClusterTrackMatching()         { fRecalculateMatching = kFALSE; } 
+  Bool_t IsRecalculationOfClusterTrackMatchingOn()  const { return fRecalculateMatching  ; }
   Float_t GetCutR() const { return fCutR; }
   Float_t GetCutZ() const { return fCutZ; }
   
@@ -194,7 +194,7 @@ class AliCalorimeterUtils : public TObject {
   Int_t              fDebug;                 //  Debugging level
   TString            fEMCALGeoName;          //  Name of geometry to use for EMCAL.
   TString            fPHOSGeoName;           //  Name of geometry to use for PHOS.     
-  AliEMCALGeoUtils * fEMCALGeo ;             //! EMCAL geometry pointer
+  AliEMCALGeometry * fEMCALGeo ;             //! EMCAL geometry pointer
   AliPHOSGeoUtils  * fPHOSGeo  ;             //! PHOS  geometry pointer  
   Bool_t             fEMCALGeoMatrixSet;     //  Check if the transformation matrix is set for EMCAL
   Bool_t             fPHOSGeoMatrixSet ;     //  Check if the transformation matrix is set for PHOS
index 8c0de9e78787e271e94554c542d67963237eebcb..cfe9e3dd2a44e5ed158d3c464fee446cfc8fc695 100755 (executable)
@@ -85,7 +85,7 @@ fhPrimEtaPt(0x0), fhPrimEtaAccPt(0x0), fhPrimEtaY(0x0), fhPrimEtaAccY(0x0), fhPr
 fhPrimPi0PtOrigin(0x0),  fhPrimEtaPtOrigin(0x0), 
 fhMCOrgMass(),fhMCOrgAsym(),  fhMCOrgDeltaEta(),fhMCOrgDeltaPhi(),
 fhMCPi0MassPtRec(), fhMCPi0MassPtTrue(), fhMCPi0PtTruePtRec(), fhMCEtaMassPtRec(), fhMCEtaMassPtTrue(), fhMCEtaPtTruePtRec(),
-fhMCPi0PtOrigin(0x0),  fhMCEtaPtOrigin(0x0)
+fhMCPi0PtOrigin(0x0),  fhMCEtaPtOrigin(0x0), fFirstPi0(0), fLastPi0(0)
 {
 //Default Ctor
  InitParameters();
@@ -1028,6 +1028,43 @@ void AliAnaPi0::FillAcceptanceHistograms(){
   if(GetReader()->ReadStack()){        
     AliStack * stack = GetMCStack();
     if(stack){
+      
+      //Find last/first pi0 for weigth
+      //const Double_t rcut = 1. ; //cut for primary particles
+      
+      //Look for the bunch of pi0s with at least 2 j\psi (443) after
+      fFirstPi0=0;
+      fLastPi0=0;
+    
+      Int_t pi0inBunch=-1;
+      const Int_t minNPi0InBunch=10 ;
+      for (Int_t iTracks = 0; iTracks < stack->GetNtrack(); iTracks++) {
+        TParticle* particle = (TParticle *)stack->Particle(iTracks);
+        //Look only at primary particles
+        if(particle->R()>1 || particle->GetFirstMother()!=-1)
+          continue ;
+        if(particle->GetPdgCode()==111){
+          //primary pi0
+          if(pi0inBunch==-1){ //Start new bunch
+            pi0inBunch=iTracks ;
+          }
+        }
+        else{//bunch of pi0s ended
+          if(pi0inBunch>-1){
+            if(iTracks-pi0inBunch > minNPi0InBunch){//This was our bunch
+              fFirstPi0=pi0inBunch ;
+              fLastPi0=iTracks-1 ;
+              break ;
+            }
+            else{
+              pi0inBunch=-1;
+            }
+          }
+        }
+      }
+      
+//      printf("Set Last %d - First %d \n",fLastPi0,fFirstPi0);
+
       for(Int_t i=0 ; i<stack->GetNtrack(); i++){
         TParticle * prim = stack->Particle(i) ;
         Int_t pdg = prim->GetPdgCode();
@@ -1041,10 +1078,10 @@ void AliAnaPi0::FillAcceptanceHistograms(){
           Double_t phi   = TMath::RadToDeg()*prim->Phi() ;
           if(pdg == 111){
             if(TMath::Abs(pi0Y) < 1.0){
-              fhPrimPi0Pt ->Fill(pi0Pt) ;
-              fhPrimPi0Phi->Fill(pi0Pt, phi) ;
+              fhPrimPi0Pt ->Fill(pi0Pt,WeightPi0(i)) ;
+              fhPrimPi0Phi->Fill(pi0Pt, phi,WeightPi0(i)) ;
             }
-            fhPrimPi0Y  ->Fill(pi0Pt, pi0Y) ;
+            fhPrimPi0Y  ->Fill(pi0Pt, pi0Y,WeightPi0(i)) ;
           }
           else if(pdg == 221){
             if(TMath::Abs(pi0Y) < 1.0){
@@ -1071,7 +1108,7 @@ void AliAnaPi0::FillAcceptanceHistograms(){
               else if(mompdg    >= 310   && mompdg    <= 323) fhPrimPi0PtOrigin->Fill(pi0Pt,6.5);//k0S, k+-,k*
               else if(mompdg    == 130) fhPrimPi0PtOrigin->Fill(pi0Pt,6.5);//k0L
               else if(momstatus == 11 || momstatus  == 12 ) fhPrimPi0PtOrigin->Fill(pi0Pt,3.5);//resonances   
-              else                      fhPrimPi0PtOrigin->Fill(pi0Pt,7.5);//other?
+              else                      fhPrimPi0PtOrigin->Fill(pi0Pt,7.5, WeightPi0(i));//other?
             }//pi0
             else {
               if     (momstatus == 21 ) fhPrimEtaPtOrigin->Fill(pi0Pt,0.5);//parton
@@ -1140,12 +1177,12 @@ void AliAnaPi0::FillAcceptanceHistograms(){
               
               if(inacceptance){
                 if(pdg==111){
-                  fhPrimPi0AccPt ->Fill(pi0Pt) ;
-                  fhPrimPi0AccPhi->Fill(pi0Pt, phi) ;
-                  fhPrimPi0AccY  ->Fill(pi0Pt, pi0Y) ;
+                  fhPrimPi0AccPt ->Fill(pi0Pt, WeightPi0(i)) ;
+                  fhPrimPi0AccPhi->Fill(pi0Pt, phi, WeightPi0(i)) ;
+                  fhPrimPi0AccY  ->Fill(pi0Pt, pi0Y, WeightPi0(i)) ;
                   Double_t angle  = lv1.Angle(lv2.Vect());
-                  fhPrimPi0OpeningAngle   ->Fill(pi0Pt,angle);
-                  fhPrimPi0CosOpeningAngle->Fill(pi0Pt,TMath::Cos(angle));
+                  fhPrimPi0OpeningAngle   ->Fill(pi0Pt,angle, WeightPi0(i));
+                  fhPrimPi0CosOpeningAngle->Fill(pi0Pt,TMath::Cos(angle), WeightPi0(i));
                 }
                 else if(pdg==221){
                   fhPrimEtaAccPt ->Fill(pi0Pt) ;
@@ -1164,6 +1201,44 @@ void AliAnaPi0::FillAcceptanceHistograms(){
     if(mcparticles){
       Int_t nprim = mcparticles->GetEntriesFast();
 
+      
+      //Find last/first pi0 for weigth
+      //const Double_t rcut = 1. ; //cut for primary particles
+      
+      //Look for the bunch of pi0s with at least 2 j\psi (443) after
+      fFirstPi0=0;
+      fLastPi0=0;
+      
+//      Int_t pi0inBunch=-1;
+//      const Int_t minNPi0InBunch=10 ;
+//      for (Int_t iTracks = 0; iTracks < nprim-4; iTracks++) {
+//        AliAODMCParticle* particle = (AliAODMCParticle *)mcparticles->At(iTracks);
+//        //Look only at primary particles
+//        if(TMath::Sqrt(particle->Yv()*particle->Yv()+particle->Xv()*particle->Xv())>1 || particle->GetMother()!=-1)
+//          continue ;
+//        if(particle->GetPdgCode()==111){
+//          //primary pi0
+//          if(pi0inBunch==-1){ //Start new bunch
+//            pi0inBunch=iTracks ;
+//          }
+//        }
+//        else{//bunch of pi0s ended
+//          if(pi0inBunch>-1){
+//            if(iTracks-pi0inBunch > minNPi0InBunch){//This was our bunch
+//              fFirstPi0=pi0inBunch ;
+//              fLastPi0=iTracks-1 ;
+//              break ;
+//            }
+//            else{
+//              pi0inBunch=-1;
+//            }
+//          }
+//        }
+//      }
+      
+//      printf("Set Last %d - First %d \n",fLastPi0,fFirstPi0);
+
+      
       for(Int_t i=0; i < nprim; i++)
       {
         AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);   
@@ -1181,10 +1256,10 @@ void AliAnaPi0::FillAcceptanceHistograms(){
           Double_t phi   = TMath::RadToDeg()*prim->Phi() ;
           if(pdg == 111){
             if(TMath::Abs(pi0Y) < 1){
-              fhPrimPi0Pt->Fill(pi0Pt) ;            
-              fhPrimPi0Phi->Fill(pi0Pt, phi) ;
+              fhPrimPi0Pt->Fill(pi0Pt, WeightPi0(i)) ;            
+              fhPrimPi0Phi->Fill(pi0Pt, phi, WeightPi0(i)) ;
             }
-            fhPrimPi0Y  ->Fill(pi0Pt, pi0Y) ;
+            fhPrimPi0Y  ->Fill(pi0Pt, pi0Y, WeightPi0(i)) ;
           }
           else if(pdg == 221){
             if(TMath::Abs(pi0Y) < 1){
@@ -1211,7 +1286,7 @@ void AliAnaPi0::FillAcceptanceHistograms(){
               else if(mompdg    >= 310   && mompdg    <= 323) fhPrimPi0PtOrigin->Fill(pi0Pt,6.5);//k0S, k+-,k*
               else if(mompdg    == 130) fhPrimPi0PtOrigin->Fill(pi0Pt,6.5);//k0L
               else if(momstatus == 11 || momstatus  == 12 ) fhPrimPi0PtOrigin->Fill(pi0Pt,3.5);//resonances   
-              else                      fhPrimPi0PtOrigin->Fill(pi0Pt,7.5);//other?
+              else                      fhPrimPi0PtOrigin->Fill(pi0Pt,7.5, WeightPi0(i));//other?
             }//pi0
             else {
               if     (momstatus == 21 ) fhPrimEtaPtOrigin->Fill(pi0Pt,0.5);//parton
@@ -1299,12 +1374,12 @@ void AliAnaPi0::FillAcceptanceHistograms(){
               if(inacceptance){
                 if(pdg==111){
   //                printf("ACCEPTED pi0: pt %2.2f, phi %3.2f, eta %1.2f\n",pi0Pt,phi,pi0Y);
-                  fhPrimPi0AccPt ->Fill(pi0Pt) ;
-                  fhPrimPi0AccPhi->Fill(pi0Pt, phi) ;
-                  fhPrimPi0AccY  ->Fill(pi0Pt, pi0Y) ;
+                  fhPrimPi0AccPt ->Fill(pi0Pt, WeightPi0(i)) ;
+                  fhPrimPi0AccPhi->Fill(pi0Pt, phi, WeightPi0(i)) ;
+                  fhPrimPi0AccY  ->Fill(pi0Pt, pi0Y, WeightPi0(i)) ;
                   Double_t angle  = lv1.Angle(lv2.Vect());
-                  fhPrimPi0OpeningAngle   ->Fill(pi0Pt,angle);
-                  fhPrimPi0CosOpeningAngle->Fill(pi0Pt,TMath::Cos(angle));
+                  fhPrimPi0OpeningAngle   ->Fill(pi0Pt,angle, WeightPi0(i));
+                  fhPrimPi0CosOpeningAngle->Fill(pi0Pt,TMath::Cos(angle), WeightPi0(i));
                 }
                 else if(pdg==221){
                   fhPrimEtaAccPt ->Fill(pi0Pt) ;
@@ -1322,6 +1397,65 @@ void AliAnaPi0::FillAcceptanceHistograms(){
   }    // read AOD MC
 }
 
+//___________________________________________________________________________
+Double_t AliAnaPi0::WeightPi0(Int_t pi0Id){
+  
+ //Weight to correct for pi0
+  
+  if(pi0Id<fFirstPi0) return 1 ;
+  if(pi0Id>fLastPi0) return 1 ;
+  //This is HardPi0 generators
+  //In total there were 5 generators
+  printf("Last %d - First %d \n",fLastPi0,fFirstPi0);
+  Int_t pi0PerGenerator = (fLastPi0-fFirstPi0+1)/5 ;
+  if(pi0PerGenerator==0) return 1.;
+  Int_t nGenerator=(pi0Id-fFirstPi0+1)/pi0PerGenerator;
+  const Double_t kp0 =1.35;
+  const Double_t kxn= 6.18;
+  
+  switch(nGenerator){
+    case 0: return 1.;  //  genPi0HagPt0->SetPtRange(0., 30.) ;
+    case 1: return TMath::Power(kp0 /(kp0 + 3.), kxn);    //genPi0HagPt1->SetPtRange(3., 30.) ;
+    case 2: return TMath::Power(kp0 /(kp0 + 6.), kxn);;    //genPi0HagPt2->SetPtRange(6., 30.) ;
+    case 3: return TMath::Power(kp0 /(kp0 + 9.), kxn);;    //genPi0HagPt3->SetPtRange(9., 30.) ;
+    case 4: return TMath::Power(kp0 /(kp0 + 12.), kxn);;    //genPi0HagPt4->SetPtRange(12., 30.) ;
+    default: printf("Unknown generator %d: pi0=%d, first Pi0=%d, last pi0=%d \n",nGenerator,pi0Id,fFirstPi0,fLastPi0) ; return 1;
+  }
+}  
+
+//___________________________________________________________________________
+Int_t AliAnaPi0::GetMotherPi0Index(Int_t label){
+  
+  //Index of mother pi0, if pi0
+  
+  
+  if(GetReader()->ReadAODMCParticles()){
+    TClonesArray * mcparticles = GetReader()->GetAODMCParticles(0);
+    
+    while(label > -1){
+      AliAODMCParticle * mom = (AliAODMCParticle *) mcparticles->At(label);
+      if(mom){
+        if(mom->GetPdgCode()==111) return label;
+        else label  = mom->GetMother() ;
+      }
+    }
+  }  //AOD  
+  else { //Kine stack from ESDs 
+    AliStack * stack = GetReader()->GetStack();
+    
+    while(label > -1){
+      TParticle * mom = stack->Particle(label);        
+      if(mom){
+        if(mom->GetPdgCode()==111) return label;
+        else label  = mom->GetFirstMother() ;
+      }
+    }
+  }//Stack
+  
+  return -1;
+  
+}
+
 //_____________________________________________________________
 void AliAnaPi0::FillMCVersusRecDataHistograms(const Int_t index1,  const Int_t index2, 
                                               const Float_t pt1,   const Float_t pt2, 
@@ -1359,10 +1493,10 @@ void AliAnaPi0::FillMCVersusRecDataHistograms(const Int_t index1,  const Int_t i
         fhMCOrgDeltaPhi[1]->Fill(pt,dphi);
       }          
       else if(ancPDG==111){//Pi0
-        fhMCOrgMass[2]->Fill(pt,mass);
-        fhMCOrgAsym[2]->Fill(pt,asym);
-        fhMCOrgDeltaEta[2]->Fill(pt,deta);
-        fhMCOrgDeltaPhi[2]->Fill(pt,dphi);
+        fhMCOrgMass[2]->Fill(pt,mass, WeightPi0(momindex));
+        fhMCOrgAsym[2]->Fill(pt,asym), WeightPi0(momindex);
+        fhMCOrgDeltaEta[2]->Fill(pt,deta, WeightPi0(momindex));
+        fhMCOrgDeltaPhi[2]->Fill(pt,dphi, WeightPi0(momindex));
         if(fMultiCutAnaSim){
           for(Int_t ipt=0; ipt<fNPtCuts; ipt++){          
             for(Int_t icell=0; icell<fNCellNCuts; icell++){
@@ -1371,18 +1505,18 @@ void AliAnaPi0::FillMCVersusRecDataHistograms(const Int_t index1,  const Int_t i
                 if(pt1    >  fPtCuts[ipt]      && pt2    >  fPtCuts[ipt]        && 
                    asym   <  fAsymCuts[iasym]                                   && 
                    ncell1 >= fCellNCuts[icell] && ncell2 >= fCellNCuts[icell]){ 
-                  fhMCPi0MassPtRec [index]->Fill(pt,mass);
-                  fhMCPi0MassPtTrue[index]->Fill(ancMomentum.Pt(),mass);
-                  if(mass < 0.17 && mass > 0.1) fhMCPi0PtTruePtRec[index]->Fill(ancMomentum.Pt(),pt);
+                  fhMCPi0MassPtRec [index]->Fill(pt,mass, WeightPi0(momindex));
+                  fhMCPi0MassPtTrue[index]->Fill(ancMomentum.Pt(),mass, WeightPi0(momindex));
+                  if(mass < 0.17 && mass > 0.1) fhMCPi0PtTruePtRec[index]->Fill(ancMomentum.Pt(),pt, WeightPi0(momindex));
                 }//pass the different cuts
               }// pid bit cut loop
             }// icell loop
           }// pt cut loop
         }//Multi cut ana sim
         else {
-          fhMCPi0MassPtTrue[0]->Fill(ancMomentum.Pt(),mass);
+          fhMCPi0MassPtTrue[0]->Fill(ancMomentum.Pt(),mass, WeightPi0(momindex));
           if(mass < 0.17 && mass > 0.1) {
-            fhMCPi0PtTruePtRec[0]->Fill(ancMomentum.Pt(),pt); 
+            fhMCPi0PtTruePtRec[0]->Fill(ancMomentum.Pt(),pt, WeightPi0(momindex)); 
    
             if(GetReader()->ReadStack()){      
               TParticle* ancestor = GetMCStack()->Particle(ancLabel);
@@ -1412,7 +1546,7 @@ void AliAnaPi0::FillMCVersusRecDataHistograms(const Int_t index1,  const Int_t i
             else if(mompdg    >= 310   && mompdg    <= 323) fhMCPi0PtOrigin->Fill(pt,6.5);//k0S, k+-,k*
             else if(mompdg    == 130) fhMCPi0PtOrigin->Fill(pt,6.5);//k0L
             else if(momstatus == 11 || momstatus  == 12 ) fhMCPi0PtOrigin->Fill(pt,3.5);//resonances   
-            else                      fhMCPi0PtOrigin->Fill(pt,7.5);//other?
+            else                      fhMCPi0PtOrigin->Fill(pt,7.5, WeightPi0(momindex));//other?
             
           }//pi0 mass region
           
@@ -1802,6 +1936,10 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
     //Get (Super)Module number of this cluster
     module1 = GetModuleNumber(p1);
     
+    Int_t label1 = GetMotherPi0Index(p1->GetLabel());
+    Double_t weight1 = WeightPi0(label1);
+    p1->SetFiducialArea(weight1*10000);
+    
     //---------------------------------
     //Second loop on photons/clusters
     //---------------------------------
@@ -1836,6 +1974,17 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
       if(GetDebug() > 2)
         printf(" E: photon1 %f, photon2 %f; Pair: pT %f, mass %f, a %f\n", p1->E(), p2->E(), (photon1 + photon2).E(),m,a);
       
+      
+      Int_t label2 = GetMotherPi0Index(p2->GetLabel());
+      Double_t weight2 = WeightPi0(label2);
+      p2->SetFiducialArea(weight2*10000);
+      Double_t weight=1.;
+      if(label1!=label2) weight=weight1*weight2;
+      else               weight=weight1;
+       
+      if(weight!=1)
+        printf("Weight: l1 %d, w1 %f, l2 %d, w2 %f, W %f\n",label1,weight1,label2,weight2,weight);
+      
       //--------------------------------
       // Opening angle selection
       //--------------------------------
@@ -1858,7 +2007,7 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
       //-------------------------------------------------------------------------------------------------
       if(a < fAsymCuts[0] && fFillSMCombinations){
         if(module1==module2 && module1 >=0 && module1<fNModules)
-          fhReMod[module1]->Fill(pt,m) ;
+          fhReMod[module1]->Fill(pt,m,weight) ;
 
         if(fCalorimeter=="EMCAL"){
           
@@ -1866,18 +2015,18 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
           Int_t j=0;
           for(Int_t i = 0; i < fNModules/2; i++){
             j=2*i;
-            if((module1==j && module2==j+1) || (module1==j+1 && module2==j)) fhReSameSectorEMCALMod[i]->Fill(pt,m) ;
+            if((module1==j && module2==j+1) || (module1==j+1 && module2==j)) fhReSameSectorEMCALMod[i]->Fill(pt,m,weight) ;
           }
           
           // Same side
           for(Int_t i = 0; i < fNModules-2; i++){
-            if((module1==i && module2==i+2) || (module1==i+2 && module2==i)) fhReSameSideEMCALMod[i]->Fill(pt,m); 
+            if((module1==i && module2==i+2) || (module1==i+2 && module2==i)) fhReSameSideEMCALMod[i]->Fill(pt,m,weight); 
           }
         }//EMCAL
         else {//PHOS
-          if((module1==0 && module2==1) || (module1==1 && module2==0)) fhReDiffPHOSMod[0]->Fill(pt,m) ; 
-          if((module1==0 && module2==2) || (module1==2 && module2==0)) fhReDiffPHOSMod[1]->Fill(pt,m) ; 
-          if((module1==1 && module2==2) || (module1==2 && module2==1)) fhReDiffPHOSMod[2]->Fill(pt,m) ;
+          if((module1==0 && module2==1) || (module1==1 && module2==0)) fhReDiffPHOSMod[0]->Fill(pt,m,weight) ; 
+          if((module1==0 && module2==2) || (module1==2 && module2==0)) fhReDiffPHOSMod[1]->Fill(pt,m,weight) ; 
+          if((module1==1 && module2==2) || (module1==2 && module2==1)) fhReDiffPHOSMod[2]->Fill(pt,m,weight) ;
         }//PHOS
       }
       
@@ -1887,8 +2036,8 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
       if(ok){
         
         //Check if one of the clusters comes from a conversion 
-        if     (p1->IsTagged() && p2->IsTagged()) fhReConv2->Fill(pt,m);
-        else if(p1->IsTagged() || p2->IsTagged()) fhReConv ->Fill(pt,m);
+        if     (p1->IsTagged() && p2->IsTagged()) fhReConv2->Fill(pt,m,weight);
+        else if(p1->IsTagged() || p2->IsTagged()) fhReConv ->Fill(pt,m,weight);
         
         //Fill histograms for different bad channel distance, centrality, assymmetry cut and pid bit
         for(Int_t ipid=0; ipid<fNPIDBits; ipid++){
@@ -1897,15 +2046,15 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
               if(a < fAsymCuts[iasym]){
                 Int_t index = ((curCentrBin*fNPIDBits)+ipid)*fNAsymCuts + iasym;
                 //printf("index %d :(cen %d * nPID %d + ipid %d)*nasym %d + iasym %d\n",index,curCentrBin,fNPIDBits,ipid,fNAsymCuts,iasym);
-                fhRe1     [index]->Fill(pt,m);
-                if(fMakeInvPtPlots)fhReInvPt1[index]->Fill(pt,m,1./pt) ;
+                fhRe1     [index]->Fill(pt,m,weight);
+                if(fMakeInvPtPlots)fhReInvPt1[index]->Fill(pt,m,weight/pt) ;
                 if(fFillBadDistHisto){
                   if(p1->DistToBad()>0 && p2->DistToBad()>0){
-                    fhRe2     [index]->Fill(pt,m) ;
-                    if(fMakeInvPtPlots)fhReInvPt2[index]->Fill(pt,m,1./pt) ;
+                    fhRe2     [index]->Fill(pt,m,weight) ;
+                    if(fMakeInvPtPlots)fhReInvPt2[index]->Fill(pt,m,weight/pt) ;
                     if(p1->DistToBad()>1 && p2->DistToBad()>1){
-                      fhRe3     [index]->Fill(pt,m) ;
-                      if(fMakeInvPtPlots)fhReInvPt3[index]->Fill(pt,m,1./pt) ;
+                      fhRe3     [index]->Fill(pt,m,weight) ;
+                      if(fMakeInvPtPlots)fhReInvPt3[index]->Fill(pt,m,weight/pt) ;
                     }// bad 3
                   }// bad2
                 }// Fill bad dist histos
@@ -1915,13 +2064,13 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
         }// pid bit loop
         
         //Fill histograms with opening angle
-        fhRealOpeningAngle   ->Fill(pt,angle);
-        fhRealCosOpeningAngle->Fill(pt,TMath::Cos(angle));
+        fhRealOpeningAngle   ->Fill(pt,angle,weight);
+        fhRealCosOpeningAngle->Fill(pt,TMath::Cos(angle),weight);
         
         //Fill histograms with pair assymmetry
-        fhRePtAsym->Fill(pt,a);
-        if(m > 0.10 && m < 0.17) fhRePtAsymPi0->Fill(pt,a);
-        if(m > 0.45 && m < 0.65) fhRePtAsymEta->Fill(pt,a);
+        fhRePtAsym->Fill(pt,a,weight);
+        if(m > 0.10 && m < 0.17) fhRePtAsymPi0->Fill(pt,a,weight);
+        if(m > 0.45 && m < 0.65) fhRePtAsymEta->Fill(pt,a,weight);
         
         //-------------------------------------------------------
         //Get the number of cells needed for multi cut analysis.
@@ -1965,7 +2114,7 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
           for(Int_t ipid=0; ipid<fNPIDBits; ipid++){
             
             if(p1->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton)    && 
-               p2->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton))   fhRePIDBits[ipid]->Fill(pt,m) ;
+               p2->IsPIDOK(fPIDBits[ipid],AliCaloPID::kPhoton))   fhRePIDBits[ipid]->Fill(pt,m,weight) ;
             
             //printf("ipt %d, ipid%d, name %s\n",ipt, ipid, fhRePtPIDCuts[ipt*fNPIDBitsBits+ipid]->GetName());
           } // pid bit cut loop
@@ -1978,24 +2127,19 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
                 if(p1->E() >   fPtCuts[ipt]      && p2->E() > fPtCuts[ipt]        && 
                    a        <   fAsymCuts[iasym]                                    && 
                    ncell1   >=  fCellNCuts[icell] && ncell2   >= fCellNCuts[icell]){
-                    fhRePtNCellAsymCuts[index]->Fill(pt,m) ;
+                    fhRePtNCellAsymCuts[index]->Fill(pt,m,weight) ;
                   //printf("ipt %d, icell%d, iasym %d, name %s\n",ipt, icell, iasym,  fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym]->GetName());
                   if(fFillSMCombinations && module1==module2){
-                    if     (module1==0)  fhRePtNCellAsymCutsSM0[index]->Fill(pt,m) ;
-                    else if(module1==1)  fhRePtNCellAsymCutsSM1[index]->Fill(pt,m) ;
-                    else if(module1==2)  fhRePtNCellAsymCutsSM2[index]->Fill(pt,m) ;
-                    else if(module1==3)  fhRePtNCellAsymCutsSM3[index]->Fill(pt,m) ;
+                    if     (module1==0)  fhRePtNCellAsymCutsSM0[index]->Fill(pt,m,weight) ;
+                    else if(module1==1)  fhRePtNCellAsymCutsSM1[index]->Fill(pt,m,weight) ;
+                    else if(module1==2)  fhRePtNCellAsymCutsSM2[index]->Fill(pt,m,weight) ;
+                    else if(module1==3)  fhRePtNCellAsymCutsSM3[index]->Fill(pt,m,weight) ;
                     //else printf("AliAnaPi0::FillHistograms() - WRONG SM NUMBER\n");
                   }
                 }
               }// pid bit cut loop
             }// icell loop
           }// pt cut loop
-          if(GetHistoTrackMultiplicityBins()){
-            for(Int_t iasym = 0; iasym < fNAsymCuts; iasym++){
-              if(a < fAsymCuts[iasym])fhRePtMult[iasym]->Fill(pt,GetTrackMultiplicity(),m) ;
-            }
-          }
         }// multiple cuts analysis
       }// ok if same sm
     }// second same event particle
@@ -2012,6 +2156,7 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
     for(Int_t ii=0; ii<nMixed; ii++){  
       TClonesArray* ev2= (TClonesArray*) (evMixList->At(ii));
       Int_t nPhot2=ev2->GetEntriesFast() ;
+
       Double_t m = -999;
       if(GetDebug() > 1) 
         printf("AliAnaPi0::MakeAnalysisFillHistograms() - Mixed event %d photon entries %d, centrality bin %d\n", ii, nPhot2, curCentrBin);
@@ -2026,13 +2171,15 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
         //Get kinematics of cluster and (super) module of this cluster
         TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E());
         module1 = GetModuleNumber(p1);
-        
+        Float_t weight1 = p1->GetFiducialArea()*10000.;
+
         //---------------------------------
         //First loop on photons/clusters
         //---------------------------------        
         for(Int_t i2=0; i2<nPhot2; i2++){
           AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (ev2->At(i2)) ;
-          
+          Float_t weight2 = p2->GetFiducialArea()*10000.;
+          Float_t weight  = weight1*weight2;
           //Get kinematics of second cluster and calculate those of the pair
           TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E());
           m           = (photon1+photon2).M() ; 
@@ -2065,7 +2212,7 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
           //-------------------------------------------------------------------------------------------------          
           if(a < fAsymCuts[0] && fFillSMCombinations){
             if(module1==module2 && module1 >=0 && module1<fNModules)
-              fhMiMod[module1]->Fill(pt,m) ;
+              fhMiMod[module1]->Fill(pt,m,weight) ;
 
             if(fCalorimeter=="EMCAL"){
               
@@ -2073,18 +2220,18 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
               Int_t j=0;
               for(Int_t i = 0; i < fNModules/2; i++){
                 j=2*i;
-                if((module1==j && module2==j+1) || (module1==j+1 && module2==j)) fhMiSameSectorEMCALMod[i]->Fill(pt,m) ;
+                if((module1==j && module2==j+1) || (module1==j+1 && module2==j)) fhMiSameSectorEMCALMod[i]->Fill(pt,m,weight) ;
               }
               
               // Same side
               for(Int_t i = 0; i < fNModules-2; i++){
-                if((module1==i && module2==i+2) || (module1==i+2 && module2==i)) fhMiSameSideEMCALMod[i]->Fill(pt,m); 
+                if((module1==i && module2==i+2) || (module1==i+2 && module2==i)) fhMiSameSideEMCALMod[i]->Fill(pt,m,weight); 
               }
             }//EMCAL
             else {//PHOS
-              if((module1==0 && module2==1) || (module1==1 && module2==0)) fhMiDiffPHOSMod[0]->Fill(pt,m) ; 
-              if((module1==0 && module2==2) || (module1==2 && module2==0)) fhMiDiffPHOSMod[1]->Fill(pt,m) ; 
-              if((module1==1 && module2==2) || (module1==2 && module2==1)) fhMiDiffPHOSMod[2]->Fill(pt,m) ;
+              if((module1==0 && module2==1) || (module1==1 && module2==0)) fhMiDiffPHOSMod[0]->Fill(pt,m,weight) ; 
+              if((module1==0 && module2==2) || (module1==2 && module2==0)) fhMiDiffPHOSMod[1]->Fill(pt,m,weight) ; 
+              if((module1==1 && module2==2) || (module1==2 && module2==1)) fhMiDiffPHOSMod[2]->Fill(pt,m,weight) ;
             }//PHOS
             
             
@@ -2095,8 +2242,8 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
           if(ok){
             
             //Check if one of the clusters comes from a conversion 
-            if     (p1->IsTagged() && p2->IsTagged()) fhMiConv2->Fill(pt,m);
-            else if(p1->IsTagged() || p2->IsTagged()) fhMiConv ->Fill(pt,m);
+            if     (p1->IsTagged() && p2->IsTagged()) fhMiConv2->Fill(pt,m,weight);
+            else if(p1->IsTagged() || p2->IsTagged()) fhMiConv ->Fill(pt,m,weight);
 
             //Fill histograms for different bad channel distance, centrality, assymmetry cut and pid bit
             for(Int_t ipid=0; ipid<fNPIDBits; ipid++){ 
@@ -2104,15 +2251,15 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
                 for(Int_t iasym=0; iasym < fNAsymCuts; iasym++){
                   if(a < fAsymCuts[iasym]){
                     Int_t index = ((curCentrBin*fNPIDBits)+ipid)*fNAsymCuts + iasym;
-                    fhMi1     [index]->Fill(pt,m) ;
-                    if(fMakeInvPtPlots)fhMiInvPt1[index]->Fill(pt,m,1./pt) ;
+                    fhMi1     [index]->Fill(pt,m,weight) ;
+                    if(fMakeInvPtPlots)fhMiInvPt1[index]->Fill(pt,m,weight/pt) ;
                     if(fFillBadDistHisto){
                       if(p1->DistToBad()>0 && p2->DistToBad()>0){
                         fhMi2     [index]->Fill(pt,m) ;
-                        if(fMakeInvPtPlots)fhMiInvPt2[index]->Fill(pt,m,1./pt) ;
+                        if(fMakeInvPtPlots)fhMiInvPt2[index]->Fill(pt,m,weight/pt) ;
                         if(p1->DistToBad()>1 && p2->DistToBad()>1){
                           fhMi3     [index]->Fill(pt,m) ;
-                          if(fMakeInvPtPlots)fhMiInvPt3[index]->Fill(pt,m,1./pt) ;
+                          if(fMakeInvPtPlots)fhMiInvPt3[index]->Fill(pt,m,weight/pt) ;
                         }
                       }
                     }// Fill bad dist histo
@@ -2133,7 +2280,7 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
                     if(p1->Pt() >   fPtCuts[ipt]      && p2->Pt() > fPtCuts[ipt]        && 
                        a        <   fAsymCuts[iasym]                                    && 
                        p1->GetBtag() >=  fCellNCuts[icell] && p2->GetBtag() >= fCellNCuts[icell]){
-                      fhMiPtNCellAsymCuts[index]->Fill(pt,m) ;
+                      fhMiPtNCellAsymCuts[index]->Fill(pt,m,weight) ;
                       //printf("ipt %d, icell%d, iasym %d, name %s\n",ipt, icell, iasym,  fhRePtNCellAsymCuts[((ipt*fNCellNCuts)+icell)*fNAsymCuts + iasym]->GetName());
                     }
                   }// pid bit cut loop
@@ -2142,8 +2289,8 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
             } // Multi cut ana
             
             //Fill histograms with opening angle
-            fhMixedOpeningAngle   ->Fill(pt,angle);
-            fhMixedCosOpeningAngle->Fill(pt,TMath::Cos(angle));          
+            fhMixedOpeningAngle   ->Fill(pt,angle,weight);
+            fhMixedCosOpeningAngle->Fill(pt,TMath::Cos(angle),weight);          
           }//ok
         }// second cluster loop
       }//first cluster loop
index ed6e72e05b8289eba5ab554e57f040a05f61a624..1bcbcf088c620720e9dac8ee87512169ede2ffe9 100755 (executable)
@@ -159,6 +159,8 @@ class AliAnaPi0 : public AliAnaPartCorrBaseClass {
   void     SwitchOnConversionChecker()             { fCheckConversion = kTRUE  ; }
   void     SwitchOffConversionChecker()            { fCheckConversion = kFALSE ; }  
   
+  Double_t WeightPi0(Int_t pi0Id);
+  Int_t    GetMotherPi0Index(Int_t label);
   
   private:
   Bool_t   fDoOwnMix;            // Do combinatorial background not the one provided by the frame
@@ -318,6 +320,9 @@ class AliAnaPi0 : public AliAnaPartCorrBaseClass {
   TH2D *  fhMCPi0PtOrigin ;         //! Mass of reoconstructed pi0 pairs  in calorimeter vs mother
   TH2D *  fhMCEtaPtOrigin ;         //! Mass of reoconstructed pi0 pairs  in calorimeter vs mother
 
+  Int_t fFirstPi0;
+  Int_t fLastPi0;
+
   ClassDef(AliAnaPi0,18)
 } ;