RawOvershootBlock Class Reference

#include <RawOvershootBlock.h>

Inheritance diagram for RawOvershootBlock:
RawDataBlock

List of all members.

Public Types

typedef std::map< RawChannelId,
UInt_t > 
RCIdToTickMap
typedef
RCIdToTickMap::const_iterator 
RCIdToTickMapConstIter
typedef std::pair
< RawChannelId, UInt_t > 
RCIdTickPair

Public Member Functions

 RawOvershootBlock ()
 RawOvershootBlock (const Int_t *block)
 RawOvershootBlock (const VldContext &vldc, const RCIdToTickMap &inmap)
virtual ~RawOvershootBlock ()
UInt_t GetNumberOfEntries () const
const RCIdTickPair GetPair (UInt_t indx) const
RawChannelId GetChannelId (UInt_t indx) const
UInt_t GetTicks (UInt_t indx) const
UInt_t GetTicks (const RawChannelId &rcid) const
const RCIdToTickMapGetOvershootChannels () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawOvershootBlock (const RawOvershootBlock &rhs)
RawOvershootBlockoperator= (const RawOvershootBlock &rhs)

Static Public Member Functions

static void SetDebugFlags (const UInt_t dbgflgs)
static UInt_t GetDebugFlags ()

Protected Member Functions

virtual void FillOvershootChannels () const

Protected Attributes

Bool_t fUnpacked
RCIdToTickMap fOvershootChannels
 not written out

Static Private Attributes

static UInt_t fgDebugFlags = 0
 not written out

Detailed Description

Definition at line 20 of file RawOvershootBlock.h.


Member Typedef Documentation

typedef std::pair<RawChannelId,UInt_t> RawOvershootBlock::RCIdTickPair

Definition at line 28 of file RawOvershootBlock.h.

Definition at line 26 of file RawOvershootBlock.h.

typedef RCIdToTickMap::const_iterator RawOvershootBlock::RCIdToTickMapConstIter

Definition at line 27 of file RawOvershootBlock.h.


Constructor & Destructor Documentation

RawOvershootBlock::RawOvershootBlock (  ) 

Definition at line 33 of file RawOvershootBlock.cxx.

00033                                      : fUnpacked(false)
00034 { 
00035    // Default constructor
00036 }

RawOvershootBlock::RawOvershootBlock ( const Int_t *  block  ) 

Definition at line 39 of file RawOvershootBlock.cxx.

00040    : RawDataBlock(block), fUnpacked(false)
00041 {
00042    //  stored block format is:
00043    //---------------------
00044    //  0   # words in block
00045    //  1   checksum
00046    //  2   Block Id
00047    //-----
00048    //  3      # dead chips in crate 0
00049    //  4      time <<13 || chad for channel hit in previous 55us
00050    //  5      time <<13 || chad ...
00051    //  3+N0   # dead chips in crate 1
00052    //  3+N0+1 time <<13 || chad ...
00053    //   ...
00054 }

RawOvershootBlock::RawOvershootBlock ( const VldContext vldc,
const RCIdToTickMap inmap 
)

Definition at line 57 of file RawOvershootBlock.cxx.

References Msg::kError, and MSG.

00059    : RawDataBlock(), fUnpacked(false)
00060 {
00061    // create a RawOvershootBlock from a STL map of <RawChannelId,UInt_t>'s
00062    MSG("Raw",Msg::kError)
00063      << "RawOVershootBlock ctor using RCIdToTickMap is not yet implemented"
00064      << endl;
00065    assert(0);
00066 }

RawOvershootBlock::~RawOvershootBlock (  )  [virtual]

Definition at line 69 of file RawOvershootBlock.cxx.

00070 {
00071    // dtor
00072 }

RawOvershootBlock::RawOvershootBlock ( const RawOvershootBlock rhs  )  [inline]

Definition at line 50 of file RawOvershootBlock.h.

References fOvershootChannels.

00051      : RawDataBlock(rhs), fUnpacked(0) { fOvershootChannels.clear(); }


Member Function Documentation

void RawOvershootBlock::FillOvershootChannels (  )  const [protected, virtual]

Definition at line 109 of file RawOvershootBlock.cxx.

References det, fOvershootChannels, RawDataBlock::fRawBlock, RawDataBlock::fSize, RawDataBlock::GetBlockId(), RawBlockId::GetDetector(), ElecType::kVA, and zzzz_last.

Referenced by FormatToOStream(), GetNumberOfEntries(), GetOvershootChannels(), and GetTicks().

