1 #include "TrainSetup.C"
3 //====================================================================
5 * Analysis train to make Forward and Central MC corrections
9 * gROOT->LoadMacro("TrainSetup.C");
11 * MakeMCCorrTrain t("My Analysis");
12 * // Set variaous parameters on the train
13 * t.SetDataDir("/home/of/data");
16 * t.Run("LOCAL", "FULL", -1, false, false);
19 * @ingroup pwg2_forward_mc
20 * @ingroup pwg2_forward_trains
22 class MakeMCCorrTrain : public TrainSetup
26 * Constructor. Date and time must be specified when running this
27 * in Termiante mode on Grid
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
37 MakeMCCorrTrain(const char* name,
38 Bool_t dateTime = false,
44 : TrainSetup(name, dateTime,
45 year, month, day, hour, min)
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
55 void Run(const char* mode, const char* oper,
56 Int_t nEvents=-1, Bool_t usePar=false)
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);
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
70 void Run(EMode mode, EOper oper, Int_t nEvents=-1,
71 Bool_t usePar = false)
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);
81 * @param mode Processing mode
82 * @param par Whether to use par files
83 * @param mgr Analysis manager
85 void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager* mgr)
87 // --- Output file name ------------------------------------------
88 AliAnalysisManager::SetCommonFileName("forward_mccorr.root");
90 // --- Load libraries/pars ---------------------------------------
91 LoadLibrary("PWG2forward2", mode, par, true);
93 // --- Set load path ---------------------------------------------
94 gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWG2/FORWARD/analysis2",
95 gROOT->GetMacroPath()));
97 // --- Check if this is MC ---------------------------------------
98 if (!mgr->GetMCtruthEventHandler()) return;
100 // --- Add the task ----------------------------------------------
101 gROOT->Macro("AddTaskForwardMCCorr.C");
103 // --- Add the task ----------------------------------------------
104 gROOT->Macro("AddTaskCentralMCCorr.C");
106 //__________________________________________________________________
108 * Create physics selection , and add to manager
110 * @param mc Whether this is for MC
113 void CreatePhysicsSelection(Bool_t mc,
114 AliAnalysisManager* mgr)
116 TrainSetup::CreatePhysicsSelection(mc, mgr);
118 // --- Get input event handler -----------------------------------
119 AliInputEventHandler* ih =
120 dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
122 Fatal("CreatePhysicsSelection", "Couldn't get input handler (%p)", ih);
124 // --- Get Physics selection -------------------------------------
125 AliPhysicsSelection* ps =
126 dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
128 Fatal("CreatePhysicsSelection", "Couldn't get PhysicsSelection (%p)", ps);
130 // --- Ignore trigger class when selecting events. This means ---
131 // --- that we get offline+(A,C,E) events too --------------------
132 // ps->SetSkipTriggerClassSelection(true);
135 * Do not the centrality selection
137 void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {}
138 Double_t fVzMin; // Least v_z
139 Double_t fVzMax; // Largest v_z