]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added possibility to only accumulate statistics for MB events.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Oct 2013 07:08:14 +0000 (07:08 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Oct 2013 07:08:14 +0000 (07:08 +0000)
This is to prevent a possible bias in case the MB trigger is
downscaled relative to the other triggers active.

PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C
PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx
PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.h
PWGLF/FORWARD/analysis2/trains/MakeFMDELossTrain.C

index a43732196e13280eb17d63f535c43106e24b0a17..f957dfe366ab2de281f1ad9db6226d8158256c20 100644 (file)
 /**
  * This is the macro to include the FMD energy fitter in a train.  
  * 
- * @param mc      Assume MC input 
- * @param useCent Use centrality information 
- * @param debug   Debug level
+ * @param mc        Assume MC input 
+ * @param useCent   Use centrality information 
+ * @param onlyMB    Only collect statistics for MB (INEL) events
+ * @param debug     Debug level
  * @param residuals If set, also do residuals 
  *
  * @return Newly created task 
  * @ingroup pwglf_forward_eloss
  */
 AliAnalysisTask*
-AddTaskFMDELoss(Bool_t mc, Bool_t useCent, Int_t debug=0,
+AddTaskFMDELoss(Bool_t        mc, 
+               Bool_t        useCent,
+               Bool_t        onlyMB=false, 
+               Int_t         debug=0,
                const Char_t* residuals="")
 {
   // --- Load libraries ----------------------------------------------
@@ -44,9 +48,6 @@ AddTaskFMDELoss(Bool_t mc, Bool_t useCent, Int_t debug=0,
   
   // --- Make the task and add it to the manager ---------------------
   AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("ForwardELoss");
-  // task->SetBLow(blow);
-  // task->SetBLow(bhigh);
-  
   // --- Set parameters on the algorithms ----------------------------
   // Set the number of SPD tracklets for which we consider the event a
   // low flux event
@@ -77,7 +78,10 @@ AddTaskFMDELoss(Bool_t mc, Bool_t useCent, Int_t debug=0,
   // Set the minimum number of entries in the distribution before
   // trying to fit to the data - 10K seems the absolute minimum
   task->GetEnergyFitter().SetMinEntries(10000);
-  // Debug 
+  // If set, only collect statistics for MB.  This is to prevent a
+  // bias when looping over data where the MB trigger is downscaled.
+  task->SetOnlyMB(onlyMB);
+  // Debug
   task->SetDebug(debug);
 
   TString resi(residuals);
index d85aac542cdb393e5514a79aa67800078a2cb665..89ac621b514ea438a5232e6487cbcced36f4da07 100644 (file)
@@ -34,8 +34,7 @@ AliFMDEnergyFitterTask::AliFMDEnergyFitterTask()
   : AliBaseESDTask(),
     fEventInspector(),
     fEnergyFitter(),
-    fbLow(0),
-    fbHigh(100)
+    fOnlyMB(false)
 {
   // 
   // Constructor
@@ -49,8 +48,7 @@ AliFMDEnergyFitterTask::AliFMDEnergyFitterTask(const char* name)
   : AliBaseESDTask(name, "", &(AliForwardCorrectionManager::Instance())), 
     fEventInspector("event"),
     fEnergyFitter("energy"),
-    fbLow(0),
-    fbHigh(100)
+    fOnlyMB(false)
 {
   // 
   // Constructor 
@@ -107,6 +105,7 @@ AliFMDEnergyFitterTask::Book()
 
   fEnergyFitter.CreateOutputObjects(fList);
 
+  fList->Add(AliForwardUtil::MakeParameter("onlyMB", fOnlyMB));
   return true;
 }
 //____________________________________________________________________
@@ -166,6 +165,9 @@ AliFMDEnergyFitterTask::Event(AliESDEvent& esd)
   // We want only the events found by off-line 
   if (!(triggers & AliAODForwardMult::kOffline)) return false;
 
+  // Perhaps we should also insist on MB only 
+  if (fOnlyMB && (!(triggers & AliAODForwardMult::kInel))) return false;
+
   //  if(cent > 0) {
   //  if( cent < 40 || cent >50 ) return;
   //  else std::cout<<"selecting event with cent "<<cent<<std::endl;
@@ -201,6 +203,11 @@ AliFMDEnergyFitterTask::Finalize()
   return true;
 }
 
+#define PFB(N,FLAG)                            \
+  do {                                                                 \
+    AliForwardUtil::PrintName(N);                                      \
+    std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
+  } while(false)
 //____________________________________________________________________
 void
 AliFMDEnergyFitterTask::Print(Option_t* option) const
@@ -213,6 +220,7 @@ AliFMDEnergyFitterTask::Print(Option_t* option) const
   //
   AliBaseESDTask::Print(option);
   gROOT->IncreaseDirLevel();
+  PFB("Only MB", fOnlyMB);
   fEnergyFitter.Print(option);
   gROOT->DecreaseDirLevel();
 }
index a0f34129a96a63b50d6e6c52db0a5dd8c54043b4..86d0e0e7caa5e22c792766b4864b57ca9ca17881 100644 (file)
@@ -135,17 +135,12 @@ public:
    */
   void SetDebug(Int_t dbg);
   /** 
-   * Set low cut on B
+   * Set whether to only look at MB (INEL) data, so as to avoid 
+   * bias from different trigger scalars. 
    * 
-   * @param b Low cut
+   * @param onlyMB if true, only analyse MB events
    */
-  void SetBLow(Float_t b) {fbLow = b;}
-  /** 
-   * Set high cut on B
-   * 
-   * @param b high cut
-   */
-  void SetBHigh(Float_t b) {fbHigh = b;}
+  void SetOnlyMB(Bool_t onlyMB) { fOnlyMB = onlyMB; }
   /* @} */
   /** 
    * @{ 
@@ -188,10 +183,9 @@ protected:
 
   AliFMDEventInspector fEventInspector; // Algorithm
   AliFMDEnergyFitter   fEnergyFitter;   // Algorithm
-  Float_t              fbLow;           // What's this?
-  Float_t              fbHigh;          // What's this? 
-  
-  ClassDef(AliFMDEnergyFitterTask,3) // Forward multiplicity class
+  Bool_t               fOnlyMB;         // Only MB flag
+
+  ClassDef(AliFMDEnergyFitterTask,4) // Forward multiplicity class
 };
 
 #endif
index 25381d844578407d5c6fd9de077d0d326c57999a..65034e10a65f3661b0f918a5b53768cc05307156 100644 (file)
@@ -29,6 +29,7 @@ public:
     : TrainSetup(name)
   {
     fOptions.Add("cent", "Use centrality");
+    fOptions.Add("only-mb", "Only collect statistics from MB events");
     fOptions.Add("residuals", "MODE", "Optional calculation of residuals", "");
     fOptions.Set("type", "ESD");
   }
@@ -66,15 +67,16 @@ protected:
                             gROOT->GetMacroPath()));
 
     // --- Check if this is MC ---------------------------------------
-    Bool_t   mc   = mgr->GetMCtruthEventHandler() != 0;
-    Bool_t   cent = fOptions.Has("cent");
-    Int_t    verb = fOptions.AsInt("verbose");
-    TString  resi = "";
+    Bool_t   mc     = HasMCHandler();
+    Bool_t   cent   = fOptions.Has("cent");
+    Bool_t   onlyMB = fOptions.AsBool("only-mb");
+    Int_t    verb   = fOptions.AsInt("verbose");
+    TString  resi   = "";
     if (fOptions.Has("residuals")) resi = fOptions.Get("residuals"); 
 
     // --- Add the task ----------------------------------------------
-    gROOT->Macro(Form("AddTaskFMDELoss.C(%d,%d,%d,\"%s\")", 
-                     mc, cent, verb, resi.Data()));
+    AddTask("AddTaskFMDELoss.C", Form("%d,%d,%d,%d,\"%s\")", 
+                                     mc, cent, onlyMB, verb, resi.Data()));
   }
   /** 
    * Create entrality selection if enabled 
@@ -155,7 +157,7 @@ protected:
   }
   void PostShellCode(std::ostream& f)
   {
-    Bool_t   mc   = mgr->GetMCtruthEventHandler() != 0;
+    Bool_t   mc   = HasMCHandler();
     f << "  echo \"=== Extracting Corrections ...\"\n"
       << "  aliroot -l -b -q ${prefix}Extract.C\n"
       << "  echo \"=== Summarizing results ...\"\n"