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(
"ipz-bins",
"BINS",
"IPz bins",
"u15");
39 fOptions.
Add(
"scheme",
"SCHEME",
"Normalization scheme",
"EVENT,TRIGGER");
40 fOptions.
Add(
"trigEff",
"EFFICIENCY",
"Trigger efficiency", 1.);
41 fOptions.
Add(
"trigEff0",
"EFFICIENCY",
"0-bin trigger effeciency", 1.);
42 fOptions.
Add(
"mc",
"Also make dN/deta for MC truth",
false);
43 fOptions.
Add(
"satellite",
"Restrict analysis to satellite events",
false);
44 fOptions.
Add(
"forward-config",
"FILE",
"Forward configuration",
46 fOptions.
Add(
"central-config",
"FILE",
"Central configuration",
48 fOptions.
Add(
"truth-config",
"FILE",
"MC-Truth configuration",
50 fOptions.
Add(
"mean-ipz",
"MU",
"Mean of IPz dist.", 0);
51 fOptions.
Add(
"var-ipz",
"SIGMA",
"Variance of IPz dist.", -1);
52 fOptions.
Add(
"no-central",
"Do not at SPD cluster task",
false);
53 fOptions.
Add(
"abs-min-cent",
"PERCENT",
"Absolute least centrality", -1.);
59 UInt_t mask = AliVEvent::kAny;
61 Form(
"\"%s\",\"%s\"", which, cfg),
64 Printf(
"Failed to add task via AddTaskdNdeta.C(%s,%s)", cfg);
67 FromOption(tsk,
"TriggerMask",
"trig",
"INEL");
68 FromOption(tsk,
"FilterMask",
"filter",
"OUTLIER|PILEUP-BIN");
69 FromOption(tsk,
"NormalizationScheme",
"scheme",
"EVENT,TRIGGER");
70 FromOption(tsk,
"CentralityMethod",
"cent",
"default");
71 FromOption(tsk,
"CentralityAxis",
"cent-bins",
"default");
74 FromOption(tsk,
"TriggerEff0",
"trigEff0", 1.);
75 FromOption(tsk,
"SatelliteVertices",
"satellite",
false);
76 FromOption(tsk,
"AbsMinCent",
"abs-min-cent",-1.);
78 if (!
TString(which).BeginsWith(
"forward",TString::kIgnoreCase))
return true;
82 if (sigmaIpz <= 0)
return true;
84 TF1* f=
new TF1(
"ipZw",
"TMath::Gaus(x,[0],[1],1)/TMath::Gaus(x,[2],[3],1)");
85 f->SetParNames(
"#mu_{emp}",
"#sigma_{emp}",
"#mu_{this}",
"#sigma_{this}");
86 f->SetParameters(0.592,6.836,muIpz,sigmaIpz);
89 Printf(
"Created re-weight function");
93 ->ProcessLine(Form(
"((AliBasedNdetaTask*)%p)->SetIpzReweight((TF1*)%p);",
105 AliAnalysisManager::SetCommonFileName(
"forward_dndeta.root");
114 gROOT->SetMacroPath(Form(
"%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
115 gROOT->GetMacroPath()));
152 const char*
ClassName()
const {
return "MakedNdetaTrain"; }
168 std::ofstream f(
"Summarize.C");
170 Error(
"SaveSummarize",
"Failed to open Summarize.C script");
173 f <<
"// Generated by " <<
ClassName() <<
"\n" 174 <<
"// WHAT is a bit mask of\n" 175 <<
"// 0x001 Forward\n" 176 <<
"// 0x002 Central\n" 178 <<
"// 0x008 Results\n" 179 <<
"// 0x010 Only min-bias (no centrality)\n" 180 <<
"// 0x080 Assume simulation results\n" 181 <<
"// 0x100 Landscape\n" 182 <<
"// 0x200 Pause\n" 183 <<
"// 0x400 Also draw single result canvas\n" 185 <<
"void Summarize(const char* filename=\"forward_dndeta.root\",\n" 186 <<
" UShort_t what=0x10F)\n" 188 <<
" const char* fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2\";\n" 189 <<
" gROOT->LoadMacro(Form(\"%s/DrawdNdetaSummary.C\",fwd));\n" 190 <<
" DrawdNdetaSummary(filename,what & 0x3FF);\n" 192 <<
" if (!(what & 0x400)) return;\n" 193 <<
" gROOT->SetMacroPath(Form(\"../:%s\",gROOT->GetMacroPath()));\n" 194 <<
" gROOT->Macro(\"Draw.C\");\n" 196 <<
"// EOF" << std::endl;
205 std::ofstream o(
"Draw.C");
207 Error(
"MakedNdetaTrain::SaveSetup",
"Failed to open Draw.C");
211 o <<
"// Created by " <<
ClassName() <<
"\n" 212 <<
"// Will draw dN/deta results from produced file\n" 214 <<
"void Draw(UShort_t rebin=5,\n" 215 <<
" Double_t eff=1,\n" 216 <<
" Bool_t raw=false,\n" 217 <<
" Bool_t cutEdges=false,\n" 218 <<
" const char* which=\"Forward\")\n" 220 <<
" TString fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/dndeta\";\n" 221 <<
" gROOT->LoadMacro(Form(\"%s/ExtractGSEs.C\",fwd.Data()));\n" 222 <<
" ExtractGSEs(\"forward_dndeta.root\",\n" 223 <<
" rebin,eff,raw,cutEdges,which);\n" 227 <<
"//" << std::endl;
232 f <<
" echo \"=== Summarizing results ...\"\n" 233 <<
" aliroot -l -b -q ${prefix}Summarize.C\n" 234 <<
" echo \"=== Draw results ...\"\n" 235 <<
" aliroot -l -b -q ${prefix}Draw.C\n" Double_t AsDouble(const TString &name, Double_t def=0) const
void SaveSetup(Bool_t asShellScript)
const TString & Get(const TString &name) const
const char * ClassName() const
Bool_t Has(const TString &name) const
virtual Bool_t IsMC() const
MakedNdetaTrain(const char *name)
void CreateTasks(AliAnalysisManager *)
Bool_t CoupledNdetaCar(const char *which, const char *cfg)
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)
AliVEventHandler * CreateMCHandler(UShort_t, bool)
void FromOption(AliAnalysisTaskSE *task, const char *what, const char *opt, Double_t defval)
AliVEventHandler * CreateOutputHandler(UShort_t)
void PostShellCode(std::ostream &f)
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