ROOT logo
Podd » SRC » THaDetMap

class THaDetMap


 The standard detector map for a Hall A detector.

Function Members (Methods)

THaDetMap(const THaDetMap&)
virtual Int_tAddModule(UShort_t crate, UShort_t slot, UShort_t chan_lo, UShort_t chan_hi, UInt_t first = 0, UInt_t model = 0, Int_t refindex = -1, Int_t refchan = -1, UInt_t plane = 0, UInt_t signal = 0)
static TClass*Class()
virtual Int_tFill(const vector<Int_t>& values, UInt_t flags = 0)
virtual THaDetMap::Module*Find(UShort_t crate, UShort_t slot, UShort_t chan)
voidGetMinMaxChan(Int_t& min, Int_t& max, THaDetMap::ECountMode mode = kLogicalChan) const
UInt_tGetModel(UShort_t i) const
static UInt_tGetModel(THaDetMap::Module* d)
THaDetMap::Module*GetModule(UShort_t i) const
Int_tGetNchan(UShort_t i) const
Int_tGetSize() const
Int_tGetTotNumChan() const
virtual TClass*IsA() const
Bool_tIsADC(UShort_t i) const
static Bool_tIsADC(THaDetMap::Module* d)
Bool_tIsTDC(UShort_t i) const
static Bool_tIsTDC(THaDetMap::Module* d)
THaDetMap&operator=(const THaDetMap&)
virtual voidPrint(Option_t* opt = "") const
virtual voidReset()
virtual voidShowMembers(TMemberInspector&)
virtual voidSort()
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
THaDetMap::Module*uGetModule(UShort_t i) const

Data Members

enum ECountMode { kLogicalChan
enum EFillFlags { kDoNotClear
static const intkDetMapSizeSanity limit on map size
THaDetMap::Module*fMapArray of modules, each module is a 7-tuple
Int_tfMaplengthcurrent size of the fMap array
UShort_tfNmodulesNumber of modules (=crate,slot) in the map
static const UInt_tkADCBit
static const UInt_tkModelMask
static const UInt_tkTDCBit

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

 Default constructor. Creates an empty detector map.
THaDetMap(const THaDetMap& )
 Copy constructor
THaDetMap& operator=(const THaDetMap& )
 THaDetMap assignment operator
Int_t AddModule(UShort_t crate, UShort_t slot, UShort_t chan_lo, UShort_t chan_hi, UInt_t first = 0, UInt_t model = 0, Int_t refindex = -1, Int_t refchan = -1, UInt_t plane = 0, UInt_t signal = 0)
 Add a module to the map.
Int_t Fill(const vector<Int_t>& values, UInt_t flags = 0)
 Fill the map with 'values'. Depending on 'flags', the values vector
 is interpreted as a 4-, 5-, 6- or 7-tuple:

 The first 4 values are interpreted as (crate,slot,start_chan,end_chan)
 Each of the following flags causes one more value to be used as part of
 the tuple for each module:

 kFillLogicalChannel - Logical channel number for 'start_chan'.
 kFillModel          - The module's hardware model number (see AddModule())
 kFillRefChan        - Reference channel (for pipeline TDCs etc.)
 kFillRefIndex       - Reference index (for pipeline TDCs etc.)
 kFillPlane          - Which plane in detector (for Hall C)
 kFillSignal         - Which signal type (for Hall C)

 If more than one flag is present, the numbers will be interpreted
 in the order the flags are listed above.
      flags = kFillModel | kFillRefChan
      the vector is interpreted as a series of 6-tuples in the order

 If kFillLogicalChannel is not set then the first logical channel numbers
 are automatically calculated for each module, assuming the numbers are

 By default, an existing map is overwritten. If the flag kDoNotClear
 is present, then the data are appended.

 The return value is the number of modules successfully added,
 or negative if an error occurred.
Int_t GetTotNumChan() const
 Get sum of the number of channels of all modules in the map. This is
 typically the total number of hardware channels used by the detector.
void GetMinMaxChan(Int_t& min, Int_t& max, THaDetMap::ECountMode mode = kLogicalChan) const
 Put the minimum and maximum logical or reference channel numbers
 into min and max. If refidx is true, check refindex, else check logical
 channel numbers.
void Print(Option_t* opt = "") const
 Print the contents of the map
void Reset()
 Clear() the map and reset the array size to zero, freeing memory.
void Sort()
 Sort the map by crate/slot/low channel
Bool_t IsADC(THaDetMap::Module* d)
Bool_t IsTDC(THaDetMap::Module* d)
UInt_t GetModel(THaDetMap::Module* d)
Bool_t IsADC(UShort_t i) const
Bool_t IsTDC(UShort_t i) const
UInt_t GetModel(UShort_t i) const
Int_t GetNchan(UShort_t i) const
 Return the number of channels of the i-th module
void Clear()
{ fNmodules = 0; }
Module* Find(UShort_t crate, UShort_t slot, UShort_t chan)
Module* GetModule(UShort_t i) const
Int_t GetSize() const
{ return static_cast<Int_t>(fNmodules); }
Module* uGetModule(UShort_t i) const
{ return fMap+i; }