]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/trains/MakeQATrain.C
Merge branch 'TPCdev' of https://git.cern.ch/reps/AliRoot into TPCdev
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / trains / MakeQATrain.C
1 /**
2  * @file   MakeQATrain.C
3  * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk>
4  * @date   Fri Jun  1 13:55:02 2012
5  * 
6  * @brief  
7  * 
8  * 
9  * @ingroup pwglf_forward_trains_specific
10  */
11 #include "TrainSetup.C"
12
13 //====================================================================
14 /**
15  * Analysis train to do Quality assurance
16  * 
17  * @ingroup pwglf_forward_trains_specific
18  * @ingroup pwglf_forward_qa
19  */
20 class MakeQATrain : public TrainSetup
21 {
22 public:
23   /** 
24    * Constructor.  Date and time must be specified when running this
25    * in Termiante mode on Grid
26    * 
27    * @param name     Name of train 
28    */
29   MakeQATrain(const char* name  = "Forward QA") 
30     : TrainSetup(name)
31   {
32     fOptions.Add("cent", "Use centrality");
33     fOptions.Set("type", "ESD");
34     fOptions.Add("corr", "DIR", "Corrections dir", "");
35   }
36 protected:
37   //__________________________________________________________________
38   /** 
39    * Create the tasks 
40    * 
41    * @param mgr  Analysis manager 
42    */
43   void CreateTasks(AliAnalysisManager* mgr)
44   {
45     // --- Output file name ------------------------------------------
46     AliAnalysisManager::SetCommonFileName("forward_qa.root");
47
48     // --- Load libraries/pars ---------------------------------------
49     fRailway->LoadLibrary("PWGLFforward2");
50     
51     // --- Set load path ---------------------------------------------
52     gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2",
53                              gROOT->GetMacroPath()));
54
55     // --- Check if this is MC ---------------------------------------
56     Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
57
58     // --- Add the task ----------------------------------------------
59     if (!CoupleCar("AddTaskForwardQA.C", 
60                    Form("%d,%d", mc, fOptions.Has("cent"))))
61       Fatal("CreateTasks", "Failed to add ForwardQA task");
62
63     TString  cor = "";
64     if (fOptions.Has("corr")) cor = fOptions.Get("corr"); 
65     if (!cor.IsNull()) {
66       fRailway->LoadAux(Form("%s/fmd_corrections.root",cor.Data()), true);
67     }
68   }
69   /** 
70    * Create entrality selection if enabled 
71    * 
72    * @param mc   Whether this is MC or not
73    * @param mgr  Analysis manager 
74    */
75   virtual void CreateCentralitySelection(Bool_t mc)
76   {
77     if (!fOptions.Has("cent")) return;
78     TrainSetup::CreateCentralitySelection(mc);    
79   }
80   /** 
81    * Crete output handler - we don't want one here. 
82    * 
83    * @return 0
84    */
85   AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
86   //__________________________________________________________________
87   const char* ClassName() const { return "MakeQATrain"; }
88 };
89
90 //
91 // EOF
92 //