]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Various updates
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Jan 2011 23:35:32 +0000 (23:35 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Jan 2011 23:35:32 +0000 (23:35 +0000)
19 files changed:
PWG2/FORWARD/analysis2/AddTaskFMD.C
PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx
PWG2/FORWARD/analysis2/AliFMDCorrELossFit.h
PWG2/FORWARD/analysis2/AliFMDCorrections.h
PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx
PWG2/FORWARD/analysis2/AliFMDDensityCalculator.h
PWG2/FORWARD/analysis2/AliFMDMCSharingFilter.cxx
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/AliForwardUtil.cxx
PWG2/FORWARD/analysis2/AnalyseAOD.C
PWG2/FORWARD/analysis2/MakeAOD.C
PWG2/FORWARD/analysis2/Pass1.C
PWG2/FORWARD/analysis2/Run.sh
PWG2/FORWARD/analysis2/scripts/LoadPars.C

index cc940e102a7985d8a4ad27575731511535470949..57ff483ce036b9a84d6972ec88b6c0f948614712 100644 (file)
@@ -68,7 +68,7 @@ AddTaskFMD(Bool_t mc)
   // Set the lower multiplicity cut.  Overrides setting in energy loss fits.
   task->GetDensityCalculator().SetMultCut(0.3);
   // Whether to use the merging efficiency correction 
-  task->GetCorrections().UseMergingEfficiency(false);
+  task->GetCorrections().SetUseMergingEfficiency(false);
   // Set the number of extra bins (beyond the secondary map border) 
   task->GetHistCollector().SetNCutBins(2);
   // Set the correction cut, that is, when bins in the secondary map 
index 15885536fb98d5f7ca7cdd8d479cd408fb666ae6..774db2fe88d55e91cf82a8b66e3bc7ca6f927a9a 100644 (file)
@@ -738,6 +738,48 @@ AliFMDCorrELossFit::SetFit(UShort_t  d, Char_t r, Double_t eta,
   }
   return kTRUE;
 }
+//____________________________________________________________________
+AliFMDCorrELossFit::ELossFit*
+AliFMDCorrELossFit::GetFit(UShort_t  d, Char_t r, Int_t etabin) const
+{
+  // 
+  // Get the fit corresponding to the specified parameters 
+  // 
+  // Parameters:
+  //    d      Detector 
+  //    r      Ring 
+  //    etabin Eta bin (1 based)
+  // 
+  // Return:
+  //    Fit parameters or null in case of problems 
+  //
+  TObjArray* ringArray = GetRingArray(d, r);
+  if (!ringArray)                                   return 0;
+  if (etabin <= 0 || etabin >= fEtaAxis.GetNbins()) return 0;
+  if      (etabin > ringArray->GetEntriesFast())    return 0;
+  else if (etabin >= ringArray->GetEntriesFast())   etabin--;
+  else if (!ringArray->At(etabin))                  etabin++;
+  return static_cast<ELossFit*>(ringArray->At(etabin));
+}
+//____________________________________________________________________
+AliFMDCorrELossFit::ELossFit*
+AliFMDCorrELossFit::GetFit(UShort_t  d, Char_t r, Double_t eta) const
+{
+  // 
+  // Find the fit corresponding to the specified parameters 
+  // 
+  // Parameters:
+  //    d   Detector 
+  //    r   Ring 
+  //    eta Eta value 
+  // 
+  // Return:
+  //    Fit parameters or null in case of problems 
+  //
+  Int_t etabin = FindEtaBin(eta);
+  return GetFit(d, r, etabin);
+}
+
 //____________________________________________________________________
 AliFMDCorrELossFit::ELossFit*
 AliFMDCorrELossFit::FindFit(UShort_t  d, Char_t r, Int_t etabin) const
index 3e6fac86b4f24837e002cb7d3a4a3fad7ac329aa..3f9ab6ae004d7aada35f6ba31e47df8b3fab1b18 100644 (file)
@@ -493,6 +493,26 @@ public:
    * @return Fit parameters or null in case of problems 
    */
   ELossFit* FindFit(UShort_t d, Char_t r, Int_t etabin) const;
+  /** 
+   * Find the fit corresponding to the specified parameters 
+   * 
+   * @param d   Detector 
+   * @param r   Ring 
+   * @param eta Eta value 
+   * 
+   * @return Fit parameters or null in case of problems 
+   */
+  ELossFit* GetFit(UShort_t d, Char_t r, Double_t eta) const;
+  /** 
+   * Find the fit corresponding to the specified parameters 
+   * 
+   * @param d      Detector 
+   * @param r      Ring 
+   * @param etabin Eta bin (1 based)
+   * 
+   * @return Fit parameters or null in case of problems 
+   */
+  ELossFit* GetFit(UShort_t d, Char_t r, Int_t etabin) const;
   /* @} */
 
   /**                                          
index ee6d68cbcee50eee4e4b1d36c781dafea55c5f1a..18b59e72dafcdd5bcc85938e63f3b85f62023e2b 100644 (file)
@@ -91,7 +91,18 @@ public:
    * @param dbg Debug level 
    */
   void SetDebug(Int_t dbg=1) { fDebug = dbg; }
