]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Code clean-up in dN/deta calculation.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Mar 2011 15:35:03 +0000 (15:35 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Mar 2011 15:35:03 +0000 (15:35 +0000)
  - First properly calculate d2N/detadphi
  - Then project.
Removed Energy loss fitter from AOD tasks -
it just takes up memory and is largely useless
there.

15 files changed:
PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C
PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C
PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx
PWG2/FORWARD/analysis2/AliBasedNdetaTask.h
PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx
PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.h
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h
PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.h
PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx
PWG2/FORWARD/analysis2/AliForwarddNdetaTask.h
PWG2/FORWARD/analysis2/DrawdNdeta.C
PWG2/FORWARD/analysis2/ForwardAODConfig.C
PWG2/FORWARD/analysis2/TrainSetup.C

index ed74af2fcbc7dc12e328d5a15409bae3243ebe5e..e34704a6e220eb18803f45033d1413bccf123f2f 100644 (file)
@@ -42,6 +42,10 @@ AddTaskCentraldNdeta(const char* trig     = "INEL",
   task->SetTriggerMask(trig);
   // Whether to cut edges when re-binning 
   task->SetCutEdges(cutEdges);
+  // Whether to correct for empty bins when projecting 
+  task->SetCorrEmpty(false);
+  // Whether to use TH2::ProjectionX 
+  task->SetUseROOTProjectX(false);
   // Bit mask of 
   // 
   //    kNone               Normalise to accepted events 
index 4ac3119e297bf99d0ae797418bcdd2a9af59575b..2d0de44af5c07b55a5b8e6c823ffb6af7f4c7c3c 100644 (file)
@@ -42,6 +42,10 @@ AddTaskForwarddNdeta(const char* trig     = "INEL",
   task->SetTriggerMask(trig);
   // Whether to cut edges when re-binning 
   task->SetCutEdges(cutEdges);
+  // Whether to correct for empty bins when projecting 
+  task->SetCorrEmpty(true);
+  // Whether to use TH2::ProjectionX 
+  task->SetUseROOTProjectX(false);
   // Bit mask of 
   // 
   //    kNone           Normalise to accepted events 
index c979a75a23b183f2a976ffbb75cb9ac1d765646e..a100dbe6042246efd22eaa9fcf2990be11f8805b 100644 (file)
@@ -26,6 +26,7 @@ AliBasedNdetaTask::AliBasedNdetaTask()
     fCutEdges(false), 
     fSymmetrice(true),
     fCorrEmpty(true), 
+    fUseROOTProj(false),
     fTriggerEff(1),
     fShapeCorr(0),
     fListOfCentralities(0),
@@ -54,6 +55,7 @@ AliBasedNdetaTask::AliBasedNdetaTask(const char* name)
     fCutEdges(false), 
     fSymmetrice(true),
     fCorrEmpty(true), 
+    fUseROOTProj(false),
     fTriggerEff(1),
     fShapeCorr(0),
     fListOfCentralities(0),
@@ -91,8 +93,9 @@ AliBasedNdetaTask::AliBasedNdetaTask(const AliBasedNdetaTask& o)
     fTriggerMask(o.fTriggerMask),// Int_t - Trigger mask 
     fRebin(o.fRebin),          // Int_t - Rebinning factor 
     fCutEdges(o.fCutEdges),    // Bool_t - Whether to cut edges when rebinning
-    fSymmetrice(true),
-    fCorrEmpty(true), 
+    fSymmetrice(o.fSymmetrice),
+    fCorrEmpty(o.fCorrEmpty), 
+    fUseROOTProj(o.fUseROOTProj),
     fTriggerEff(o.fTriggerEff),
     fShapeCorr(o.fShapeCorr),
     fListOfCentralities(o.fListOfCentralities),
@@ -417,6 +420,7 @@ AliBasedNdetaTask::ProjectX(const TH2D* h,
                            const char* name,
                            Int_t firstbin, 
                            Int_t lastbin, 
+                           bool  useRoot,
                            bool  corr,
                            bool  error)
 {
@@ -434,9 +438,8 @@ AliBasedNdetaTask::ProjectX(const TH2D* h,
   //    Newly created histogram or null
   //
   if (!h) return 0;
-#if USE_ROOT_PROJECT
-  return h->ProjectionX(name, firstbin, lastbin, (error ? "e" : ""));
-#endif
+  if (useRoot) 
+    return h->ProjectionX(name, firstbin, lastbin, (error ? "e" : ""));
   
   TAxis* xaxis = h->GetXaxis();
   TAxis* yaxis = h->GetYaxis();
@@ -486,6 +489,11 @@ AliBasedNdetaTask::ProjectX(const TH2D* h,
     } // for (ybin)
     if(content > 0 && nbins > 0) {
       Double_t factor = (corr ? Double_t(ybins) / nbins : 1);
+#if 0
+      AliWarningGeneral(ret->GetName(), 
+                       Form("factor @ %d is %d/%d -> %f", 
+                            xbin, ybins, nbins, factor));
+#endif
       if (error) { 
        // Calculate weighted average
        ret->SetBinContent(xbin, content * factor);
@@ -542,7 +550,7 @@ AliBasedNdetaTask::Terminate(Option_t *)
   CentralityBin* bin = 0;
   while ((bin = static_cast<CentralityBin*>(next()))) 
     bin->End(fSums, fOutput, fNormalizationScheme, fShapeCorr, fTriggerEff,
-            fSymmetrice, fRebin, fCorrEmpty, fCutEdges, 
+            fSymmetrice, fRebin, fUseROOTProj, fCorrEmpty, fCutEdges, 
             fTriggerMask, GetColor(), GetMarker());
 
   // Output collision energy string 
@@ -570,6 +578,14 @@ AliBasedNdetaTask::Terminate(Option_t *)
   fOutput->Add(new TParameter<Double_t>("triggerEff", fTriggerEff)); 
   if (fShapeCorr) fOutput->Add(fShapeCorr);
 
+  TNamed* options = new TNamed("options","");
+  TString str;
+  str.Append(Form("Edges %scut, ", fCutEdges ? "" : "not "));
+  str.Append(Form("Empty bins %scorrected for, ", fCorrEmpty ? "" : "not "));
+  str.Append(Form("TH2::ProjectionX %sused", fUseROOTProj ? "" : "not "));
+  options->SetTitle(str);
+  fOutput->Add(options);
+
   PostData(2, fOutput);
 }
 //________________________________________________________________________
@@ -640,6 +656,7 @@ AliBasedNdetaTask::Print(Option_t*) const
            << " Rebin factor:         " << fRebin << "\n" 
            << " Cut edges:            " << fCutEdges << "\n"
            << " Symmertrice:          " << fSymmetrice << "\n"
+           << " Use TH2::ProjectionX: " << fUseROOTProj << "\n"
            << " Correct for empty:    " << fCorrEmpty << "\n"
            << " Normalization scheme: " << (fSchemeString ? 
                                             fSchemeString->GetTitle() : 
@@ -1037,14 +1054,27 @@ AliBasedNdetaTask::CentralityBin::Normalization(const TH1I& t,
                 ntotal, scaler));
            
     if (scheme & kBackground) {
-      AliInfo(Form("Correcting for background\n" 
-                  " beta = N_a + N_c + 2N_e = %d + %d - 2 * %d = %d", 
-                  Int_t(nA), Int_t(nC), Int_t(nE), Int_t(beta)));
+      //          1            E_V             E_V
+      //   s = --------- = ------------- = ------------ 
+      //        1 - beta   1 - beta E_V    1 - beta N_V 
+      //       ---  ----       --------        ---- ---
+      //       E_V  N_V          N_V           N_V  N_T 
+      // 
+      //          E_V
+      //     = ------------
+      //        1 - beta 
+      //            ----
+      //             N_T 
+      // 
       ntotal -= nAccepted * beta / nWithVertex;
-      scaler = 1. / (1. / vtxEff - beta / nWithVertex);
-       // scaler -= (beta > 0 ? nWithVertex / beta : 0);
+      // This one is direct and correct. 
+      // scaler = 1. / (1. / vtxEff - beta / nWithVertex);
+      // A simpler expresion
+      scaler /= (1 - beta / nTriggered); // 0.831631 -> 0.780689
       AliInfo(Form("Calculating event normalisation as\n"
+                  " beta = N_a + N_c + 2 N_e = %d + %d - 2 * %d = %d\n"
                   " N = N - N_A * beta / N_V = %f - %d * %d / %d = %f (%f)",
+                  Int_t(nA), Int_t(nC), Int_t(nE), Int_t(beta),
                   nAccepted / vtxEff, Int_t(nAccepted), Int_t(beta), 
                   Int_t(nWithVertex), ntotal, scaler));
     }
@@ -1078,6 +1108,80 @@ AliBasedNdetaTask::CentralityBin::Normalization(const TH1I& t,
   return scaler;
 }
 
+//________________________________________________________________________
+void 
+AliBasedNdetaTask::CentralityBin::MakeResult(const TH2D* sum,  
+                                            const char* postfix, 
+                                            bool        rootProj, 
+                                            bool        corrEmpty,
+                                            const TH1*  shapeCorr,
+                                            Double_t    scaler,
+                                            bool        symmetrice, 
+                                            Int_t       rebin, 
+                                            bool        cutEdges, 
+                                            Int_t       color, 
+                                            Int_t       marker)
+{
+  // 
+  // Generate the dN/deta result from input 
+  // 
+  // Parameters: 
+  //     sum        Sum of 2D hists 
+  //     postfix    Post fix on names
+  //     rootProj   Whether to use ROOT TH2::ProjectionX
+  //     corrEmpty  Correct for empty bins 
+  //     shapeCorr  Shape correction to use 
+  //     scaler     Event-level normalization scaler  
+  //     symmetrice Whether to make symmetric extensions 
+  //     rebin      Whether to rebin
+  //     cutEdges   Whether to cut edges when rebinning 
+  //
+  TH2D* copy    = static_cast<TH2D*>(sum->Clone(Form("d2Ndetadphi%s%s", 
+                                                    GetName(), postfix)));
+  TH1D* accNorm = ProjectX(sum, Form("norm%s%s",GetName(), postfix), 0, 0, 
+                          rootProj, corrEmpty, false);
+  accNorm->SetDirectory(0);
+
+  // ---- Scale by shape correction ----------------------------------
+  if (shapeCorr) copy->Divide(shapeCorr);
+  else AliInfo("No shape correction specified, or disabled");
+  
+  // Normalize to the acceptance -
+  // dndeta->Divide(accNorm);
+  for (Int_t i = 1; i <= copy->GetNbinsX(); i++) { 
+    for (Int_t j = 1; j <= copy->GetNbinsY(); j++) { 
+      Double_t c = copy->GetBinContent(i, j);
+      Double_t e = copy->GetBinError(i, j);
+      Double_t a = accNorm->GetBinContent(i);
+      copy->SetBinContent(i, j, a <= 0 ? 0 : c / a);
+      copy->SetBinError(i, j, a <= 0 ? 0 : e / a);
+    }
+  }
+  // --- Event-level normalization -----------------------------------
+  copy->Scale(scaler);
+
+  // --- Project on X axis -------------------------------------------
+  TH1D* dndeta = ProjectX(copy, Form("dndeta%s%s",GetName(), postfix), 
+                         1, sum->GetNbinsY(), rootProj, corrEmpty);
+  dndeta->SetDirectory(0);
+  // Event-level normalization 
+  dndeta->Scale(1., "width");
+  copy->Scale(1., "width");
+
+  // --- Set some histogram attributes -------------------------------
+  SetHistogramAttributes(dndeta,  color, marker, Form("ALICE %s", GetName()));
+  SetHistogramAttributes(accNorm, color, marker, Form("ALICE %s normalisation", 
+                                                     GetName())); 
+
+  // --- Make symmetric extensions and rebinnings --------------------
+  if (symmetrice)   fOutput->Add(Symmetrice(dndeta));
+  fOutput->Add(dndeta);
+  fOutput->Add(accNorm);
+  fOutput->Add(copy);
+  fOutput->Add(Rebin(dndeta, rebin, cutEdges));
+  if (symmetrice)   fOutput->Add(Symmetrice(Rebin(dndeta, rebin, cutEdges)));
+}  
+
 //________________________________________________________________________
 void 
 AliBasedNdetaTask::CentralityBin::End(TList*      sums, 
@@ -1087,6 +1191,7 @@ AliBasedNdetaTask::CentralityBin::End(TList*      sums,
                                      Double_t    trigEff,
                                      Bool_t      symmetrice,
                                      Int_t       rebin, 
+                                     Bool_t      rootProj,
                                      Bool_t      corrEmpty, 
                                      Bool_t      cutEdges, 
                                      Int_t       triggerMask,
@@ -1132,23 +1237,6 @@ AliBasedNdetaTask::CentralityBin::End(TList*      sums,
     return;
   }
 
-  // --- Get acceptance normalisation from underflow bins ------------
-  const char* name = GetName();
-  TH1D* accNorm = ProjectX(fSum, Form("norm%s",name), 0, 0, corrEmpty, false);
-  accNorm->SetDirectory(0);
-
-  // ---- Scale by shape correction ----------------------------------
-  if ((scheme & kShape) && shapeCorr) fSum->Divide(shapeCorr);
-  else AliInfo("No shape correction specified, or disabled");
-
-  // --- Project on X axis -------------------------------------------
-  TH1D* dndeta = ProjectX(fSum, Form("dndeta%s",name), 1, fSum->GetNbinsY(),
-                         corrEmpty);
-  dndeta->SetDirectory(0);
-  
-  // Normalize to the acceptance -
-  dndeta->Divide(accNorm);
-  
   // --- Get normalization scaler ------------------------------------
   Double_t ntotal = 0;
   Double_t epsilonT = trigEff;
@@ -1163,54 +1251,17 @@ AliBasedNdetaTask::CentralityBin::End(TList*      sums,
     AliError("Failed to calculate normalization - bailing out");
     return;
   }
-  // Event-level normalization 
-  dndeta->Scale(scaler, "width");
-
-  // --- Set some histogram attributes -------------------------------
-  SetHistogramAttributes(dndeta, color, marker, Form("ALICE %s", name));
-  SetHistogramAttributes(accNorm,   color, marker, Form("ALICE %s normalisation", 
-                                                    name)); 
-
-  // --- Make symmetric extensions and rebinnings --------------------
   fOutput->Add(fTriggers->Clone());
-  if (symmetrice)   fOutput->Add(Symmetrice(dndeta));
-  fOutput->Add(dndeta);
-  fOutput->Add(accNorm);
-  fOutput->Add(Rebin(dndeta, rebin, cutEdges));
-  if (symmetrice)   fOutput->Add(Symmetrice(Rebin(dndeta, rebin, cutEdges)));
+
+  // --- Make result and store ---------------------------------------
+  MakeResult(fSum, "", rootProj, corrEmpty, (scheme & kShape) ? shapeCorr : 0,
+            scaler, symmetrice, rebin, cutEdges, color, marker);
 
   // --- Process result from TrackRefs -------------------------------
   if (fSumMC) { 
-    // Project onto eta axis - _ignoring_underflow_bins_!
-    TH1D* dndetaMC = ProjectX(fSumMC,Form("dndeta%sMC", name),1,
-                             fSum->GetNbinsY(), corrEmpty);
-    // Get acceptance normalisation from underflow bins 
-    TH1D* accNormMC   = ProjectX(fSumMC,Form("norm%sMC", name), 0, 0, 
-                             corrEmpty, false);
-    // Scale by shape correction
-    if ((scheme & kShape) && shapeCorr) fSum->Divide(shapeCorr);
-
-    // Normalize to the acceptance 
-    dndetaMC->Divide(accNormMC);
-
-    // Scale by the vertex efficiency 
-    dndetaMC->Scale(scaler, "width");
-
-    // Set hisotgram attributes
-    SetHistogramAttributes(dndetaMC, color+2, marker, 
-                          Form("ALICE %s (MC)",name));
-    SetHistogramAttributes(accNormMC,   color+2, marker, 
-                          Form("ALICE %s (MC) normalisation",name)); 
-
-    // Make symmetric extensions, rebinnings, and add to output
-    fOutput->Add(dndetaMC);
-    if (symmetrice)   fOutput->Add(Symmetrice(dndetaMC));    
-
-    fOutput->Add(accNormMC);
-    fOutput->Add(Rebin(dndetaMC, rebin, cutEdges));
-
-    if (symmetrice)   
-      fOutput->Add(Symmetrice(Rebin(dndetaMC, rebin, cutEdges)));
+    MakeResult(fSumMC, "MC", rootProj, corrEmpty, 
+              (scheme & kShape) ? shapeCorr : 0,
+              scaler, symmetrice, rebin, cutEdges, color+2, marker);
   }
 
   // Temporary stuff 
index 2123b1f3e06be422794130aace147dc1ec707bc5..68f4a8ad7b9c79387f31b585748f7a3c41469c44 100644 (file)
@@ -138,6 +138,19 @@ public:
    * @param cut If true, cut edges 
    */
   void SetCutEdges(Bool_t cut) {fCutEdges = cut;}
+  /** 
+   * Set whether to correct for empty bins when projecting on the X axis. 
+   * 
+   * @param use Whether to correct for empty bins 
+   */
+  void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; }
+  /** 
+   * Set whether to use the ROOT TH2::ProjectionX method when
+   * projecting on the X axis.
+   * 
+   * @param use Whether to use TH2::ProjectionX
+   */
+  void SetUseROOTProjectX(Bool_t use) { fUseROOTProj = use; }
   /** 
    * Trigger efficiency for selected trigger(s)
    * 
@@ -245,6 +258,7 @@ public:
                        const char* name,
                        Int_t firstbin, 
                        Int_t lastbin, 
+                       bool  useROOT=false,
                        bool  corr=true,
                        bool  error=true);
   /** 
@@ -436,6 +450,30 @@ protected:
                                   UShort_t    scheme,
                                   Double_t    trgEff,
                                   Double_t&   ntotal) const;
+    /** 
+     * Generate the dN/deta result from input 
+     * 
+     * @param sum        Sum of 2D hists 
+     * @param postfix    Post fix on names
+     * @param rootProj   Whether to use ROOT TH2::ProjectionX
+     * @param corrEmpty  Correct for empty bins 
+     * @param shapeCorr  Shape correction to use 
+     * @param scaler     Event-level normalization scaler  
+     * @param symmetrice Whether to make symmetric extensions 
+     * @param rebin      Whether to rebin
+     * @param cutEdges   Whether to cut edges when rebinning 
+     */
+    virtual void MakeResult(const TH2D* sum,  
+                           const char* postfix, 
+                           bool        rootProj, 
+                           bool        corrEmpty,
+                           const TH1*  shapeCorr,
+                           Double_t    scaler,
+                           bool        symmetrice, 
+                           Int_t       rebin, 
+                           bool        cutEdges, 
+                           Int_t       color, 
+                           Int_t       marker);
     /** 
      * End of processing 
      * 
@@ -446,6 +484,7 @@ protected:
      * @param trigEff     Trigger efficiency 
      * @param symmetrice  Whether to symmetrice the results
      * @param rebin       Whether to rebin the results
+     * @param rootProj    If true, use TH2::ProjectionX
      * @param corrEmpty   Whether to correct for empty bins
      * @param cutEdges    Whether to cut edges when rebinning
      * @param triggerMask Trigger mask 
@@ -459,6 +498,7 @@ protected:
                     Double_t    trigEff,
                     Bool_t      symmetrice,
                     Int_t       rebin, 
+                    Bool_t      rootProj,
                     Bool_t      corrEmpty, 
                     Bool_t      cutEdges, 
                     Int_t       triggerMask,
@@ -538,6 +578,7 @@ protected:
   Bool_t          fCutEdges;     // Whether to cut edges when rebinning
   Bool_t          fSymmetrice;   // Whether to symmetrice data 
   Bool_t          fCorrEmpty;    // Correct for empty bins 
+  Bool_t          fUseROOTProj;  // Whether to use ROOT's ProjectionX
   Double_t        fTriggerEff;   // Trigger efficiency for selected trigger(s)
   TH1*            fShapeCorr;    // Shape correction 
   TObjArray*      fListOfCentralities; // Centrality bins 
index 95b220f49b31261e7d304aecab07d7ef9b0ddbcc..4e29b526770eaa7750c923a1e510475e88bff4c0 100644 (file)
@@ -40,7 +40,6 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask()
     fMCAODFMD(),
     fPrimary(0),
     fEventInspector(),
-    fEnergyFitter(),
     fSharingFilter(),
     fDensityCalculator(),
     fCorrections(),
@@ -64,7 +63,6 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const char* name)
     fMCAODFMD(kTRUE),
     fPrimary(0),
     fEventInspector("event"),
-    fEnergyFitter("energy"),
     fSharingFilter("sharing"), 
     fDensityCalculator("density"),
     fCorrections("corrections"),
@@ -92,7 +90,6 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const AliForwardMCMul
     fMCAODFMD(o.fMCAODFMD),
     fPrimary(o.fPrimary),
     fEventInspector(o.fEventInspector),
-    fEnergyFitter(o.fEnergyFitter),
     fSharingFilter(o.fSharingFilter),
     fDensityCalculator(o.fDensityCalculator),
     fCorrections(o.fCorrections),
@@ -125,7 +122,6 @@ AliForwardMCMultiplicityTask::operator=(const AliForwardMCMultiplicityTask& o)
 
   fHData             = o.fHData;
   fEventInspector    = o.fEventInspector;
-  fEnergyFitter      = o.fEnergyFitter;
   fSharingFilter     = o.fSharingFilter;
   fDensityCalculator = o.fDensityCalculator;
   fCorrections       = o.fCorrections;
@@ -151,7 +147,6 @@ AliForwardMCMultiplicityTask::SetDebug(Int_t dbg)
   //    dbg debug level
   //
   fEventInspector.SetDebug(dbg);
-  fEnergyFitter.SetDebug(dbg);
   fSharingFilter.SetDebug(dbg);
   fDensityCalculator.SetDebug(dbg);
   fCorrections.SetDebug(dbg);
@@ -181,7 +176,6 @@ AliForwardMCMultiplicityTask::InitializeSubs()
 
   fList->Add(fHData);
 
-  fEnergyFitter.Init(*pe);
   fEventInspector.Init(*pv);
   fDensityCalculator.Init(*pe);
   fCorrections.Init(*pe);
@@ -224,7 +218,6 @@ AliForwardMCMultiplicityTask::UserCreateOutputObjects()
   ah->AddBranch("TH2D", &fPrimary);
 
   fEventInspector.DefineOutput(fList);
-  fEnergyFitter.DefineOutput(fList);
   fSharingFilter.DefineOutput(fList);
   fDensityCalculator.DefineOutput(fList);
   fCorrections.DefineOutput(fList);
@@ -331,13 +324,6 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*)
   //MarkEventForStore();
   fSharingFilter.CompareResults(fESDFMD, fMCESDFMD);
 
-  // Do the energy stuff 
-  if (!fEnergyFitter.Accumulate(*esdFMD, cent, 
-                               triggers & AliAODForwardMult::kEmpty)){
-    AliWarning("Energy fitter failed");
-    return;
-  }
-
   // Calculate the inclusive charged particle density 
   if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux)) { 
     AliWarning("Density calculator failed!");
@@ -425,7 +411,6 @@ AliForwardMCMultiplicityTask::Terminate(Option_t*)
   list->Add(dNdeta);
   list->Add(norm);
 
-  fEnergyFitter.Fit(list);
   fSharingFilter.ScaleHistograms(list,Int_t(hEventsTr->Integral()));
   fDensityCalculator.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral()));
   fCorrections.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral()));
index 8412b3c70e0da59c7a0978da3d471d9ae436d636..96c9cd910cae5fdc50f4fe9c6836a0d81a068e7b 100644 (file)
@@ -16,7 +16,6 @@
 #include "AliForwardMultiplicityBase.h"
 #include "AliForwardUtil.h"
 #include "AliFMDMCEventInspector.h"
-#include "AliFMDEnergyFitter.h"
 #include "AliFMDMCSharingFilter.h"
 #include "AliFMDMCDensityCalculator.h"
 #include "AliFMDMCCorrector.h"
@@ -110,12 +109,6 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   AliFMDEventInspector& GetEventInspector() { return fEventInspector; }
-  /**
-   * Get reference to the EnergyFitter algorithm 
-   * 
-   * @return Reference to AliFMDEnergyFitter object 
-   */
-  AliFMDEnergyFitter& GetEnergyFitter() { return fEnergyFitter; }
   /**
    * Get reference to the SharingFilter algorithm 
    * 
@@ -146,12 +139,6 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   const AliFMDEventInspector& GetEventInspector() const { return fEventInspector; }
-  /**
-   * Get reference to the EnergyFitter algorithm 
-   * 
-   * @return Reference to AliFMDEnergyFitter object 
-   */
-  const AliFMDEnergyFitter& GetEnergyFitter() const { return fEnergyFitter; }
   /**
    * Get reference to the SharingFilter algorithm 
    * 
@@ -202,7 +189,6 @@ protected:
   TH2D*                  fPrimary;      // Per event primary particles 
 
   AliFMDMCEventInspector    fEventInspector;    // Algorithm
-  AliFMDEnergyFitter        fEnergyFitter;      // Algorithm
   AliFMDMCSharingFilter     fSharingFilter;     // Algorithm
   AliFMDMCDensityCalculator fDensityCalculator; // Algorithm
   AliFMDMCCorrector         fCorrections;       // Algorithm
index 7db23ec3b0206a8eec5d635eede037546c96e54c..19fafc3520a15107f165c0b5c00b83ffca4500d7 100644 (file)
@@ -20,7 +20,6 @@
 #include "AliInputEventHandler.h"
 #include "AliAnalysisManager.h"
 #include "AliFMDEventInspector.h"
-#include "AliFMDEnergyFitter.h"
 #include "AliFMDSharingFilter.h"
 #include "AliFMDDensityCalculator.h"
 #include "AliFMDCorrector.h"
@@ -231,7 +230,6 @@ AliForwardMultiplicityBase::Print(Option_t* option) const
   else  
     std::cout << "  Correction manager not set yet" << std::endl;
   GetEventInspector()   .Print(option);
-  GetEnergyFitter()     .Print(option);    
   GetSharingFilter()    .Print(option);
   GetDensityCalculator().Print(option);
   GetCorrections()      .Print(option);
index d4c9e504c40ff1963ed8e754d040c9f2aa3c2bcc..270b1369e4e80697e8a7670e612c6befece01889 100644 (file)
@@ -180,12 +180,6 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   virtual AliFMDEventInspector& GetEventInspector() = 0;
-  /**
-   * Get reference to the EnergyFitter algorithm 
-   * 
-   * @return Reference to AliFMDEnergyFitter object 
-   */
-  virtual AliFMDEnergyFitter& GetEnergyFitter() = 0;
   /**
    * Get reference to the SharingFilter algorithm 
    * 
@@ -216,12 +210,6 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   virtual const AliFMDEventInspector& GetEventInspector() const = 0;
-  /**
-   * Get reference to the EnergyFitter algorithm 
-   * 
-   * @return Reference to AliFMDEnergyFitter object 
-   */
-  virtual const AliFMDEnergyFitter& GetEnergyFitter() const = 0;
   /**
    * Get reference to the SharingFilter algorithm 
    * 
index 77f424f177f92e9df8269e924aba9dfdd8cac9f0..ca348400aceb3f1d97e629c4a786f1cf62ae5327 100644 (file)
@@ -35,7 +35,6 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask()
     fHistos(),
     fAODFMD(),
     fEventInspector(),
-    fEnergyFitter(),
     fSharingFilter(),
     fDensityCalculator(),
     fCorrections(),
@@ -55,7 +54,6 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const char* name)
     fHistos(),
     fAODFMD(false),
     fEventInspector("event"),
-    fEnergyFitter("energy"),
     fSharingFilter("sharing"), 
     fDensityCalculator("density"),
     fCorrections("corrections"),
@@ -79,7 +77,6 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const AliForwardMultiplic
     fHistos(o.fHistos),
     fAODFMD(o.fAODFMD),
     fEventInspector(o.fEventInspector),
-    fEnergyFitter(o.fEnergyFitter),
     fSharingFilter(o.fSharingFilter),
     fDensityCalculator(o.fDensityCalculator),
     fCorrections(o.fCorrections),
@@ -112,7 +109,6 @@ AliForwardMultiplicityTask::operator=(const AliForwardMultiplicityTask& o)
 
   fHData             = o.fHData;
   fEventInspector    = o.fEventInspector;
-  fEnergyFitter      = o.fEnergyFitter;
   fSharingFilter     = o.fSharingFilter;
   fDensityCalculator = o.fDensityCalculator;
   fCorrections       = o.fCorrections;
@@ -135,7 +131,6 @@ AliForwardMultiplicityTask::SetDebug(Int_t dbg)
   //    dbg Debug level
   //
   fEventInspector.SetDebug(dbg);
-  fEnergyFitter.SetDebug(dbg);
   fSharingFilter.SetDebug(dbg);
   fDensityCalculator.SetDebug(dbg);
   fCorrections.SetDebug(dbg);
@@ -163,7 +158,6 @@ AliForwardMultiplicityTask::InitializeSubs()
   fHData->SetDirectory(0);
   fList->Add(fHData);
 
-  fEnergyFitter.Init(*pe);
   fEventInspector.Init(*pv);
   fDensityCalculator.Init(*pe);
   fCorrections.Init(*pe);
@@ -193,7 +187,6 @@ AliForwardMultiplicityTask::UserCreateOutputObjects()
   ah->AddBranch("AliAODForwardMult", &obj);
 
   fEventInspector.DefineOutput(fList);
-  fEnergyFitter.DefineOutput(fList);
   fSharingFilter.DefineOutput(fList);
   fDensityCalculator.DefineOutput(fList);
   fCorrections.DefineOutput(fList);
@@ -261,13 +254,6 @@ AliForwardMultiplicityTask::UserExec(Option_t*)
     return;
   }
 
-  // Do the energy stuff 
-  if (!fEnergyFitter.Accumulate(*esdFMD, cent, 
-                               triggers & AliAODForwardMult::kEmpty)){
-    AliWarning("Energy fitter failed");
-    return;
-  }
-
   // Calculate the inclusive charged particle density 
   //if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux)) { 
   if (!fDensityCalculator.Calculate(*esdFMD, fHistos, ivz, lowFlux)) { 
@@ -343,7 +329,6 @@ AliForwardMultiplicityTask::Terminate(Option_t*)
   list->Add(dNdeta);
   list->Add(norm);
 
-  fEnergyFitter.Fit(list);
   fSharingFilter.ScaleHistograms(list,Int_t(hEventsTr->Integral()));
   fDensityCalculator.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral()));
   fCorrections.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral()));
index 63b4149415ffe655be20b2ec5de51c6b97212a6c..1d784b82c386457703186314292fe14ce5eedf58 100644 (file)
@@ -16,7 +16,6 @@
 #include "AliForwardMultiplicityBase.h"
 #include "AliForwardUtil.h"
 #include "AliFMDEventInspector.h"
-#include "AliFMDEnergyFitter.h"
 #include "AliFMDSharingFilter.h"
 #include "AliFMDDensityCalculator.h"
 #include "AliFMDCorrector.h"
@@ -106,12 +105,6 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   AliFMDEventInspector& GetEventInspector() { return fEventInspector; }
-  /**
-   * Get reference to the EnergyFitter algorithm 
-   * 
-   * @return Reference to AliFMDEnergyFitter object 
-   */
-  AliFMDEnergyFitter& GetEnergyFitter() { return fEnergyFitter; }
   /**
    * Get reference to the SharingFilter algorithm 
    * 
@@ -142,12 +135,6 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   const AliFMDEventInspector& GetEventInspector() const { return fEventInspector; }
-  /**
-   * Get reference to the EnergyFitter algorithm 
-   * 
-   * @return Reference to AliFMDEnergyFitter object 
-   */
-  const AliFMDEnergyFitter& GetEnergyFitter() const { return fEnergyFitter; }
   /**
    * Get reference to the SharingFilter algorithm 
    * 
@@ -194,7 +181,6 @@ protected:
   AliAODForwardMult      fAODFMD;       // Output object
 
   AliFMDEventInspector    fEventInspector;    // Algorithm
-  AliFMDEnergyFitter      fEnergyFitter;      // Algorithm
   AliFMDSharingFilter     fSharingFilter;     // Algorithm
   AliFMDDensityCalculator fDensityCalculator; // Algorithm
   AliFMDCorrector         fCorrections;       // Algorithm
index 45fcab723b0e3e3edcc5b575285f27da197c0fb8..a07aeb979adfd2c1dc0541bb92c15fc9429a0898 100644 (file)
@@ -170,17 +170,20 @@ AliForwarddNdetaTask::CentralityBin::End(TList*      sums,
                                         Double_t    trigEff,
                                         Bool_t      symmetrice,
                                         Int_t       rebin, 
+                                        Bool_t      rootProj,
                                         Bool_t      corrEmpty, 
-                                        Bool_t      cutEdges, 
+                                        Bool_t      cutEdges,
                                         Int_t       triggerMask,
                                         Int_t       color,
                                         Int_t       marker)
 {
+  AliInfo(Form("In End of %s with corrEmpty=%d, cutEdges=%d, rootProj=%d", 
+              GetName(), corrEmpty, cutEdges, rootProj));
   AliBasedNdetaTask::CentralityBin::End(sums, results, scheme, 
                                        shapeCorr, trigEff, 
-                                       symmetrice, rebin, corrEmpty, cutEdges,
-                                       triggerMask,
-                                       color, marker);
+                                       symmetrice, rebin, 
+                                       rootProj, corrEmpty, cutEdges,
+                                       triggerMask, color, marker);
 
   fSumPrimary     = static_cast<TH2D*>(fSums->FindObject("truth"));
 
index 56318161aff9c1f10f7855c0c823e1c21182aa72..0859946f21dc7b1dc815ca20ade341153f1b244a 100644 (file)
@@ -144,6 +144,7 @@ protected:
      * @param trigEff     Trigger efficiency 
      * @param symmetrice  Whether to symmetrice the results
      * @param rebin       Whether to rebin the results
+     * @param rootProj    If true, use TH2::ProjectionX
      * @param corrEmpty   Whether to correct for empty bins
      * @param cutEdges    Whether to cut edges when rebinning
      * @param triggerMask Trigger mask 
@@ -157,6 +158,7 @@ protected:
                     Double_t    trigEff,
                     Bool_t      symmetrice,
                     Int_t       rebin, 
+                    Bool_t      rootProj,
                     Bool_t      corrEmpty, 
                     Bool_t      cutEdges, 
                     Int_t       triggerMask,
index eded880e61ab7b78f60bdde8987320a719898315..c6afac18bffa7f155cc3488ac97c70cf68c21558 100644 (file)
@@ -327,6 +327,8 @@ struct dNdetaDrawer
       fVtxAxis    = static_cast<TAxis*>(results->FindObject("vtxAxis"));
     if (!fCentAxis) 
       fCentAxis   = static_cast<TAxis*>(results->FindObject("centAxis"));
+
+    TNamed* options = static_cast<TAxis*>(results->FindObject("options"));
     if (!fTrigString) fTrigString = new TNamed("trigger", "unknown");
     if (!fNormString) fNormString = new TNamed("scheme", "unknown");
     if (!fSNNString)  fSNNString  = new TNamed("sNN", "unknown");
@@ -352,13 +354,14 @@ struct dNdetaDrawer
         "   System:        %-30s  (%d)\n"
         "   Vz range:      %-30s  (%f,%f)\n"
         "   Normalization: %-30s  (%d)\n"
-        "   Centrality:    %s",
+        "   Centrality:    %s\n"
+        "   Options:       %s",
         fTrigString->GetTitle(), fTrigString->GetUniqueID(), 
         fSNNString->GetTitle(),  fSNNString->GetUniqueID(), 
         fSysString->GetTitle(),  fSysString->GetUniqueID(), 
         fVtxAxis->GetTitle(), fVtxAxis->GetXmin(), fVtxAxis->GetXmax(),
         fNormString->GetTitle(), fNormString->GetUniqueID(),
-        centTxt.Data());
+        centTxt.Data(), (options ? options->GetTitle() : "none"));
   }
   //__________________________________________________________________
   TMultiGraph* FetchOthers(UShort_t centLow, UShort_t centHigh)
index ad3af9753118526fd4344ca7ed449a87a7e45430..89528561dc1b8076944aeb17c795f3ce6d6a1885 100644 (file)
@@ -34,32 +34,6 @@ ForwardAODConfig(AliForwardMultiplicityBase* task)
   task->GetEventInspector().SetLowFluxCut(1000); 
   // Set the maximum error on v_z [cm]
   task->GetEventInspector().SetMaxVzErr(0.2);
-  
-  // --- Energy Loss Fitter ------------------------------------------
-  // Set the eta axis to use - note, this overrides whatever is used
-  // by the rest of the algorithms - but only for the energy fitter
-  // algorithm. 
-  task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
-  // Set maximum energy loss to consider 
-  task->GetEnergyFitter().SetMaxE(10); 
-  // Set number of energy loss bins 
-  task->GetEnergyFitter().SetNEbins(300);
-  // Set whether to use increasing bin sizes 
-  task->GetEnergyFitter().SetUseIncreasingBins(true);
-  // Set whether to do fit the energy distributions 
-  task->GetEnergyFitter().SetDoFits(kFALSE);
-  // Set whether to make the correction object 
-  task->GetEnergyFitter().SetDoMakeObject(kFALSE);
-  // Set the low cut used for energy
-  task->GetEnergyFitter().SetLowCut(0.4);
-  // Set the number of bins to subtract from maximum of distributions
-  // to get the lower bound of the fit range
-  task->GetEnergyFitter().SetFitRangeBinWidth(4);
-  // Set the maximum number of landaus to try to fit (max 5)
-  task->GetEnergyFitter().SetNParticles(5);
-  // Set the minimum number of entries in the distribution before
-  // trying to fit to the data
-  task->GetEnergyFitter().SetMinEntries(1000);
 
   // --- Sharing filter ----------------------------------------------
   // Set the low cut used for sharing - overrides settings in eloss fits
index b5ba0102b8677775e51139e36c947065c52e2405..97097072f80e4ff5a5d3b21c938f9fc86b8265fa 100644 (file)
@@ -1521,7 +1521,7 @@ protected:
     Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
 
     // --- Add the task ----------------------------------------------
-    gROOT->Macro(Form("AddTaskForwardMultEloss.C(%d)", mc));
+    gROOT->Macro(Form("AddTaskFMDEloss.C(%d)", mc, fUseCent));
   }
   /** 
    * Crete output handler - we don't want one here. 
@@ -1529,6 +1529,7 @@ protected:
    * @return 0
    */
   AliVEventHandler* CreateOutputHandler(EType) { return 0; }
+  Bool_t fUseCent;
 };
 
 //====================================================================