A++ » INC » AtlTriggerConf

class AtlTriggerConf: public TObject


 ATLAS trigger configuration database + interface singleton

 This class provides an interface to the trigger configuration
 database which is stored inside a Root tree of its own. This tree
 is stored together with its corresponding A++ event tree in one
 .root file.

 The trigger configuration tree contains multiple configurations
 valid for certain run ranges. Each configuration consists of two
 run numbers indicating the valid run range of the configuration,
 and three maps (level 1, level 2 and event filter). These maps are
 lists of pair-wise information, the association between a trigger
 item name (note that in this context 'item' means 'chain' as well)
 and its corresponding trigger bit number. The bit numbers are
 needed for accessing the actual trigger information in an A++
 event.


    A++ .root file
   +--------------------------+
   | +------------------+     |           +-----------------------------+
   | | TriggerConf Tree |---------------->| Trigger Configuration (RAM) |
   | +------------------+     |           +-----------------------------+
   |                          |                          |<------------------ Run Number
   | +------------------+     |               +----------V----------+
   | | A++ Event Tree   |-------------------->| Bit No. / Item Name |<------- Trigger Item
   | +------------------+     |               +--------x------------+
   +-------------|------------+                     |
                 |                                  |
                 |                                  V
                 |                             +-----------+
                 +---------------------------->| A++ Event |----------------> Trigger Decision
                                               +-----------+


 For fast access, copies of the maps (which are of type TClonesArray
 inside the tree) are being kept in form of hash tables (THashTable)
 in RAM.


 Usage examples:


 (1) Create a new configuration dbase:

    AtlTriggerConf *conf = new AtlTriggerConf;
    TTree *t_conf = conf->CreateTree();

 (2) Build a configuration (in memory)

    conf->Clear();
    conf->AddTriggerItem(); // Item 1
    conf->AddTriggerItem(); // Item 2

    conf->Rehash();

 (3) Write the current configuration (RAM) to the tree
     for the run range RunStart -> RunEnd

    conf->WriteConfiguration(RunStart, RunEnd);



 Author: Oliver Maria Kind <mailto: kind@mail.desy.de>
 Update: $Id: AtlTriggerConf.cxx,v 1.16 2011/03/12 17:39:50 kind Exp $
 Copyright: 2008 (C) Oliver Maria Kind

Function Members (Methods)

public:
virtual~AtlTriggerConf()
voidTObject::AbstractMethod(const char* method) const
AtlTriggerConfItem*AddTriggerItem(AtlTriggerConf::ETrigger trigger, const char* name, const char* title, Int_t bit)
virtual voidTObject::AppendPad(Option_t* option = "")
AtlTriggerConf()
AtlTriggerConf(const AtlTriggerConf&)
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
TTree*CreateTree()
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TTree*GetConfigTree() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
const char*GetHLTItemName(Int_t Bit)
const char*GetHLTItemName(Int_t Bit, Int_t RunNr)
Int_tGetHLTTriggerBit(const char* name)
Int_tGetHLTTriggerBit(const char* name, Int_t RunNr)
virtual const char*TObject::GetIconName() const
const char*GetL1ItemName(Int_t Bit)
const char*GetL1ItemName(Int_t Bit, Int_t RunNr)
Int_tGetL1TriggerBit(const char* name)
Int_tGetL1TriggerBit(const char* name, Int_t RunNr)
Int_tGetN_TriggerItems(AtlTriggerConf::ETrigger trigger) const
Int_tGetN_TriggerItems(AtlTriggerConf::ETrigger trigger, Int_t RunNr)
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetRunEnd() const
Int_tGetRunStart() const
virtual const char*TObject::GetTitle() const
AtlTriggerConfItem*GetTriggerItem(AtlTriggerConf::ETrigger trigger, const char* name, Int_t RunNr)
AtlTriggerConfItem*GetTriggerItem(AtlTriggerConf::ETrigger trigger, const char* name, Bool_t CheckValidity = kFALSE)
TClonesArray*GetTriggerItemsCA(AtlTriggerConf::ETrigger trigger) const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
static AtlTriggerConf*Instance()
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
AtlTriggerConf*LoadTree(TDirectory* dir)
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
AtlTriggerConf&operator=(const AtlTriggerConf&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "ALL")
virtual Int_tTObject::Read(const char* name)
voidReadConfiguration(Int_t RunNr)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidRehash()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetRunEnd(Int_t RunEnd)
voidSetRunStart(Int_t RunStart)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
voidWriteConfiguration()
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
THashTable*GetTriggerItemsHT(AtlTriggerConf::ETrigger trigger) const
voidSetN_TriggerItems(AtlTriggerConf::ETrigger trigger, Int_t NItems)

Data Members