-  void UseMergingEfficiency(Bool_t use=true) { fUseMergingEfficiency = use; }
+  /** 
+   * Whether to use the merging efficiency correction
+   * 
+   * @param use If true, use the merging efficiency correction
+   */
+  void SetUseMergingEfficiency(Bool_t use=true) { fUseMergingEfficiency = use; }
+  /** 
+   * Check 
+   * 
+   * @return true if the merging efficiency correction is used.
+   */
+  Bool_t IsUseMergingEfficiency() const { return fUseMergingEfficiency; }
   /** 
    * Print information
    * 
index 944ccb02209d5ca9e4dc3e0eec89be72e5c94f1e..f90cec0af6b9db4aaf2d5636bbc7cc73aace455e 100644 (file)
@@ -30,6 +30,11 @@ AliFMDDensityCalculator::AliFMDDensityCalculator()
     fMaxParticles(5),
     fAccI(0),
     fAccO(0),
+    fFMD1iMax(0),
+    fFMD2iMax(0),
+    fFMD2oMax(0),
+    fFMD3iMax(0),
+    fFMD3oMax(0),
     fDebug(0)
 {
   // 
@@ -48,6 +53,11 @@ AliFMDDensityCalculator::AliFMDDensityCalculator(const char* title)
     fMaxParticles(5),
     fAccI(0),
     fAccO(0),
+    fFMD1iMax(0),
+    fFMD2iMax(0),
+    fFMD2oMax(0),
+    fFMD3iMax(0),
+    fFMD3oMax(0),
     fDebug(0)
 {
   // 
@@ -91,6 +101,11 @@ AliFMDDensityCalculator::AliFMDDensityCalculator(const
     fMaxParticles(o.fMaxParticles),
     fAccI(o.fAccI),
     fAccO(o.fAccO),
+    fFMD1iMax(o.fFMD1iMax),
+    fFMD2iMax(o.fFMD2iMax),
+    fFMD2oMax(o.fFMD2oMax),
+    fFMD3iMax(o.fFMD3iMax),
+    fFMD3oMax(o.fFMD3oMax),
     fDebug(o.fDebug)
 {
   // 
@@ -133,6 +148,11 @@ AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o)
   fMaxParticles = o.fMaxParticles;
   fAccI         = o.fAccI;
   fAccO         = o.fAccO;
+  fFMD1iMax     = o.fFMD1iMax;
+  fFMD2iMax     = o.fFMD2iMax;
+  fFMD2oMax     = o.fFMD2oMax;
+  fFMD3iMax     = o.fFMD3iMax;
+  fFMD3oMax     = o.fFMD3oMax;
 
   fRingHistos.Delete();
   TIter    next(&o.fRingHistos);
@@ -142,6 +162,17 @@ AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o)
   return *this;
 }
 
+//____________________________________________________________________
+void
+AliFMDDensityCalculator::Init(const TAxis&)
+{
+  // Intialize this sub-algorithm 
+  //
+  // Parameters:
+  //   etaAxis   Not used
+  CacheMaxWeights();
+}
+
 //____________________________________________________________________
 AliFMDDensityCalculator::RingHistos*
 AliFMDDensityCalculator::GetRingHistos(UShort_t d, Char_t r) const
@@ -244,6 +275,81 @@ AliFMDDensityCalculator::Calculate(const AliESDFMD&        fmd,
   return kTRUE;
 }
 
+//_____________________________________________________________________
+Int_t
+AliFMDDensityCalculator::FindMaxWeight(AliFMDCorrELossFit* cor,
+                                      UShort_t d, Char_t r, Int_t iEta) const
+{
+  AliFMDCorrELossFit::ELossFit* fit = cor->GetFit(d,r,iEta);
+  if (!fit) { 
+    // AliWarning(Form("No energy loss fit for FMD%d%c at eta=%f", d, r, eta));
+    return -1;
+  }
+  return fit->FindMaxWeight();
+}
+  
+//_____________________________________________________________________
+void
+AliFMDDensityCalculator::CacheMaxWeights()
+{
+  AliForwardCorrectionManager&  fcm = AliForwardCorrectionManager::Instance();
+  AliFMDCorrELossFit*           cor = fcm.GetELossFit();
+  const TAxis&                  eta = cor->GetEtaAxis();
+
+  Int_t nEta = eta.GetNbins();
+  fFMD1iMax.Set(nEta);
+  fFMD2iMax.Set(nEta);
+  fFMD2oMax.Set(nEta);
+  fFMD3iMax.Set(nEta);
+  fFMD3oMax.Set(nEta);
+  
+  for (Int_t i = 0; i < nEta; i++) {
+    fFMD1iMax[i] = FindMaxWeight(cor, 1, 'I', i+1);
+    fFMD2iMax[i] = FindMaxWeight(cor, 2, 'I', i+1);
+    fFMD2oMax[i] = FindMaxWeight(cor, 2, 'O', i+1);
+    fFMD3iMax[i] = FindMaxWeight(cor, 3, 'I', i+1);
+    fFMD3oMax[i] = FindMaxWeight(cor, 3, 'O', i+1);
+  }
+}
+
+//_____________________________________________________________________
+Int_t
+AliFMDDensityCalculator::GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const
+{
+  if (iEta < 0) return -1;
+
+  const TArrayI* max  = 0;
+  switch (d) { 
+  case 1:  max = &fFMD1iMax;                                       break;
+  case 2:  max = (r == 'I' || r == 'i' ? &fFMD2iMax : &fFMD2oMax); break;
+  case 3:  max = (r == 'I' || r == 'i' ? &fFMD3iMax : &fFMD3oMax); break;
+  }
+  if (!max) { 
+    AliWarning(Form("No array for FMD%d%c", d, r));
+    return -1;
+  }
+  
+  if (iEta >= max->fN) { 
+    AliWarning(Form("Eta bin %3d out of bounds [0,%d]", 
+                   iEta, max->fN-1));
+    return -1;
+  }
+
+  AliDebug(30,Form("Max weight for FMD%d%c eta bin %3d: %d", d, r, iEta, 
+                  max->At(iEta)));
+  return max->At(iEta);
+}
+
+//_____________________________________________________________________
+Int_t
+AliFMDDensityCalculator::GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const
+{
+  AliForwardCorrectionManager&  fcm  = AliForwardCorrectionManager::Instance();
+  Int_t                         iEta = fcm.GetELossFit()->FindEtaBin(eta) -1;
+
+  return GetMaxWeight(d, r, iEta);
+}
+
 //_____________________________________________________________________
 Float_t 
 AliFMDDensityCalculator::NParticles(Float_t  mult, 
@@ -281,7 +387,7 @@ AliFMDDensityCalculator::NParticles(Float_t  mult,
     return 0;
   }
   
-  Int_t    m   = fit->FindMaxWeight();
+  Int_t    m   = GetMaxWeight(d,r,eta); // fit->FindMaxWeight();
   if (m < 1) { 
     AliWarning(Form("No good fits for FMD%d%c at eta=%f", d, r, eta));
     return 0;
@@ -292,7 +398,7 @@ AliFMDDensityCalculator::NParticles(Float_t  mult,
   if (fDebug > 10) {
     AliInfo(Form("FMD%d%c, eta=%7.4f, %8.5f -> %8.5f", d, r, eta, mult, ret));
   }
-
+  
   fWeightedSum->Fill(ret);
   fSumOfWeights->Fill(ret);
 
@@ -573,7 +679,7 @@ AliFMDDensityCalculator::DefineOutput(TList* dir)
 }
 //____________________________________________________________________
 void
-AliFMDDensityCalculator::Print(Option_t*) const
+AliFMDDensityCalculator::Print(Option_t* option) const
 {
   // 
   // Print information 
@@ -581,13 +687,42 @@ AliFMDDensityCalculator::Print(Option_t*) const
   // Parameters:
   //    option Not used
   //
-  char ind[gROOT->GetDirLevel()+1];
+  char ind[gROOT->GetDirLevel()+3];
   for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
   ind[gROOT->GetDirLevel()] = '\0';
   std::cout << ind << "AliFMDDensityCalculator: " << GetName() << '\n'
            << ind << " Multiplicity cut:       " << fMultCut << '\n'
            << ind << " Max(particles):         " << fMaxParticles 
            << std::endl;
+  TString opt(option);
+  opt.ToLower();
+  if (opt.Contains("nomax")) return;
+  
+  std::cout << ind << " Max weights:\n";
+
+  for (UShort_t d=1; d<=3; d++) { 
+    UShort_t nr = (d == 1 ? 1 : 2);
+    for (UShort_t q=0; q<nr; q++) { 
+      ind[gROOT->GetDirLevel()]   = ' ';
+      ind[gROOT->GetDirLevel()+1] = '\0';
+      Char_t      r = (q == 0 ? 'I' : 'O');
+      std::cout << ind << " FMD" << d << r << ":";
+      ind[gROOT->GetDirLevel()+1] = ' ';
+      ind[gROOT->GetDirLevel()+2] = '\0';
+      
+      const TArrayI& a = (d == 1 ? fFMD1iMax : 
+                         (d == 2 ? (r == 'I' ? fFMD2iMax : fFMD2oMax) : 
+                          (r == 'I' ? fFMD3iMax : fFMD3oMax)));
+      Int_t j = 0;
+      for (Int_t i = 0; i < a.fN; i++) { 
+       if (a.fArray[i] < 1) continue; 
+       if (j % 6 == 0)      std::cout << "\n " << ind;
+       j++;
+       std::cout << "  " << std::setw(3) << i << ": " << a.fArray[i];
+      }
+      std::cout << std::endl;
+    }
+  }
 }
 
 //====================================================================
index c74001b15b3af8d4d1700666196e41c65928b719..3bed8ea48943af62bb2b5a32242d06eb933facbd 100644 (file)
@@ -5,11 +5,13 @@
 #define ALIFMDDENSITYCALCULATOR_H
 #include <TNamed.h>
 #include <TList.h>
+#include <TArrayI.h>
 #include "AliForwardUtil.h"
 class AliESDFMD;
 class TH2D;
 class TH1D;
 class TProfile;
+class AliFMDCorrELossFit;
 
 /** 
  * This class calculates the inclusive charged particle density
@@ -60,6 +62,12 @@ public:
    * @return Reference to this object
    */
   AliFMDDensityCalculator& operator=(const AliFMDDensityCalculator& o);
