AliPhysics  a5cd6b6 (a5cd6b6)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExtractNoiseGain.C
Go to the documentation of this file.
1 #include <fstream>
2 
7 const char* fwd = "$ALICE_PHYSICS/PWGLF/FORWARD/analysis2";
8 
9 const 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 
15 void
16 ExtractNoiseGain(Long_t runNo=0)
17 {
18 
19  gSystem->AddIncludePath(Form("-I%s -I$ALICE_PHYSICS/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 //
const char * url
TSystem * gSystem
void ExtractNoiseGain(Long_t runNo=0)
const char * fwd
void ExtractForRun(Int_t runNo)
Definition: ExtractNG.C:24
void ExtractAll()
Definition: ExtractNG.C:128