]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/MakedNdeta.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / MakedNdeta.C
index 8351a01ba6f0b4007fa313f314f20166cb6031e2..03d7e0988243c9780f1c4ec5e76dcde9e31c5805 100644 (file)
  * 
  * @ingroup pwglf_forward_scripts_makers
  */
+//====================================================================
 /** 
  * Run second pass analysis - make @f$ dN/d\eta@f$
  * 
- * If the ROOT AliEn interface library (libRAliEn) can be loaded, 
- * and the parameter @a name is not empty, then use the plugin to do
- * the analysis.  Note that in this case, the output is placed 
- * in a sub-directory named by @a name after escaping spaces and special 
- * characters 
- * 
- * @param aoddir     AOD input directory. Any file matching the pattern 
- *                   *AliAODs*.root are added to the chain 
- * @param nEvents    Number of events to process.  If 0 or less, then 
- *                   all events are analysed
- * @param trig       Trigger to use 
- * @param useCent    Whether to use centrality or not 
- * @param scheme     Normalisation scheme 
- * @param vzMin      Least @f$ v_z@f$ (centimeter)
- * @param vzMax      Largest @f$ v_z@f$ (centimeter)
- * @param proof      If larger then 1, run in PROOF-Lite mode with this 
- *                   many number of workers. 
  * @param name       Name of train - free form.  This will be the name
  *                   of the output directory if the plug-in is used 
- * @param mcfile     Final MC corrections from this, if present
+ * @param options    Options string
+ * @param url        Execution and input URL
  *
- * @ingroup pwglf_forward_dndeta
+ * @ingroup pwglf_forward_aod
  */
-void MakedNdeta(const char* aoddir   = ".", 
-               Int_t       nEvents  = -1, 
-               const char* trig     = "INEL",
-               Bool_t      useCent  = false,
-               const char* scheme   = 0,
-               Double_t    vzMin    = -10,
-               Double_t    vzMax    = +10,
-               Int_t       proof    = 0,
-               const char* name     = 0,
-               const char* mcfile   = 0)
+void MakedNdeta(TString     name       = "aod", 
+               TString     url        = "help",
+               TString     options    = "help")
 {
-  if ((name && name[0] != '\0') && gSystem->Load("libRAliEn") >= 0) {
-    gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2:"
-                            "$ALICE_ROOT/ANALYSIS/macros",
-                            gROOT->GetMacroPath()));
-    gSystem->AddIncludePath("-I${ALICE_ROOT}/include");
-    gSystem->Load("libANALYSIS");
-    gSystem->Load("libANALYSISalice");
-    gROOT->LoadMacro("TrainSetup.C+");
-    MakedNdetaTrain t(name, trig, vzMin, vzMax, scheme, useCent, false);
-    t.SetDataDir(aoddir);
-    t.SetDataSet("");
-    t.SetAllowOverwrite(true);
-    t.SetProofServer(Form("workers=%d",proof));
-    t.Run(proof > 0 ? "PROOF" : "LOCAL", "FULL", nEvents, proof > 0);
-    return;
-  }
-  // --- Libraries to load -------------------------------------------
-  gROOT->Macro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C");
-
-  // --- Check for proof mode, and possibly upload pars --------------
-  if (proof> 0) { 
-    gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadPars.C");
-    LoadPars(proof);
-  }
-  
-  // --- Our data chain ----------------------------------------------
-  gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/MakeChain.C");
-  TChain* chain = MakeChain("AOD", aoddir,true);
-  // If 0 or less events is select, choose all 
-  if (nEvents <= 0) nEvents = chain->GetEntries();
-
-  // --- Set the macro path ------------------------------------------
-  gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2:"
-                          "$ALICE_ROOT/ANALYSIS/macros",
-                          gROOT->GetMacroPath()));
-
-  // --- Creating the manager and handlers ---------------------------
-  AliAnalysisManager *mgr  = new AliAnalysisManager(name, "Forward dN/deta");
-  AliAnalysisManager::SetCommonFileName("forward_dndeta.root");
-
-  // --- ESD input handler -------------------------------------------
-  AliAODInputHandler *aodInputHandler = new AliAODInputHandler();
-  mgr->SetInputEventHandler(aodInputHandler);      
-       
-  // --- Add tasks ---------------------------------------------------
-  // Forward 
-  gROOT->LoadMacro("AddTaskForwarddNdeta.C");
-  AddTaskForwarddNdeta(trig, vzMin, vzMax, useCent, scheme, true, mcfile);
-  // Central
-  gROOT->LoadMacro("AddTaskCentraldNdeta.C");
-  AddTaskCentraldNdeta(trig, vzMin, vzMax, useCent, scheme,false, mcfile);
-  // MC
-  gROOT->LoadMacro("AddTaskMCTruthdNdeta.C");
-  AddTaskMCTruthdNdeta(trig, vzMin, vzMax, useCent, scheme);
+  gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/trains/MakeTrain.C");
 
-  
-  // --- Run the analysis --------------------------------------------
-  TStopwatch t;
-  if (!mgr->InitAnalysis()) {
-    Error("MakedNdeta", "Failed to initialize analysis train!");
-    return;
-  }
-  // Skip terminate if we're so requested and not in Proof or full mode
-  mgr->SetSkipTerminate(false);
-  // Some informative output 
-  mgr->PrintStatus();
-  // mgr->SetDebugLevel(3);
-  if (mgr->GetDebugLevel() < 1 && !proof) 
-    mgr->SetUseProgressBar(kTRUE,100);
-  
-  // Run the train 
-  t.Start();
-  Printf("=== RUNNING ANALYSIS ==================================");
-  mgr->StartAnalysis(proof ? "proof" : "local", chain, nEvents);
-  t.Stop();
-  t.Print();
+  MakeTrain(name, "MakedNdetaTrain", url, options);
 }
 //
 // EOF