00110 {
00111    // unpack the data into a STL map of <RawChannelId,UInt_t>'s
00112 
00113    Detector::Detector_t det = GetBlockId().GetDetector();
00114    // assume this block is only sensible for VA electronics
00115    ElecType::Elec_t elec = ElecType::kVA;
00116 
00117    Int_t  crate = -1;
00118    Int_t* ptr = fRawBlock+zzzz_last;
00119    while (ptr < fRawBlock+fSize) {
00120       // start of new crate
00121       crate++;
00122       int ndead = *ptr; ptr++;
00123       for (int i=0; i<ndead; i++) {
00124          Int_t tmp   = *ptr; ptr++;
00125          Int_t chad  = tmp & 0x1fff;
00126          Int_t ticks = tmp>>13;
00127          RawChannelId rcid(det,elec,crate,chad);
00128          fOvershootChannels[rcid] = ticks;
00129       }
00130    }
00131 }

std::ostream & RawOvershootBlock::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Reimplemented from RawDataBlock.

Definition at line 88 of file RawOvershootBlock.cxx.

References FillOvershootChannels(), and fOvershootChannels.

00090 {
00091    RawDataBlock::FormatToOStream(os,option);
00092    if (option[0] == 'X') return os;
00093 
00094    FillOvershootChannels();
00095    RCIdToTickMapConstIter iter = fOvershootChannels.begin();
00096    while (iter != fOvershootChannels.end()) {
00097       RCIdTickPair pair = *iter;
00098       os << " " << pair.first.AsString("e")
00099          << " was hits just " << pair.second << " ticks ago" 
00100          << endl;
00101       iter++;
00102    }
00103    os << endl;
00104 
00105    return os;
00106 }

RawChannelId RawOvershootBlock::GetChannelId ( UInt_t  indx  )  const [inline]

Definition at line 86 of file RawOvershootBlock.h.

References GetPair().

00087 { return GetPair(indx).first; }

static UInt_t RawOvershootBlock::GetDebugFlags (  )  [inline, static]

Definition at line 47 of file RawOvershootBlock.h.

References fgDebugFlags.

00047 { return fgDebugFlags; }

UInt_t RawOvershootBlock::GetNumberOfEntries (  )  const [inline]

Definition at line 72 of file RawOvershootBlock.h.

References FillOvershootChannels(), and fOvershootChannels.

Referenced by GetPair().

00073 { FillOvershootChannels(); return fOvershootChannels.size(); }

const std::map< RawChannelId, UInt_t > & RawOvershootBlock::GetOvershootChannels (  )  const [inline]

Definition at line 75 of file RawOvershootBlock.h.

References FillOvershootChannels(), and fOvershootChannels.

Referenced by GetPair().

const std::pair< RawChannelId, UInt_t > RawOvershootBlock::GetPair ( UInt_t  indx  )  const [inline]

Definition at line 78 of file RawOvershootBlock.h.

References GetNumberOfEntries(), and GetOvershootChannels().

Referenced by GetChannelId(), and GetTicks().

00079 {
00080    if (indx > GetNumberOfEntries() ) return std::make_pair(RawChannelId(),0);
00081    RCIdToTickMapConstIter iter = GetOvershootChannels().begin();
00082    for (UInt_t i=0; i<indx; i++) iter++;
00083    return *iter;
00084 }

UInt_t RawOvershootBlock::GetTicks ( const RawChannelId rcid  )  const [inline]

Definition at line 92 of file RawOvershootBlock.h.

References FillOvershootChannels(), and fOvershootChannels.

00093 { FillOvershootChannels(); return fOvershootChannels[rcid]; }

UInt_t RawOvershootBlock::GetTicks ( UInt_t  indx  )  const [inline]

Definition at line 89 of file RawOvershootBlock.h.

References GetPair().

00090 { return GetPair(indx).second; }

RawOvershootBlock & RawOvershootBlock::operator= ( const RawOvershootBlock rhs  ) 

Reimplemented from RawDataBlock.

Definition at line 75 of file RawOvershootBlock.cxx.

References fOvershootChannels, and fUnpacked.

00076 {
00077    // deep copy assignment 
00078    if (this != &rhs) {
00079      RawDataBlock::operator=(rhs);
00080      // clear the unpacked info to allow it to be re-filled
00081      fUnpacked = false;
00082      fOvershootChannels.clear();
00083    }
00084    return *this;
00085 }

static void RawOvershootBlock::SetDebugFlags ( const UInt_t  dbgflgs  )  [inline, static]

Definition at line 46 of file RawOvershootBlock.h.

References fgDebugFlags.

00046 {fgDebugFlags=dbgflgs;}


Member Data Documentation

UInt_t RawOvershootBlock::fgDebugFlags = 0 [static, private]

not written out

Definition at line 67 of file RawOvershootBlock.h.

Referenced by GetDebugFlags(), and SetDebugFlags().

Bool_t RawOvershootBlock::fUnpacked [mutable, protected]

Definition at line 61 of file RawOvershootBlock.h.

Referenced by operator=().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1