2 * Script to draw the energy loss fits
4 * @ingroup pwg2_forward_analysis_scripts
10 #include "AliFMDCorrSecondaryMap.h"
11 #include "AliCentralCorrSecondaryMap.h"
12 #include "AliForwardCorrectionManager.h"
15 //____________________________________________________________________
17 * Extract the energy loss correction object from file and rename it
18 * according to the settings
20 * @param fname File to extract from
21 * @param sys Collision system (pp, PbPb)
22 * @param sNN Center of mass energy (in GeV) per nucleon
23 * @param field L3 magnetic field (-5,0,5) in kGaus
25 * @ingroup pwg2_forward_analysis_scripts
28 ExtractSecMap(const char* fname,
29 UShort_t sys=1, UShort_t sNN=900, Short_t field=5)
32 gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
35 TFile* file = TFile::Open(fname, "READ");
37 Error("ExtractSecMap", "Couldn't open %s", fname);
41 ExtractFMDSecMap(file, sys, sNN, field);
42 ExtractSPDSecMap(file, sys, sNN, field);
45 //____________________________________________________________________
47 * Extract and copy FMD secondary map to file
49 * @param file Input file
50 * @param sys Collision system (1:pp, 2:PbPb)
51 * @param sNN Center of mass energy (GeV) per nucleon
52 * @param field L3 magnetic field
54 * @ingroup pwg2_forward_analysis_scripts
57 ExtractFMDSecMap(TFile* file, UShort_t sys, UShort_t sNN, Short_t field)
59 TList* forward = static_cast<TList*>(file->Get("ForwardResults"));
60 // static_cast<TList*>(file->Get("PWG2forwardDnDeta/Forward"));
62 Error("ExtractSecMap", "Couldn't get forward list from %s", fname);
66 TString n(AliFMDCorrSecondaryMap::Class()->GetName());
67 TObject* fmdCorr = forward->FindObject(n);
69 Error("ExtractSecMap", "Couldn't get forward correction object %s",
74 AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
75 mgr.WriteFile(AliForwardCorrectionManager::kSecondaryMap,
76 sys, sNN, field, false, fmdCorr, false);
79 //____________________________________________________________________
81 * Extract and copy SPD secondary map to file
83 * @param file Input file
84 * @param sys Collision system (1:pp, 2:PbPb)
85 * @param sNN Center of mass energy (GeV) per nucleon
86 * @param field L3 magnetic field
88 * @ingroup pwg2_forward_analysis_scripts
91 ExtractSPDSecMap(TFile* file, UShort_t sys, UShort_t sNN, Short_t field)
93 TList* central = static_cast<TList*>(file->Get("CentralResults"));
94 // static_cast<TList*>(file->Get("PWG2centralDnDeta/Central"));
96 Error("ExtractSecMap", "Couldn't get central list from %s", fname);
100 TString n(AliCentralCorrSecondaryMap::Class()->GetName());
101 TObject* spdCorr = central->FindObject(n);
103 Error("ExtractSecMap", "Couldn't get central correction object %s",
109 AliCentralMultiplicityTask::Manager* mgr = new
110 AliCentralMultiplicityTask::Manager;
113 mgr->WriteFile(0, sys, sNN, field, spdCorr, false);
117 //____________________________________________________________________
119 * Extract the energy loss correction object from file and rename it
120 * according to the settings
122 * @param fname File to extract from
123 * @param sys Collision system (pp, PbPb)
124 * @param sNN Center of mass energy (in GeV) per nucleon
125 * @param field L3 magnetic field (-5,0,5) in kGaus
126 * @param mc Whether this is from MC data or not
128 * @ingroup pwg2_forward_analysis_scripts
131 ExtractSecMap(const char* fname="forward_mccorr.root",
132 const char* sys="p-p",
136 gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
138 UShort_t uSys = AliForwardUtil::ParseCollisionSystem(sys);
139 UShort_t usNN = AliForwardUtil::ParseCenterOfMassEnergy(uSys,sNN);
140 Short_t sField = AliForwardUtil::ParseMagneticField(field);
142 ExtractSecMap(fname, uSys, usNN, sField);
145 //____________________________________________________________________