fix energy cut in cell histograms
authorsaiola <salvatore.aiola@cern.ch>
Fri, 21 Mar 2014 14:27:39 +0000 (10:27 -0400)
committerhristov <Peter.Hristov@cern.ch>
Thu, 27 Mar 2014 15:25:22 +0000 (16:25 +0100)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.h

index e958340..8a187c8 100644 (file)
@@ -36,7 +36,7 @@ ClassImp(AliAnalysisTaskSAQA)
 //________________________________________________________________________
 AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() : 
   AliAnalysisTaskEmcalJet("AliAnalysisTaskSAQA", kTRUE),
-  fCellEnergyCut(0.1),
+  fCellEnergyCut(0.05),
   fParticleLevel(kFALSE),
   fIsMC(kFALSE),
   fCentMethod2(""),
@@ -88,7 +88,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
 //________________________________________________________________________
 AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) : 
   AliAnalysisTaskEmcalJet(name, kTRUE),
-  fCellEnergyCut(0.1),
+  fCellEnergyCut(0.05),
   fParticleLevel(kFALSE),
   fIsMC(kFALSE),
   fCentMethod2(""),
@@ -540,7 +540,6 @@ Bool_t AliAnalysisTaskSAQA::FillHistograms()
   Float_t trackSum = 0;
   Float_t clusSum = 0;
   Float_t cellSum = 0;
-  Float_t cellCutSum = 0;
 
   Int_t ntracks = 0;
   Int_t nclusters = 0;
@@ -588,7 +587,7 @@ Bool_t AliAnalysisTaskSAQA::FillHistograms()
   }
   
   if (fCaloCells) {
-    ncells = DoCellLoop(cellSum, cellCutSum);
+    ncells = DoCellLoop(cellSum);
     AliDebug(2,Form("%d cells found in the event", ncells));
   }
 
@@ -675,7 +674,7 @@ void AliAnalysisTaskSAQA::FillEventQAHisto(Float_t cent, Float_t cent2, Float_t
 }
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskSAQA::DoCellLoop(Float_t &sum, Float_t &sum_cut)
+Int_t AliAnalysisTaskSAQA::DoCellLoop(Float_t &sum)
 {
   // Do cell loop.
 
@@ -685,27 +684,21 @@ Int_t AliAnalysisTaskSAQA::DoCellLoop(Float_t &sum, Float_t &sum_cut)
     return 0;
 
   const Int_t ncells = cells->GetNumberOfCells();
+  Int_t nAccCells = 0;
 
   for (Int_t pos = 0; pos < ncells; pos++) {
     Float_t amp   = cells->GetAmplitude(pos);
     Int_t   absId = cells->GetCellNumber(pos);
-    fHistCellsAbsIdEnergy[fCentBin]->Fill(absId,amp);
-    sum += amp;
+
     if (amp < fCellEnergyCut)
       continue;
-    sum_cut += amp;
-  } 
 
-  return ncells;
-}
+    fHistCellsAbsIdEnergy[fCentBin]->Fill(absId,amp);
+    nAccCells++;
+    sum += amp;
+  } 
 
-//________________________________________________________________________
-Double_t AliAnalysisTaskSAQA::GetCellEnergySum(AliVCluster *cluster, AliVCaloCells *cells)
-{
-  Double_t sum = 0;
-  for (Int_t i = 0; i < cluster->GetNCells(); i++) 
-    sum += cells->GetCellAmplitude(cluster->GetCellAbsId(i));
-  return sum;
+  return nAccCells;
 }
 
 //________________________________________________________________________
index 9b6b4c3..7b8cffd 100644 (file)
@@ -38,12 +38,11 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
                                               Float_t maxClusterE, Float_t maxClusterEta, Float_t maxClusterPhi,
                                               Float_t maxJetPt, Float_t maxJetEta, Float_t maxJetPhi);
   Bool_t                      RetrieveEventObjects()                                        ;
-  Int_t                       DoCellLoop(Float_t &sum, Float_t &sum_cut)                    ;
+  Int_t                       DoCellLoop(Float_t &sum)                    ;
   Int_t                       DoTrackLoop(Float_t &sum, AliVParticle* &leading)             ;
   Int_t                       DoClusterLoop(Float_t &sum, AliVCluster* &leading)            ;
   Int_t                       DoJetLoop(AliEmcalJet* &leading)                              ;
   Double_t                    GetFcross(AliVCluster *cluster, AliVCaloCells *cells)         ;
-  Double_t                    GetCellEnergySum(AliVCluster *cluster, AliVCaloCells *cells)  ;
 
   Float_t                     fCellEnergyCut;            // Energy cell cut
   Bool_t                      fParticleLevel;            // Set particle level analysis