+  /** 
+   * Initialize this sub-algorithm
+   * 
+   * @param etaAxis Not used 
+   */
+  virtual void Init(const TAxis& etaAxis);
   /** 
    * Do the calculations 
    * 
@@ -116,10 +124,50 @@ public:
   /** 
    * Print information 
    * 
-   * @param option Not used
+   * @param option Print options 
+   *   - max  Print max weights 
    */
   void Print(Option_t* option="") const;
 protected:
+  /** 
+   * Find the max weight to use for FMD<i>dr</i> in eta bin @a iEta
+   * 
+   * @param cor   Correction
+   * @param d     Detector 
+   * @param r     Ring 
+   * @param iEta  Eta bin 
+   */
+  Int_t FindMaxWeight(AliFMDCorrELossFit* cor,
+                     UShort_t d, Char_t r, Int_t iEta) const;
+
+  /** 
+   * Find the max weights and cache them 
+   * 
+   */  
+  void CacheMaxWeights();
+  /** 
+   * Find the (cached) maximum weight for FMD<i>dr</i> in 
+   * @f$\eta@f$ bin @a iEta
+   * 
+   * @param d     Detector
+   * @param r     Ring
+   * @param iEta  Eta bin
+   * 
+   * @return max weight or <= 0 in case of problems 
+   */
+  Int_t GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const;
+  /** 
+   * Find the (cached) maximum weight for FMD<i>dr</i> iat
+   * @f$\eta@f$ 
+   * 
+   * @param d     Detector
+   * @param r     Ring
+   * @param eta   Eta bin
+   * 
+   * @return max weight or <= 0 in case of problems 
+   */
+  Int_t GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const;
+
   /** 
    * Get the number of particles corresponding to the signal mult
    * 
@@ -240,12 +288,17 @@ protected:
 
   TList    fRingHistos;    //  List of histogram containers
   Double_t fMultCut;       //  Low cut on scaled energy loss
-  TH1D*    fSumOfWeights;  //! Histogram
-  TH1D*    fWeightedSum;   //! Histogram
-  TH1D*    fCorrections;   //! Histogram
+  TH1D*    fSumOfWeights;  //  Histogram
+  TH1D*    fWeightedSum;   //  Histogram
+  TH1D*    fCorrections;   //  Histogram
   UShort_t fMaxParticles;  //  Maximum particle weight to use 
   TH1D*    fAccI;          //  Acceptance correction for inner rings
   TH1D*    fAccO;          //  Acceptance correction for outer rings
+  TArrayI  fFMD1iMax;      //  Array of max weights 
+  TArrayI  fFMD2iMax;      //  Array of max weights 
+  TArrayI  fFMD2oMax;      //  Array of max weights 
+  TArrayI  fFMD3iMax;      //  Array of max weights 
+  TArrayI  fFMD3oMax;      //  Array of max weights 
   Int_t    fDebug;         //  Debug level 
 
   ClassDef(AliFMDDensityCalculator,1); // Calculate Nch density 
index f1d08ee9b814e971822d1c8ff915dd343b596b0f..bcd00c57210d2ee2c7deaef7baa70cf1dc53723f 100644 (file)
@@ -55,11 +55,11 @@ AliFMDMCSharingFilter::AliFMDMCSharingFilter(const char* title)
   // Parameters:
   //    title Title of object  - not significant 
   //
-  fFMD1i = new TH2D("FMD1i_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
-  fFMD2i = new TH2D("FMD2i_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
-  fFMD2o = new TH2D("FMD2o_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
-  fFMD3i = new TH2D("FMD3i_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
-  fFMD3o = new TH2D("FMD3o_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
+  fFMD1i = new TH2D("FMD1i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
+  fFMD2i = new TH2D("FMD2i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
+  fFMD2o = new TH2D("FMD2o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
+  fFMD3i = new TH2D("FMD3i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
+  fFMD3o = new TH2D("FMD3o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
   fFMD1i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
   fFMD1i->SetXTitle("Hits (MC)");
   fFMD2i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
index 3a261606d822f4ce3cbe056725f0c6ace4c213c2..75e07db241eac4aee0f3d8910b59c62b05b36f92 100644 (file)
@@ -167,42 +167,19 @@ AliForwardMCMultiplicityTask::InitializeSubs()
   // Initialise the sub objects and stuff.  Called on first event 
   // 
   //
+  UInt_t what = AliForwardCorrectionManager::kAll;
+  if (!fEnableLowFlux) 
+    what ^= AliForwardCorrectionManager::kDoubleHit;
+  if (!fCorrections.IsUseMergingEfficiency())
+    what ^= AliForwardCorrectionManager::kMergingEfficiency;
+
   AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
   fcm.Init(fEventInspector.GetCollisionSystem(), 
           fEventInspector.GetEnergy(),
-          fEventInspector.GetField(), 
-          true); // Last true is for MC flag 
-  // Check that we have the energy loss fits, needed by 
-  //   AliFMDSharingFilter 
-  //   AliFMDDensityCalculator 
-  if (!fcm.GetELossFit()) { 
-    AliFatal(Form("No energy loss fits"));
-    return;
-  }
-  // Check that we have the double hit correction - (optionally) used by 
-  //  AliFMDDensityCalculator 
-  if (!fcm.GetDoubleHit()) {
-    AliWarning("No double hit corrections"); 
-  }
-  // Check that we have the secondary maps, needed by 
-  //   AliFMDCorrections 
-  //   AliFMDHistCollector
-  if (!fcm.GetSecondaryMap()) {
-    AliFatal("No secondary corrections");
-    return;
-  }
-  // Check that we have the vertex bias correction, needed by 
-  //   AliFMDCorrections 
-  if (!fcm.GetVertexBias()) { 
-    AliFatal("No event vertex bias corrections");
-    return;
-  }
-  // Check that we have the merging efficiencies, optionally used by 
-  //   AliFMDCorrections 
-  if (!fcm.GetMergingEfficiency()) {
-    AliWarning("No merging efficiencies");
-  }
-
+          fEventInspector.GetField(),
+          true,
+          what);
+  if (!CheckCorrections(what)) return;
 
   const TAxis* pe = fcm.GetEtaAxis();
   const TAxis* pv = fcm.GetVertexAxis();
@@ -462,26 +439,6 @@ AliForwardMCMultiplicityTask::Terminate(Option_t*)
   fCorrections.ScaleHistograms(list,hEventsTrVtx->Integral());
 }
 
-//____________________________________________________________________
-void
-AliForwardMCMultiplicityTask::Print(Option_t* option) const
-{
-  // 
-  // Print information 
-  // 
-  // Parameters:
-  //    option Not used
-  //
-  AliForwardMultiplicityBase::Print(option);
-  gROOT->IncreaseDirLevel();
-  fEventInspector   .Print(option);
-  fEnergyFitter     .Print(option);    
-  fSharingFilter    .Print(option);
-  fDensityCalculator.Print(option);
-  fCorrections      .Print(option);
-  fHistCollector    .Print(option);
-  gROOT->DecreaseDirLevel();
-}
 
 //
 // EOF
index eb9e4a80f8ad481a54895826dbd97d539a36c92e..8dfeab638f34c0aa5dbc010dc17a429cc1f9afd6 100644 (file)
@@ -89,12 +89,6 @@ public:
   /** 
    * @} 
    */
