changed centrality selection criteria to use floats instead of integers
authorrbertens <rbertens@cern.ch>
Thu, 6 Feb 2014 11:53:25 +0000 (12:53 +0100)
committerrbertens <rbertens@cern.ch>
Thu, 6 Feb 2014 11:53:44 +0000 (12:53 +0100)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskRhoVnModulation.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskRhoVnModulation.h

index df75e7b..8381dc7 100644 (file)
@@ -257,7 +257,7 @@ TH1F* AliAnalysisTaskRhoVnModulation::BookTH1F(const char* name, const char* x,
     TString title(name);
     if(c!=-1) { // format centrality dependent histograms accordingly
         name = Form("%s_%i", name, c);
-        title += Form("_%i-%i", fCentralityClasses->At(c), fCentralityClasses->At(1+c));
+        title += Form("_%i-%i", (int)(fCentralityClasses->At(c)), (int)(fCentralityClasses->At((1+c))));
     }
     title += Form(";%s;[counts]", x);
     TH1F* histogram = new TH1F(name, title.Data(), bins, min, max);
@@ -276,7 +276,7 @@ TH2F* AliAnalysisTaskRhoVnModulation::BookTH2F(const char* name, const char* x,
     TString title(name);
     if(c!=-1) { // format centrality dependent histograms accordingly
         name = Form("%s_%i", name, c);
-        title += Form("_%i-%i", fCentralityClasses->At(c), fCentralityClasses->At(1+c));
+        title += Form("_%i-%i", (int)fCentralityClasses->At(c), (int)(fCentralityClasses->At((1+c))));
     }
     title += Form(";%s;%s", x, y);
     TH2F* histogram = new TH2F(name, title.Data(), binsx, minx, maxx, binsy, miny, maxy);
@@ -292,8 +292,8 @@ void AliAnalysisTaskRhoVnModulation::UserCreateOutputObjects()
     fOutputList = new TList();
     fOutputList->SetOwner(kTRUE);
     if(!fCentralityClasses) {   // classes must be defined at this point
-        Int_t c[] = {0, 20, 40, 60, 80, 100};
-        fCentralityClasses = new TArrayI(sizeof(c)/sizeof(c[0]), c);
+        Double_t c[] = {0., 20., 40., 60., 80., 100.};
+        fCentralityClasses = new TArrayD(sizeof(c)/sizeof(c[0]), c);
     }
     // global QA
     fHistCentrality =           BookTH1F("fHistCentrality", "centrality", 102, -2, 100);
index 31330aa..c475f22 100644 (file)
@@ -12,6 +12,7 @@
 #include <AliVCluster.h>
 #include <TClonesArray.h>
 #include <TMath.h>
+#include <TArrayD.h>
 #include <TRandom3.h>
 #include <AliJetContainer.h>
 #include <AliParticleContainer.h>
@@ -69,7 +70,7 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet {
         void                    SetReduceBinsXYByFactor(Float_t x, Float_t y)   {fReduceBinsXByFactor = x;
                                                                                  fReduceBinsYByFactor = y;}
         void                    SetNoEventWeightsForQC(Bool_t e)                {fNoEventWeightsForQC = e;}
-        void                    SetCentralityClasses(TArrayI* c)                {fCentralityClasses = c;}
+        void                    SetCentralityClasses(TArrayD* c)                {fCentralityClasses = c;}
         void                    SetPtBinsHybrids(TArrayD* p)                    {fPtBinsHybrids = p;}
         void                    SetPtBinsJets(TArrayD* p)                       {fPtBinsJets = p;}
         void                    SetIntegratedFlow(TH1F* i, TH1F* j)             {fUserSuppliedV2 = i;
@@ -108,7 +109,7 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet {
         TString                 GetJetsName() const                             {return GetJetContainer()->GetArrayName(); }
         TString                 GetTracksName() const                           {return GetParticleContainer()->GetArrayName(); }
         TString                 GetLocalRhoName() const                         {return fLocalRhoName; }
-        TArrayI*                GetCentralityClasses() const                    {return fCentralityClasses;}
+        TArrayD*                GetCentralityClasses() const                    {return fCentralityClasses;}
         TArrayD*                GetPtBinsHybrids() const                        {return fPtBinsHybrids; }
         TArrayD*                GetPtBinsJets() const                           {return fPtBinsJets; }
         TProfile*               GetResolutionParameters(Int_t h, Int_t c) const {return (h==2) ? fProfV2Resolution[c] : fProfV3Resolution[c];}
@@ -179,7 +180,7 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet {
         Float_t                 fReduceBinsXByFactor;   // reduce the bins on x-axis of histo's by this much
         Float_t                 fReduceBinsYByFactor;   // reduce the bins on y-axis of histo's by this much
         Bool_t                  fNoEventWeightsForQC;   // don't store event weights for qc analysis
-        TArrayI*                fCentralityClasses;     //-> centrality classes (maximum 10)
+        TArrayD*                fCentralityClasses;     //-> centrality classes (maximum 10)
         TArrayD*                fPtBinsHybrids;         //-> pt bins for hybrid track vn anaysis
         TArrayD*                fPtBinsJets;            //-> pt bins for jet vn analysis
         TH1F*                   fUserSuppliedV2;        // histo with integrated v2
@@ -318,7 +319,7 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet {
         AliAnalysisTaskRhoVnModulation(const AliAnalysisTaskRhoVnModulation&);                  // not implemented
         AliAnalysisTaskRhoVnModulation& operator=(const AliAnalysisTaskRhoVnModulation&);       // not implemented
 
-        ClassDef(AliAnalysisTaskRhoVnModulation, 19);
+        ClassDef(AliAnalysisTaskRhoVnModulation, 20);
 };
 
 #endif