3 #include <AliESDInputHandlerRP.h>
44 fOptions.
Add(
"trig",
"NAME",
"Trigger to use",
"V0AND");
45 fOptions.
Add(
"cent",
"METHOD",
"Centrality selector",
"V0M");
46 fOptions.
Add(
"cent-bins",
"BINS",
"Centrality bins",
47 "0-5-10-20-30-40-50-60-70-80");
48 fOptions.
Add(
"max-delta",
"X",
"Cut on weighted distance",25.);
49 fOptions.
Add(
"tail-delta",
"X",
"Tail cut on distance", 5.);
50 fOptions.
Add(
"scale-dtheta",
"Scale dTheta" ,
true);
52 fOptions.
Add(
"dphi-window",
"X",
"dPhi window", 0.06);
53 fOptions.
Add(
"dtheta-window",
"X",
"dTheta window", 0.025);
54 fOptions.
Add(
"dphi-shift",
"X",
"Bending shift", 0.0045);
55 fOptions.
Add(
"phi-overlap-cut",
"X",
"Phi overlap cut", 0.005);
56 fOptions.
Add(
"z-eta-overlap-cut",
"X",
"Z-Eta overlap cut", 0.05);
57 fOptions.
Add(
"phi-rotation",
"X",
"Rotation BG angle",TMath::Pi());
58 fOptions.
Add(
"inj-scale",
"X",
"Injection BG scale", 1.);
59 fOptions.
Add(
"shifted-dphi-cut",
"X",
"Cut on dPhi-phiBent", -1.);
60 fOptions.
Add(
"delta-cut",
"X",
"Cut on weighted distance", 1.5);
61 fOptions.
Add(
"eta-bins",
"BINS",
"Eta bins",
"r16:-2:+2");
62 fOptions.
Add(
"ipz-bins",
"BINS",
"IPz bins",
"u15");
63 fOptions.
Add(
"reconstruct",
"WHAT",
"Reconstruction types",
65 fOptions.
Add(
"reweight",
"OPTIONS",
"','-seperates list",
"");
67 "extract dNch/deta. The train should be run on "
68 "both real data and simulated data.\n"
69 "BINS are specified as comma or colon separated "
70 "lists of bins. If prefixed by 'r', then the "
71 "specification assumes the first number is the "
72 "number of bins, and the following one or two "
73 "numbers give the min/max. If prefixed by 'u' "
74 "then unit bins are assumed, and the following "
75 "one or two numbers give the min/max.\n"
76 "When processing simulated data, it is possible to "
77 "reweigh the particles according to predefined "
78 "histograms in pT. These histograms should "
79 "be stored in separate files. The option to "
80 "select reweighting is 'reweight', which is "
81 "a comma separated list of options:\n"
82 "- pt, pid, str: Reweigh according to pT, PID or "
84 "- up, down: Vary reweight up or down\n"
85 "- pi, K, p: For PID reweigh of particular specie");
102 Bool_t needRP = (recMode.Contains(
"nor") ||
103 recMode.Contains(
"inj") ||
104 recMode.Contains(
"rot") || needRec);
119 AliMCEventHandler* ret =
121 if (ret) ret->SetPreReadMode(AliMCEventHandler::kLmPreRead);
168 if (sel.IsNull() || sel.BeginsWith(
"no"))
178 while ((ostr = static_cast<TObjString*>(next()))) {
179 const TString& token = ostr->String();
181 if (token.EqualTo(
"pt")) {
183 files.Add(
new TObjString(
"REWEIGHTpt.root"));
184 Printf(
"Will reweigh in pT");
186 else if (token.EqualTo(
"pid")) {
188 Printf(
"Will reweigh particle species");
190 else if (token.EqualTo(
"str")) {
192 Printf(
"Will reweight particles from strange weak decays");
195 if (what == 0x0)
return;
200 while ((ostr = static_cast<TObjString*>(next()))) {
201 const TString& token = ostr->String();
202 Int_t aOpt = TMath::Abs(opt);
203 if (token.EqualTo(
"up") || token.EqualTo(
"+"))
204 opt = (aOpt==0 ? +1 : +aOpt);
205 else if (token.EqualTo(
"down") || token.EqualTo(
"-"))
206 opt = (aOpt==0 ? -1 : -aOpt);
207 else if (token.EqualTo(
"pi") || token.EqualTo(
"pion")){
208 opt = 1; part =
"pi";
210 else if (token.EqualTo(
"k") || token.EqualTo(
"kaon")) {
211 opt = 2; part =
"ka";
213 else if (token.EqualTo(
"p") || token.EqualTo(
"proton")) {
214 opt = 3; part =
"pr";
218 Printf(
"Will reweigh %s (%c30%% for pT<0.05)",
219 opt < 0 ?
"down" :
"up", opt < 0 ?
'-' :
'+');
221 if (!part.IsNull()) {
222 Printf(
"Will reweight %s in particular", part.Data());
224 part.Append(opt < 0 ?
"-" :
"+");
226 files.Add(
new TObjString(Form(
"REWEIGHTpid%s.root", part.Data())));
229 files.Add(
new TObjString(Form(
"REWEIGHTstr%s.root",
231 opt == +1 ?
"+" :
"")));
234 Printf(
"Setting reweighing flag=0x%x with option=%d", what, opt);
239 while ((ostr = static_cast<TObjString*>(nextF()))) {
240 Printf(
"Loading reweighting file %s", ostr->GetName());
264 Info(
"CreateTasks",
"Loading code");
270 Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
271 const char* nme = (mc ?
"MidMCdNdeta" :
"MiddNdeta");
272 const char* cls = (mc ?
273 "AliTrackletdNdetaMCTask" :
274 "AliTrackletdNdetaTask");
275 Long_t ret = gROOT->ProcessLine(Form(
"new %s(\"%s\")",cls,nme));
280 gROOT->ProcessLine(Form(
"((%s*)%p)->Connect()", cls, task));
285 UInt_t sel = AliVEvent::kINT7;
286 if (trg.EqualTo(
"MB")) sel = AliVEvent::kMB;
287 else if (trg.EqualTo(
"V0AND")) sel = AliVEvent::kINT7;
288 else if (trg.EqualTo(
"V0OR")) sel = AliVEvent::kCINT5;
289 else if (trg.EqualTo(
"ANY")) sel = AliVEvent::kAny;
293 const char* defCent =
"0-5-10-20-30-40-50-60-70-80-90";
294 task->SelectCollisionCandidates(sel);
295 FromOption(task,
"ReconstructionMode",
"reconstruct",
"nor,inj");
296 FromOption(task,
"CentralityMethod",
"cent",
"V0M");
297 FromOption(task,
"CentralityAxis",
"cent-bins", defCent);
298 FromOption(task,
"EtaAxis",
"eta-bins",
"r16:2");
299 FromOption(task,
"IPzAxis",
"ipz-bins",
"u15");
301 FromOption(task,
"MaxDelta",
"max-delta", 25.);
302 FromOption(task,
"TailDelta",
"tail-delta", 5.);
303 FromOption(task,
"ScaleDTheta",
"scale-dtheta",
false);
304 FromOption(task,
"DPhiWindow",
"dphi-window", 0.06);
305 FromOption(task,
"DThetaWindow",
"dtheta-window", 0.025);
306 FromOption(task,
"DPhiShift",
"dphi-shift", 0.0045);
307 FromOption(task,
"PhiOverlapCut",
"phi-overlap-cut" ,0.005);
308 FromOption(task,
"ZEtaOverlapCut",
"z-eta-overlap-cut",0.05);
309 FromOption(task,
"PhiRotation",
"phi-rotation", TMath::Pi());
311 FromOption(task,
"ShiftedDPhiCut",
"shifted-dphi-cut",-1.);
312 FromOption(task,
"DeltaCut",
"delta-cut", 1.5);
314 FromOption(task,
"ScaleDThetaCut",
"dtheta-window", 0.025);
331 Fatal(
"",
"Failed to create the task");
336 gSystem->RedirectOutput(
"settings.txt");
337 Printf(
"=== Settings for %s train === ", mc ?
"mc" :
"dt");
348 const char*
ClassName()
const {
return "TrackletdNdetaTrain"; }
virtual AliVEventHandler * CreateInputHandler(UShort_t type, Bool_t esdRecPoints=false)
Bool_t AsBool(const TString &name) const
virtual AliVEventHandler * CreateMCHandler(UShort_t, bool mc)
const char * AsString(const TString &name, const TString &def="") const
void CreateTasks(AliAnalysisManager *mgr)
AliAnalysisTaskSE * CreateTask(AliAnalysisManager *mgr)
const TString & Get(const TString &name) const
void SetupReweighting(AliAnalysisTaskSE *task)
TrackletdNdetaTrain(const char *name)
void SetDescription(const TString &d)
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
const char * ClassName() const
virtual Bool_t LoadAux(const TString &name, Bool_t copy=false)
AliVEventHandler * CreateInputHandler(UShort_t type, Bool_t needRec=false)
void FromOption(AliAnalysisTaskSE *task, const char *what, const char *opt, Double_t defval)
virtual AliVEventHandler * CreateOutputHandler(UShort_t)
AliVEventHandler * CreateMCHandler(UShort_t type, bool mc)
virtual Bool_t LoadSource(const TString &name, bool copy=false)
void SetOnTask(AliAnalysisTaskSE *task, const char *what, UInt_t val)