1 //====================================================================
3 * Analysis train to make Forward and Central multiplicity
7 * gROOT->LoadMacro("TrainSetup.C");
9 * MakeAODTrain t("My Analysis");
10 * // Set variaous parameters on the train
11 * t.SetDataDir("/home/of/data");
14 * t.Run("LOCAL", "FULL", -1, false, false);
17 * @ingroup pwg2_forward_scripts_makers
18 * @ingroup pwg2_forward_aod
20 class MakeAODTrain : public TrainSetup
24 * Constructor. Date and time must be specified when running this
25 * in Termiante mode on Grid
27 * @param name Name of train (free form)
28 * @param sys Collision system (1: pp, 2: PbPb)
29 * @param sNN Center of mass energy [GeV]
30 * @param field L3 magnetic field - one of {-5,0,+5} kG
31 * @param useCent Whether to use centrality
32 * @param dateTime Append date and time to name
33 * @param year Year - if not specified, current year
34 * @param month Month - if not specified, current month
35 * @param day Day - if not specified, current day
36 * @param hour Hour - if not specified, current hour
37 * @param min Minutes - if not specified, current minutes
39 MakeAODTrain(const char* name,
43 Bool_t useCent = false,
44 Bool_t dateTime = false,
50 : TrainSetup(name, dateTime,
51 year, month, day, hour, min),
60 * @param mode Mode - see TrainSetup::EMode
61 * @param oper Operation - see TrainSetup::EOperation
62 * @param nEvents Number of events (negative means all)
63 * @param mc If true, assume simulated events
64 * @param usePar If true, use PARs
66 void Run(const char* mode, const char* oper,
67 Int_t nEvents=-1, Bool_t mc=false,
70 Info("Run", "Running in mode=%s, oper=%s, events=%d, MC=%d, Par=%d",
71 mode, oper, nEvents, mc, usePar);
72 Exec("ESD", mode, oper, nEvents, mc, usePar);
77 * @param mode Mode - see TrainSetup::EMode
78 * @param oper Operation - see TrainSetup::EOperation
79 * @param nEvents Number of events (negative means all)
80 * @param mc If true, assume simulated events
81 * @param usePar If true, use PARs
83 void Run(EMode mode, EOper oper, Int_t nEvents=-1, Bool_t mc=false,
84 Bool_t usePar = false)
86 Info("Run", "Running in mode=%d, oper=%d, events=%d, MC=%d, Par=%d",
87 mode, oper, nEvents, mc, usePar);
88 Exec(kESD, mode, oper, nEvents, mc, usePar);
94 * @param mode Processing mode
95 * @param par Whether to use par files
96 * @param mgr Analysis manager
98 void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager* mgr)
100 // --- Output file name ------------------------------------------
101 AliAnalysisManager::SetCommonFileName("forward.root");
103 // --- Load libraries/pars ---------------------------------------
104 LoadLibrary("PWG2forward2", mode, par, true);
106 // --- Set load path ---------------------------------------------
107 gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWG2/FORWARD/analysis2",
108 gROOT->GetMacroPath()));
110 // --- Check if this is MC ---------------------------------------
111 Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
113 // --- Add the task ----------------------------------------------
114 gROOT->Macro(Form("AddTaskForwardMult.C(%d,%d,%d,%d)",
115 mc, fSys, fSNN, fField));
116 AddExtraFile(gSystem->Which(gROOT->GetMacroPath(), "ForwardAODConfig.C"));
118 // --- Add the task ----------------------------------------------
119 gROOT->Macro(Form("AddTaskCentralMult.C(%d,%d,%d,%d)",
120 mc, fSys, fSNN, fField));
121 AddExtraFile(gSystem->Which(gROOT->GetMacroPath(), "CentralAODConfig.C"));
123 //__________________________________________________________________
125 * Create physics selection , and add to manager
127 * @param mc Whether this is for MC
130 void CreatePhysicsSelection(Bool_t mc,
131 AliAnalysisManager* mgr)
133 TrainSetup::CreatePhysicsSelection(mc, mgr);
135 // --- Get input event handler -----------------------------------
136 AliInputEventHandler* ih =
137 dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
139 Fatal("CreatePhysicsSelection", "Couldn't get input handler (%p)", ih);
141 // --- Get Physics selection -------------------------------------
142 AliPhysicsSelection* ps =
143 dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
145 Fatal("CreatePhysicsSelection", "Couldn't get PhysicsSelection (%p)",ps);
147 // --- Ignore trigger class when selecting events. This means ---
148 // --- that we get offline+(A,C,E) events too --------------------
149 // ps->SetSkipTriggerClassSelection(true);
151 //__________________________________________________________________
153 * Create the centrality selection only if requested
155 * @param mc Monte-Carlo truth flag
158 void CreateCentralitySelection(Bool_t mc, AliAnalysisManager* mgr)
160 if (!fUseCent) return;
161 TrainSetup::CreateCentralitySelection(mc, mgr);