Move GenerateFixedBinArray to AliAnalysisTaskEmcal and change data type from Float...
authorsaiola <salvatore.aiola@cern.ch>
Tue, 15 Jul 2014 14:04:17 +0000 (10:04 -0400)
committersaiola <salvatore.aiola@cern.ch>
Tue, 15 Jul 2014 14:04:42 +0000 (10:04 -0400)
PWG/EMCAL/AliAnalysisTaskEmcal.cxx
PWG/EMCAL/AliAnalysisTaskEmcal.h
PWGJE/EMCALJetTasks/AliAnalysisTaskDeltaPt.cxx
PWGJE/EMCALJetTasks/AliAnalysisTaskEmcalJet.cxx
PWGJE/EMCALJetTasks/AliAnalysisTaskEmcalJet.h
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDeltaPtJEmb.cxx

index fc65204..192b0dc 100644 (file)
@@ -1219,3 +1219,23 @@ void AliAnalysisTaskEmcal::AddObjectToEvent(TObject *obj)
     AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
   }
 }
+
+//________________________________________________________________________
+void AliAnalysisTaskEmcal::GenerateFixedBinArray(Int_t n, Double_t min, Double_t max, Double_t* array) const
+{
+  Double_t binWidth = (max-min)/n;
+  array[0] = min;
+  for (Int_t i = 1; i <= n; i++) {
+    array[i] = array[i-1]+binWidth;
+  }
+}
+
+//________________________________________________________________________
+Double_t* AliAnalysisTaskEmcal::GenerateFixedBinArray(Int_t n, Double_t min, Double_t max) const
+{
+  Double_t *array = new Double_t[n+1];
+
+  GenerateFixedBinArray(n, min, max, array);
+
+  return array;
+}
index 12dae06..e24fdb9 100644 (file)
@@ -84,6 +84,8 @@ class AliAnalysisTaskEmcal : public AliAnalysisTaskSE {
   void                        SetVzRange(Double_t min, Double_t max)                { fMinVz             = min  ; fMaxVz   = max          ; }
 
  protected:
+  Double_t*                   GenerateFixedBinArray(Int_t n, Double_t min, Double_t max) const;
+  void                        GenerateFixedBinArray(Int_t n, Double_t min, Double_t max, Double_t* array) const;
   void                        SetMakeGeneralHistograms(Bool_t g)                    { fGeneralHistograms = g                              ; }
   Bool_t                      AcceptCluster(AliVCluster *clus, Int_t c = 0)      const;
   Bool_t                      AcceptTrack(AliVParticle *track, Int_t c = 0)      const;
index b704164..dbbc190 100644 (file)
@@ -262,11 +262,11 @@ void AliAnalysisTaskDeltaPt::UserCreateOutputObjects()
   TString histname;
 
   const Int_t nbinsZ = 12;
-  Float_t binsZ[nbinsZ+1] = {0,1,2,3,4,5,6,7,8,9,10,20,1000};
+  Double_t binsZ[nbinsZ+1] = {0,1,2,3,4,5,6,7,8,9,10,20,1000};
 
-  Float_t *binsPt       = GenerateFixedBinArray(fNbins, fMinBinPt, fMaxBinPt);
-  Float_t *binsCorrPt   = GenerateFixedBinArray(fNbins*2, -fMaxBinPt, fMaxBinPt);
-  Float_t *binsArea     = GenerateFixedBinArray(50, 0, 2);
+  Double_t *binsPt       = GenerateFixedBinArray(fNbins, fMinBinPt, fMaxBinPt);
+  Double_t *binsCorrPt   = GenerateFixedBinArray(fNbins*2, -fMaxBinPt, fMaxBinPt);
+  Double_t *binsArea     = GenerateFixedBinArray(50, 0, 2);
 
   for (Int_t i = 0; i < fNcentBins; i++) {
     if (fTracksCont || fCaloClustersCont) {
index ac1f33d..ca2b25f 100644 (file)
@@ -77,20 +77,6 @@ Bool_t AliAnalysisTaskEmcalJet::AcceptBiasJet(AliEmcalJet *jet, Int_t c)
 }
 
 //________________________________________________________________________
-Float_t* AliAnalysisTaskEmcalJet::GenerateFixedBinArray(Int_t n, Float_t min, Float_t max) const
-{
-  Float_t *bins = new Float_t[n+1];
-
-  Float_t binWidth = (max-min)/n;
-  bins[0] = min;
-  for (Int_t i = 1; i <= n; i++) {
-    bins[i] = bins[i-1]+binWidth;
-  }
-
-  return bins;
-}
-
-//________________________________________________________________________
 Double_t AliAnalysisTaskEmcalJet::GetLeadingHadronPt(AliEmcalJet *jet, Int_t c)
 {
 
index dcf2797..2ac5c8b 100644 (file)
@@ -53,7 +53,6 @@ class AliAnalysisTaskEmcalJet : public AliAnalysisTaskEmcal {
   AliJetContainer            *GetJetContainer(const char* name)                                        const;
 
  protected:
-  Float_t*                    GenerateFixedBinArray(Int_t n, Float_t min, Float_t max) const;
   virtual Bool_t              AcceptJet(AliEmcalJet* jet, Int_t c =0);
   Bool_t                      AcceptBiasJet(AliEmcalJet* jet, Int_t c =0);
   Double_t                    GetLeadingHadronPt(AliEmcalJet* jet, Int_t c =0);
index 48673ec..5cad621 100644 (file)
@@ -154,11 +154,11 @@ void AliAnalysisTaskDeltaPtJEmb::UserCreateOutputObjects()
   TString histname;
 
   const Int_t nbinsZ = 12;
-  Float_t binsZ[nbinsZ+1] = {0,1,2,3,4,5,6,7,8,9,10,20,1000};
+  Double_t binsZ[nbinsZ+1] = {0,1,2,3,4,5,6,7,8,9,10,20,1000};
 
-  Float_t *binsPt       = GenerateFixedBinArray(fNbins, fMinBinPt, fMaxBinPt);
-  Float_t *binsCorrPt   = GenerateFixedBinArray(fNbins*2, -fMaxBinPt, fMaxBinPt);
-  Float_t *binsArea     = GenerateFixedBinArray(50, 0, 2);
+  Double_t *binsPt       = GenerateFixedBinArray(fNbins, fMinBinPt, fMaxBinPt);
+  Double_t *binsCorrPt   = GenerateFixedBinArray(fNbins*2, -fMaxBinPt, fMaxBinPt);
+  Double_t *binsArea     = GenerateFixedBinArray(50, 0, 2);
 
   for (Int_t i = 0; i < fNcentBins; i++) {
     histname = "fHistEmbJetsPtArea_";