2 * Script to draw the energy loss fits
4 * @ingroup pwglf_forward_scripts_corr
7 //____________________________________________________________________
9 * Extract the energy loss correction object from file and rename it
10 * according to the settings
12 * @param fname File to extract from
13 * @param sys Collision system (pp, PbPb)
14 * @param sNN Center of mass energy (in GeV) per nucleon
15 * @param field L3 magnetic field (-5,0,5) in kGaus
17 * @ingroup pwglf_forward_scripts_corr
20 ExtractMCCorr(const char* fname)
22 const char* fwd = "$ALICE_ROOT/../trunk/PWGLF/FORWARD/analysis2";
23 gSystem->AddIncludePath(Form("-I%s", fwd));
24 gROOT->Macro(Form("%s/scripts/LoadLibs.C", fwd));
25 gROOT->LoadMacro(Form("%s/corrs/CorrExtractor.C++g", fwd));
27 CorrExtractor fmdEx(&AliForwardCorrectionManager::Instance());
28 if (fmdEx.Init(fname, "ForwardCorrSums", "fmd_corrections.root")) {
29 fmdEx.Extract(AliFMDCorrSecondaryMap::Class(),
30 "ForwardCorrResults");
33 CorrExtractor spdEx(&AliCentralCorrectionManager::Instance());
34 if (spdEx.Init(fname, "CentralCorrSums", "spd_corrections.root")) {
35 spdEx.Extract(AliCentralCorrSecondaryMap::Class(), "CentralCorrResults");
36 spdEx.Extract(AliCentralCorrAcceptance::Class(), "CentralCorrResults");
39 std::ofstream f("Upload.C");
40 f << "// Generated by ExtractMCCorr.C\n"
41 << "TString MakeDest(const TString& dest, const TString& fname)\n"
43 << " TString tmp(dest);\n"
44 << " if (!tmp.IsNull()) {\n"
45 << " if (!tmp.EndsWith(\"/\")) tmp.Append(\"/\");\n"
46 << " tmp.Append(fname);\n"
50 << "void Upload(const TString& dest=\"\")\n"
52 << " gROOT->Macro(\"" << fwd << "/scripts/LoadLibs.C\");\n"
54 << " const char* fmdFile = \"fmd_corrections.root\";\n"
55 << " const char* spdFile = \"spd_corrections.root\";\n"
56 << " TString fdest = MakeDest(dest, fmdFile);\n"
57 << " TString sdest = MakeDest(dest, spdFile);\n"
59 << " AliForwardCorrectionManager::Instance().Append(fmdFile, fdest);\n"
60 << " AliCentralCorrectionManager::Instance().Append(spdFile, sdest);\n"
67 //____________________________________________________________________