-  /** 
-   * Print information 
-   * 
-   * @param option Not used
-   */
-  void Print(Option_t* option="") const;
   /** 
    * @{ 
    * @name Access to sub-algorithms 
@@ -135,6 +129,42 @@ public:
    * @return Reference to AliFMDHistCollector object 
    */
   AliFMDHistCollector& GetHistCollector() { return fHistCollector; }
+  /**
+   * Get reference to the EventInspector algorithm 
+   * 
+   * @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 
+   * 
+   * @return Reference to AliFMDSharingFilter object 
+   */
+  const AliFMDSharingFilter& GetSharingFilter() const { return fSharingFilter; }
+  /**
+   * Get reference to the DensityCalculator algorithm 
+   * 
+   * @return Reference to AliFMDDensityCalculator object 
+   */
+  const AliFMDDensityCalculator& GetDensityCalculator() const { return fDensityCalculator; }
+  /**
+   * Get reference to the Corrections algorithm 
+   * 
+   * @return Reference to AliFMDCorrections object 
+   */
+  const AliFMDCorrections& GetCorrections() const { return fCorrections; }
+  /**
+   * Get reference to the HistCollector algorithm 
+   * 
+   * @return Reference to AliFMDHistCollector object 
+   */
+  const AliFMDHistCollector& GetHistCollector() const { return fHistCollector; }
   /** 
    * @} 
    */
index 7007a18360e0485cd2d45c239d125dc031f076f2..32d4162e02d207369e4e3ca7678f9496038540c1 100644 (file)
 //   
 // Corrections used 
 #include "AliForwardMultiplicityBase.h"
+#include "AliForwardCorrectionManager.h"
 #include "AliLog.h"
 #include "AliAODHandler.h"
 #include "AliInputEventHandler.h"
 #include "AliAnalysisManager.h"
+#include "AliFMDEventInspector.h"
+#include "AliFMDEnergyFitter.h"
+#include "AliFMDSharingFilter.h"
+#include "AliFMDDensityCalculator.h"
+#include "AliFMDCorrections.h"
+#include "AliFMDHistCollector.h"
 #include <TROOT.h>
 #include <iostream>
 #include <iomanip>
 
 //====================================================================
+Bool_t 
+AliForwardMultiplicityBase::CheckCorrections(UInt_t what) const
+{
+  // 
+  // Check if all needed corrections are there and accounted for.  If not,
+  // do a Fatal exit 
+  // 
+  // Parameters:
+  //    what Which corrections is needed
+  // 
+  // Return:
+  //    true if all present, false otherwise
+  //  
+
+  AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
+  // Check that we have the energy loss fits, needed by 
+  //   AliFMDSharingFilter 
+  //   AliFMDDensityCalculator 
+  if (what & AliForwardCorrectionManager::kELossFits && !fcm.GetELossFit()) { 
+    AliFatal(Form("No energy loss fits"));
+    return false;
+  }
+  // Check that we have the double hit correction - (optionally) used by 
+  //  AliFMDDensityCalculator 
+  if (what & AliForwardCorrectionManager::kDoubleHit && !fcm.GetDoubleHit()) {
+    AliFatal("No double hit corrections"); 
+    return false;
+  }
+  // Check that we have the secondary maps, needed by 
+  //   AliFMDCorrections 
+  //   AliFMDHistCollector
+  if (what & AliForwardCorrectionManager::kSecondaryMap && 
+      !fcm.GetSecondaryMap()) {
+    AliFatal("No secondary corrections");
+    return false;
+  }
+  // Check that we have the vertex bias correction, needed by 
+  //   AliFMDCorrections 
+  if (what & AliForwardCorrectionManager::kVertexBias && 
+      !fcm.GetVertexBias()) { 
+    AliFatal("No event vertex bias corrections");
+    return false;
+  }
+  // Check that we have the merging efficiencies, optionally used by 
+  //   AliFMDCorrections 
+  if (what & AliForwardCorrectionManager::kMergingEfficiency && 
+      !fcm.GetMergingEfficiency()) {
+    AliFatal("No merging efficiencies");
+    return false;
+  }
+  return true;
+}
+
+//____________________________________________________________________
 void
 AliForwardMultiplicityBase::MarkEventForStore() const
 {
@@ -48,8 +109,17 @@ AliForwardMultiplicityBase::Print(Option_t* option) const
   std::cout << "AliForwardMultiplicityBase: " << GetName() << "\n" 
            << "  Enable low flux code:   " << (fEnableLowFlux ? "yes" : "no")
            << std::endl;
+  gROOT->IncreaseDirLevel();
+  GetEventInspector()   .Print(option);
+  GetEnergyFitter()     .Print(option);    
+  GetSharingFilter()    .Print(option);
+  GetDensityCalculator().Print(option);
+  GetCorrections()      .Print(option);
+  GetHistCollector()    .Print(option);
+  gROOT->DecreaseDirLevel();
 }
 
+
 //
 // EOF
 //
index ad25b68e8c09f2d62190a4190194fcd44b31e2c0..b258b6ba65f995cc117f750c75e376a6e9266791 100644 (file)
@@ -137,6 +137,42 @@ public:
    * @return Reference to AliFMDHistCollector object 
    */
   virtual AliFMDHistCollector& GetHistCollector() = 0;
+  /**
+   * Get reference to the EventInspector algorithm 
+   * 
+   * @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 
+   * 
+   * @return Reference to AliFMDSharingFilter object 
+   */
+  virtual const AliFMDSharingFilter& GetSharingFilter() const = 0;
+  /**
+   * Get reference to the DensityCalculator algorithm 
+   * 
+   * @return Reference to AliFMDDensityCalculator object 
+   */
+  virtual const AliFMDDensityCalculator& GetDensityCalculator() const = 0;
+  /**
+   * Get reference to the Corrections algorithm 
+   * 
+   * @return Reference to AliFMDCorrections object 
+   */
+  virtual const AliFMDCorrections& GetCorrections() const = 0;
+  /**
+   * Get reference to the HistCollector algorithm 
+   * 
+   * @return Reference to AliFMDHistCollector object 
+   */
+  virtual const AliFMDHistCollector& GetHistCollector() const = 0;
   /** 
    * @} 
    */
@@ -182,6 +218,15 @@ protected:
     fFirstEvent    = o.fFirstEvent;
     return *this;
   }
