ROOT logo
Podd » SRC » THaDecData

class THaDecData: public THaApparatus


 Hall A miscellaneous decoder data, which typically do not belong to a
 detector class. Provides a place to rapidly add new channels and to
 make their data available as analyzer global variables.

 To use this class, add something like the following to your analysis

 gHaApps->Add( new THaDecData("D","Decoder raw data") );

 This will give your class the name "D", which will be the prefix for
 all its database keys and global variables.

 To define channels, corresponding database entries have to be
 set up. Either use the old-style flat file database format
 (see examples/ or the new key/value format.
 For each channel, first decide how to identify the data:

 1. "crate" variables define single 32-bit data words by crate/slot/channel
 2. "multi" is the same as "crate", except it allows multihit channels
    with an arbitrary number of hits.
 3. "word" variables define single data words found in a given crate's
    event buffer by a 32-bit header word and an offset. Offset = 1
    means the data word following the header, etc.
 4. "roclen" variables contain the event length of a given crate.
 5. Hall A-specific: "bitNN" variables, where NN is a number 0-31,
    report the value of a trigger bit read via a multihit TDC.
    Ask the DAQ expert for details.

 In the key/value database format, define one database key for ALL
 the variables of a given type. The key's value is then a long string
 of n-tuples of configuration parameters, variable name first. For

 D.crate = syncadc1, 1, 25, 16,  \
           syncadc2, 2, 24, 48

 will set up two "crate" variables, for crate/slot/chan = (1/25/16) and
 (2/24/48), respectively, that will appear as global variables
 "D.syncadc1" and "D.syncadc2". Note the continuation mark "\".

 "word" variables are defined similarly, but take header (in hex) and
 offset as the 3rd and 4th parameters.

 Alternatively, use the "" example file to define channels
 line by line. (This file format will be phased out in the future.)
 To add a new variable, if it is on a single-hit channel, you may
 imitate 'synchadc1' if you know the (crate,slot,chan), and
 imitate 'timeroc2' if you know the (crate,header,offset).

 If your variable is more complicated and relies on several
 channels, you may easily write you own plug-in class derived
 from BdataLoc (see BdataLoc.[Ch]). Decoding is done in Load().
 You'll have to define a new, unique type name (like "crate") and
 initialize the class with a static initialization call to DoRegister
 (see top of BdataLoc.C). Also, you'll probably need to override
 Configure() to get additional or different parameters from the

 Originally written by R. Michaels, March 2002
 Modified by R.J. Feuerbach, April 2004
 Rewritten by O. Hansen, October 2013

Function Members (Methods)

THaDecData(const char* name = "D", const char* description = "Raw decoder data")
voidTObject::AbstractMethod(const char* method) const
virtual Int_tAddDetector(THaDetector* det)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual Int_tTHaApparatus::Begin(THaRunBase* r = 0)
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* opt = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTHaApparatus::CoarseReconstruct()
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual Int_tDecode(const THaEvData&)
static Int_tTHaAnalysisObject::DefineVarsFromList(const void* list, THaAnalysisObject::EType type, THaAnalysisObject::EMode mode, const char* var_prefix, const TObject* obj, const char* prefix, const char* here)
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 Int_tTHaApparatus::End(THaRunBase* r = 0)
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 voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static voidTHaAnalysisObject::GeoToSph(Double_t th_geo, Double_t ph_geo, Double_t& th_sph, Double_t& ph_sph)
const char*THaAnalysisObject::GetClassName() const
const char*THaAnalysisObject::GetConfig() const
virtual const char*THaAnalysisObject::GetDBFileName() const
Int_tTHaAnalysisObject::GetDebug() const
virtual THaDetector*THaApparatus::GetDetector(const char* name)
const TList*THaApparatus::GetDetectors()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TDatimeTHaAnalysisObject::GetInitDate() const
virtual const char*TNamed::GetName() const
Int_tTHaApparatus::GetNumDets() const
static TString&THaAnalysisObject::GetObjArrayString(const TObjArray* params, Int_t pos)
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
const char*THaAnalysisObject::GetPrefix() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::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 THaAnalysisObject::EStatusInit(const TDatime& run_time)
virtual Int_tTHaAnalysisObject::InitOutput(THaOutput*)
virtual voidTObject::Inspect() constMENU
static Bool_tTHaAnalysisObject::IntersectPlaneWithRay(const TVector3& xax, const TVector3& yax, const TVector3& org, const TVector3& ray_start, const TVector3& ray_vect, Double_t& length, TVector3& intersect)
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTHaAnalysisObject::IsInit() const
Bool_tTHaAnalysisObject::IsOK() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
static boolTHaAnalysisObject::IsTag(const char* buf)
Bool_tTObject::IsZombie() const
static Int_tTHaAnalysisObject::LoadDB(FILE* file, const TDatime& date, const DBRequest* request, const char* prefix, Int_t search = 0, const char* here = "THaAnalysisObject::LoadDB")
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, Double_t& value)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, Int_t& value)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, string& text)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, TString& text)
virtual voidTNamed::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
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static 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)
TNamed&TNamed::operator=(const TNamed& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* opt = "") const
static voidTHaAnalysisObject::PrintObjects(Option_t* opt = "")
virtual Int_tTObject::Read(const char* name)
static Int_tTHaAnalysisObject::ReadDBline(FILE* fp, char* buf, size_t bufsiz, string& line)
virtual Int_tReconstruct()
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
static Int_tTHaAnalysisObject::SeekDBconfig(FILE* file, const char* tag, const char* label = "config", Bool_t end_on_tag = false)
static Int_tTHaAnalysisObject::SeekDBdate(FILE* file, const TDatime& date, Bool_t end_on_tag = false)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidTHaAnalysisObject::SetConfig(const char* label)
virtual voidTHaAnalysisObject::SetDebug(Int_t level)
virtual voidTHaApparatus::SetDebugAll(Int_t level)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTHaAnalysisObject::SetName(const char* name)
virtual voidTHaAnalysisObject::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
static voidTHaAnalysisObject::SphToGeo(Double_t th_sph, Double_t ph_sph, Double_t& th_geo, Double_t& ph_geo)
THaAnalysisObject::EStatusTHaAnalysisObject::Status() 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()
static vector<std::string>THaAnalysisObject::vsplit(const string& s)
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
virtual const char*THaAnalysisObject::ClassNameHere(const char*) const
Int_tDefineLocType(const BdataLoc::BdataLocType& loctype, const TString& configstr, bool re_init)
virtual Int_tDefineVariables(THaAnalysisObject::EMode mode = kDefine)
Int_tTHaAnalysisObject::DefineVarsFromList(const VarDef* list, THaAnalysisObject::EMode mode = kDefine, const char* var_prefix = "") const
Int_tTHaAnalysisObject::DefineVarsFromList(const RVarDef* list, THaAnalysisObject::EMode mode = kDefine, const char* var_prefix = "") const
Int_tTHaAnalysisObject::DefineVarsFromList(const void* list, THaAnalysisObject::EType type, THaAnalysisObject::EMode mode, const char* var_prefix = "") const
virtual voidTHaAnalysisObject::DoError(int level, const char* location, const char* fmt, va_list va) const
THaAnalysisObject*THaAnalysisObject::FindModule(const char* name, const char* classname, bool do_error = true)
static vector<std::string>THaAnalysisObject::GetDBFileList(const char* name, const TDatime& date, const char* here = "GetDBFileList()")
virtual const char*THaAnalysisObject::Here(const char*) const
Int_tTHaAnalysisObject::LoadDB(FILE* f, const TDatime& date, const DBRequest* req, Int_t search = 0)
virtual voidTHaAnalysisObject::MakePrefix()
voidTHaAnalysisObject::MakePrefix(const char* basename)
virtual FILE*OpenFile(const TDatime& date)
virtual FILE*THaAnalysisObject::OpenRunDBFile(const TDatime& date)
static char*THaAnalysisObject::ReadComment(FILE* fp, char* buf, const int len)
virtual Int_tReadDatabase(const TDatime& date)
virtual Int_tTHaAnalysisObject::ReadRunDatabase(const TDatime& date)
virtual Int_tTHaAnalysisObject::RemoveVariables()

