/** * @file * * Scripts to draw energy loss fits from correction object file * * @ingroup pwglf_forward_scripts_corr */ void Setup(Bool_t compile) { const char* post = (compile ? "++g" : ""); const char* fwd = "$ALICE_ROOT/PWGLF/FORWARD/analysis2"; if (!gROOT->GetClass("AliFMDCorrELossFit")) gROOT->Macro(Form("%s/scripts/LoadLibs.C", fwd)); gSystem->AddIncludePath(Form("-I%s/scripts -I%s/corrs -I%s " "-I$ALICE_ROOT/include", fwd, fwd, fwd)); gROOT->LoadMacro(Form("%s/scripts/SummaryDrawer.C%s", fwd, post)); gROOT->LoadMacro(Form("%s/corrs/CorrDrawer.C%s", fwd, post)); } /** * Draw energy loss fits to a multi-page PDF. * * @par Input: * The input file is expected to contain a AliFMDCorrELossFit object * named @c elossfits in the top level directory. * * @par Output: * A multi-page PDF. Note, that the PDF generated by ROOT in this way * is broken (cannot be read by Acrobat Reader on Windows and MacOSX) * and one should pass it through a filter to correct these problems. * * @param runNo Run number * @param sys Collision system * @param sNN Collision energy in GeV * @param field L3 field strength * @param mc For simulation input * @param sat For satellite interactions * @param fname File name * @param details Drawing options * * @ingroup pwglf_forward_scripts_corr */ void DrawCorrELoss(ULong_t runNo, UShort_t sys, UShort_t sNN, Short_t field, Bool_t mc=false, Bool_t sat=false, const char* fname=0, Bool_t details=true) { // Load libraries and object // const char* fwd = "$ALICE_ROOT/PWGLF/FORWARD/analysis2"; Setup(false); CorrDrawer d; d.Summarize(AliForwardCorrectionManager::kELossFits, runNo, sys, sNN, field, mc, sat, "", fname); } /** * Draw the energy loss correction * * @param mc For MC * @param file Input file with the full fits * @param local Local correction database */ void DrawCorrELoss(Bool_t mc, const char* file="forward_eloss.root", const char* local="fmd_corrections.root") { Setup(true); CorrDrawer::Summarize(AliForwardCorrectionManager::kELossFits, mc, file, local, "LANDSCAPE FEW"); } /** * Draw the energy loss correction * * @param mc For MC * @param dummy Not used * @param file Input file with the full fits */ void DrawCorrELoss(Bool_t mc, Bool_t dummy, const char* file="forward_eloss_rerun.root") { Setup(true); Printf("Drawing fit results from %s", file); TFile* hist = TFile::Open(file, "READ"); if (!hist) { Error("DrawCorrELoss", "Failed to open %s", file); return; } TList* res = static_cast(hist->Get("ForwardELossResults")); if (!res) { Error("DrawCorrEloss", "Failed to get ForwardELossResults from %s", file); return; } TList* ef = static_cast(res->FindObject("fmdEnergyFitter")); if (!ef) { Error("DrawCorrEloss", "Failed to get fmdEnergyFitter from %s:/%s", file, res->GetName()); return; } AliFMDCorrELossFit* fits = static_cast(ef->FindObject("AliFMDCorrELossFit")); if (!fits) { Error("DrawCorrEloss", "Failed to get AliFMDCorrELossFit from %s:/%s/%s", file, res->GetName(), ef->GetName()); return; } CorrDrawer* cd = new CorrDrawer; cd->fELossExtra = file; cd->fMinQuality = 8; // cd->fLandscape = true; cd->Summarize(const_cast(fits), true); } // // EOF //