From: cholm Date: Wed, 7 May 2014 10:40:29 +0000 (+0200) Subject: Script to extract noise gain corrections X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=5f1858847e294fadcf97a131a540ed52e4fb6817;p=u%2Fmrichter%2FAliRoot.git Script to extract noise gain corrections --- diff --git a/PWGLF/FORWARD/analysis2/corrs/ExtractNoiseGain.C b/PWGLF/FORWARD/analysis2/corrs/ExtractNoiseGain.C new file mode 100644 index 00000000000..3efa1379e45 --- /dev/null +++ b/PWGLF/FORWARD/analysis2/corrs/ExtractNoiseGain.C @@ -0,0 +1,55 @@ +#include + +/** + * 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 +//