#include <fstream> /** * Forward directory * */ const char* fwd = "$ALICE_ROOT/PWGLF/FORWARD/analysis2"; 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="; /** * Extract the noise/gain correction * */ void ExtractNoiseGain(Long_t runNo=0) { gSystem->AddIncludePath(Form("-I%s -I$ALICE_ROOT/include", fwd)); gROOT->Macro(Form("%s/scripts/LoadLibs.C", fwd)); gROOT->LoadMacro("ExtractNG.C+"); std::ofstream f("Upload.C"); f << "// Generated by ExtractELoss.C\n" << "TString MakeDest(const TString& dest, const TString& fname)\n" << "{\n" << " TString tmp(dest);\n" << " if (!tmp.IsNull()) {\n" << " if (!tmp.EndsWith(\"/\")) tmp.Append(\"/\");\n" << " tmp.Append(fname);\n" << " }\n" << " return tmp;\n" << "}\n\n" << "void Upload(const TString& dest=\"\")\n" << "{\n" << " gROOT->Macro(\"" << fwd << "/scripts/LoadLibs.C\");\n" << " \n" << " const char* fmdFile = \"fmd_corrections.root\";\n" << " TString fdest = MakeDest(dest, fmdFile);\n" << " \n" << " AliForwardCorrectionManager::Instance().Append(fmdFile, fdest);\n" << "}\n" << "// EOF\n" << std::endl; f.close(); if (runNo > 0) ExtractForRun(runNo); else ExtractAll(); Info("ExtractNoiseGain", "Run generated Upload.C(DEST) script to copy files in place"); } // // EOF //