![]() |
AliPhysics
0937c79 (0937c79)
|
#include <AliOADBForward.h>
Classes | |
class | Entry |
class | Table |
Public Types | |
enum | ERunSelectMode { kDefault = 0, kExact = 1, kNewest = 2, kNear = 3, kOlder = 4, kNewer = 5 } |
enum | { kMaxNearDistance = 1000000, kInvalidField = 999 } |
Public Member Functions | |
AliOADBForward () | |
~AliOADBForward () | |
void | Print (const Option_t *option="") const |
void | Browse (TBrowser *b) |
Table * | FindTable (const TString &name, Bool_t quite=false) const |
const TMap & | GetTables () const |
Input/output | |
Bool_t | Open (const TString &fileName, const TString &tables="*", Bool_t rw=false, Bool_t verb=false, Bool_t fallback=false) |
Bool_t | Open (TFile *file, const TString &tables, Bool_t rw=false, Bool_t verb=false, Bool_t fallback=false) |
Bool_t | Close () |
Bool_t | Update () |
Queries | |
Entry * | Get (const TString &table, ULong_t run=0, ERunSelectMode mode=kNear, UShort_t sys=0, UShort_t sNN=0, Short_t fld=0, Bool_t mc=false, Bool_t sat=false) const |
TObject * | GetData (const TString &table, ULong_t run=0, ERunSelectMode mode=kNear, UShort_t sys=0, UShort_t sNN=0, Short_t fld=0, Bool_t mc=false, Bool_t sat=false) const |
Bool_t | Insert (const TString &table, TObject *o, ULong_t runNo, UShort_t sys, UShort_t sNN, Short_t field, Bool_t mc=false, Bool_t sat=false, ULong_t aliRev=0, const TString &author="") |
Bool_t | CopyEntry (const TString &table, ULong_t oldRunNo, UShort_t oldSys, UShort_t oldSNN, Short_t oldField, ULong_t newRunNo, UShort_t newSys, UShort_t newSNN, Short_t newField, Bool_t mc, Bool_t sat) |
Static Public Member Functions | |
static const char * | Mode2String (ERunSelectMode mode) |
static ERunSelectMode | String2Mode (const TString &str) |
static ERunSelectMode | Int2Mode (Int_t mode) |
Tests | |
static void | TestGet (AliOADBForward &t, const TString &table, ULong_t runNo=0, ERunSelectMode mode=kNear, UShort_t sys=2, UShort_t sNN=2760, Short_t fld=-5, Bool_t mc=false, Bool_t sat=false) |
static void | TestInsert (AliOADBForward &t, const TString &table, ULong_t runNo=0, UShort_t sys=2, UShort_t sNN=2760, Short_t fld=-5, Bool_t mc=false, Bool_t sat=false) |
static void | Test () |
Protected Member Functions | |
Int_t | GetFiles (TList &files) const |
Table * | GetTableFromFile (TFile *file, Bool_t rw, const TString &name, const TString &mode) const |
void | OpenTable (TFile *file, Bool_t rw, const TString &name, const TString &mode, Bool_t verb, Bool_t fallback) |
Static Protected Member Functions | |
static void | AppendToQuery (TString &q, const TString &s, Bool_t andNotOr=true) |
static TString | Conditions (UShort_t sys=0, UShort_t sNN=0, Short_t fld=kInvalidField, Bool_t mc=false, Bool_t sat=false) |
Protected Attributes | |
TMap | fTables |
Container/handler of Forward calibration objects.
Definition at line 15 of file AliOADBForward.h.
anonymous enum |
Various flags
Definition at line 79 of file AliOADBForward.h.
Options for selecting the entries according to the run number given in the query.
Definition at line 23 of file AliOADBForward.h.
AliOADBForward::AliOADBForward | ( | ) |
AliOADBForward::~AliOADBForward | ( | ) |
Destructor
Definition at line 642 of file AliOADBForward.cxx.
|
staticprotected |
Helper function to append to query string
q | String to attach to |
s | What to attach |
andNotOr | If true, assume and, otherwise or |
Definition at line 1026 of file AliOADBForward.cxx.
Referenced by Conditions(), GetTables(), and AliOADBForward::Table::Query().
void AliOADBForward::Browse | ( | TBrowser * | b | ) |
Browse this database
b | Browser |
Definition at line 910 of file AliOADBForward.cxx.
Referenced by AliOADBForward::Table::SetEnableFallBack().
Bool_t AliOADBForward::Close | ( | ) |
Close this database
Definition at line 758 of file AliOADBForward.cxx.
Referenced by AliOADBForward::Table::SetEnableFallBack(), AliCorrectionManagerBase::Correction::StoreIt(), Test(), and ~AliOADBForward().
|
staticprotected |
Helper function to build a query string
sys | Collision system (1:pp, 2: PbPb, 3:pPb) |
sNN | Collision energy in GeV |
fld | L3-Field strength and polarity |
mc | For Monte-carlo |
sat | For satelitte collisions |
Definition at line 1036 of file AliOADBForward.cxx.
Referenced by GetTables(), and AliOADBForward::Table::Query().
Bool_t AliOADBForward::CopyEntry | ( | const TString & | table, |
ULong_t | oldRunNo, | ||
UShort_t | oldSys, | ||
UShort_t | oldSNN, | ||
Short_t | oldField, | ||
ULong_t | newRunNo, | ||
UShort_t | newSys, | ||
UShort_t | newSNN, | ||
Short_t | newField, | ||
Bool_t | mc, | ||
Bool_t | sat | ||
) |
Copy one entry to another entry
table | Table name |
oldRunNo | Old run number |
oldSys | Old collision system |
oldSNN | Old center of mass energy |
oldField | Old L3 magnetic field strength |
newRunNo | New run number |
newSys | New collision system |
newSNN | New center of mass energy |
newField | New L3 magnetic field strength |
mc | True for MC only queries |
sat | True for including satellite queries |
Definition at line 867 of file AliOADBForward.cxx.
Referenced by CopyCorr().
AliOADBForward::Table * AliOADBForward::FindTable | ( | const TString & | name, |
Bool_t | quite = false |
||
) | const |
Find a table by name
name | Name of table |
quite | Do not print warning if not found |
Definition at line 926 of file AliOADBForward.cxx.
Referenced by AliCorrectionManagerBase::Correction::CleanIt(), CopyEntry(), Get(), GetData(), GetTableFromFile(), Insert(), and AliCorrectionManagerBase::Correction::OpenIt().
AliOADBForward::Entry * AliOADBForward::Get | ( | const TString & | table, |
ULong_t | run = 0 , |
||
ERunSelectMode | mode = kNear , |
||
UShort_t | sys = 0 , |
||
UShort_t | sNN = 0 , |
||
Short_t | fld = 0 , |
||
Bool_t | mc = false , |
||
Bool_t | sat = false |
||
) | const |
Query the table for an object. The strategy is as follows.
This allow us to specify default objects for a period, and for collision system, energy, and field setting.
table | Table name |
run | Run number |
mode | Run selection mode |
sys | Collision system (1: pp, 2: PbPb, 3: pPb) |
sNN | Center of mass energy (GeV) |
fld | L3 magnetic field (kG) |
mc | For MC only |
sat | For satellite interactions |
Definition at line 811 of file AliOADBForward.cxx.
Referenced by AliCorrectionManagerBase::Correction::ReadIt(), AliOADBForward::Table::SetEnableFallBack(), and TestGet().
TObject * AliOADBForward::GetData | ( | const TString & | table, |
ULong_t | run = 0 , |
||
ERunSelectMode | mode = kNear , |
||
UShort_t | sys = 0 , |
||
UShort_t | sNN = 0 , |
||
Short_t | fld = 0 , |
||
Bool_t | mc = false , |
||
Bool_t | sat = false |
||
) | const |
Query the table for an object. The strategy is as follows.
This allow us to specify default objects for a period, and for collision system, energy, and field setting.
table | Table name |
run | Run number |
mode | Run selection mode |
sys | Collision system (1: pp, 2: PbPb, 3: pPb) |
sNN | Center of mass energy (GeV) |
fld | L3 magnetic field (kG) |
mc | For MC only |
sat | For satellite interactions |
Definition at line 830 of file AliOADBForward.cxx.
Referenced by AliOADBForward::Table::SetEnableFallBack().
Get a list of associated files
files | On return, contains list of files |
Definition at line 941 of file AliOADBForward.cxx.
Referenced by Close(), GetTables(), and Update().
|
protected |
Get a table (TTree) from a file
file | File to look in |
rw | If true, open read/write, false read-only |
name | Name of the table |
mode | Default mode for new table, or override mode for existing tables if not default |
Definition at line 965 of file AliOADBForward.cxx.
Referenced by GetTables(), and OpenTable().
|
inline |
Bool_t AliOADBForward::Insert | ( | const TString & | table, |
TObject * | o, | ||
ULong_t | runNo, | ||
UShort_t | sys, | ||
UShort_t | sNN, | ||
Short_t | field, | ||
Bool_t | mc = false , |
||
Bool_t | sat = false , |
||
ULong_t | aliRev = 0 , |
||
const TString & | author = "" |
||
) |
Insert a new entry into the table
table | Table name |
o | Object to write |
runNo | Run number |
sys | Collision system (1: pp, 2:PbPb, 3:pPb) |
sNN | Center of mass energy (GeV) |
field | L3 magnetic field (kG) |
mc | If true, only for MC |
sat | For satellite interactions |
aliRev | AliROOT revision |
author | Creater of this correction |
Definition at line 846 of file AliOADBForward.cxx.
Referenced by AliOADBForward::Table::SetEnableFallBack(), NormExtractor::Store(), AliCorrectionManagerBase::Correction::StoreIt(), and TestInsert().
|
static |
Return mode as an integer
mode | Mode |
Definition at line 48 of file AliOADBForward.cxx.
|
static |
Return the mode as a string
mode | Mode |
Definition at line 24 of file AliOADBForward.cxx.
Referenced by AliCorrectionManagerBase::Correction::CleanIt(), CopyEntry(), AliOADBForward::Table::GetEntry(), AliOADBForward::Table::Print(), AliOADBForward::Table::Query(), and AliOADBForward::Table::Table().
Bool_t AliOADBForward::Open | ( | const TString & | fileName, |
const TString & | tables = "*" , |
||
Bool_t | rw = false , |
||
Bool_t | verb = false , |
||
Bool_t | fallback = false |
||
) |
Open a file containing tables. Note, this member function can be called multiple times to open tables in different files.
If a table is already associated with this handler, it will not be re-associated.
fileName | Path to file to get/write tables from/in |
rw | if true, open read+write, otherwise read-only |
tables | Tables to open |
verb | Verbosity flag |
fallback | If true allow for fall-backs |
Definition at line 667 of file AliOADBForward.cxx.
Referenced by Browse(), CopyCorr(), AliCorrectionManagerBase::Correction::OpenIt(), NormExtractor::Store(), AliCorrectionManagerBase::Correction::StoreIt(), and Test().
Bool_t AliOADBForward::Open | ( | TFile * | file, |
const TString & | tables, | ||
Bool_t | rw = false , |
||
Bool_t | verb = false , |
||
Bool_t | fallback = false |
||
) |
Open a file containing tables. Note, this member function can be called multiple times to open tables in different files.
If a table is already associated with this handler, it will not be re-associated.
file | File to get/write tables from/in |
rw | if true, open read+write, otherwise read-only |
tables | Tables to open |
verb | Verbosity flag |
fallback | If true allow for fall-backs |
Definition at line 695 of file AliOADBForward.cxx.
|
protected |
Get a table (TTree) from a file and attach
file | File to look in |
rw | If true, open read/write, false read-only |
name | Name of the table |
mode | Default mode for new table, or override mode for existing tables if not default |
fallback | Enable fall-backs |
verb | If true, be verbose |
Definition at line 1004 of file AliOADBForward.cxx.
Referenced by GetTables(), and Open().
void AliOADBForward::Print | ( | const Option_t * | option = "" | ) | const |
Print the content of all tables
option | Passed on to tables |
Definition at line 892 of file AliOADBForward.cxx.
Referenced by Test().
|
static |
Parse a string to get the mode
str | Input string |
Definition at line 37 of file AliOADBForward.cxx.
Referenced by GetTableFromFile(), and AliOADBForward::Table::Table().
|
static |
Definition at line 1097 of file AliOADBForward.cxx.
|
static |
Definition at line 1058 of file AliOADBForward.cxx.
Referenced by Test().
|
static |
Definition at line 1078 of file AliOADBForward.cxx.
Referenced by Test().
Bool_t AliOADBForward::Update | ( | ) |
Flush to disk
Definition at line 784 of file AliOADBForward.cxx.
Referenced by AliOADBForward::Table::SetEnableFallBack().
|
protected |
Definition at line 712 of file AliOADBForward.h.
Referenced by AliOADBForward(), Browse(), Close(), FindTable(), GetFiles(), GetTables(), OpenTable(), Print(), and ~AliOADBForward().