public:
static const Int_tfgHLTMaxBits
static const Int_tfgL1MaxBits
static const char*fgTreeName
static const char*fgTreeTitle
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static AtlTriggerConf::ETriggerkHLT
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static AtlTriggerConf::ETriggerkL1
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
private:
TTree*fConfigTreeTree containing the configuration
TClonesArray*fHLTTriggerItemsCAArray of HLT trigger items in config tree
THashTable*fHLTTriggerItemsHTHash table of HLT trigger items for fast access
TClonesArray*fL1TriggerItemsCAArray of L1 trigger items in config tree
THashTable*fL1TriggerItemsHTHash table of L1 trigger items for fast access
Int_tfN_HLTTriggerItemsNo. of items filled in HLT clones array
Int_tfN_L1TriggerItemsNo. of items filled in L1 clones array
Int_tfRunEndEnd of run range
Int_tfRunStartBegin of run range
static AtlTriggerConf*fgInstanceTrigger configuration singleton

Class Charts

Inheritance Chart:
TObject
AtlTriggerConf

Function documentation

AtlTriggerConf()
 Default constructor

~AtlTriggerConf()
 Default destructor

AtlTriggerConf* Instance()
 Create trigger db singleton

void Clear(Option_t* option = "")
 Clear the current configuration

 Clear the clone arrays and the hash tables and remove their
 contents.

AtlTriggerConf* LoadTree(TDirectory* dir)
 Load configuration tree from given directory

TTree* CreateTree()
 Create the configuration tree and its branches

AtlTriggerConfItem* GetTriggerItem(AtlTriggerConf::ETrigger trigger, const char* name, Int_t RunNr)
 Find trigger item by name for given run nmber

 Check if current configuration is still valid
 Load new configuration otherwise.

AtlTriggerConfItem* GetTriggerItem(AtlTriggerConf::ETrigger trigger, const char* name, Bool_t CheckValidity = kFALSE)
 Find trigger item by name using the currently loaded
 configuration.

 If CheckValidity == true the program is aborted in case the
 item is not found (default is false).

AtlTriggerConfItem* AddTriggerItem(AtlTriggerConf::ETrigger trigger, const char* name, const char* title, Int_t bit)
 Add item to the clone arrays of the current configuration for
 the given trigger.

 Before adding the first item, the Clear() function has to be
 called in order to clean the arrays and tablles from the
 previous configuration.

 Note that the hash tables are NOT updated. This is done with
 the help Rehash() member function, which needs to be called
 when all trigger items are added

void ReadConfiguration(Int_t RunNr)
 Read configuration for the given run number from the tree and
 update the hash tables. Any previous configuration is removed
 from memory

void WriteConfiguration()
 Fill the current configuration of trigger items stored in the
 clone arrays into the configuration tree for the given run
 period.

void Rehash()
 Clear hash tables (without deleting its contents) and fill them
 with the information from the clone arrays.

void Print(Option_t* option = "ALL")
 Print current configuration

 Options available:
    "CUR"  - Print current configuration
    "LIST" - Print list of all configurations
    "ALL"  - Print all (default)

TClonesArray* GetTriggerItemsCA(AtlTriggerConf::ETrigger trigger) const
 Get trigger items clone array

THashTable* GetTriggerItemsHT(AtlTriggerConf::ETrigger trigger) const
 Get trigger items hash table

Int_t GetN_TriggerItems(AtlTriggerConf::ETrigger trigger, Int_t RunNr)
 Get no. of trigger items in clones array for given run number

Int_t GetN_TriggerItems(AtlTriggerConf::ETrigger trigger) const
 Get no. of trigger items in clones array for given run number
 for current configuration

void SetN_TriggerItems(AtlTriggerConf::ETrigger trigger, Int_t NItems)
 Set no. of trigger items in clones array

const char* GetL1ItemName(Int_t Bit, Int_t RunNr)
 Get name of the L1 item associated to the given bit.

 Check if the current configuration is still valid for the given
 run. Load new configuration otherwise

const char* GetHLTItemName(Int_t Bit, Int_t RunNr)
 Get name of the HLT item associated to the given bit.

 Check if the current configuration is still valid for the given
 run. Load new configuration otherwise.

const char* GetL1ItemName(Int_t Bit)
 Get name of the L1 item associated to the given bit
 from the currently loaded configuration

const char* GetHLTItemName(Int_t Bit)
 Get name of the HLT item associated to the given bit
 from the currently loaded configuration

AtlTriggerConf()
 valid for the current configuration
TTree* GetConfigTree() const
{ return fConfigTree; }
Int_t GetL1TriggerBit(const char* name, Int_t RunNr)
 Return bit number of L1 trigger item <name>.
 Check if the present configuration is still valid for the
 given run - load appropiate config otherwise.

 Return -1 in case the given item could not be found

Int_t GetHLTTriggerBit(const char* name, Int_t RunNr)
 Return bit number of HLT trigger item <name>
 Check if the present configuration is still valid for the
 given run - load appropiate config otherwise.

 Return -1 in case the given item could not be found

Int_t GetL1TriggerBit(const char* name)
 Return bit number of L1 trigger item <name>
 from the current configuration.

Int_t GetHLTTriggerBit(const char* name)
 Return bit number of HLT trigger item <name>
 from the current configuration.

Int_t GetRunStart() const
{ return fRunStart; }
Int_t GetRunEnd() const
{ return fRunEnd; }
void SetRunStart(Int_t RunStart)
 Set begin of valid run range for the current configuration
void SetRunEnd(Int_t RunEnd)
 Set end of valid run range for the current configuration
 Check that the given end run number is larger than the already
 given start run number of the run range