34 fOptions.
Add(
"trig",
"TYPE",
"Trigger type",
"INEL");
35 fOptions.
Add(
"filter",
"TYPE",
"Filter type",
"OUTLIER|PILEUP-BIN");
36 fOptions.
Add(
"cent",
"ESTIMATOR",
"Use centrality",
"none");
37 fOptions.
Add(
"cent-bins",
"BINS",
"Centrality bins",
"default");
38 fOptions.
Add(
"abs-min-cent",
"PERCENT",
"Absolute least centrality", -1.);
39 fOptions.
Add(
"ipz-bins",
"BINS",
"IPz bins",
"u15");
40 fOptions.
Add(
"eta-bins",
"BINS",
"Eta bins",
"r16:-2:+2");
42 fOptions.
Add(
"scheme",
"SCHEME",
"Normalization scheme",
"EVENT,TRIGGER");
43 fOptions.
Add(
"trigEff",
"EFFICIENCY",
"Trigger efficiency", 1.);
44 fOptions.
Add(
"trigEff0",
"EFFICIENCY",
"0-bin trigger effeciency", 1.);
45 fOptions.
Add(
"satellite",
"Restrict analysis to satellite events",
false);
46 fOptions.
Add(
"mean-ipz",
"MU",
"Mean of IPz dist.", 0);
47 fOptions.
Add(
"var-ipz",
"SIGMA",
"Variance of IPz dist.", -1);
48 fOptions.
Add(
"forward-config",
"FILE",
"Forward configuration",
51 fOptions.
Add(
"mc",
"Also make dN/deta for MC truth",
false);
52 fOptions.
Add(
"truth-config",
"FILE",
"MC-Truth configuration",
55 fOptions.
Add(
"central-config",
"FILE",
"Central configuration",
57 fOptions.
Add(
"no-central",
"Do not at SPD cluster task",
false);
59 fOptions.
Add(
"max-delta",
"X",
"Cut on weighted distance",25.);
60 fOptions.
Add(
"tail-delta",
"X",
"Tail cut on distance", 5.);
61 fOptions.
Add(
"tail-max",
"X",
"Tail cut on distance", -1.);
62 fOptions.
Add(
"delta-cut",
"X",
"Cut on weighted distance",1.5);
63 fOptions.
Add(
"dphi-shift",
"RADIANS",
"Bending shift", 0.0045);
64 fOptions.
Add(
"shifted-dphi-cut",
"RADIANS",
"Cut on dPhi-phiBent", -1.);
65 fOptions.
Add(
"reweigh",
"FILE",
"File with weights",
"");
66 fOptions.
Add(
"reweigh-calc",
"MODE",
"prod,square,sum",
"prod");
67 fOptions.
Add(
"reweigh-mask",
"MASK",
"Tracklet mask for weighing", 0xFF);
68 fOptions.
Add(
"reweigh-veto",
"VETO",
"Tracklet veto for weighing", 0x0);
76 UInt_t mask = AliVEvent::kAny;
78 Form(
"\"%s\",\"%s\"", which, cfg),
81 Printf(
"Failed to add task via AddTaskdNdeta.C(%s,%s)", cfg);
84 FromOption(tsk,
"TriggerMask",
"trig",
"INEL");
85 FromOption(tsk,
"FilterMask",
"filter",
"OUTLIER|PILEUP-BIN");
86 FromOption(tsk,
"NormalizationScheme",
"scheme",
"EVENT,TRIGGER");
87 FromOption(tsk,
"CentralityMethod",
"cent",
"default");
88 FromOption(tsk,
"CentralityAxis",
"cent-bins",
"default");
91 FromOption(tsk,
"TriggerEff0",
"trigEff0", 1.);
92 FromOption(tsk,
"SatelliteVertices",
"satellite",
false);
93 FromOption(tsk,
"AbsMinCent",
"abs-min-cent",-1.);
95 if (!
TString(which).BeginsWith(
"forward",TString::kIgnoreCase))
return true;
99 if (sigmaIpz <= 0)
return true;
101 TF1* f=
new TF1(
"ipZw",
"TMath::Gaus(x,[0],[1],1)/TMath::Gaus(x,[2],[3],1)");
102 f->SetParNames(
"#mu_{emp}",
"#sigma_{emp}",
"#mu_{this}",
"#sigma_{this}");
103 f->SetParameters(0.592,6.836,muIpz,sigmaIpz);
106 Printf(
"Created re-weight function");
110 ->ProcessLine(Form(
"((AliBasedNdetaTask*)%p)->SetIpzReweight((TF1*)%p);",
122 AliAnalysisManager::SetCommonFileName(
"tracklet_dndeta.root");
124 if (
fwd.IsNull())
fwd =
"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2";
125 gROOT->SetMacroPath(Form(
"%s:%s/dndeta/tracklets3",
126 gROOT->GetMacroPath(),
fwd.Data()));
127 gSystem->AddIncludePath(Form(
"-I%s/dndeta/tracklets3",
fwd.Data()));
129 Info(
"CreateTasks",
"Loading code");
141 gROOT->ProcessLine(Form(
"AliTrackletAODdNdeta::Create(%d,\"%s\")",mc,
148 UInt_t sel = AliVEvent::kINT7;
149 UInt_t mb = AliVEvent::kINT1;
150 if (trg.EqualTo(
"MB")) sel = mb;
151 else if (trg.EqualTo(
"MBOR")) sel = mb;
152 else if (trg.EqualTo(
"INEL")) sel = mb;
153 else if (trg.EqualTo(
"INELGT0")) sel = mb;
154 else if (trg.EqualTo(
"V0AND")) sel = AliVEvent::kINT7;
155 else if (trg.EqualTo(
"NSD")) sel = AliVEvent::kINT7;
156 else if (trg.EqualTo(
"V0OR")) sel = AliVEvent::kCINT5;
157 else if (trg.EqualTo(
"ANY")) sel = AliVEvent::kAny;
158 task->SelectCollisionCandidates(sel);
159 Int_t minTrk = trg.EqualTo(
"INELGT0") ? 1 : 0;
164 if (calc.BeginsWith(
"PROD")) mcal = 0;
165 else if (calc.BeginsWith(
"SQ")) mcal = 1;
166 else if (calc.BeginsWith(
"SUM")) mcal = 2;
167 else if (calc.BeginsWith(
"AV")) mcal = 3;
170 const char* defCent =
"0-5-10-20-30-40-50-60-70-80-90";
171 FromOption(task,
"CentralityMethod",
"cent",
"V0M");
172 FromOption(task,
"CentralityAxis",
"cent-bins", defCent);
173 FromOption(task,
"EtaAxis",
"eta-bins",
"r16:2");
174 FromOption(task,
"IPzAxis",
"ipz-bins",
"u15");
175 FromOption(task,
"DeltaCut",
"delta-cut", 1.5);
176 FromOption(task,
"TailDelta",
"tail-delta", 5.);
177 FromOption(task,
"TailMaximum",
"tail-max", -1);
178 FromOption(task,
"MaxDelta",
"max-delta", 25.);
179 FromOption(task,
"DPhiShift",
"dphi-shift", 0.0045);
180 FromOption(task,
"ShiftedDPhiCut",
"shifted-dphi-cut",-1.);
181 FromOption(task,
"AbsMinCent",
"abs-min-cent", -1.);
182 FromOption(task,
"WeightMask",
"reweigh-mask", 0xFF);
183 FromOption(task,
"WeightVeto",
"reweigh-veto", 0x0);
185 FromOption(task,
"WeightInverse",
"reweigh-inv",
false);
186 FromOption(task,
"TriggerEff",
"trigEff", 0.);
213 Printf(
"Print the generated task");
223 AliAnalysisManager::SetCommonFileName(
"forward_dndeta.root");
232 gROOT->SetMacroPath(Form(
"%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
233 gROOT->GetMacroPath()));
271 const char*
ClassName()
const {
return "BothdNdetaTrain"; }
288 std::ofstream f(
"Summarize.C");
290 Error(
"SaveSummarize",
"Failed to open Summarize.C script");
293 f <<
"// Generated by " <<
ClassName() <<
"\n"
294 <<
"// WHAT is a bit mask of\n"
295 <<
"// 0x001 Forward\n"
296 <<
"// 0x002 Central\n"
298 <<
"// 0x008 Results\n"
299 <<
"// 0x010 Only min-bias (no centrality)\n"
300 <<
"// 0x080 Assume simulation results\n"
301 <<
"// 0x100 Landscape\n"
302 <<
"// 0x200 Pause\n"
303 <<
"// 0x400 Also draw single result canvas\n"
305 <<
"void Summarize(const char* filename=\"forward_dndeta.root\",\n"
306 <<
" UShort_t what=0x10F)\n"
308 <<
" const char* fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2\";\n"
309 <<
" gROOT->LoadMacro(Form(\"%s/DrawdNdetaSummary.C\",fwd));\n"
310 <<
" DrawdNdetaSummary(filename,what & 0x3FF);\n"
312 <<
" if (!(what & 0x400)) return;\n"
313 <<
" gROOT->SetMacroPath(Form(\"../:%s\",gROOT->GetMacroPath()));\n"
314 <<
" gROOT->Macro(\"Draw.C\");\n"
316 <<
"// EOF" << std::endl;
325 std::ofstream o(
"Draw.C");
327 Error(
"BothdNdetaTrain::SaveDraw",
"Failed to open Draw.C");
331 o <<
"// Created by " <<
ClassName() <<
"\n"
332 <<
"// Will draw dN/deta results from produced file\n"
334 <<
"void Draw(UShort_t rebin=5,\n"
335 <<
" Double_t eff=1,\n"
336 <<
" Bool_t raw=false,\n"
337 <<
" Bool_t cutEdges=false,\n"
338 <<
" const char* which=\"Forward\")\n"
340 <<
" TString fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/dndeta\";\n"
341 <<
" gROOT->LoadMacro(Form(\"%s/ExtractGSEs.C\",fwd.Data()));\n"
342 <<
" ExtractGSEs(\"forward_dndeta.root\",\n"
343 <<
" rebin,eff,raw,cutEdges,which);\n"
347 <<
"//" << std::endl;
352 std::ofstream o(
"Collect.C");
354 Error(
"BothdNdetaTrain::SavePost",
"Failed to open Collect.C");
357 o <<
"// Created by " <<
ClassName() <<
"\n"
358 <<
"// Will draw dN/deta results from produced files\n"
360 <<
"void Collect(const char* other,\n"
361 <<
" const char* output,\n"
362 <<
" UInt_t proc=0x2,\n"
363 <<
" UInt_t viz=0x32f,\n"
367 <<
" \"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/dndeta/tracklets3\";\n"
368 <<
" if (gSystem->Getenv(\"ANA_SRC\"))\n"
369 <<
" fwd = \"$ANA_SRC/dndeta/tracklets3\";\n"
370 <<
" gROOT->LoadMacro(Form(\"%s/Post.C\",fwd.Data()));\n"
371 <<
" const char* thisDir = \"" <<
fEscapedName <<
"\";\n";
373 o <<
" Post(thisDir,other,output,proc,viz,n);\n";
375 o <<
" Post(other,thisDir,output,proc,viz,n);\n";
383 f <<
" echo \"=== Summarizing results ...\"\n"
384 <<
" aliroot -l -b -q ${prefix}Summarize.C\n"
385 <<
" echo \"=== Draw results ...\"\n"
386 <<
" aliroot -l -b -q ${prefix}Draw.C\n"
Double_t AsDouble(const TString &name, Double_t def=0) const
void CreateTasks(AliAnalysisManager *mgr)
AliVEventHandler * CreateOutputHandler(UShort_t)
const char * AsString(const TString &name, const TString &def="") const
BothdNdetaTrain(const char *name)
const TString & Get(const TString &name) const
AliVEventHandler * CreateMCHandler(UShort_t, bool)
const char * ClassName() const
Bool_t Has(const TString &name) const
void CoupleTrackletCar(AliAnalysisManager *mgr)
virtual Bool_t IsMC() const
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
virtual void SaveSetup(Bool_t asShellScript)
void FromOption(AliAnalysisTaskSE *task, const char *what, const char *opt, Double_t defval)
Bool_t CoupledNdetaCar(const char *which, const char *cfg)
void PostShellCode(std::ostream &f)
void SaveSetup(Bool_t asShellScript)
virtual AliAnalysisTaskSE * CoupleSECar(const TString ¯o, const TString &args, UInt_t mask=0)
virtual Bool_t LoadLibrary(const TString &name, Bool_t slave=true, Bool_t forcePar=false)=0
virtual Bool_t LoadSource(const TString &name, bool copy=false)
void SetOnTask(AliAnalysisTaskSE *task, const char *what, UInt_t val)