AliPhysics  5a28df1 (5a28df1)
AliCorrectionManagerBase Class Reference

#include <AliCorrectionManagerBase.h>

Inheritance diagram for AliCorrectionManagerBase:

Classes

struct  Correction
 

Public Types

enum  EConstants { kIgnoreValue = 0, kIgnoreField = 999 }
 
enum  EFields {
  kRun = 0x01, kSys = 0x02, kSNN = 0x04, kField = 0x08,
  kMC = 0x10, kSatellite = 0x20, kStandard = kRun|kSys|kSNN|kField, kFull = kStandard|kMC|kSatellite
}
 

Public Member Functions

virtual ~AliCorrectionManagerBase ()
 
virtual void SetPrefix (const TString &prefix)
 
virtual void SetEnableFallBack (Bool_t use=true)
 
const char * GetObjectName (Int_t what) const
 
Storing corrections
virtual Bool_t Store (TObject *o, ULong_t runNo, UShort_t sys, UShort_t sNN, Short_t field, Bool_t mc, Bool_t sat, const char *file, const char *meth="NEAR") const
 
virtual Bool_t Append (const TString &addition, const TString &destination="") const
 
virtual Bool_t CleanUp (const TString &destination, Bool_t verb=false, Bool_t all=false) const
 
Getting the corrections
virtual void EnableCorrections (UInt_t what)
 
virtual Bool_t CheckCorrections (UInt_t what, Bool_t verbose=true) const
 
Bool_t InitCorrections (ULong_t run, UShort_t sys, UShort_t sNN, Short_t fld, Bool_t mc, Bool_t sat, Bool_t force=false)
 
Get axis objects.
virtual const TAxisGetVertexAxis () const
 
virtual const TAxisGetEtaAxis () const
 
Misc
virtual Bool_t IsInit () const
 
virtual void Print (Option_t *option="") const
 
virtual void Browse (TBrowser *b)
 
virtual Bool_t IsFolder () const
 
virtual void SetDebug (Bool_t debug)
 

Protected Member Functions

 AliCorrectionManagerBase ()
 
 AliCorrectionManagerBase (Bool_t notUsed)
 
 AliCorrectionManagerBase (const AliCorrectionManagerBase &o)
 
AliCorrectionManagerBaseoperator= (const AliCorrectionManagerBase &o)
 
void RegisterCorrection (Int_t id, Correction *corr)
 
void RegisterCorrection (Int_t id, const TString &tableName, const TString &fileName, TClass *cls, UShort_t fields=kStandard, Bool_t enabled=false)
 
void EnableCorrection (Int_t id, Bool_t enable=true)
 
CorrectionGetCorrection (Int_t id)
 
const CorrectionGetCorrection (Int_t id) const
 
void SetCorrectionFile (Int_t id, const TString &fileName) const
 
Int_t GetId (const TString &what) const
 
Int_t GetId (const TObject *obj) const
 
TObjectGet (Int_t id)
 
const TObjectGet (Int_t id) const
 
Bool_t CheckConditions (ULong_t run, UShort_t sys, UShort_t sNN, Short_t fld, Bool_t mc, Bool_t sat)
 
Bool_t ReadCorrections (ULong_t run, UShort_t sys, UShort_t sNN, Short_t fld, Bool_t mc, Bool_t sat)
 
Bool_t ReadCorrection (Int_t id, ULong_t run, UShort_t sys, UShort_t sNN, Short_t fld, Bool_t mc, Bool_t sat)
 
void SetCorrectionFile (Int_t i, const TString &file)
 

Protected Attributes

TObjArray fCorrections
 
Bool_t fIsInit
 
ULong_t fRun
 
UShort_t fSys
 
UShort_t fSNN
 
Short_t fField
 
Bool_t fMC
 
Bool_t fSatellite
 
AliOADBForwardfDB
 
Bool_t fDebug
 do not store More...
 
Bool_t fFallBack
 