+  /** 
+   * Check if all needed corrections are there and accounted for.  If not,
+   * do a Fatal exit 
+   * 
+   * @param what Which corrections is needed
+   * 
+   * @return true if all present, false otherwise
+   */  
+  Bool_t CheckCorrections(UInt_t what) const;
   /** 
    * Mark this event as one to store in the AOD 
    * 
index 196a7dfb05a148b3ad792687f406f49794e08676..19072101ed05330499748fb9ab3bbe41099a5447 100644 (file)
@@ -151,40 +151,19 @@ AliForwardMultiplicityTask::InitializeSubs()
   // Initialise the sub objects and stuff.  Called on first event 
   // 
   //
+  UInt_t what = AliForwardCorrectionManager::kAll;
+  if (!fEnableLowFlux) 
+    what ^= AliForwardCorrectionManager::kDoubleHit;
+  if (!fCorrections.IsUseMergingEfficiency())
+    what ^= AliForwardCorrectionManager::kMergingEfficiency;
+
   AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
   fcm.Init(fEventInspector.GetCollisionSystem(), 
           fEventInspector.GetEnergy(),
-          fEventInspector.GetField());
-  // Check that we have the energy loss fits, needed by 
-  //   AliFMDSharingFilter 
-  //   AliFMDDensityCalculator 
-  if (!fcm.GetELossFit()) { 
-    AliFatal(Form("No energy loss fits"));
-    return;
-  }
-  // Check that we have the double hit correction - (optionally) used by 
-  //  AliFMDDensityCalculator 
-  if (!fcm.GetDoubleHit()) {
-    AliWarning("No double hit corrections"); 
-  }
-  // Check that we have the secondary maps, needed by 
-  //   AliFMDCorrections 
-  //   AliFMDHistCollector
-  if (!fcm.GetSecondaryMap()) {
-    AliFatal("No secondary corrections");
-    return;
-  }
-  // Check that we have the vertex bias correction, needed by 
-  //   AliFMDCorrections 
-  if (!fcm.GetVertexBias()) { 
-    AliFatal("No event vertex bias corrections");
-    return;
-  }
-  // Check that we have the merging efficiencies, optionally used by 
-  //   AliFMDCorrections 
-  if (!fcm.GetMergingEfficiency()) {
-    AliWarning("No merging efficiencies");
-  }
+          fEventInspector.GetField(),
+          false,
+          what);
+  if (!CheckCorrections(what)) return;
 
 
   const TAxis* pe = fcm.GetEtaAxis();
@@ -202,6 +181,7 @@ AliForwardMultiplicityTask::InitializeSubs()
 
   fEnergyFitter.Init(*pe);
   fEventInspector.Init(*pv);
+  fDensityCalculator.Init(*pe);
   fHistCollector.Init(*pv);
 
   this->Print();
@@ -395,26 +375,6 @@ AliForwardMultiplicityTask::Terminate(Option_t*)
   fDensityCalculator.ScaleHistograms(list,hEventsTrVtx->Integral());
   fCorrections.ScaleHistograms(list,hEventsTrVtx->Integral());
 }
-//____________________________________________________________________
-void
-AliForwardMultiplicityTask::Print(Option_t* option) const
-{
-  // 
-  // Print information 
-  // 
-  // Parameters:
-  //    option Not used
-  //
-  AliForwardMultiplicityBase::Print(option);
-  gROOT->IncreaseDirLevel();
-  fEventInspector   .Print(option);
-  fEnergyFitter     .Print(option);    
-  fSharingFilter    .Print(option);
-  fDensityCalculator.Print(option);
-  fCorrections      .Print(option);
-  fHistCollector    .Print(option);
-  gROOT->DecreaseDirLevel();
-}
 
 //
 // EOF
index 25aff1c1e93525a58375e4830e119238580e0679..8e6ade5e4183389076638ec93cedf0d418a6e2e3 100644 (file)
@@ -85,12 +85,6 @@ public:
   /** 
    * @} 
    */
-  /** 
-   * Print information 
-   * 
-   * @param option Not used
-   */
-  void Print(Option_t* option="") const;
   /** 
    * @{ 
    * @name Access to sub-algorithms 
@@ -131,6 +125,42 @@ public:
    * @return Reference to AliFMDHistCollector object 
    */
   AliFMDHistCollector& GetHistCollector() { return fHistCollector; }
+  /**
+   * Get reference to the EventInspector algorithm 
+   * 
+   * @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 
+   * 
+   * @return Reference to AliFMDSharingFilter object 
+   */
+  const AliFMDSharingFilter& GetSharingFilter() const { return fSharingFilter; }
+  /**
+   * Get reference to the DensityCalculator algorithm 
+   * 
+   * @return Reference to AliFMDDensityCalculator object 
+   */
+  const AliFMDDensityCalculator& GetDensityCalculator() const { return fDensityCalculator; }
+  /**
+   * Get reference to the Corrections algorithm 
+   * 
+   * @return Reference to AliFMDCorrections object 
+   */
+  const AliFMDCorrections& GetCorrections() const { return fCorrections; }
+  /**
+   * Get reference to the HistCollector algorithm 
+   * 
+   * @return Reference to AliFMDHistCollector object 
+   */
+  const AliFMDHistCollector& GetHistCollector() const { return fHistCollector; }
   /** 
    * @} 
    */
index 819e3b040c93932b8e4253e4e1083dc7614fd280..c7723886ba2afea3ba120ba00f3df1483c79f9c7 100644 (file)
@@ -163,9 +163,9 @@ namespace {
     Double_t delta    = pp[AliForwardUtil::ELossFitter::kDelta];
     Double_t xi       = pp[AliForwardUtil::ELossFitter::kXi];
     Double_t sigma    = pp[AliForwardUtil::ELossFitter::kSigma];
-    Double_t sigma_n  = pp[AliForwardUtil::ELossFitter::kSigmaN];
+    Double_t sigma  = pp[AliForwardUtil::ELossFitter::kSigmaN];
 
-    return constant * AliForwardUtil::LandauGaus(x, delta, xi, sigma, sigma_n);
+    return constant * AliForwardUtil::LandauGaus(x, delta, xi, sigma, sigmaN);
   }
 
   // 