Data Members

enum THaAnalysisObject::EStatus { kOK
enum THaAnalysisObject::EType { kVarDef
enum THaAnalysisObject::EMode { kDefine
enum THaAnalysisObject::EProperties { kNeedsRunDB
enum TObject::EStatusBits { kCanDelete
enum TObject::[unnamed] { kIsOnHeap
static const Double_tTHaAnalysisObject::kBig= 1.e38; // default junk value
UInt_tevtypeCODA event type
UInt_tevtypebitsBitpattern of active trigger numbers
THashListfBdataLocRaw data channels
TStringTHaAnalysisObject::fConfigConfiguration to use from database
Int_tTHaAnalysisObject::fDebugDebug level
TList*THaApparatus::fDetectorsList of all detectors for this apparatus
TDatimeTHaAnalysisObject::fInitDateDate passed to Init
Bool_tTHaAnalysisObject::fIsInitFlag indicating that ReadDatabase done
Bool_tTHaAnalysisObject::fIsSetupFlag indicating that DefineVariables done.
TStringTNamed::fNameobject identifier
Bool_tTHaAnalysisObject::fOKOutFlag indicating object-output prepared
char*THaAnalysisObject::fPrefixName prefix for global variables
UInt_tTHaAnalysisObject::fPropertiesProperties of this object (see EProperties)
THaAnalysisObject::EStatusTHaAnalysisObject::fStatusInitialization status flag
TStringTNamed::fTitleobject title

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

THaDecData(const char* name = "D", const char* description = "Raw decoder data")
 Destructor. Delete data location objects and global variables.
void Clear(Option_t* opt = "")
 Reset event-by-event data
Int_t DefineVariables(THaAnalysisObject::EMode mode = kDefine)
 Register global variables, open decdata map file, and parse it.
 If mode == kDelete, remove global variables.
Int_t DefineLocType(const BdataLoc::BdataLocType& loctype, const TString& configstr, bool re_init)
 Define variables for given loctype using parameters in configstr
FILE* OpenFile(const TDatime& date)
 Open DecData database file. First look for standard file name,
 e.g. "db_D.dat", then for legacy file name ""
Int_t ReadDatabase(const TDatime& date)
 Read THaDecData database
THaAnalysisObject::EStatus Init(const TDatime& run_time)
 Custom Init() method. Since this apparatus has no traditional "detectors",
 we skip the detector initialization.
Int_t Decode(const THaEvData& )
 Extract the requested variables from the event data
void Print(Option_t* opt = "") const
 Print current status of all THaDecData variables
Int_t AddDetector(THaDetector* det)
 Disabled functions from THaApparatus
{ return 0; }
Int_t Reconstruct()
{ return 0; }