Detailed Description

Base class for correction managers.

A correction is added to the manager by calling RegisterCorrection

class MyManager : public AliCorrectionManager
{
public:
enum {
kA,
kB
};
MyManager()
: AliCorrectionManager(Bool_t setup=false)
{
if (setup) {
RegisterCorrection(kA, "A", "/some/path/to/file",
TH2D::Class(), kStandard);
RegisterCorrection(kB, "B", "/some/path/to/file",
}
}
void Init(Bool_t useA, Bool_t useB, ULong_t run, UShort_t sys,
UShort_t sNN, Short_t fld, Bool_t mc, Bool_t sat,
Bool_t force=false)
{
if (useA) GetCorrection(kA)->fEnabled = true;
if (useB) GetCorrection(kB)->fEnabled = true;
return InitCorrections(run, sys, sNN, fld, mc, sat, force);
}
TH2D* GetA() const { return static_cast<TH2D*>(Get(kA)); }
TParameter<float>* GetB() const { return static_cast<TParameter<float>*>(Get(kB)); }
};

In case the derived object is to be a singleton, one has to take a little extra care about when the constructor is called - especially if the singleton is to be streamed to disk:

class MyManager : public AliCorrectionManager
{
public:
// As above, except the constructor must be private and
MyManager& Instance()
{
if (!fgInstance) fgInstance = MyManager(true);
return fgInstance;
}
static MyManager* fgInstance;
};

It is important - for I/O that default construction does not register the corrections. This should only be done in-code on first construction.

Definition at line 80 of file AliCorrectionManagerBase.h.

Member Enumeration Documentation

Enumerator
kIgnoreValue 
kIgnoreField 

Definition at line 83 of file AliCorrectionManagerBase.h.

Enumerator
kRun 
kSys 
kSNN 
kField 
kMC 
kSatellite 
kStandard 
kFull 

Definition at line 87 of file AliCorrectionManagerBase.h.

Constructor & Destructor Documentation

AliCorrectionManagerBase::~AliCorrectionManagerBase ( )
virtual

Destructor

Definition at line 97 of file AliCorrectionManagerBase.cxx.

AliCorrectionManagerBase::AliCorrectionManagerBase ( )
protected

Constructor

Definition at line 17 of file AliCorrectionManagerBase.cxx.

AliCorrectionManagerBase::AliCorrectionManagerBase ( Bool_t  notUsed)
protected

Constructor

Definition at line 33 of file AliCorrectionManagerBase.cxx.

AliCorrectionManagerBase::AliCorrectionManagerBase ( const AliCorrectionManagerBase o)
protected

Copy Constructor

Definition at line 50 of file AliCorrectionManagerBase.cxx.

Member Function Documentation

Bool_t AliCorrectionManagerBase::Append ( const TString addition,
const TString destination = "" 
) const
virtual

Append the content of the file addition to the destination file for this manager. This used TFileMerger::PartialMerge

Parameters
destinationFilename of destination storage (in OADB_PATH)
additionFilename of addition.
Returns
true on success

Definition at line 189 of file AliCorrectionManagerBase.cxx.

Referenced by SetEnableFallBack(), and Upload().

void AliCorrectionManagerBase::Browse ( TBrowser *  b)
virtual

Browse this object

Parameters
bBrowser to use

Definition at line 145 of file AliCorrectionManagerBase.cxx.

Referenced by IsInit().

Bool_t AliCorrectionManagerBase::CheckConditions ( ULong_t  run,
UShort_t  sys,
UShort_t  sNN,
Short_t  fld,
Bool_t  mc,
Bool_t  sat 
)
protected

Read in all corrections

Parameters
runRun number
sysSystem
sNNCenter of mass energy
fldL3 magnetic field
mcFor simulations
satFor satellite interactions
Returns
true on success

Definition at line 419 of file AliCorrectionManagerBase.cxx.

Referenced by InitCorrections().

Bool_t AliCorrectionManagerBase::CheckCorrections ( UInt_t  what,
Bool_t  verbose = true 
) const
virtual

Check if the specified corrrections have been initialized

Parameters
whatCorrections to check
verboseIf true, be verbose
Returns
true if all specified the corrections have been

Definition at line 253 of file AliCorrectionManagerBase.cxx.

Referenced by AliBaseESDTask::CheckCorrections(), and SetEnableFallBack().

Bool_t AliCorrectionManagerBase::CleanUp ( const TString destination,
Bool_t  verb = false,
Bool_t  all = false 
) const
virtual

Write a new database file with tables that only has one entry for each query tuple.

Parameters
destinationWhere to write the new file
verbWhether to be verbose
allIf true, copy all entries
Returns
true on success, false otherwise

Definition at line 220 of file AliCorrectionManagerBase.cxx.

Referenced by CleanOADB(), and SetEnableFallBack().

void AliCorrectionManagerBase::EnableCorrection ( Int_t  id,
Bool_t  enable = true 
)
protected

Enable the correction at id

Parameters
idIdentifier
enableWhether to enable (true) or disable (false)

Definition at line 349 of file AliCorrectionManagerBase.cxx.

Referenced by EnableCorrections(), AliCentralCorrectionManager::Init(), and AliForwardCorrectionManager::Init().

void AliCorrectionManagerBase::EnableCorrections ( UInt_t  what)
virtual

Convinience function to enable corrections on-mass. User class should overload this to properly enable corrections based on the bit identifiers.

Parameters
whatBit mask of correction identifiers.

Definition at line 244 of file AliCorrectionManagerBase.cxx.

Referenced by CleanOADB(), AliBaseESDTask::ReadCorrections(), and SetEnableFallBack().

const TObject * AliCorrectionManagerBase::Get ( Int_t  id) const
protected

Get the object corresponding to ID

Parameters
idCorrection identifier
Returns
Object of correction, or null if correction not found or in-active

Definition at line 384 of file AliCorrectionManagerBase.cxx.

AliCorrectionManagerBase::Correction * AliCorrectionManagerBase::GetCorrection ( Int_t  id)
protected

Get the correction at id

Parameters
idIdentifier
Returns
Correction or null

Definition at line 312 of file AliCorrectionManagerBase.cxx.

Referenced by CheckCorrections(), CleanUp(), EnableCorrection(), EnableCorrections(), Get(), GetId(), GetObjectName(), Print(), ReadCorrection(), SetCorrectionFile(), SetPrefix(), and Store().

const AliCorrectionManagerBase::Correction * AliCorrectionManagerBase::GetCorrection ( Int_t  id) const
protected

Get the correction at id

Parameters
idIdentifier
Returns
Correction or null

Definition at line 320 of file AliCorrectionManagerBase.cxx.

virtual const TAxis* AliCorrectionManagerBase::GetEtaAxis ( ) const
inlinevirtual

Get the \(\eta\) axis

Returns
The \(\eta\) axis or null

Reimplemented in AliForwardCorrectionManager, and AliCentralCorrectionManager.

Definition at line 226 of file AliCorrectionManagerBase.h.

Referenced by AliBaseESDTask::ReadCorrections().

Int_t AliCorrectionManagerBase::GetId ( const TString what) const
protected

Get the id of the correction with a given name

Parameters
whatName of correction to look for
Returns
Correction identifier

Definition at line 337 of file AliCorrectionManagerBase.cxx.

Int_t AliCorrectionManagerBase::GetId ( const TObject obj) const
protected

Get the id of the correction to store an object

Parameters
objCorrection object
Returns
Correction identifier

Definition at line 361 of file AliCorrectionManagerBase.cxx.

const char * AliCorrectionManagerBase::GetObjectName ( Int_t  what) const
virtual const TAxis* AliCorrectionManagerBase::GetVertexAxis ( ) const
inlinevirtual

Get the vertex axis

Returns
The vertex axis or null

Reimplemented in AliForwardCorrectionManager, and AliCentralCorrectionManager.

Definition at line 220 of file AliCorrectionManagerBase.h.

Referenced by AliBaseESDTask::ReadCorrections().

Bool_t AliCorrectionManagerBase::InitCorrections ( ULong_t  run,
UShort_t  sys,
UShort_t  sNN,
Short_t  fld,
Bool_t  mc,
Bool_t  sat,
Bool_t  force = false 
)

Read in all corrections

Parameters
runRun number
sysSystem
sNNCenter of mass energy
fldL3 magnetic field
mcFor simulations
satFor satellite interactions
forceForce-reread
Returns
true on success

Definition at line 396 of file AliCorrectionManagerBase.cxx.

Referenced by AliCentralCorrectionManager::Init(), AliForwardCorrectionManager::Init(), AliBaseESDTask::ReadCorrections(), and SetEnableFallBack().

virtual Bool_t AliCorrectionManagerBase::IsFolder ( ) const
inlinevirtual

Flag that this is a folder

Returns
Always true

Definition at line 259 of file AliCorrectionManagerBase.h.

virtual Bool_t AliCorrectionManagerBase::IsInit ( ) const
inlinevirtual

Check if the manager is initialized

Returns
True if initialized

Definition at line 238 of file AliCorrectionManagerBase.h.

Referenced by AliCentralMultiplicityTask::Print().

AliCorrectionManagerBase & AliCorrectionManagerBase::operator= ( const AliCorrectionManagerBase o)
protected

Assignement operator

Parameters
oObject to assign from
Returns
Reference to this

Definition at line 73 of file AliCorrectionManagerBase.cxx.

void AliCorrectionManagerBase::Print ( Option_t option = "") const
virtual

Print information

Parameters
optionOptions:
  • R Recursive list each correction
  • D Also give details for each correction

Definition at line 116 of file AliCorrectionManagerBase.cxx.

Referenced by CleanOADB(), IsInit(), and AliBaseESDTask::Print().

Bool_t AliCorrectionManagerBase::ReadCorrection ( Int_t  id,
ULong_t  run,
UShort_t  sys,
UShort_t  sNN,
Short_t  fld,
Bool_t  mc,
Bool_t  sat 
)
protected

Read in a correction

Parameters
idCorrection identifier
runRun number
sysSystem
sNNCenter of mass energy
fldL3 magnetic field
mcFor simulations
satFor satellite interactions
Returns
true on success

Definition at line 480 of file AliCorrectionManagerBase.cxx.

Referenced by ReadCorrections().

Bool_t AliCorrectionManagerBase::ReadCorrections ( ULong_t  run,
UShort_t  sys,
UShort_t  sNN,
Short_t  fld,
Bool_t  mc,
Bool_t  sat 
)
protected

Read in all corrections

Parameters
runRun number
sysSystem
sNNCenter of mass energy
fldL3 magnetic field
mcFor simulations
satFor satellite interactions
Returns
true on success

Definition at line 501 of file AliCorrectionManagerBase.cxx.

Referenced by InitCorrections().

void AliCorrectionManagerBase::RegisterCorrection ( Int_t  id,
Correction corr 
)
protected
void AliCorrectionManagerBase::RegisterCorrection ( Int_t  id,
const TString tableName,
const TString fileName,
TClass *  cls,
UShort_t  fields = kStandard,
Bool_t  enabled = false 
)
protected

Register a new correction.

Parameters
idIdentifier
tableNameTable name
fileNameFile name
clsClass
fieldsFields
enabledEnabled or not

Definition at line 297 of file AliCorrectionManagerBase.cxx.

void AliCorrectionManagerBase::SetCorrectionFile ( Int_t  i,
const TString file 
)
protected

Set the correction file name for correction at i

Parameters
iIdentifier
fileFilename

Definition at line 328 of file AliCorrectionManagerBase.cxx.

virtual void AliCorrectionManagerBase::SetDebug ( Bool_t  debug)
inlinevirtual

Set whehter to enable debug information

Parameters
debugif true, do verbose queries

Definition at line 265 of file AliCorrectionManagerBase.h.

Referenced by MultCutDrawer::Init(), and CorrDrawer::Run().

virtual void AliCorrectionManagerBase::SetEnableFallBack ( Bool_t  use = true)
inlinevirtual

Set whether to enable fall-back queries

Parameters
useIf true, enable fall-back queries

Definition at line 112 of file AliCorrectionManagerBase.h.

Referenced by AliForwardQATask::AliForwardQATask().

void AliCorrectionManagerBase::SetPrefix ( const TString prefix)
virtual

Set the prefix to use when looking for the input files

Parameters
prefixPrefix to use for all corrections

Definition at line 152 of file AliCorrectionManagerBase.cxx.

Referenced by AddTaskCentralMult(), AddTaskFMDELoss(), AddTaskForwardMult(), and CorrDrawer::Run().

Bool_t AliCorrectionManagerBase::Store ( TObject o,
ULong_t  runNo,
UShort_t  sys,
UShort_t  sNN,
Short_t  field,
Bool_t  mc,
Bool_t  sat,
const char *  file,
const char *  meth = "NEAR" 
) const
virtual

Store a correction

Parameters
oObject to store
runNoRun number of run this was created from
sysCollision system (1:pp, 2:PbPb, 3:pPb)
sNNCenter of mass energy in GeV
fieldL3 magnetic field in kG
mcIf true, this is for simulations
satIf true, contain info for satellite interactions
file(optional) file name to store in
meth(optional) method for run look to use.
Returns
true on success

Definition at line 165 of file AliCorrectionManagerBase.cxx.

Referenced by CorrExtractor::Extract(), ExtractAcceptance(), ExtractForRun(), SetEnableFallBack(), and Trending2ELoss().

Member Data Documentation

TObjArray AliCorrectionManagerBase::fCorrections
protected
AliOADBForward* AliCorrectionManagerBase::fDB
protected
Bool_t AliCorrectionManagerBase::fDebug
protected

do not store

Definition at line 660 of file AliCorrectionManagerBase.h.

Referenced by operator=(), ReadCorrection(), and SetDebug().

Bool_t AliCorrectionManagerBase::fFallBack
protected

Definition at line 661 of file AliCorrectionManagerBase.h.

Referenced by operator=(), ReadCorrection(), and SetEnableFallBack().

Short_t AliCorrectionManagerBase::fField
protected

Definition at line 656 of file AliCorrectionManagerBase.h.

Referenced by CheckConditions(), operator=(), Print(), and ReadCorrections().

Bool_t AliCorrectionManagerBase::fIsInit
protected
Bool_t AliCorrectionManagerBase::fMC
protected

Definition at line 657 of file AliCorrectionManagerBase.h.

Referenced by CheckConditions(), operator=(), Print(), and ReadCorrections().

ULong_t AliCorrectionManagerBase::fRun
protected

Definition at line 653 of file AliCorrectionManagerBase.h.

Referenced by CheckConditions(), operator=(), Print(), and ReadCorrections().

Bool_t AliCorrectionManagerBase::fSatellite
protected

Definition at line 658 of file AliCorrectionManagerBase.h.

Referenced by CheckConditions(), operator=(), Print(), and ReadCorrections().

UShort_t AliCorrectionManagerBase::fSNN
protected

Definition at line 655 of file AliCorrectionManagerBase.h.

Referenced by CheckConditions(), operator=(), Print(), and ReadCorrections().

UShort_t AliCorrectionManagerBase::fSys
protected

Definition at line 654 of file AliCorrectionManagerBase.h.

Referenced by CheckConditions(), operator=(), Print(), and ReadCorrections().


The documentation for this class was generated from the following files: