3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Tue Jul 12 10:05:30 2011
6 * @brief Run first pass analysis - make AOD tree
8 * @ingroup pwglf_forward_trains
10 //====================================================================
11 #include "TrainSetup.C"
14 * Analysis train to make Forward and Central multiplicity
18 * gROOT->LoadMacro("TrainSetup.C");
20 * MakeAODTrain t("My Analysis");
21 * // Set variaous parameters on the train
22 * t.SetDataDir("/home/of/data");
25 * t.Run("LOCAL", "FULL", -1, false, false);
28 * @ingroup pwglf_forward_aod
29 * @ingroup pwglf_forward_trains
31 class MakeAODTrain : public TrainSetup
35 * Constructor. Date and time must be specified when running this
36 * in Termiante mode on Grid
38 * @param name Name of train (free form)
39 * @param sys Collision system (1: pp, 2: PbPb)
40 * @param sNN Center of mass energy [GeV]
41 * @param field L3 magnetic field - one of {-5,0,+5} kG
42 * @param useCent Whether to use centrality
43 * @param dateTime Append date and time to name
44 * @param year Year - if not specified, current year
45 * @param month Month - if not specified, current month
46 * @param day Day - if not specified, current day
47 * @param hour Hour - if not specified, current hour
48 * @param min Minutes - if not specified, current minutes
50 MakeAODTrain(const char* name,
54 Bool_t useCent = false,
55 Bool_t dateTime = false,
61 : TrainSetup(name, dateTime,
62 year, month, day, hour, min),
71 * @param mode Mode - see TrainSetup::EMode
72 * @param oper Operation - see TrainSetup::EOperation
73 * @param nEvents Number of events (negative means all)
74 * @param mc If true, assume simulated events
75 * @param usePar If true, use PARs
77 void Run(const char* mode, const char* oper,
78 Int_t nEvents=-1, Bool_t mc=false,
81 Info("Run", "Running in mode=%s, oper=%s, events=%d, MC=%d, Par=%d",
82 mode, oper, nEvents, mc, usePar);
83 Exec("ESD", mode, oper, nEvents, mc, usePar);
88 * @param mode Mode - see TrainSetup::EMode
89 * @param oper Operation - see TrainSetup::EOperation
90 * @param nEvents Number of events (negative means all)
91 * @param mc If true, assume simulated events
92 * @param usePar If true, use PARs
94 void Run(EMode mode, EOper oper, Int_t nEvents=-1, Bool_t mc=false,
95 Bool_t usePar = false)
97 Info("Run", "Running in mode=%d, oper=%d, events=%d, MC=%d, Par=%d",
98 mode, oper, nEvents, mc, usePar);
99 Exec(kESD, mode, oper, nEvents, mc, usePar);
105 * @param mode Processing mode
106 * @param par Whether to use par files
107 * @param mgr Analysis manager
109 void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager* mgr)
111 // --- Output file name ------------------------------------------
112 AliAnalysisManager::SetCommonFileName("forward.root");
114 // --- Load libraries/pars ---------------------------------------
115 LoadLibrary("PWGLFforward2", mode, par, true);
117 // --- Set load path ---------------------------------------------
118 gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2",
119 gROOT->GetMacroPath()));
121 // --- Check if this is MC ---------------------------------------
122 Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
124 // --- Task to copy header information ---------------------------
125 gROOT->Macro("AddTaskCopyHeader.C");
127 // --- Add the task ----------------------------------------------
128 gROOT->Macro(Form("AddTaskForwardMult.C(%d,%d,%d,%d)",
129 mc, fSys, fSNN, fField));
130 AddExtraFile(gSystem->Which(gROOT->GetMacroPath(), "ForwardAODConfig.C"));
132 // --- Add the task ----------------------------------------------
133 gROOT->Macro(Form("AddTaskCentralMult.C(%d,%d,%d,%d)",
134 mc, fSys, fSNN, fField));
135 AddExtraFile(gSystem->Which(gROOT->GetMacroPath(), "CentralAODConfig.C"));
137 //__________________________________________________________________
139 * Create physics selection , and add to manager
141 * @param mc Whether this is for MC
144 void CreatePhysicsSelection(Bool_t mc,
145 AliAnalysisManager* mgr)
147 TrainSetup::CreatePhysicsSelection(mc, mgr);
149 // --- Get input event handler -----------------------------------
150 AliInputEventHandler* ih =
151 dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
153 Fatal("CreatePhysicsSelection", "Couldn't get input handler (%p)", ih);
155 // --- Get Physics selection -------------------------------------
156 AliPhysicsSelection* ps =
157 dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
159 Fatal("CreatePhysicsSelection", "Couldn't get PhysicsSelection (%p)",ps);
161 // --- Ignore trigger class when selecting events. This means ---
162 // --- that we get offline+(A,C,E) events too --------------------
163 // ps->SetSkipTriggerClassSelection(true);
165 //__________________________________________________________________
167 * Create the centrality selection only if requested
169 * @param mc Monte-Carlo truth flag
172 void CreateCentralitySelection(Bool_t mc, AliAnalysisManager* mgr)
174 if (!fUseCent) return;
175 TrainSetup::CreateCentralitySelection(mc, mgr);