2 * Script to draw the energy loss fits
4 * @ingroup pwg2_forward_analysis_scripts
10 #include "AliFMDCorrELossFit.h"
11 #include "AliForwardCorrectionManager.h"
14 //____________________________________________________________________
16 * Extract the energy loss correction object from file and rename it
17 * according to the settings
19 * @param fname File to extract from
20 * @param sys Collision system (pp, PbPb)
21 * @param sNN Center of mass energy (in GeV) per nucleon
22 * @param field L3 magnetic field (-5,0,5) in kGaus
23 * @param mc Whether this is from MC data or not
25 * @ingroup pwg2_forward_analysis_scripts
28 ExtractELoss(const char* fname="forward_eloss.root",
29 UShort_t sys=1, UShort_t sNN=900, Short_t field=5, Bool_t mc=false)
32 gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
35 TFile* file = TFile::Open(fname, "READ");
37 Error("ExtractELoss", "Couldn't open %s", fname);
41 TList* forward = static_cast<TList*>(file->Get("ForwardResults"));
42 // static_cast<TList*>(file->Get("PWG2forwardDnDeta/Forward"));
44 Error("ExtractELoss", "Couldn't get forward list from %s", fname);
48 TList* fitter = static_cast<TList*>(forward->FindObject("fmdEnergyFitter"));
50 Error("ExtractELoss", "Couldn't get fitter folder");
54 TString cName(AliFMDCorrELossFit::Class()->GetName());
56 AliFMDCorrELossFit* obj =
57 static_cast<AliFMDCorrELossFit*>(fitter->FindObject(cName));
59 Error("ExtractELoss", "Couldn't get %s correction object", cName.Data());
63 AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
64 mgr.WriteFile(AliForwardCorrectionManager::kELossFits,
65 sys, sNN, field, mc, obj, false);
70 //____________________________________________________________________
72 * Extract the energy loss correction object from file and rename it
73 * according to the settings
75 * @param fname File to extract from
76 * @param sys Collision system (pp, PbPb)
77 * @param sNN Center of mass energy (in GeV) per nucleon
78 * @param field L3 magnetic field (-5,0,5) in kGaus
79 * @param mc Whether this is from MC data or not
81 * @ingroup pwg2_forward_analysis_scripts
84 ExtractELoss(const char* fname="energyFits.root",
85 const char* sys="p-p",
90 UShort_t uSys = AliForwardUtil::ParseCollisionSystem(sys);
91 UShort_t usNN = AliForwardUtil::ParseCenterOfMassEnergy(uSys,sNN);
92 Short_t sField = AliForwardUtil::ParseMagneticField(field);
94 ExtractELoss(fname, uSys, usNN, sField, mc);
97 //____________________________________________________________________