Selection of clusters from primary vertex moved into the separate loop
authorYuri Kharlov <kharlov@spin.ihep.su>
Wed, 15 Jan 2014 15:26:19 +0000 (19:26 +0400)
committerYuri Kharlov <kharlov@spin.ihep.su>
Wed, 15 Jan 2014 15:26:19 +0000 (19:26 +0400)
PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0FlowMC.cxx

index 3b5e866..758dcd2 100644 (file)
@@ -264,14 +264,18 @@ void AliAnalysisTaskPi0FlowMC::SelectPhotonClusters()
     Int_t primary=FindPrimary(cluster,sure) ;
     photon->SetPrimary(primary);
     photon->SetWeight(PrimaryWeight(primary)) ;
+  }
 
+  for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
+    AliCaloPhoton * photon = (AliCaloPhoton*)fCaloPhotonsPHOS->At(i1);
+    Int_t primary = photon->GetPrimary();
     TParticle* p = fStack->Particle(primary);
-    
     if(p->R() >kRCut) {
       if(p->GetPdgCode()==11 || p->GetPdgCode()==-11) continue;
-      else { fCaloPhotonsPHOS->Remove(photon); fCaloPhotonsPHOS->Compress(); } 
-    } 
-  }  
+      else { fCaloPhotonsPHOS->Remove(photon); fCaloPhotonsPHOS->Compress(); }
+    }
+  }
+    
 }
 
 void AliAnalysisTaskPi0FlowMC::FillSelectedClusterHistograms()