#include "AliForwardCorrectionManager.h"
#include "AliFMDCorrSecondaryMap.h"
#include "AliFMDCorrDoubleHit.h"
#include "AliFMDCorrELossFit.h"
#include "AliFMDCorrVertexBias.h"
#include "AliFMDCorrMergingEfficiency.h"
#include "AliFMDCorrAcceptance.h"
#include "AliFMDCorrNoiseGain.h"
#include "AliForwardUtil.h"
#include "AliOADBForward.h"
#include <TString.h>
#include <AliLog.h>
#include <TFile.h>
#include <TSystem.h>
#include <TBrowser.h>
#include <TROOT.h>
#include <TClass.h>
#include <iostream>
#include <iomanip>
AliForwardCorrectionManager* AliForwardCorrectionManager::fgInstance= 0;
const char* AliForwardCorrectionManager::fgkSecondaryMapSkel = "secondary";
const char* AliForwardCorrectionManager::fgkDoubleHitSkel = "doublehit";
const char* AliForwardCorrectionManager::fgkELossFitsSkel = "elossfits";
const char* AliForwardCorrectionManager::fgkVertexBiasSkel = "vertexbias";
const char* AliForwardCorrectionManager::fgkMergingEffSkel = "merging";
const char* AliForwardCorrectionManager::fgkAcceptanceSkel = "acceptance";
const char* AliForwardCorrectionManager::fgkNoiseGainSkel = "noisegain";
#define PREFIX "$(ALICE_ROOT)/OADB/PWGLF/FORWARD/CORRECTIONS/data/"
#define DB_NAME "fmd_corrections.root"
AliForwardCorrectionManager& AliForwardCorrectionManager::Instance()
{
if (!fgInstance) fgInstance= new AliForwardCorrectionManager(false);
return *fgInstance;
}
AliForwardCorrectionManager::AliForwardCorrectionManager()
{
}
AliForwardCorrectionManager::AliForwardCorrectionManager(Bool_t d)
: AliCorrectionManagerBase(d)
{
RegisterCorrection(kIdSecondaryMap, fgkSecondaryMapSkel,
PREFIX DB_NAME, AliFMDCorrSecondaryMap::Class(),
kStandard|kSatellite);
RegisterCorrection(kIdELossFits, fgkELossFitsSkel,
PREFIX DB_NAME, AliFMDCorrELossFit::Class(),
kRun|kSys|kSNN|kSatellite|kMC );
RegisterCorrection(kIdVertexBias, fgkVertexBiasSkel,
PREFIX DB_NAME, AliFMDCorrVertexBias::Class(),
kStandard|kSatellite);
RegisterCorrection(kIdMergingEfficiency, fgkMergingEffSkel,
PREFIX DB_NAME, AliFMDCorrMergingEfficiency::Class(),
kStandard|kSatellite);
RegisterCorrection(kIdDoubleHit, fgkDoubleHitSkel,
PREFIX DB_NAME, AliFMDCorrDoubleHit::Class(),
kStandard|kMC);
RegisterCorrection(kIdAcceptance, fgkAcceptanceSkel,
PREFIX DB_NAME, AliFMDCorrAcceptance::Class(),
kRun|kSys|kSNN|kSatellite);
RegisterCorrection(kIdNoiseGain, fgkNoiseGainSkel,
PREFIX DB_NAME, AliFMDCorrNoiseGain::Class(), kRun);
}
Bool_t
AliForwardCorrectionManager::Init(ULong_t runNo,
const char* sys,
Float_t sNN,
Float_t field,
Bool_t mc,
Bool_t sat,
UInt_t what,
Bool_t force)
{
UShort_t col = AliForwardUtil::ParseCollisionSystem(sys);
return Init(runNo, col,
AliForwardUtil::ParseCenterOfMassEnergy(col, sNN),
AliForwardUtil::ParseMagneticField(field),
mc, sat, what, force);
}
Bool_t
AliForwardCorrectionManager::Init(ULong_t runNo,
UShort_t sys,
UShort_t sNN,
Short_t field,
Bool_t mc,
Bool_t sat,
UInt_t what,
Bool_t force)
{
EnableCorrection(kIdSecondaryMap, what & kSecondaryMap);
EnableCorrection(kIdDoubleHit, what & kDoubleHit);
EnableCorrection(kIdELossFits, what & kELossFits);
EnableCorrection(kIdAcceptance, what & kAcceptance);
EnableCorrection(kIdVertexBias, what & kVertexBias);
EnableCorrection(kIdMergingEfficiency,what & kMergingEfficiency);
EnableCorrection(kIdNoiseGain, what & kNoiseGain);
return InitCorrections(runNo, sys, sNN, field, mc, sat, force);
}
UInt_t
AliForwardCorrectionManager::ParseFields(const TString& fields)
{
UInt_t ret = 0;
TObjArray* tokens = fields.Tokenize(" \t,|+:;-&");
TIter next(tokens);
TObjString* ostr = 0;
while ((ostr = static_cast<TObjString*>(next()))) {
const TString& str = ostr->String();
if (str.Contains("all", TString::kIgnoreCase))
ret |= kAll;
else if (str.Contains("default", TString::kIgnoreCase))
ret |= kDefault;
else if (str.Contains(fgkSecondaryMapSkel, TString::kIgnoreCase))
ret |= kSecondaryMap;
else if (str.Contains(fgkDoubleHitSkel, TString::kIgnoreCase))
ret |= kDoubleHit;
else if (str.Contains(fgkELossFitsSkel, TString::kIgnoreCase))
ret |= kELossFits;
else if (str.Contains(fgkVertexBiasSkel, TString::kIgnoreCase))
ret |= kVertexBias;
else if (str.Contains(fgkMergingEffSkel, TString::kIgnoreCase))
ret |= kMergingEfficiency;
else if (str.Contains(fgkAcceptanceSkel, TString::kIgnoreCase))
ret |= kAcceptance;
else if (str.Contains(fgkNoiseGainSkel, TString::kIgnoreCase))
ret |= kNoiseGain;
else
AliWarningClassF("Unknown correction: %s", str.Data());
}
delete tokens;
return ret;
}
Bool_t
AliForwardCorrectionManager::Append(const TString& addition,
const TString& destination) const
{
TString dest(destination);
if (dest.IsNull())
dest = PREFIX DB_NAME;
return AliCorrectionManagerBase::Append(addition, dest);
}
const AliFMDCorrELossFit*
AliForwardCorrectionManager::GetELossFit() const
{
return static_cast<const AliFMDCorrELossFit*>(Get(kIdELossFits));
}
const AliFMDCorrSecondaryMap*
AliForwardCorrectionManager::GetSecondaryMap() const
{
return static_cast<const AliFMDCorrSecondaryMap*>(Get(kIdSecondaryMap));
}
const AliFMDCorrDoubleHit*
AliForwardCorrectionManager::GetDoubleHit() const
{
return static_cast<const AliFMDCorrDoubleHit*>(Get(kIdDoubleHit));
}
const AliFMDCorrVertexBias*
AliForwardCorrectionManager::GetVertexBias() const
{
return static_cast<const AliFMDCorrVertexBias*>(Get(kIdVertexBias));
}
const AliFMDCorrMergingEfficiency*
AliForwardCorrectionManager::GetMergingEfficiency() const
{
return
static_cast<const AliFMDCorrMergingEfficiency*>(Get(kIdMergingEfficiency));
}
const AliFMDCorrAcceptance*
AliForwardCorrectionManager::GetAcceptance() const
{
return static_cast<const AliFMDCorrAcceptance*>(Get(kIdAcceptance));
}
const AliFMDCorrNoiseGain*
AliForwardCorrectionManager::GetNoiseGain() const
{
return static_cast<const AliFMDCorrNoiseGain*>(Get(kIdNoiseGain));
}
const TAxis*
AliForwardCorrectionManager::GetEtaAxis() const
{
const AliFMDCorrSecondaryMap* map = GetSecondaryMap();
if (!map) return 0;
return &(map->GetEtaAxis());
}
const TAxis*
AliForwardCorrectionManager::GetVertexAxis() const
{
const AliFMDCorrSecondaryMap* map = GetSecondaryMap();
if (!map) return 0;
return &(map->GetVertexAxis());
}
#ifndef DOXY_INPUT
void AliForwardCorrectionManager::Streamer(TBuffer &R__b)
{
if (R__b.IsReading()) {
R__b.ReadClassBuffer(AliForwardCorrectionManager::Class(),this);
if (fgInstance) {
AliWarning(Form("Singleton instance already set (%p) when reading "
"singleton object (%p). Read object will be new "
"singleton object", fgInstance, this));
}
fgInstance = this;
} else {
R__b.WriteClassBuffer(AliForwardCorrectionManager::Class(),this);
}
}
#endif
AliForwardCorrectionManager.cxx:1 AliForwardCorrectionManager.cxx:2 AliForwardCorrectionManager.cxx:3 AliForwardCorrectionManager.cxx:4 AliForwardCorrectionManager.cxx:5 AliForwardCorrectionManager.cxx:6 AliForwardCorrectionManager.cxx:7 AliForwardCorrectionManager.cxx:8 AliForwardCorrectionManager.cxx:9 AliForwardCorrectionManager.cxx:10 AliForwardCorrectionManager.cxx:11 AliForwardCorrectionManager.cxx:12 AliForwardCorrectionManager.cxx:13 AliForwardCorrectionManager.cxx:14 AliForwardCorrectionManager.cxx:15 AliForwardCorrectionManager.cxx:16 AliForwardCorrectionManager.cxx:17 AliForwardCorrectionManager.cxx:18 AliForwardCorrectionManager.cxx:19 AliForwardCorrectionManager.cxx:20 AliForwardCorrectionManager.cxx:21 AliForwardCorrectionManager.cxx:22 AliForwardCorrectionManager.cxx:23 AliForwardCorrectionManager.cxx:24 AliForwardCorrectionManager.cxx:25 AliForwardCorrectionManager.cxx:26 AliForwardCorrectionManager.cxx:27 AliForwardCorrectionManager.cxx:28 AliForwardCorrectionManager.cxx:29 AliForwardCorrectionManager.cxx:30 AliForwardCorrectionManager.cxx:31 AliForwardCorrectionManager.cxx:32 AliForwardCorrectionManager.cxx:33 AliForwardCorrectionManager.cxx:34 AliForwardCorrectionManager.cxx:35 AliForwardCorrectionManager.cxx:36 AliForwardCorrectionManager.cxx:37 AliForwardCorrectionManager.cxx:38 AliForwardCorrectionManager.cxx:39 AliForwardCorrectionManager.cxx:40 AliForwardCorrectionManager.cxx:41 AliForwardCorrectionManager.cxx:42 AliForwardCorrectionManager.cxx:43 AliForwardCorrectionManager.cxx:44 AliForwardCorrectionManager.cxx:45 AliForwardCorrectionManager.cxx:46 AliForwardCorrectionManager.cxx:47 AliForwardCorrectionManager.cxx:48 AliForwardCorrectionManager.cxx:49 AliForwardCorrectionManager.cxx:50 AliForwardCorrectionManager.cxx:51 AliForwardCorrectionManager.cxx:52 AliForwardCorrectionManager.cxx:53 AliForwardCorrectionManager.cxx:54 AliForwardCorrectionManager.cxx:55 AliForwardCorrectionManager.cxx:56 AliForwardCorrectionManager.cxx:57 AliForwardCorrectionManager.cxx:58 AliForwardCorrectionManager.cxx:59 AliForwardCorrectionManager.cxx:60 AliForwardCorrectionManager.cxx:61 AliForwardCorrectionManager.cxx:62 AliForwardCorrectionManager.cxx:63 AliForwardCorrectionManager.cxx:64 AliForwardCorrectionManager.cxx:65 AliForwardCorrectionManager.cxx:66 AliForwardCorrectionManager.cxx:67 AliForwardCorrectionManager.cxx:68 AliForwardCorrectionManager.cxx:69 AliForwardCorrectionManager.cxx:70 AliForwardCorrectionManager.cxx:71 AliForwardCorrectionManager.cxx:72 AliForwardCorrectionManager.cxx:73 AliForwardCorrectionManager.cxx:74 AliForwardCorrectionManager.cxx:75 AliForwardCorrectionManager.cxx:76 AliForwardCorrectionManager.cxx:77 AliForwardCorrectionManager.cxx:78 AliForwardCorrectionManager.cxx:79 AliForwardCorrectionManager.cxx:80 AliForwardCorrectionManager.cxx:81 AliForwardCorrectionManager.cxx:82 AliForwardCorrectionManager.cxx:83 AliForwardCorrectionManager.cxx:84 AliForwardCorrectionManager.cxx:85 AliForwardCorrectionManager.cxx:86 AliForwardCorrectionManager.cxx:87 AliForwardCorrectionManager.cxx:88 AliForwardCorrectionManager.cxx:89 AliForwardCorrectionManager.cxx:90 AliForwardCorrectionManager.cxx:91 AliForwardCorrectionManager.cxx:92 AliForwardCorrectionManager.cxx:93 AliForwardCorrectionManager.cxx:94 AliForwardCorrectionManager.cxx:95 AliForwardCorrectionManager.cxx:96 AliForwardCorrectionManager.cxx:97 AliForwardCorrectionManager.cxx:98 AliForwardCorrectionManager.cxx:99 AliForwardCorrectionManager.cxx:100 AliForwardCorrectionManager.cxx:101 AliForwardCorrectionManager.cxx:102 AliForwardCorrectionManager.cxx:103 AliForwardCorrectionManager.cxx:104 AliForwardCorrectionManager.cxx:105 AliForwardCorrectionManager.cxx:106 AliForwardCorrectionManager.cxx:107 AliForwardCorrectionManager.cxx:108 AliForwardCorrectionManager.cxx:109 AliForwardCorrectionManager.cxx:110 AliForwardCorrectionManager.cxx:111 AliForwardCorrectionManager.cxx:112 AliForwardCorrectionManager.cxx:113 AliForwardCorrectionManager.cxx:114 AliForwardCorrectionManager.cxx:115 AliForwardCorrectionManager.cxx:116 AliForwardCorrectionManager.cxx:117 AliForwardCorrectionManager.cxx:118 AliForwardCorrectionManager.cxx:119 AliForwardCorrectionManager.cxx:120 AliForwardCorrectionManager.cxx:121 AliForwardCorrectionManager.cxx:122 AliForwardCorrectionManager.cxx:123 AliForwardCorrectionManager.cxx:124 AliForwardCorrectionManager.cxx:125 AliForwardCorrectionManager.cxx:126 AliForwardCorrectionManager.cxx:127 AliForwardCorrectionManager.cxx:128 AliForwardCorrectionManager.cxx:129 AliForwardCorrectionManager.cxx:130 AliForwardCorrectionManager.cxx:131 AliForwardCorrectionManager.cxx:132 AliForwardCorrectionManager.cxx:133 AliForwardCorrectionManager.cxx:134 AliForwardCorrectionManager.cxx:135 AliForwardCorrectionManager.cxx:136 AliForwardCorrectionManager.cxx:137 AliForwardCorrectionManager.cxx:138 AliForwardCorrectionManager.cxx:139 AliForwardCorrectionManager.cxx:140 AliForwardCorrectionManager.cxx:141 AliForwardCorrectionManager.cxx:142 AliForwardCorrectionManager.cxx:143 AliForwardCorrectionManager.cxx:144 AliForwardCorrectionManager.cxx:145 AliForwardCorrectionManager.cxx:146 AliForwardCorrectionManager.cxx:147 AliForwardCorrectionManager.cxx:148 AliForwardCorrectionManager.cxx:149 AliForwardCorrectionManager.cxx:150 AliForwardCorrectionManager.cxx:151 AliForwardCorrectionManager.cxx:152 AliForwardCorrectionManager.cxx:153 AliForwardCorrectionManager.cxx:154 AliForwardCorrectionManager.cxx:155 AliForwardCorrectionManager.cxx:156 AliForwardCorrectionManager.cxx:157 AliForwardCorrectionManager.cxx:158 AliForwardCorrectionManager.cxx:159 AliForwardCorrectionManager.cxx:160 AliForwardCorrectionManager.cxx:161 AliForwardCorrectionManager.cxx:162 AliForwardCorrectionManager.cxx:163 AliForwardCorrectionManager.cxx:164 AliForwardCorrectionManager.cxx:165 AliForwardCorrectionManager.cxx:166 AliForwardCorrectionManager.cxx:167 AliForwardCorrectionManager.cxx:168 AliForwardCorrectionManager.cxx:169 AliForwardCorrectionManager.cxx:170 AliForwardCorrectionManager.cxx:171 AliForwardCorrectionManager.cxx:172 AliForwardCorrectionManager.cxx:173 AliForwardCorrectionManager.cxx:174 AliForwardCorrectionManager.cxx:175 AliForwardCorrectionManager.cxx:176 AliForwardCorrectionManager.cxx:177 AliForwardCorrectionManager.cxx:178 AliForwardCorrectionManager.cxx:179 AliForwardCorrectionManager.cxx:180 AliForwardCorrectionManager.cxx:181 AliForwardCorrectionManager.cxx:182 AliForwardCorrectionManager.cxx:183 AliForwardCorrectionManager.cxx:184 AliForwardCorrectionManager.cxx:185 AliForwardCorrectionManager.cxx:186 AliForwardCorrectionManager.cxx:187 AliForwardCorrectionManager.cxx:188 AliForwardCorrectionManager.cxx:189 AliForwardCorrectionManager.cxx:190 AliForwardCorrectionManager.cxx:191 AliForwardCorrectionManager.cxx:192 AliForwardCorrectionManager.cxx:193 AliForwardCorrectionManager.cxx:194 AliForwardCorrectionManager.cxx:195 AliForwardCorrectionManager.cxx:196 AliForwardCorrectionManager.cxx:197 AliForwardCorrectionManager.cxx:198 AliForwardCorrectionManager.cxx:199 AliForwardCorrectionManager.cxx:200 AliForwardCorrectionManager.cxx:201 AliForwardCorrectionManager.cxx:202 AliForwardCorrectionManager.cxx:203 AliForwardCorrectionManager.cxx:204 AliForwardCorrectionManager.cxx:205 AliForwardCorrectionManager.cxx:206 AliForwardCorrectionManager.cxx:207 AliForwardCorrectionManager.cxx:208 AliForwardCorrectionManager.cxx:209 AliForwardCorrectionManager.cxx:210 AliForwardCorrectionManager.cxx:211 AliForwardCorrectionManager.cxx:212 AliForwardCorrectionManager.cxx:213 AliForwardCorrectionManager.cxx:214 AliForwardCorrectionManager.cxx:215 AliForwardCorrectionManager.cxx:216 AliForwardCorrectionManager.cxx:217 AliForwardCorrectionManager.cxx:218 AliForwardCorrectionManager.cxx:219 AliForwardCorrectionManager.cxx:220 AliForwardCorrectionManager.cxx:221 AliForwardCorrectionManager.cxx:222 AliForwardCorrectionManager.cxx:223 AliForwardCorrectionManager.cxx:224 AliForwardCorrectionManager.cxx:225 AliForwardCorrectionManager.cxx:226 AliForwardCorrectionManager.cxx:227 AliForwardCorrectionManager.cxx:228 AliForwardCorrectionManager.cxx:229 AliForwardCorrectionManager.cxx:230 AliForwardCorrectionManager.cxx:231 AliForwardCorrectionManager.cxx:232 AliForwardCorrectionManager.cxx:233 AliForwardCorrectionManager.cxx:234 AliForwardCorrectionManager.cxx:235 AliForwardCorrectionManager.cxx:236 AliForwardCorrectionManager.cxx:237 AliForwardCorrectionManager.cxx:238 AliForwardCorrectionManager.cxx:239 AliForwardCorrectionManager.cxx:240 AliForwardCorrectionManager.cxx:241 AliForwardCorrectionManager.cxx:242 AliForwardCorrectionManager.cxx:243 AliForwardCorrectionManager.cxx:244 AliForwardCorrectionManager.cxx:245 AliForwardCorrectionManager.cxx:246 AliForwardCorrectionManager.cxx:247 AliForwardCorrectionManager.cxx:248 AliForwardCorrectionManager.cxx:249 AliForwardCorrectionManager.cxx:250 AliForwardCorrectionManager.cxx:251 AliForwardCorrectionManager.cxx:252 AliForwardCorrectionManager.cxx:253 AliForwardCorrectionManager.cxx:254 AliForwardCorrectionManager.cxx:255 AliForwardCorrectionManager.cxx:256 AliForwardCorrectionManager.cxx:257 AliForwardCorrectionManager.cxx:258 AliForwardCorrectionManager.cxx:259 AliForwardCorrectionManager.cxx:260 AliForwardCorrectionManager.cxx:261 AliForwardCorrectionManager.cxx:262 AliForwardCorrectionManager.cxx:263 AliForwardCorrectionManager.cxx:264 AliForwardCorrectionManager.cxx:265 AliForwardCorrectionManager.cxx:266 AliForwardCorrectionManager.cxx:267 AliForwardCorrectionManager.cxx:268 AliForwardCorrectionManager.cxx:269 AliForwardCorrectionManager.cxx:270 AliForwardCorrectionManager.cxx:271 AliForwardCorrectionManager.cxx:272 AliForwardCorrectionManager.cxx:273 AliForwardCorrectionManager.cxx:274 AliForwardCorrectionManager.cxx:275 AliForwardCorrectionManager.cxx:276 AliForwardCorrectionManager.cxx:277 AliForwardCorrectionManager.cxx:278 AliForwardCorrectionManager.cxx:279 AliForwardCorrectionManager.cxx:280 AliForwardCorrectionManager.cxx:281 AliForwardCorrectionManager.cxx:282 AliForwardCorrectionManager.cxx:283 AliForwardCorrectionManager.cxx:284 AliForwardCorrectionManager.cxx:285 AliForwardCorrectionManager.cxx:286 AliForwardCorrectionManager.cxx:287 AliForwardCorrectionManager.cxx:288 AliForwardCorrectionManager.cxx:289 AliForwardCorrectionManager.cxx:290 AliForwardCorrectionManager.cxx:291 AliForwardCorrectionManager.cxx:292 AliForwardCorrectionManager.cxx:293 AliForwardCorrectionManager.cxx:294 AliForwardCorrectionManager.cxx:295 AliForwardCorrectionManager.cxx:296 AliForwardCorrectionManager.cxx:297 AliForwardCorrectionManager.cxx:298 AliForwardCorrectionManager.cxx:299 AliForwardCorrectionManager.cxx:300 AliForwardCorrectionManager.cxx:301 AliForwardCorrectionManager.cxx:302 AliForwardCorrectionManager.cxx:303 AliForwardCorrectionManager.cxx:304 AliForwardCorrectionManager.cxx:305 AliForwardCorrectionManager.cxx:306 AliForwardCorrectionManager.cxx:307 AliForwardCorrectionManager.cxx:308 AliForwardCorrectionManager.cxx:309 AliForwardCorrectionManager.cxx:310 AliForwardCorrectionManager.cxx:311 AliForwardCorrectionManager.cxx:312 AliForwardCorrectionManager.cxx:313 AliForwardCorrectionManager.cxx:314 AliForwardCorrectionManager.cxx:315 AliForwardCorrectionManager.cxx:316 AliForwardCorrectionManager.cxx:317 AliForwardCorrectionManager.cxx:318 AliForwardCorrectionManager.cxx:319 AliForwardCorrectionManager.cxx:320 AliForwardCorrectionManager.cxx:321 AliForwardCorrectionManager.cxx:322 AliForwardCorrectionManager.cxx:323 AliForwardCorrectionManager.cxx:324 AliForwardCorrectionManager.cxx:325 AliForwardCorrectionManager.cxx:326 AliForwardCorrectionManager.cxx:327 AliForwardCorrectionManager.cxx:328 AliForwardCorrectionManager.cxx:329 AliForwardCorrectionManager.cxx:330 AliForwardCorrectionManager.cxx:331 AliForwardCorrectionManager.cxx:332