]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/trains/MakeFMDELossTrain.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / trains / MakeFMDELossTrain.C
index 1988169a031dc4daeca5f76d84edf2796c6b2eeb..867ff5f9758f63cfc8e2b6947668953703641439 100644 (file)
@@ -28,9 +28,9 @@ public:
   MakeFMDELossTrain(const char* name  = "FMD Energy Loss")
     : 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.Add("config",  "FILE", "Configuration", "elossFitConfig.C");
+    fOptions.Add("corr",    "DIR",  "Corrections dir", "");
     fOptions.Set("type", "ESD");
   }
 protected:
@@ -60,7 +60,7 @@ protected:
     AliAnalysisManager::SetCommonFileName("forward_eloss.root");
 
     // --- Load libraries/pars ---------------------------------------
-    fHelper->LoadLibrary("PWGLFforward2");
+    fRailway->LoadLibrary("PWGLFforward2");
     
     // --- Set load path ---------------------------------------------
     gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2",
@@ -68,15 +68,20 @@ protected:
 
     // --- Check if this is MC ---------------------------------------
     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"); 
+    TString  config = fOptions.Get("config"); 
+    TString  corrs  = "";
+    if (fOptions.Has("corr")) corrs = fOptions.Get("corr"); 
 
     // --- Add the task ----------------------------------------------
-    AddTask("AddTaskFMDELoss.C", Form("%d,%d,%d,%d,\"%s\"", 
-                                     mc, cent, onlyMB, verb, resi.Data()));
+    CoupleCar("AddTaskFMDELoss.C", Form("%d,%d,\"%s\",\"%s\"", 
+                                       mc, onlyMB,  
+                                       config.Data(), 
+                                       corrs.Data()));
+    fRailway->LoadAux(gSystem->Which(gROOT->GetMacroPath(), config), true);
+    if (!corrs.IsNull())
+      fRailway->LoadAux(Form("%s/fmd_corrections.root",corrs.Data()), true);
+    
   }
   /** 
    * Create entrality selection if enabled 
@@ -84,17 +89,10 @@ protected:
    * @param mc   Whether this is MC or not
    * @param mgr  Analysis manager 
    */
-  virtual void CreateCentralitySelection(Bool_t mc, AliAnalysisManager* mgr)
+  virtual void CreateCentralitySelection(Bool_t mc)
   {
     if (!fOptions.Has("cent")) return;
-
-    const char* name = "CentralitySelection";
-    gROOT->Macro("AddTaskCentrality.C");
-    AliCentralitySelectionTask* ctask = 
-      dynamic_cast<AliCentralitySelectionTask*>(mgr->GetTask(name));
-    if (!ctask) return;
-    // ctask->SetPass(fESDPass);
-    if (mc) ctask->SetMCInput();
+    TrainSetup::CreateCentralitySelection(mc);    
   }
   /** 
    * Crete output handler - we don't want one here. 
@@ -167,7 +165,7 @@ protected:
     f << std::boolalpha 
       << "// Generated by " << ClassName() << "\n"
       << "// If force=true, then force set parameters\n"
-      << "// If shift=true, enable extra shift in Delta from \sigma/xi
+      << "// If shift=true, enable extra shift in Delta from sigma/xi\n"
       << "//\n"
       << "void ReFit(Bool_t      force=false,\n"
       << "           Bool_t      shift=true,\n"