33 fOptions.
Add(
"eff",
"Effective SPD correction",
false);
34 fOptions.
Add(
"satellite",
"Set-up for satellite-main",
false);
35 fOptions.
Add(
"reweigh",
"MODE",
"Whether to reweigh",
"");
37 "Maximum consequtive strips", 2);
48 AliAnalysisManager::SetCommonFileName(
"forward_mccorr.root");
54 gROOT->SetMacroPath(Form(
"%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
55 gROOT->GetMacroPath()));
63 if (reweigh.Contains(
"track")) rflags |= 0x1;
64 if (reweigh.Contains(
"prim")) rflags |= 0x2;
65 if (reweigh.Contains(
"real")) rflags |= 0x4;
68 if (!mgr->GetMCtruthEventHandler())
return;
73 UInt_t mask = AliVEvent::kAny;
76 Form(
"%d,0x%x,%d", satellite, rflags, maxStrips), mask);
80 Form(
"%d,%d", satellite, spdEffective), mask);
95 AliInputEventHandler* ih =
96 dynamic_cast<AliInputEventHandler*
>(mgr->GetInputEventHandler());
98 Fatal(
"CreatePhysicsSelection",
"Couldn't get input handler (%p)", ih);
101 AliPhysicsSelection* ps =
102 dynamic_cast<AliPhysicsSelection*
>(ih->GetEventSelection());
104 Fatal(
"CreatePhysicsSelection",
"Couldn't get PhysicsSelection (%p)", ps);
121 const char*
ClassName()
const {
return "MakeMCCorrTrain"; }
139 std::ofstream f(
"Extract.C");
141 Error(
"SaveSetup",
"Failed to open Extract.C");
144 f <<
"// Generated by " <<
ClassName() <<
"\n"
145 <<
"void Extract()\n"
147 <<
" const char* fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2\";\n"
148 <<
" gROOT->LoadMacro(Form(\"%s/corrs/ExtractMCCorr.C\",fwd));\n"
149 <<
" ExtractMCCorr(\"forward_mccorr.root\");\n"
151 <<
"// EOF" << std::endl;
160 std::ofstream f(
"Summarize.C");
162 Error(
"SaveSummarize",
"Failed to open Summarize.C script");
165 f <<
"// Generated by " <<
ClassName() <<
"\n"
166 <<
"// WHAT is a bit mask of\n"
167 <<
"// 0x001 Event inspector\n"
168 <<
"// 0x002 Track density\n"
169 <<
"// 0x004 Vertex bins\n"
170 <<
"// 0x008 Results\n"
171 <<
"// 0x080 Central\n"
172 <<
"// 0x100 Landscape\n"
173 <<
"// 0x200 Pause\n"
175 <<
"void Summarize(const char* filename=\"forward_mccorr.root\",\n"
176 <<
" UShort_t what=0x11F)\n"
178 <<
" const char* fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2\";\n"
179 <<
" gROOT->LoadMacro(Form(\"%s/DrawMCCorrSummary.C\",fwd));\n"
180 <<
" DrawMCCorrSummary(filename,what);\n"
182 <<
"// EOF" << std::endl;
191 std::ofstream f(
"Draw.C");
193 Error(
"SaveDraw",
"Failed to open Draw.C script");
196 f <<
"// Generated by " <<
ClassName() <<
"\n"
197 <<
"// WHAT is a bit mask of\n"
198 <<
"// 0x001 Event inspector\n"
199 <<
"// 0x002 Track density\n"
200 <<
"// 0x004 Vertex bins\n"
201 <<
"// 0x008 Results\n"
202 <<
"// 0x080 Central\n"
203 <<
"// 0x100 Landscape\n"
204 <<
"// 0x200 Pause\n"
206 <<
"void Draw(bool details=false)\n"
208 <<
" const char* fwd=\"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2\";\n"
209 <<
" gROOT->LoadMacro(Form(\"%s/corrs/DrawCorrSecMap.C\",fwd));\n"
210 <<
" DrawCorrSecMap(999,0,0,999," <<
fOptions.
Has(
"satellite")
211 <<
",\"fmd_corrections.root\",details);\n"
213 <<
"// EOF" << std::endl;
218 f <<
" echo \"=== Extracting Corrections ...\"\n"
219 <<
" aliroot -l -b -q ${prefix}Extract.C\n"
220 <<
" echo \"=== Summarizing results ...\"\n"
221 <<
" aliroot -l -b -q ${prefix}Summarize.C\n"
222 <<
" echo \"=== Draw results ...\"\n"
223 <<
" aliroot -l -b -q ${prefix}Draw.C\n"
224 <<
" if test x$dest = x ; then return ; fi\n"
225 <<
" echo \"=== Uploading to ${dest} ...\"\n"
226 <<
" aliroot -l -b -q Upload.C\\(\\\"${dest}\\\"\\);"
Bool_t AsBool(const TString &name) const
Int_t AsInt(const TString &name, Int_t def=0) const
const char * AsString(const TString &name, const TString &def="") const
Bool_t Has(const TString &name) const
void PostShellCode(std::ostream &f)
virtual AliVEventHandler * CreateOutputHandler(UShort_t)
void Set(const TString &name, const TString &value)
void SaveSetup(Bool_t asShellScript)
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
const char * ClassName() const
virtual void SaveSetup(Bool_t asShellScript)
void CreatePhysicsSelection(Bool_t mc, AliAnalysisManager *mgr)
MakeMCCorrTrain(const char *name)
void CreateTasks(AliAnalysisManager *mgr)
virtual void CreatePhysicsSelection(Bool_t mc, AliAnalysisManager *mgr)
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