merge centrality bins on input level
authorrbertens <rbertens@cern.ch>
Sun, 23 Mar 2014 15:59:05 +0000 (16:59 +0100)
committerhristov <Peter.Hristov@cern.ch>
Thu, 27 Mar 2014 15:25:26 +0000 (16:25 +0100)
PWG/FLOW/Tasks/AliJetFlowTools.cxx
PWG/FLOW/Tasks/AliJetFlowTools.h

index 207f89e..c96e380 100644 (file)
@@ -82,6 +82,7 @@ AliJetFlowTools::AliJetFlowTools() :
     fOutputFileName     ("UnfoldedSpectra.root"),
     fOutputFile         (0x0),
     fCentralityBin      (0),
+    fCentralityArray    (0x0),
     fDetectorResponse   (0x0),
     fJetFindingEff      (0x0),
     fBetaIn             (.1),
@@ -871,6 +872,15 @@ Bool_t AliJetFlowTools::PrepareForUnfolding()
         printf(" Couldn't find spectrum %s ! \n", spectrumName.Data());
         return kFALSE;
     }
+    if(fCentralityArray) {
+        printf(" merging centralities \n");
+        for(Int_t i(1); i < fCentralityArray->GetSize(); i++) {
+            spectrumName = Form("fHistJetPsi2Pt_%i", fCentralityArray->At(i));
+            printf( " searching for %s \n", spectrumName.Data());
+            fJetPtDeltaPhi->Add(((TH2D*)fInputList->FindObject(spectrumName.Data())));
+        }
+    }
+
     fJetPtDeltaPhi = ProtectHeap(fJetPtDeltaPhi, kFALSE);
     // in plane spectrum
     if(!fDphiUnfolding) {
@@ -887,6 +897,12 @@ Bool_t AliJetFlowTools::PrepareForUnfolding()
     // normalize spectra to event count if requested
     if(fNormalizeSpectra) {
         TH1* rho((TH1*)fInputList->FindObject(Form("fHistRho_%i", fCentralityBin)));
+        if(fCentralityArray) {
+            for(Int_t i(1); i < fCentralityArray->GetSize(); i++) {
+               printf(" merging centralities \n");
+               rho->Add((TH1*)fInputList->FindObject(Form("fHistRho_%i", fCentralityArray->At(i))));
+            }
+        }
         if(!rho) return 0x0;
         Bool_t normalizeToFullSpectrum = (fEventCount < 0) ? kTRUE : kFALSE;
         if (normalizeToFullSpectrum) fEventCount = rho->GetEntries();
@@ -924,6 +940,15 @@ Bool_t AliJetFlowTools::PrepareForUnfolding()
         fRefreshInput = kTRUE;
         return kTRUE;
     }
+    if(fCentralityArray) {
+        printf(" merging centralities \n");
+        for(Int_t i(1); i < fCentralityArray->GetSize(); i++) {
+            deltaptName = (fExLJDpt) ? Form("fHistDeltaPtDeltaPhi2ExLJ_%i", fCentralityArray->At(i)) : Form("fHistDeltaPtDeltaPhi2_%i", fCentralityArray->At(i));
+            printf(" searching for %s \n ", deltaptName.Data());
+            fDeltaPtDeltaPhi->Add(((TH2D*)fInputList->FindObject(deltaptName.Data())));
+        }
+    }
+
     fDeltaPtDeltaPhi = ProtectHeap(fDeltaPtDeltaPhi, kFALSE);
     // in plane delta pt distribution
     if(!fDphiUnfolding) {
@@ -995,6 +1020,12 @@ Bool_t AliJetFlowTools::PrepareForUnfolding(Int_t low, Int_t up) {
         printf(" Couldn't find spectrum %s ! \n", spectrumName.Data());
         return kFALSE;
     }
+    if(fCentralityArray) {
+        for(Int_t i(1); i < fCentralityArray->GetSize(); i++) {
+            spectrumName = Form("fHistJetPsi2Pt_%i", fCentralityArray->At(i));
+            fJetPtDeltaPhi->Add(((TH2D*)fInputList->FindObject(spectrumName.Data())));
+        }
+    }
     fJetPtDeltaPhi = ProtectHeap(fJetPtDeltaPhi, kFALSE);
     // in plane spectrum
     fSpectrumIn = fJetPtDeltaPhi->ProjectionY(Form("_py_in_%s", spectrumName.Data()), low, up, "e");
@@ -1008,6 +1039,13 @@ Bool_t AliJetFlowTools::PrepareForUnfolding(Int_t low, Int_t up) {
         fRefreshInput = kTRUE;
         return kTRUE;
     }
+    if(fCentralityArray) {
+        for(Int_t i(1); i < fCentralityArray->GetSize(); i++) {
+            deltaptName += (fExLJDpt) ? Form("fHistDeltaPtDeltaPhi2ExLJ_%i", fCentralityArray->At(i)) : Form("fHistDeltaPtDeltaPhi2_%i", fCentralityArray->At(i));
+            fDeltaPtDeltaPhi->Add(((TH2D*)fInputList->FindObject(deltaptName.Data())));
+        }
+    }
+
     fDeltaPtDeltaPhi = ProtectHeap(fDeltaPtDeltaPhi, kFALSE);
     // in plane delta pt distribution
     fDptInDist = fDeltaPtDeltaPhi->ProjectionY(Form("_py_in_%s", deltaptName.Data()), low, up, "e");
index a6e160f..a85f4cc 100644 (file)
@@ -79,6 +79,10 @@ class AliJetFlowTools {
             fActiveDir->cd();
         }
         void            SetCentralityBin(Int_t bin)             {fCentralityBin         = bin;}
+        void            SetCentralityBin(TArrayI* bins)         {
+            fCentralityArray = bins;
+            fCentralityBin = fCentralityArray->At(0);
+        }
         void            SetDetectorResponse(TH2D* dr)           {fDetectorResponse      = dr;}
         void            SetJetFindingEfficiency(TH1D* e)        {fJetFindingEff         = e;}
         void            SetBinsTrue(TArrayD* bins)              {fBinsTrue              = bins;}
@@ -309,6 +313,7 @@ class AliJetFlowTools {
         TString                 fOutputFileName;        // output file name
         TFile*                  fOutputFile;            // output file
         Int_t                   fCentralityBin;         // centrality bin
+        TArrayI*                fCentralityArray;       // array of bins that are merged
         TH2D*                   fDetectorResponse;      // detector response
         TH1D*                   fJetFindingEff;         // jet finding efficiency
         Double_t                fBetaIn;                // regularization strength, in plane unfolding