@@ -178,11 +178,11 @@ namespace {
     Double_t delta     = pp[AliForwardUtil::ELossFitter::kDelta];
     Double_t xi        = pp[AliForwardUtil::ELossFitter::kXi];
     Double_t sigma     = pp[AliForwardUtil::ELossFitter::kSigma];
-    Double_t sigma_n   = pp[AliForwardUtil::ELossFitter::kSigmaN];
+    Double_t sigma   = pp[AliForwardUtil::ELossFitter::kSigmaN];
     Int_t     n        = Int_t(pp[AliForwardUtil::ELossFitter::kN]);
     Double_t* a        = &(pp[AliForwardUtil::ELossFitter::kA]);
 
-    return constant * AliForwardUtil::NLandauGaus(x, delta, xi, sigma, sigma_n,
+    return constant * AliForwardUtil::NLandauGaus(x, delta, xi, sigma, sigmaN,
                                                  n, a);
   }
   // 
@@ -195,10 +195,10 @@ namespace {
     Double_t delta     = pp[AliForwardUtil::ELossFitter::kDelta];
     Double_t xi        = pp[AliForwardUtil::ELossFitter::kXi];
     Double_t sigma     = pp[AliForwardUtil::ELossFitter::kSigma];
-    Double_t sigma_n   = pp[AliForwardUtil::ELossFitter::kSigmaN];
+    Double_t sigma   = pp[AliForwardUtil::ELossFitter::kSigmaN];
     Int_t    i         = Int_t(pp[AliForwardUtil::ELossFitter::kN]);
 
-    return constant * AliForwardUtil::ILandauGaus(x,delta,xi,sigma,sigma_n,i);
+    return constant * AliForwardUtil::ILandauGaus(x,delta,xi,sigma,sigmaN,i);
   }
 
 
@@ -230,7 +230,7 @@ AliForwardUtil::Landau(Double_t x, Double_t delta, Double_t xi)
 //____________________________________________________________________
 Double_t 
 AliForwardUtil::LandauGaus(Double_t x, Double_t delta, Double_t xi,
-                          Double_t sigma, Double_t sigma_n)
+                          Double_t sigma, Double_t sigmaN)
 {
   // 
   // Calculate the value of a Landau convolved with a Gaussian 
@@ -266,8 +266,8 @@ AliForwardUtil::LandauGaus(Double_t x, Double_t delta, Double_t xi,
   //    @f$ f@f$ evaluated at @f$ x@f$.  
   //
   Double_t deltap = delta - xi * mpshift;
-  Double_t sigma2 = sigma_n*sigma_n + sigma*sigma;
-  Double_t sigma1 = sigma_n == 0 ? sigma : TMath::Sqrt(sigma2);
+  Double_t sigma2 = sigmaN*sigmaN + sigma*sigma;
+  Double_t sigma1 = sigmaN == 0 ? sigma : TMath::Sqrt(sigma2);
   Double_t xlow   = x - fgConvolutionNSigma * sigma1;
   Double_t xhigh  = x + fgConvolutionNSigma * sigma1;
   Double_t step   = (xhigh - xlow) / fgConvolutionSteps;
@@ -286,7 +286,7 @@ AliForwardUtil::LandauGaus(Double_t x, Double_t delta, Double_t xi,
 //____________________________________________________________________
 Double_t 
 AliForwardUtil::ILandauGaus(Double_t x, Double_t delta, Double_t xi, 
-                           Double_t sigma, Double_t sigma_n, Int_t i)
+                           Double_t sigma, Double_t sigmaN, Int_t i)
 {
   // 
   // Evaluate 
@@ -312,14 +312,14 @@ AliForwardUtil::ILandauGaus(Double_t x, Double_t delta, Double_t xi,
   // Return:
   //    @f$ f_i @f$ evaluated
   //  
-  Double_t delta_i =  (i == 1 ? delta : i * (delta + xi * TMath::Log(i)));
-  Double_t xi_i    =  i * xi;
-  Double_t sigma_i =  (i == 1 ? sigma : TMath::Sqrt(Double_t(i))*sigma);
-  if (sigma_i < 1e-10) { 
+  Double_t deltaI =  (i == 1 ? delta : i * (delta + xi * TMath::Log(i)));
+  Double_t xiI    =  i * xi;
+  Double_t sigmaI =  (i == 1 ? sigma : TMath::Sqrt(Double_t(i))*sigma);
+  if (sigmaI < 1e-10) { 
     // Fall back to landau 
-    return AliForwardUtil::Landau(x, delta_i, xi_i);
+    return AliForwardUtil::Landau(x, deltaI, xiI);
   }
-  return AliForwardUtil::LandauGaus(x, delta_i, xi_i, sigma_i, sigma_n);
+  return AliForwardUtil::LandauGaus(x, deltaI, xiI, sigmaI, sigmaN);
 }
 
 //____________________________________________________________________
@@ -327,7 +327,7 @@ Double_t
 AliForwardUtil::IdLandauGausdPar(Double_t x, 
                                 UShort_t par,   Double_t dPar, 
                                 Double_t delta, Double_t xi, 
-                                Double_t sigma, Double_t sigma_n
+                                Double_t sigma, Double_t sigmaN
                                 Int_t    i)
 {
   // 
@@ -369,38 +369,38 @@ AliForwardUtil::IdLandauGausdPar(Double_t x,
   if (dPar == 0) return 0;
   Double_t dp      = dPar;
   Double_t d2      = dPar / 2;
-  Double_t delta_i =  i * (delta + xi * TMath::Log(i));
-  Double_t xi_i    =  i * xi;
+  Double_t delta =  i * (delta + xi * TMath::Log(i));
+  Double_t xi    =  i * xi;
   Double_t si      =  TMath::Sqrt(Double_t(i));
-  Double_t sigma_i =  si*sigma;
+  Double_t sigma =  si*sigma;
   Double_t y1      = 0;
   Double_t y2      = 0;
   Double_t y3      = 0;
   Double_t y4      = 0;
   switch (par) {
   case 0: 
-    y1 = ILandauGaus(x, delta_i+i*dp, xi_i, sigma_i, sigma_n, i);
-    y2 = ILandauGaus(x, delta_i+i*d2, xi_i, sigma_i, sigma_n, i);
-    y3 = ILandauGaus(x, delta_i-i*d2, xi_i, sigma_i, sigma_n, i);
-    y4 = ILandauGaus(x, delta_i-i*dp, xi_i, sigma_i, sigma_n, i);
+    y1 = ILandauGaus(x, deltaI+i*dp, xiI, sigmaI, sigmaN, i);
+    y2 = ILandauGaus(x, deltaI+i*d2, xiI, sigmaI, sigmaN, i);
+    y3 = ILandauGaus(x, deltaI-i*d2, xiI, sigmaI, sigmaN, i);
+    y4 = ILandauGaus(x, deltaI-i*dp, xiI, sigmaI, sigmaN, i);
     break;
   case 1: 
-    y1 = ILandauGaus(x, delta_i, xi_i+i*dp, sigma_i, sigma_n, i);
-    y2 = ILandauGaus(x, delta_i, xi_i+i*d2, sigma_i, sigma_n, i);
-    y3 = ILandauGaus(x, delta_i, xi_i-i*d2, sigma_i, sigma_n, i);
-    y4 = ILandauGaus(x, delta_i, xi_i-i*dp, sigma_i, sigma_n, i);
+    y1 = ILandauGaus(x, deltaI, xiI+i*dp, sigmaI, sigmaN, i);
+    y2 = ILandauGaus(x, deltaI, xiI+i*d2, sigmaI, sigmaN, i);
+    y3 = ILandauGaus(x, deltaI, xiI-i*d2, sigmaI, sigmaN, i);
+    y4 = ILandauGaus(x, deltaI, xiI-i*dp, sigmaI, sigmaN, i);
     break;
   case 2: 
-    y1 = ILandauGaus(x, delta_i, xi_i, sigma_i+si*dp, sigma_n, i);
-    y2 = ILandauGaus(x, delta_i, xi_i, sigma_i+si*d2, sigma_n, i);
-    y3 = ILandauGaus(x, delta_i, xi_i, sigma_i-si*d2, sigma_n, i);
-    y4 = ILandauGaus(x, delta_i, xi_i, sigma_i-si*dp, sigma_n, i);
+    y1 = ILandauGaus(x, deltaI, xiI, sigmaI+si*dp, sigmaN, i);
+    y2 = ILandauGaus(x, deltaI, xiI, sigmaI+si*d2, sigmaN, i);
+    y3 = ILandauGaus(x, deltaI, xiI, sigmaI-si*d2, sigmaN, i);
+    y4 = ILandauGaus(x, deltaI, xiI, sigmaI-si*dp, sigmaN, i);
     break;
   case 3: 
-    y1 = ILandauGaus(x, delta_i, xi_i, sigma_i, sigma_n+dp, i);
-    y2 = ILandauGaus(x, delta_i, xi_i, sigma_i, sigma_n+d2, i);
-    y3 = ILandauGaus(x, delta_i, xi_i, sigma_i, sigma_n-d2, i);
-    y4 = ILandauGaus(x, delta_i, xi_i, sigma_i, sigma_n-dp, i);
+    y1 = ILandauGaus(x, deltaI, xiI, sigmaI, sigmaN+dp, i);
+    y2 = ILandauGaus(x, deltaI, xiI, sigmaI, sigmaN+d2, i);
+    y3 = ILandauGaus(x, deltaI, xiI, sigmaI, sigmaN-d2, i);
+    y4 = ILandauGaus(x, deltaI, xiI, sigmaI, sigmaN-dp, i);
     break;
   default:
     return 0;
@@ -417,7 +417,7 @@ AliForwardUtil::IdLandauGausdPar(Double_t x,
 //____________________________________________________________________
 Double_t 
 AliForwardUtil::NLandauGaus(Double_t x, Double_t delta, Double_t xi, 
-                           Double_t sigma, Double_t sigma_n, Int_t n, 
+                           Double_t sigma, Double_t sigmaN, Int_t n, 
                            Double_t* a)
 {
   // 
@@ -449,9 +449,9 @@ AliForwardUtil::NLandauGaus(Double_t x, Double_t delta, Double_t xi,
   // Return:
   //    @f$ f_N(x;\Delta,\xi,\sigma')@f$ 
   //
-  Double_t result = ILandauGaus(x, delta, xi, sigma, sigma_n, 1);
+  Double_t result = ILandauGaus(x, delta, xi, sigma, sigmaN, 1);
   for (Int_t i = 2; i <= n; i++) 
-    result += a[i-2] * AliForwardUtil::ILandauGaus(x,delta,xi,sigma,sigma_n,i);
+    result += a[i-2] * AliForwardUtil::ILandauGaus(x,delta,xi,sigma,sigmaN,i);
   return result;
 }
 namespace { 
@@ -473,7 +473,7 @@ namespace {
 TF1*
 AliForwardUtil::MakeNLandauGaus(Double_t  c, 
                                Double_t  delta, Double_t xi, 
-                               Double_t  sigma, Double_t sigma_n, Int_t n, 
+                               Double_t  sigma, Double_t sigmaN, Int_t n, 
                                Double_t* a, 
                                Double_t  xmin, Double_t xmax)
 {
@@ -508,7 +508,7 @@ AliForwardUtil::MakeNLandauGaus(Double_t  c,
   landaun->SetParameter(AliForwardUtil::ELossFitter::kDelta,  delta);   
   landaun->SetParameter(AliForwardUtil::ELossFitter::kXi,     xi);      
   landaun->SetParameter(AliForwardUtil::ELossFitter::kSigma,  sigma);   
-  landaun->SetParameter(AliForwardUtil::ELossFitter::kSigmaN, sigma_n); 
+  landaun->SetParameter(AliForwardUtil::ELossFitter::kSigmaN, sigmaN); 
   landaun->FixParameter(AliForwardUtil::ELossFitter::kN,      n);       
 
   // Set the range and name of the scale parameters 
@@ -522,7 +522,7 @@ AliForwardUtil::MakeNLandauGaus(Double_t  c,
 TF1*
 AliForwardUtil::MakeILandauGaus(Double_t  c, 
                                Double_t  delta, Double_t xi, 
-                               Double_t  sigma, Double_t sigma_n, Int_t i, 
+                               Double_t  sigma, Double_t sigmaN, Int_t i, 
                                Double_t  xmin, Double_t xmax)
 {
   // 
@@ -554,7 +554,7 @@ AliForwardUtil::MakeILandauGaus(Double_t  c,
   landaui->SetParameter(AliForwardUtil::ELossFitter::kDelta,  delta);   
   landaui->SetParameter(AliForwardUtil::ELossFitter::kXi,     xi);      
   landaui->SetParameter(AliForwardUtil::ELossFitter::kSigma,  sigma);   
-  landaui->SetParameter(AliForwardUtil::ELossFitter::kSigmaN, sigma_n); 
+  landaui->SetParameter(AliForwardUtil::ELossFitter::kSigmaN, sigmaN); 
   landaui->FixParameter(AliForwardUtil::ELossFitter::kN,      i);       
 
   return landaui;
index 4f9f2f7fb3143bf6c6261f402c30a35de901c10f..88fa341a7616b8bdfd8cbd530f15e4e27b18e962 100644 (file)
@@ -73,6 +73,11 @@ public:
   Int_t              fNAccepted;
   /** Number of events accepted */
   Int_t              fNAll;
+  /** Min vertex */
+  Double_t           fVtxMin;
+  /** Max vertex */
+  Double_t           fVtxMax;
+  
     
   //__________________________________________________________________
   /** 
@@ -151,9 +156,11 @@ public:
                      vzMin < 0 ? 'm' : 'p', Int_t(TMath::Abs(vzMin)+.5), 
                      vzMax < 0 ? 'm' : 'p', Int_t(TMath::Abs(vzMax)+.5), 
                      rebin, trgName.Data());
-    fTitle = title;
+    fTitle  = title;
+    fVtxMin = vzMin;
+    fVtxMax = vzMax;
     if (!Open(file, outName)) return kFALSE;
-    if (!Process(vzMin,vzMax,mask)) return kFALSE;
+    if (!Process(mask)) return kFALSE;
     if (!Finish(rebin, mask, energy,doHHD,doComp)) return kFALSE;
 
     return kTRUE;
@@ -211,7 +218,7 @@ public:
    *
    * @return true on success, false otherwise 
    */
-  Bool_t Process(Double_t vzMin, Double_t vzMax, Int_t mask) 
+  Bool_t Process(Int_t mask) 
   {
     fNTriggered       = 0;                    // # of triggered ev.
     fNWithVertex      = 0;                    // # of ev. w/vertex
@@ -275,7 +282,7 @@ public:
       fNWithVertex++;
 
       // Select vertex range (in centimeters) 
-      if (!fAOD->InRange(vzMin, vzMax)) continue; 
+      if (!fAOD->InRange(fVtxMin, fVtxMax)) continue; 
       fNAccepted++;
  
       // Add contribution from this event
@@ -472,7 +479,8 @@ public:
     // Info("DrawIt", "Setting maximum to %f", max);
     stack->SetMinimum(ratios ? -0.1 : 0);
     stack->SetMaximum(max);
-    FixAxis(stack, 1/(1-yd)/1.5, "#frac{1}{N} #frac{dN_{ch}}{#eta}");
+    FixAxis(stack, 1/(1-yd)/1.5, 
+           "#frac{1}{#it{N}} #frac{#it{dN}_{ch}}{#it{d#eta}}");
     p1->Clear();
     stack->DrawClone("nostack e1");
 
@@ -502,21 +510,39 @@ public:
     tit->Draw();
 
     // Put a nice label in the plot 
+    TString eS;
+    if (energy > 1000) eS = Form("%4.2fTeV", float(energy)/1000);
+    else               eS = Form("%3dGeV", energy);
     TLatex* tt = new TLatex(.93, .93, 
-                           Form("#sqrt{s}=%dGeV, %s", energy,
+                           Form("#sqrt{s}=%s, %s", eS.Data(),
                                 AliAODForwardMult::GetTriggerString(mask)));
     tt->SetNDC();
     tt->SetTextFont(132);
     tt->SetTextAlign(33);
     tt->Draw();
 
-    // Mark the plot as preliminary 
-    TLatex* pt = new TLatex(.93, .88, "Preliminary");
+    // Put number of accepted events on the plot 
+    TLatex* et = new TLatex(.93, .83, Form("%d events", fNAccepted));
+    et->SetNDC();
+    et->SetTextFont(132);
+    et->SetTextAlign(33);
+    et->Draw();
+
+    // Put number of accepted events on the plot 
+    TLatex* vt = new TLatex(.93, .88, 
+                           Form("v_{z}#in[%+5.1f,%+5.1f]cm", fVtxMin, fVtxMax));
+    vt->SetNDC();
+    vt->SetTextFont(132);
+    vt->SetTextAlign(33);
+    vt->Draw();
+
+    // Mark the plot as preliminary
+    TLatex* pt = new TLatex(.12, .93, "Preliminary");
     pt->SetNDC();
     pt->SetTextFont(22);
     pt->SetTextSize(0.07);
     pt->SetTextColor(kRed+1);
-    pt->SetTextAlign(33);
+    pt->SetTextAlign(13);
     pt->Draw();
     c->cd();
 
index 9758949a75aded068e8f1fadc065ad6ece5fb256..0799a876cf65561e22b469f0c071aaa6cf37ea05 100644 (file)
  * @ingroup pwg2_forward_scripts
  */
 void MakeAOD(const char* esddir, 
-            Int_t       nEvents=1000
-            Bool_t      proof=false,
+            Int_t       nEvents=-1
+            Int_t       proof=0,
             Bool_t      mc=false)
 {
   // --- Libraries to load -------------------------------------------
   gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
 
   // --- Check for proof mode, and possibly upload pars --------------
-  if (proof) 
-    gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadPars.C");
+  if (proof> 0) { 
+    gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadPars.C");
+    LoadPars(proof);
+  }
   
   // --- Our data chain ----------------------------------------------
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/MakeESDChain.C");
-  TChain* chain = MakeESDChain(esddir,mc);
+  TChain* chain = MakeESDChain(esddir,true);
   // If 0 or less events is select, choose all 
   if (nEvents <= 0) nEvents = chain->GetEntries();
 
@@ -54,7 +56,6 @@ void MakeAOD(const char* esddir,
                                  "Cascades "
                                  "MuonTracks "
                                  "TrdTracks "
-                                 "CaloClusters "
                                  "HLTGlobalTrigger");
   mgr->SetInputEventHandler(esdHandler);      
        
@@ -71,10 +72,23 @@ void MakeAOD(const char* esddir,
   aodHandler->SetOutputFileName("AliAODs.root");
 
   // --- Add tasks ---------------------------------------------------
-  gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskFMD.C");
+  // Physics selection 
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
-  AddTaskFMD(mc);
   AddTaskPhysicsSelection(mc, kTRUE, kTRUE);
+
+#if 0
+  // Centrality 
+  gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/Compile.C");
+  // gDebug = 10;
+  Compile("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskCopyHeader.C","+");
+  // gDebug = 0;
+  AddTaskCopyHeader();
+#endif
+
+  // FMD 
+  gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskFMD.C");
+  AddTaskFMD(mc);
+
   
   // --- Run the analysis --------------------------------------------
   TStopwatch t;
index e2d3a549a4939023c01dca999d15b3d53776f1ca..9a65c20dde7700427f86fa4730b4b75477ee7dda 100644 (file)
  */
 void
 Pass1(const char* esddir=".", 
-      Int_t       nEvents=1000,
-      Bool_t      proof=false
+      Int_t       nEvents=-1,
+      Int_t       proof=0
       Bool_t      mc=false)
 {
-  Printf("  MC:            %s", mc    ? "yes" : "no");
-  Printf("  Proof mode     %s", proof ? "yes" : "no");
+  Printf("  MC:            %s", mc        ? "yes" : "no");
+  Printf("  Proof mode     %s", proof > 0 ? "yes" : "no");
 
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/MakeAOD.C"); 
 
index 3103fc33b76a713f6c2b733d3b2db84cf5c32f52..db6ff8b9f6d60c498bce6b7073f07fc0fff92aca 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash 
 
 ana=$ALICE_ROOT/PWG2/FORWARD/analysis2
-nev=10000
+nev=-1
 noanal=0
 nodraw=0
 rebin=1
@@ -35,7 +35,7 @@ Options:
        -t,--trigger TYPE       Select trigger TYPE        ($type)
        -e,--energy CMS         Center of mass energy      ($cms)
        -b,--batch              Do batch processing        ($batch)
-       -P,--proof              Run in PROOF(Lite) mode    ($proof)
+       -P,--proof NWORKERS     Run in PROOF(Lite) mode    ($proof)
        -M,--mc                 Run over MC data           ($mc)
        -S,--title STRING       Set the title string       ($tit)
        -g,--gdb                Run in GDB mode            ($gdb)
@@ -48,6 +48,7 @@ TYPE is a comma or space separated list of
   INEL>0      As above + N_ch > 0 in -0.5<eta<+0.5
   NSD         Non-single diffractive ((VOA&VOC)|N_ch > 5 -1.9<eta<+1.9)
 
+If NWORKERS is 0, then the analysis will be run in local mode. 
 EOF
 }
 
@@ -64,7 +65,7 @@ while test $# -gt 0 ; do
        -2|--pass2)          noanal=`toggle $noanal`   ;; 
        -1|--pass1)          nodraw=`toggle $nodraw`   ;; 
        -b|--batch)          batch=`toggle $batch`   ;; 
-       -P|--proof)          proof=`toggle $proof`   ;; 
+       -P|--proof)          proof=$2         ; shift ;; 
        -M|--mc)             mc=`toggle $mc`   ;; 
        -g|--gdb)            gdb=`toggle $gdb`   ;; 
        -H|--hhd)            hhd=`toggle $hhd`   ;; 
@@ -82,7 +83,11 @@ while test $# -gt 0 ; do
     shift
 done 
 
-base=`printf dndeta_%07d $nev`
+if test $nev -lt 0 ; then 
+    base=dndeta_xxxxxxx
+else 
+    base=`printf dndeta_%07d $nev`
+fi
 opts="-l -x"
 opts1=""
 redir=
@@ -120,9 +125,6 @@ fi
 
 if test $nodraw -lt 1 ; then
     rm -f result.root 
-    if test "x$tit" = "x" ; then 
-       tit="$nev events, v_{z}#in[$vzmin,$vzmax], $type"
-    fi
     tit=`echo $tit | tr ' ' '@'` 
     echo "Running aliroot ${opts} ${opts1} ${ana}/Pass2.C\(\"AliAODs.root\",\"$type\",$cms,$vzmin,$vzmax,$rebin,$hhd,$comp\)"
     aliroot ${opts} ${ana}/Pass2.C\(\"AliAODs.root\",\"$type\",$cms,$vzmin,$vzmax,$rebin,\"$tit\",$hhd,$comp\)
index 590d712932d00d7e6d26c24d02dd1051fd1d59bf..d97e561cb0c1c2fb8b692176b8a6e3bc94eb6f10 100644 (file)
@@ -3,9 +3,9 @@
  * 
  */
 void
-LoadPars()
+LoadPars(Int_t nWorkers=4)
 {
-  TProof::Open("workers=2");
+  TProof::Open(Form("workers=%d", nWorkers));
   const char* pkgs[] = { "STEERBase", "ESD", "AOD", "ANALYSIS", 
                         "ANALYSISalice", "PWG2forward2", 0};
   const char** pkg = pkgs;