Changes from Megan
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Jun 2012 06:51:16 +0000 (06:51 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Jun 2012 06:51:16 +0000 (06:51 +0000)
PWGGA/EMCALJetTasks/AliHadCorrTask.cxx

index 6f238f6..e8e13d0 100644 (file)
@@ -768,6 +768,11 @@ Double_t AliHadCorrTask::ApplyHadCorrAllTracks(AliEmcalParticle *emccluster, Dou
   // do the loop over the matched tracks and get the number of matches and the total momentum
   DoMatchedTracksLoop(emccluster, totalTrkP, Nmatches);
 
+  if(fCreateHisto && Nmatches == 0) {
+    fHistNclusvsCent->Fill(fCent);
+    fHistNCellsEnergy[fCentBin][0]->Fill(energyclus, cNcells);
+  }
+
   if (totalTrkP <= 0)
     return energyclus;
 
@@ -790,20 +795,17 @@ Double_t AliHadCorrTask::ApplyHadCorrAllTracks(AliEmcalParticle *emccluster, Dou
 
   // plot some histograms if switched on
   if (fCreateHisto) {
-    fHistNclusvsCent->Fill(fCent);
     fHistNMatchCent->Fill(fCent, Nmatches);
     fHistNMatchEnergy[fCentBin]->Fill(energyclus, Nmatches);
     
     if(Nmatches > 0) 
       fHistNclusMatchvsCent->Fill(fCent);
       
-    if(Nmatches == 0)
-      fHistNCellsEnergy[fCentBin][0]->Fill(energyclus, cNcells);
-    else if(Nmatches == 1)
+    if(Nmatches == 1)
       fHistNCellsEnergy[fCentBin][1]->Fill(energyclus, cNcells);       
     else if(Nmatches == 2)
       fHistNCellsEnergy[fCentBin][2]->Fill(energyclus, cNcells);
-    else
+    else if(Nmatches > 2)
       fHistNCellsEnergy[fCentBin][3]->Fill(energyclus, cNcells);
 
     if (EoP > 0) {