]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/corrs/DrawCorrELoss.C
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / corrs / DrawCorrELoss.C
CommitLineData
1c762251 1/**
2 * @file
3 *
4 * Scripts to draw energy loss fits from correction object file
5 *
bd6f5206 6 * @ingroup pwglf_forward_scripts_corr
1c762251 7 */
e65b8b56 8void Setup(Bool_t compile)
9{
10 const char* post = (compile ? "++g" : "");
11 const char* fwd = "$ALICE_ROOT/PWGLF/FORWARD/analysis2";
12 if (!gROOT->GetClass("AliFMDCorrELossFit"))
13 gROOT->Macro(Form("%s/scripts/LoadLibs.C", fwd));
14 gSystem->AddIncludePath(Form("-I%s/scripts -I%s/corrs -I%s "
15 "-I$ALICE_ROOT/include", fwd, fwd, fwd));
16 gROOT->LoadMacro(Form("%s/scripts/SummaryDrawer.C%s", fwd, post));
17 gROOT->LoadMacro(Form("%s/corrs/CorrDrawer.C%s", fwd, post));
18
19}
1c762251 20/**
21 * Draw energy loss fits to a multi-page PDF.
22 *
23 * @par Input:
24 * The input file is expected to contain a AliFMDCorrELossFit object
970b1a8a 25 * named @c elossfits in the top level directory.
1c762251 26 *
970b1a8a 27 * @par Output:
1c762251 28 * A multi-page PDF. Note, that the PDF generated by ROOT in this way
29 * is broken (cannot be read by Acrobat Reader on Windows and MacOSX)
30 * and one should pass it through a filter to correct these problems.
31 *
c8b1a7db 32 * @param runNo Run number
33 * @param sys Collision system
34 * @param sNN Collision energy in GeV
35 * @param field L3 field strength
36 * @param mc For simulation input
37 * @param sat For satellite interactions
1c762251 38 * @param fname File name
c8b1a7db 39 * @param details Drawing options
1c762251 40 *
bd6f5206 41 * @ingroup pwglf_forward_scripts_corr
1c762251 42 */
cbd6464b 43void
8449e3e0 44DrawCorrELoss(ULong_t runNo, UShort_t sys, UShort_t sNN, Short_t field,
45 Bool_t mc=false, Bool_t sat=false,
46 const char* fname=0, Bool_t details=true)
cbd6464b 47{
1c762251 48 // Load libraries and object
8449e3e0 49 // const char* fwd = "$ALICE_ROOT/PWGLF/FORWARD/analysis2";
e65b8b56 50 Setup(false);
8449e3e0 51
52 CorrDrawer d;
53 d.Summarize(AliForwardCorrectionManager::kELossFits, runNo, sys, sNN, field,
54 mc, sat, "", fname);
cbd6464b 55}
c8b1a7db 56/**
57 * Draw the energy loss correction
58 *
59 * @param mc For MC
60 * @param file Input file with the full fits
61 * @param local Local correction database
62 */
bfab35d9 63void
64DrawCorrELoss(Bool_t mc,
65 const char* file="forward_eloss.root",
66 const char* local="fmd_corrections.root")
67{
e65b8b56 68 Setup(true);
bfab35d9 69
bfab35d9 70 CorrDrawer::Summarize(AliForwardCorrectionManager::kELossFits,
a19faec0 71 mc, file, local, "LANDSCAPE FEW");
bfab35d9 72}
c8b1a7db 73/**
74 * Draw the energy loss correction
75 *
76 * @param mc For MC
77 * @param dummy Not used
78 * @param file Input file with the full fits
79 */
81775aba 80void
81DrawCorrELoss(Bool_t mc, Bool_t dummy,
82 const char* file="forward_eloss_rerun.root")
83{
e65b8b56 84 Setup(true);
81775aba 85
e65b8b56 86 Printf("Drawing fit results from %s", file);
81775aba 87 TFile* hist = TFile::Open(file, "READ");
88 if (!hist) {
89 Error("DrawCorrELoss", "Failed to open %s", file);
90 return;
91 }
a19faec0 92 TList* res = static_cast<TList*>(hist->Get("ForwardELossResults"));
81775aba 93 if (!res) {
a19faec0 94 Error("DrawCorrEloss", "Failed to get ForwardELossResults from %s", file);
81775aba 95 return;
96 }
97 TList* ef = static_cast<TList*>(res->FindObject("fmdEnergyFitter"));
98 if (!ef) {
99 Error("DrawCorrEloss", "Failed to get fmdEnergyFitter from %s:/%s",
100 file, res->GetName());
101 return;
102 }
103
104 AliFMDCorrELossFit* fits =
105 static_cast<AliFMDCorrELossFit*>(ef->FindObject("AliFMDCorrELossFit"));
106 if (!fits) {
107 Error("DrawCorrEloss", "Failed to get AliFMDCorrELossFit from %s:/%s/%s",
108 file, res->GetName(), ef->GetName());
109 return;
110 }
111
112 CorrDrawer* cd = new CorrDrawer;
113 cd->fELossExtra = file;
114 cd->fMinQuality = 8;
a19faec0 115 // cd->fLandscape = true;
e65b8b56 116 cd->Summarize(const_cast<const AliFMDCorrELossFit*>(fits), true);
81775aba 117}
118
1c762251 119//
120// EOF
121//