GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ADF::AgataKeyFactory Class Reference

Base class for a AgataKeyFactory. More...

#include <AgataKeyFactory.h>

Inheritance diagram for ADF::AgataKeyFactory:

Public Member Functions

virtual void AddConf (DotConf *)
 add a conf object to this. The added objects are not owned by this so not deleted. More...
 
virtual Bool_t Configure (ConfigurationFrame *, const char *option="in", Bool_t allow_init=false)
 configuration from/to a configuration frame : extact string from the frame and call DoConfigure More...
 
virtual Bool_t Configure (const char *name, const char *option="in", Bool_t allow_init=true)
 configuration from/to a file : open the file and call DoConfigure More...
 
virtual Bool_t DoConfigure (std::ostream &)
 write the message table More...
 
virtual Bool_t DoConfigure (std::istream &in, Bool_t allow_init)
 just call DotConf method More...
 
const Char_t * GetComment () const
 
virtual BaseBuffer::EEndian GetEndian () const
 Endian type for the keys delivered by this factory. More...
 
const std::map< std::string,
std::pair< UInt_t, UInt_t > > & 
GetKnownKeys () const
 to just browse the list of known keys More...
 
const Char_t * GetLastModif () const
 
Short_t GetMaxVersion () const
 this class could managed moddification of the versionned part up to MaxVersion : should be set in the constructor part of the inheriting class More...
 
Bool_t GetMessage (std::string keyName, UInt_t &message, UInt_t &mask)
 to check if a given keyname is in the list of known keys (return true in this case, false otherwise) and to access the corresponding message type, mask More...
 
Bool_t GetMessage (std::string keyName, UInt_t &message)
 
const Char_t * GetMessage (UInt_t)
 to get the message part as a string More...
 
virtual const std::string & GetName () const
 name of the factory More...
 
virtual const Char_t * GetRID () const
 to get the record id More...
 
virtual const Char_t * GetSRID () const
 to get the record id More...
 
virtual const Char_t * GetStreamOption () const
 get/set option More...
 
virtual Short_t GetVersion () const
 to get the curent version of this object More...
 
Bool_t IsWithRecord () const
 to know if this is intialisased with a stream composed of records. More...
 
virtual KeyNew (const FactoryItem &)
 build a key using item. More...
 
virtual void RemoveConf (DotConf *aconf=0x0)
 
void SetComment (const Char_t *comment)
 
virtual void SetEndian (BaseBuffer::EEndian)
 Agata files are always little endian !! More...
 
virtual void SetRID (const Char_t *rid, const Char_t *srid="")
 to set the record id More...
 
virtual void SetStreamOption (const Char_t *opt)
 
void SetWithRecord (Bool_t is_record=true)
 to change the behavior More...
 

Static Public Member Functions

static AgataKeyFactorytheFactory ()
 to create the main global factory for that type More...
 

Protected Member Functions

Bool_t AddRecord (std::ostream &, char t= 'b')
 Add a begin or end of record, return true if done. More...
 
std::string BeginOfRecord ()
 string that gives a start of record for this object More...
 
virtual KeyFactoryClone (const std::string &opt="full")
 Clone. More...
 
virtual KeyDoNew (const FactoryItem &)
 Ask this factory for a new AgataKey. More...
 
std::string EndOfRecord ()
 string that gives an end of record for this object More...
 
Bool_t IsBeginOfRecord (const std::string &, Bool_t allow_init)
 Return true if this string is a begin of record and call Reset if Init is found. More...
 
Bool_t IsEndOfRecord (const std::string &)
 Return true if this string is an end of record. More...
 
virtual Bool_t ProcessLine (const std::string &)
 During configuration, process a single line. More...
 
virtual void Reset (const Char_t *="")
 Reset the table. More...
 
void SetLastModif ()
 set in last modif string the current date. More...
 
void SetMaxVersion (Short_t v)
 
void SetName (std::string name)
 
void SetVersion (Short_t v)
 

Protected Attributes

LogMessage fLog
 the log messenger ... to know the object hae been properly intitialised/modified More...
 

Friends

class AKeyFactory< AgataKeyFactory >
 

Detailed Description

Base class for a AgataKeyFactory.

The factory delivers AGATA keys and thus keeps a list (std::map) of strings associated to unique addresses. It is initiated by reading ADF.conf in the distribution and/or in the environnment variable ADF_CONF_PATH.

Depending of the option given in the header in the ADF.conf file found under $ADF_CONF_PATH, the data flow agent is reset or not :

  • Init : reset
  • +,== : add/replace mode. execpt some hard coded key, it allows to modified the key content to be able to read old produced files and to add new definitions (event-like for instance or to deal with a new frame factory)

#////ADF::AgataKeyFactory_beg//// - -1 Init

The format for the map is given there :

# Format: KeyNAME message mask
#
# KeyNAME is the string to be passed to the AgataKeyFactory. It should be unique !
# message is the message part as coded in the key
# mask is to be used to extract part of the message when comparing keys
#
# with 0xWAXXYYZZ
#
# W = F for simple frame, C for composite frame - A means used AgataKey factory
#
# XX = Sub-detector number (associated to a given factories)
# 01 for Agata (Agata Frame factory), pure Agata
# 02 for Agata (Agata Frame factory), raw ancillary for Agata
# > 02 for other factories
# YY = Frame type
# 01 data (produce/consume by algorithm)
# 11 meta (general, does not depend on an algorithm)
# 02 conf (conf associated to a data/meta frame)
# 03 algo (conf specific for an algorithm)
# 04 info (conf like, just some comments)
# 05 rmess (message, raw frame)
# 06 cmess (message, conf frame)
#
# ZZ = ALGO ID, should be unique in the data flow
   data are exchanged between different algorithms. they are input for filters and ouptut of filters. 
   meta are also data BUT general i.e. not proper to a specific algorithm
   conf are configuration frames that are use to encode/decode the corresponding data frame. for instance it could contain digitizer/calibration coefficients (inner ADF usage)
   algo are configuration frames needed to reconfigure a specific algorithm. It could be a modification of some calibration coefficients, parameters (usage : for the user)
   info are configuration frames just use to pass some comments/ general informations (usage : for the user)
   rmess are raw data frame that could be used by the user for passing informations between two parts of the system
   cmess are configuration frame that could be used by the user for passing informations between two parts of the system

   all the previous frame are for simple frame (0xFA... == Frame Agata) like keys. Composite frames start with 0xCA (0xCA... == CompositeFrame Agata) 

NOTE : in the very first version of agata key, frame out of the event builder and the merger were labelled 0xFA010103 / 0xFA010104. thus breaking the rule for composite frames. It should be 0xCA010102 / 0xCA000100. To allow reading back all the adf files from the beginning, two keys have been introduced :
data:eb / data:merger
which are at some level consitent since these are the kind of data procuced by eb and merger.

Doing that the system is backward compatible. Since conf:global frame are written in .adf files the key content are modified @ reconfiguration to properly read the data already produced. There is only one consequence : in any .adf file produced based on old .adf, the composite frames for event:data and event:data:psa would be with the older definition i.e. 0xFA010103 / 0xFA010104. To allow this compatibility, a version # has been introduced for the factory:

  • For version -1, the general convention is not used for event:data and event:data:pas keys. the extention of the system is restricted
  • For version 0, the general convention is used. the user can extend the system by adding new keys / building any kind of event

To move to version 0, jsut change -1 into 0 in the header part:

#////ADF::AgataKeyFactory_beg//// - 0 Init

Of course, this is transparent for the user as soon as she/he uses adf/gw to read the adf data.

Definition at line 242 of file AgataKeyFactory.h.


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