]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/corrs/ExtractNoiseGain.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / corrs / ExtractNoiseGain.C
CommitLineData
5f185884 1#include <fstream>
2
3/**
4 * Forward directory
5 *
6 */
7const char* fwd = "$ALICE_ROOT/PWGLF/FORWARD/analysis2";
8
9const char* url = "https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=sb&p_rsob=l.run&p_rsob_dir=DESC&ptcf_rtc=%2CExactly%2CFMD%3B%2CAt+least&prsf_rtype=PHYSICS%2C&p_rspn=1&prsf_rn=";
10
11/**
12 * Extract the noise/gain correction
13 *
14 */
15void
16ExtractNoiseGain(Long_t runNo=0)
17{
18
19 gSystem->AddIncludePath(Form("-I%s -I$ALICE_ROOT/include", fwd));
20 gROOT->Macro(Form("%s/scripts/LoadLibs.C", fwd));
21 gROOT->LoadMacro("ExtractNG.C+");
22
23 std::ofstream f("Upload.C");
24 f << "// Generated by ExtractELoss.C\n"
25 << "TString MakeDest(const TString& dest, const TString& fname)\n"
26 << "{\n"
27 << " TString tmp(dest);\n"
28 << " if (!tmp.IsNull()) {\n"
29 << " if (!tmp.EndsWith(\"/\")) tmp.Append(\"/\");\n"
30 << " tmp.Append(fname);\n"
31 << " }\n"
32 << " return tmp;\n"
33 << "}\n\n"
34 << "void Upload(const TString& dest=\"\")\n"
35 << "{\n"
36 << " gROOT->Macro(\"" << fwd << "/scripts/LoadLibs.C\");\n"
37 << " \n"
38 << " const char* fmdFile = \"fmd_corrections.root\";\n"
39 << " TString fdest = MakeDest(dest, fmdFile);\n"
40 << " \n"
41 << " AliForwardCorrectionManager::Instance().Append(fmdFile, fdest);\n"
42 << "}\n"
43 << "// EOF\n"
44 << std::endl;
45 f.close();
46
47 if (runNo > 0) ExtractForRun(runNo);
48 else ExtractAll();
49
50 Info("ExtractNoiseGain",
51 "Run generated Upload.C(DEST) script to copy files in place");
52}
53//
54// EOF
55//