]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/trains/MakeMCCorrTrain.C
Documentation fixes for doxygen
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / trains / MakeMCCorrTrain.C
1 #include "TrainSetup.C"
2
3 //====================================================================
4 /**
5  * Analysis train to make Forward and Central MC corrections
6  * 
7  * To run, do 
8  * @code 
9  * gROOT->LoadMacro("TrainSetup.C");
10  * // Make train 
11  * MakeMCCorrTrain t("My Analysis");
12  * // Set variaous parameters on the train 
13  * t.SetDataDir("/home/of/data");
14  * t.AddRun(118506)
15  * // Run it 
16  * t.Run("LOCAL", "FULL", -1, false, false);
17  * @endcode 
18  *
19  * @ingroup pwg2_forward_mc
20  * @ingroup pwg2_forward_trains
21  */
22 class MakeMCCorrTrain : public TrainSetup
23 {
24 public:
25   /** 
26    * Constructor.  Date and time must be specified when running this
27    * in Termiante mode on Grid
28    * 
29    * @param name     Name of train (free form)
30    * @param dateTime Append date and time to name 
31    * @param year     Year     - if not specified, current year
32    * @param month    Month    - if not specified, current month
33    * @param day      Day      - if not specified, current day
34    * @param hour     Hour     - if not specified, current hour
35    * @param min      Minutes  - if not specified, current minutes
36    */
37   MakeMCCorrTrain(const  char* name, 
38                   Bool_t       dateTime = false,
39                   UShort_t     year     = 0, 
40                   UShort_t     month    = 0, 
41                   UShort_t     day      = 0, 
42                   UShort_t     hour     = 0, 
43                   UShort_t     min      = 0) 
44     : TrainSetup(name, dateTime, 
45                  year, month, day, hour, min)
46   {}
47   /** 
48    * Run this analysis 
49    * 
50    * @param mode     Mode - see TrainSetup::EMode
51    * @param oper     Operation - see TrainSetup::EOperation
52    * @param nEvents  Number of events (negative means all)
53    * @param usePar   If true, use PARs 
54    */
55   void Run(const char* mode, const char* oper, 
56            Int_t nEvents=-1, Bool_t usePar=false)
57   {
58     Info("Run", "Running in mode=%s, oper=%s, events=%d, Par=%d", 
59          mode, oper, nEvents, usePar);
60     Exec("ESD", mode, oper, nEvents, true, usePar);
61   }
62   /** 
63    * Run this analysis 
64    * 
65    * @param mode     Mode - see TrainSetup::EMode
66    * @param oper     Operation - see TrainSetup::EOperation
67    * @param nEvents  Number of events (negative means all)
68    * @param usePar   If true, use PARs 
69    */
70   void Run(EMode mode, EOper oper, Int_t nEvents=-1,
71            Bool_t usePar = false)
72   {
73     Info("Run", "Running in mode=%d, oper=%d, events=%d, Par=%d", 
74          mode, oper, nEvents, usePar);
75     Exec(kESD, mode, oper, nEvents, true, usePar);
76   }
77 protected:
78   /** 
79    * Create the tasks 
80    * 
81    * @param mode Processing mode
82    * @param par  Whether to use par files 
83    * @param mgr  Analysis manager 
84    */
85   void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager* mgr)
86   {
87     // --- Output file name ------------------------------------------
88     AliAnalysisManager::SetCommonFileName("forward_mccorr.root");
89
90     // --- Load libraries/pars ---------------------------------------
91     LoadLibrary("PWG2forward2", mode, par, true);
92     
93     // --- Set load path ---------------------------------------------
94     gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWG2/FORWARD/analysis2",
95                              gROOT->GetMacroPath()));
96
97     // --- Check if this is MC ---------------------------------------
98     if (!mgr->GetMCtruthEventHandler()) return;
99     
100     // --- Add the task ----------------------------------------------
101     gROOT->Macro("AddTaskForwardMCCorr.C"); 
102
103     // --- Add the task ----------------------------------------------
104     gROOT->Macro("AddTaskCentralMCCorr.C");
105   }
106   //__________________________________________________________________
107   /** 
108    * Create physics selection , and add to manager
109    * 
110    * @param mc Whether this is for MC 
111    * @param mgr Manager 
112    */
113   void CreatePhysicsSelection(Bool_t mc,
114                               AliAnalysisManager* mgr)
115   {
116     TrainSetup::CreatePhysicsSelection(mc, mgr);
117
118     // --- Get input event handler -----------------------------------
119     AliInputEventHandler* ih =
120       dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
121     if (!ih) 
122       Fatal("CreatePhysicsSelection", "Couldn't get input handler (%p)", ih);
123     
124     // --- Get Physics selection -------------------------------------
125     AliPhysicsSelection* ps = 
126       dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
127     if (!ps) 
128       Fatal("CreatePhysicsSelection", "Couldn't get PhysicsSelection (%p)", ps);
129
130     // --- Ignore trigger class when selecting events.  This means ---
131     // --- that we get offline+(A,C,E) events too --------------------
132     // ps->SetSkipTriggerClassSelection(true);
133   }
134   /** 
135    * Do not the centrality selection
136    */
137   void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {}
138   Double_t fVzMin;     // Least v_z
139   Double_t fVzMax;     // Largest v_z
140 };
141
142 //
143 // EOF
144 //