1 #include "TrainSetup.C"
3 //====================================================================
5 * Analysis train to make @f$ dN/d\eta@f$
9 * gROOT->LoadMacro("TrainSetup.C");
11 * MakedNdetaTrain 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 pwglf_forward_dndeta
20 * @ingroup pwglf_forward_trains
22 class MakedNdetaTrain : 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 trig Trigger to use
31 * @param vzMin Least @f$ v_z@f$
32 * @param vzMax Largest @f$ v_z@f$
33 * @param scheme Normalisation scheme
34 * @param useCent Whether to use centrality
35 * @param dateTime Append date and time to name
36 * @param year Year - if not specified, current year
37 * @param month Month - if not specified, current month
38 * @param day Day - if not specified, current day
39 * @param hour Hour - if not specified, current hour
40 * @param min Minutes - if not specified, current minutes
42 MakedNdetaTrain(const char* name,
43 const char* trig="INEL",
46 const char* scheme="FULL",
48 Bool_t dateTime=false,
54 : TrainSetup(name, dateTime, year, month, day, hour, min),
64 * @param mode Mode - see TrainSetup::EMode
65 * @param oper Operation - see TrainSetup::EOperation
66 * @param nEvents Number of events (negative means all)
67 * @param usePar If true, use PARs
69 void Run(const char* mode, const char* oper,
70 Int_t nEvents=-1, Bool_t usePar=false)
72 Exec("AOD", mode, oper, nEvents, false, 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 usePar If true, use PARs
82 void Run(EMode mode, EOper oper, Int_t nEvents=-1,
85 Exec(kAOD, mode, oper, nEvents, false, usePar);
88 * Set the trigger to use (INEL, INEL>0, NSD)
90 * @param trig Trigger to use
92 void SetTrigger(const char* trig) { fTrig = trig; }
94 * Set the vertex range to accept
99 void SetVertexRange(Double_t min, Double_t max) { fVzMin=min; fVzMax=max; }
101 * Set the normalisation scheme
103 * @param scheme Normalisation scheme options
105 void SetScheme(const char* scheme) { fScheme = scheme; }
107 * Whether to use centrality or not
109 * @param use To use the centrality
111 void SetUseCentrality(Bool_t use) { fUseCent = use; }
116 * @param mode Processing mode
117 * @param par Whether to use par files
119 void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager*)
121 // --- Output file name ------------------------------------------
122 AliAnalysisManager::SetCommonFileName("forward_dndeta.root");
124 // --- Load libraries/pars ---------------------------------------
125 LoadLibrary("PWGLFforward2", mode, par, true);
127 // --- Set load path ---------------------------------------------
128 gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2",
129 gROOT->GetMacroPath()));
131 // --- Add the task ----------------------------------------------
132 gROOT->Macro(Form("AddTaskForwarddNdeta.C(\"%s\",%f,%f,%d,\"%s\")",
133 fTrig.Data(), fVzMin, fVzMax, fUseCent, fScheme.Data()));
135 gROOT->Macro(Form("AddTaskCentraldNdeta.C(\"%s\",%f,%f,%d,\"%s\")",
136 fTrig.Data(), fVzMin, fVzMax, fUseCent, fScheme.Data()));
138 gROOT->Macro(Form("AddTaskMCTruthdNdeta.C(\"%s\",%f,%f,%d,\"%s\")",
139 fTrig.Data(), fVzMin, fVzMax, fUseCent, fScheme.Data()));
142 * Do not the centrality selection
144 void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {}
146 * Crete output handler - we don't want one here.
150 AliVEventHandler* CreateOutputHandler(EType) { return 0; }
151 TString fTrig; // Trigger to use
152 Double_t fVzMin; // Least v_z
153 Double_t fVzMax; // Largest v_z
154 TString fScheme; // Normalisation scheme
155 Bool_t fUseCent; // Use centrality