class THaScalerDB


   THaScalerDB

   A text-based time-dependent database for scaler
   "crate maps" and "directives".

   The "crate map" defines the correspondence
   between  the following two groups of info:
   SDB_chanKey =
     [description of channel, i.e. detector name,
        crate #, helicity]
   -- and --
   SDB_chanDesc =
     [slot and channel info]

   (the chanKey is internal to a detector,
    the chanDesc refers to physical scaler units)

   "directives" are other info one can obtain
   from the map file, e.g. clock speed or
   IP address of server (see GetDirectives()).

   author  Robert Michaels (rom@jlab.org)


Function Members (Methods)

public:
THaScalerDB()
virtual~THaScalerDB()
static TClass*Class()
Int_tCrateToInt(const string& scrate)
boolextract_db(const Bdate& bdate)
string::size_typeFindNoCase(const string s1, const string s2)
Int_tGetChan(Int_t crate, string desc, Int_t helicity = 0, Int_t chan = 0)
Int_tGetIntDirectives(Int_t crate, string directive, string key)
stringGetLongDesc(Int_t crate, string desc, Int_t helicity = 0)
Int_tGetNumDirectives(Int_t craet, string directive)
vector<std::string>GetShortNames(Int_t crate, Int_t slot, Int_t chan)
Int_tGetSlot(Int_t crate, string desc, Int_t helicity = 0)
Int_tGetSlot(Int_t crate, Int_t tgtstate, Int_t helicity)
stringGetStringDirectives(Int_t crate, string directive, string key)
virtual TClass*IsA() const
voidLoadCrateToInt(const char* bank, Int_t cr)
voidPrintChanMap()
voidPrintDirectives()
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
Bool_tUsesTargetState(Int_t crate)
private:
THaScalerDB(const THaScalerDB& bk)
Int_tAmtSpace(const string& s)
SDB_chanDescGetChanDesc(Int_t crate, string desc, Int_t helicity = 0)
stringGetLineType(const string sline)
Int_tGetSlotOffset(Int_t crate, Int_t helicity)
voidInit()
Bool_tIsHelicityTied(Int_t crate, Int_t helicity)
boolLoadDirective(string sinput)
boolLoadMap(string sinput)
THaScalerDB&operator=(const THaScalerDB& bk)
Int_tTiedCrate(Int_t crate, Int_t helicity)
vector<std::string>vsplit(const string& s)

Data Members

private:
map<SDB_chanKey,SDB_chanDesc>chanmap
map<std::pair<std::pair<Int_t,Int_t>,Int_t>,std::vector<std::string> >channame
map<std::string,Int_t>crate_strtoi
SDB_directive*direct
vector<std::string>directnames
UInt_tfgnfar
boolfound_date
stringscomment
stringsdate

Class Charts

Inheritance Chart:
THaScalerDB

Function documentation

THaScalerDB(const THaScalerDB& bk)
{ Init(); }
~THaScalerDB()
void Init()
bool extract_db(const Bdate& bdate)
 Load the database.
 Input: Bdate = time (day,month,year) when database wanted
 Return : true if successful, else false.
 Search order for scaler.map:
   $DB_DIR/DEFAULT $DB_DIR ./DB/DEFAULT ./DB ./db/DEFAULT ./db DEFAULT .
void PrintChanMap()
void PrintDirectives()
string GetLineType(const string sline)
 Decide if the line is a date, comment, directive, or a map field.
SDB_chanDesc GetChanDesc(Int_t crate, string desc, Int_t helicity = 0)
 No distinction by target state (they share channel mapping)
 First check if crate is tied to the map of another crate.
string GetLongDesc(Int_t crate, string desc, Int_t helicity = 0)
 Returns the slot in a scaler corresp. to the
 channel in the detector described by "desc".
Int_t GetSlot(Int_t crate, string desc, Int_t helicity)
 Returns the slot in a scaler corresp. to the
 channel in the detector described by "desc".
Int_t GetSlot(Int_t crate, Int_t tgtstate, Int_t helicity)
 Returns the slot in a scaler corresp. to the
 combination of target state and beam helicity.
Int_t GetChan(Int_t crate, string desc, Int_t helicity = 0, Int_t chan = 0)
 Returns the channel in a scaler corresp. to the
 channel in the detector described by "desc".
bool LoadMap(string sinput)
bool LoadDirective(string sinput)
vector<string> GetShortNames(Int_t crate, Int_t slot, Int_t chan)
string GetStringDirectives(Int_t crate, string directive, string key)
Int_t GetNumDirectives(Int_t craet, string directive)
Int_t GetIntDirectives(Int_t crate, string directive, string key)
void LoadCrateToInt(const char* bank, Int_t cr)
 Load the correspondence of crate string to integer
Int_t CrateToInt(const string& scrate)
 Find integer representation of crate "scrate".
Bool_t UsesTargetState(Int_t crate)
 Does this crate have target state info ?
Bool_t IsHelicityTied(Int_t crate, Int_t helicity)
 Does this (crate, helicity) get tied to a helicity=0 slot ?
Int_t TiedCrate(Int_t crate, Int_t helicity)
 Find the crate that this (crate, helicity) is tied to.
Int_t GetSlotOffset(Int_t crate, Int_t helicity)
 Find the slot offset relative to helicity=0 data.
string::size_type FindNoCase(const string s1, const string s2)
 Find iterator of word "sdata" where "skey" starts.  Case insensitive.
Int_t AmtSpace(const string& s)
vector<string> vsplit(const string& s)
 split a string into whitespace-separated strings
Bdate & operator=(const THaScalerDB& bk)
THaScalerDB(const THaScalerDB& bk)

Last change: Sat Nov 7 21:26:51 2009
Last generated: 2009-11-07 21:26

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.