RawLITimingSummaryBlock Class Reference

#include <RawLITimingSummaryBlock.h>

Inheritance diagram for RawLITimingSummaryBlock:

RawDataBlock RawLIHeaderInterface List of all members.

Public Member Functions

 RawLITimingSummaryBlock ()
 RawLITimingSummaryBlock (const Int_t *block)
virtual ~RawLITimingSummaryBlock ()
virtual Short_t GetCalibType () const
virtual Short_t GetCalibPoint () const
virtual Short_t GetPulserBox () const
virtual Short_t GetLed () const
virtual Short_t GetPulseHeight () const
virtual Short_t GetPulseWidth () const
virtual Short_t GetPulses () const
virtual Short_t GetPeriod () const
virtual Int_t GetCount () const
virtual VldContext GetVldContext () const
virtual VldTimeStamp GetTimeStamp () const
virtual Int_t GetSpareSize () const
virtual const Int_t * GetSpares () const
Int_t GetNumberOfSummaries () const
const RawLITimingSummaryAt (Int_t idx) const
virtual TIter GetDatumIter (Bool_t dir=kIterForward) const
Int_t IndexOf (RawLITimingSummary *rawTimingSum) const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawLITimingSummaryBlock (const RawLITimingSummaryBlock &rhs)
RawLITimingSummaryBlockoperator= (const RawLITimingSummaryBlock &rhs)

Static Public Member Functions

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

Protected Member Functions

virtual void FillRawTimingSums () const
const RawLIHeaderGetHeader () const

Protected Attributes

RawLIHeaderfRawLIHeader
TObjArray * fRawCrateStatuses
 not written out
TObjArray * fRawTimingSums
 not written out

Static Private Attributes

static UInt_t fgDebugFlags = 0
 not written out

Detailed Description

Definition at line 24 of file RawLITimingSummaryBlock.h.


Constructor & Destructor Documentation

RawLITimingSummaryBlock::RawLITimingSummaryBlock (  ) 

Definition at line 37 of file RawLITimingSummaryBlock.cxx.

00037                                                  :
00038   RawDataBlock(), fRawLIHeader(0), fRawCrateStatuses(0), fRawTimingSums(0)
00039 {
00040    // Default constructor
00041 }

RawLITimingSummaryBlock::RawLITimingSummaryBlock ( const Int_t *  block  ) 

Definition at line 44 of file RawLITimingSummaryBlock.cxx.

00045   : RawDataBlock(block), 
00046     fRawLIHeader(0), fRawCrateStatuses(0), fRawTimingSums(0)
00047 {
00048    //  stored block format is:
00049    //---------------------
00050    //  0   # words in block
00051    //  1   checksum
00052    //  2   Block Id
00053    //-----
00054    //  3   CalibType   | CalibPoint#
00055    //  4   PulserBox # | LED #
00056    //  5   PulseHeight | PulseWidth
00057    //  6   # pulses    | flashing frequency
00058    //  7   T0 (1st ROP) sec
00059    //  8   T0 (1st ROP) nsec
00060    //  9   spare field 0 (v0,v1) : # pulses used in this summary (v2)
00061    // 10   spare field 1 (v0,v1) : spare field 0  (v2)
00062    //-----
00063    // 11   Crate # i (+extra)
00064    // 12   # of crate entries (N_i)
00065    //-----
00066    // 13   ChAdd 1_i  | # of entries
00067    // 14   Mean
00068    // 15   RMS
00069    // 16   ChAdd 2_i  | # of entries
00070    // 17   Mean
00071    // 18   RMS
00072    //  ...
00073    //      ChAdd N_i  | # of entries
00074    //      Mean
00075    //      RMS
00076    //-----
00077    //  x   Crate # j (+extra)
00078    //      # of crate entries (N_j)
00079    //-----
00080    //      ChAdd 1_j  | # of entries
00081    //      Mean
00082    //      RMS
00083    //      ChAdd 2_j  | # of entries
00084    //      Mean
00085    //      RMS
00086    //  ...
00087    //      ChAdd N_j  | # of entries
00088    //      Mean*4     | RMS*4
00089 
00090 }

RawLITimingSummaryBlock::~RawLITimingSummaryBlock (  )  [virtual]

Definition at line 93 of file RawLITimingSummaryBlock.cxx.

References fRawCrateStatuses, fRawLIHeader, and fRawTimingSums.

00094 {
00095 
00096    if (fRawLIHeader) {
00097       delete fRawLIHeader;
00098       fRawLIHeader = 0;
00099    }
00100 
00101    if (fRawTimingSums) {
00102       fRawTimingSums->Delete();
00103       delete fRawTimingSums;
00104       fRawTimingSums = 0;
00105    }
00106    if (fRawCrateStatuses) {
00107       fRawCrateStatuses->Delete();
00108       delete fRawCrateStatuses;
00109       fRawCrateStatuses = 0;
00110    }
00111    return;
00112 }

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

Definition at line 60 of file RawLITimingSummaryBlock.h.


Member Function Documentation

const RawLITimingSummary * RawLITimingSummaryBlock::At ( Int_t  idx  )  const

Definition at line 152 of file RawLITimingSummaryBlock.cxx.

References FillRawTimingSums(), and fRawTimingSums.

Referenced by PulserTimingPoint::AddSummaryBlock().

00153 {
00154    // create/fill the TObjArray of RawTimingSummarys (if it doesn't exist)
00155    // return pointer to the i-th element
00156 
00157    if ( ! fRawTimingSums ) FillRawTimingSums();
00158    return (RawLITimingSummary*) fRawTimingSums->At(idx);
00159 }

void RawLITimingSummaryBlock::FillRawTimingSums (  )  const [protected, virtual]

Definition at line 182 of file RawLITimingSummaryBlock.cxx.

References SimFlag::AsString(), dbg_DumpCrateOnUnpack, dbg_DumpHeaderOnUnpack, dbg_DumpTimingSumOnUnpack, fgDebugFlags, RawDataBlock::fRawBlock, fRawCrateStatuses, fRawLIHeader, fRawTimingSums, RawDataBlock::fSize, RawDataBlock::GetBlockId(), RawCrateStatus::GetEntries(), RawBlockId::GetMinor(), RawBlockId::GetSimFlag(), Msg::kWarning, MSG, RawCrateStatus::Print(), and RawLIHeader::Print().

Referenced by At(), GetDatumIter(), GetHeader(), GetNumberOfSummaries(), and IndexOf().

00183 {
00184    // create the TObjArray of RawTimingSum (if it doesn't exist)
00185 
00186    if ( fRawTimingSums ) return;   // already filled
00187    if ( fSize <= 0 || fRawBlock == 0) {
00188       MSG("RawData",Msg::kWarning)
00189          << "RawLITimingSummaryBlock::FillRawTimingSums empty block? "
00190          << fSize << " " << fRawBlock << endl;
00191       // build a dummy header at least
00192       fRawLIHeader = new RawLIHeader;
00193       return;
00194    }
00195 
00196    fRawCrateStatuses = new TObjArray();
00197    fRawTimingSums    = new TObjArray();
00198    RawCrateStatus     *cratestatus = 0;
00199    RawLITimingSummary *rawTimingSum   = 0;
00200    const Int_t    *p   = fRawBlock;
00201    const Int_t    *end = fRawBlock + fSize; // 1 beyond end
00202 
00203    RawBlockId rbid = GetBlockId();
00204    Int_t minor = rbid.GetMinor();
00205 
00206    p += 3; // skip #words, blockid and checksum
00207 
00208    // eat up the common header info
00209    fRawLIHeader = new RawLIHeader(rbid,p);
00210 
00211    if (fgDebugFlags&dbg_DumpHeaderOnUnpack) fRawLIHeader->Print();
00212 
00213    while (p<end) {
00214       // start a new crate (pointer advanced by RawCrateStatus ctor
00215       cratestatus = new RawCrateStatus(rbid,p);
00216       fRawCrateStatuses->Add(cratestatus);
00217       Int_t npairs = cratestatus->GetEntries(); 
00218 
00219       if (fgDebugFlags&dbg_DumpCrateOnUnpack) cratestatus->Print();
00220 
00221       for (Int_t ipair = 0; ipair < npairs; ipair++) {
00222          rawTimingSum = new RawLITimingSummary(p,cratestatus,minor);
00223          fRawTimingSums->Add(rawTimingSum);
00224 
00225          if (fgDebugFlags&dbg_DumpTimingSumOnUnpack) rawTimingSum->Print();
00226          if (p>end) {
00227             MSG("RawData",Msg::kWarning)
00228                << "RawLITimingSummaryBlock::FillRawTimingSums crate info seems trashed"
00229                << endl << " SimFlag " << SimFlag::AsString(rbid.GetSimFlag())
00230                << endl;
00231             break;
00232          }
00233       }
00234    }
00235 
00236 }

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

Reimplemented from RawDataBlock.

Definition at line 239 of file RawLITimingSummaryBlock.cxx.

References RawDataBlock::FormatToOStream(), GetDatumIter(), GetHeader(), and header.

00241 {
00242    RawDataBlock::FormatToOStream(os,option);
00243    if (option[0] == 'X') return os;
00244 
00245    TIter iter = GetDatumIter();
00246 
00247    const RawLIHeader* header = GetHeader();
00248    os << (*header);
00249 
00250    os << " " << "Channel         " 
00251       << "entries"
00252       << " " << "      Mean" << "          "
00253       << " " << "       RMS" << "          "
00254       << endl;
00255 
00256    TObject *tobj;
00257    RawLITimingSummary *usum;
00258    while ( ( tobj = iter.Next() ) ) {
00259       usum = dynamic_cast<RawLITimingSummary *>(tobj);
00260       if (usum)  os << (*usum);
00261    }
00262    os << endl;
00263 
00264    return os;
00265 }

Short_t RawLITimingSummaryBlock::GetCalibPoint (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 92 of file RawLITimingSummaryBlock.h.

References RawLIHeader::GetCalibPoint(), and GetHeader().

Referenced by PulserTimingPoint::AddSummaryBlock(), and PulserTimingPoint::PulserTimingPoint().

00093 { return GetHeader()->GetCalibPoint(); }

Short_t RawLITimingSummaryBlock::GetCalibType (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 89 of file RawLITimingSummaryBlock.h.

References RawLIHeader::GetCalibType(), and GetHeader().

Referenced by PulserTimingPoint::AddSummaryBlock(), and PulserTimingPoint::PulserTimingPoint().

00090 { return GetHeader()->GetCalibType(); }

Int_t RawLITimingSummaryBlock::GetCount (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 113 of file RawLITimingSummaryBlock.h.

References RawLIHeader::GetCount(), and GetHeader().

Referenced by PulserTimingPoint::AddSummaryBlock(), and PulserTimingPoint::PulserTimingPoint().

00114 { return GetHeader()->GetCount(); }

TIter RawLITimingSummaryBlock::GetDatumIter ( Bool_t  dir = kIterForward  )  const [virtual]

Definition at line 162 of file RawLITimingSummaryBlock.cxx.

References FillRawTimingSums(), and fRawTimingSums.

Referenced by RateSummary::Ana(), and FormatToOStream().

00163 {
00164    // create/fill the TObjArray of RawTimingSummarys (if it doesn't exist)
00165    // return an iterator to look over them
00166 
00167    if ( ! fRawTimingSums ) FillRawTimingSums();
00168    return TIter(fRawTimingSums,dir);
00169 }

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

Definition at line 57 of file RawLITimingSummaryBlock.h.

References fgDebugFlags.

00057 { return fgDebugFlags; }

const RawLIHeader * RawLITimingSummaryBlock::GetHeader (  )  const [inline, protected]

Definition at line 86 of file RawLITimingSummaryBlock.h.

References FillRawTimingSums(), and fRawLIHeader.

Referenced by FormatToOStream(), GetCalibPoint(), GetCalibType(), GetCount(), GetLed(), GetPeriod(), GetPulseHeight(), GetPulserBox(), GetPulses(), GetPulseWidth(), GetSpares(), GetSpareSize(), GetTimeStamp(), and GetVldContext().

00087 { if (!fRawLIHeader) FillRawTimingSums(); return fRawLIHeader; }

Short_t RawLITimingSummaryBlock::GetLed (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 98 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetLed().

Referenced by PulserTimingPoint::AddSummaryBlock(), and PulserTimingPoint::PulserTimingPoint().

00099 { return GetHeader()->GetLed(); }

Int_t RawLITimingSummaryBlock::GetNumberOfSummaries (  )  const

Definition at line 142 of file RawLITimingSummaryBlock.cxx.

References FillRawTimingSums(), and fRawTimingSums.

Referenced by PulserTimingPoint::AddSummaryBlock().

00143 {
00144    // create/fill the TObjArray of RawTimingSummarys (if it doesn't exist)
00145    // return the number of entries
00146 
00147    if ( ! fRawTimingSums ) FillRawTimingSums();
00148    return fRawTimingSums->GetEntriesFast(); // known not to have gaps
00149 }

Short_t RawLITimingSummaryBlock::GetPeriod (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 110 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetPeriod().

Referenced by PulserTimingPoint::PulserTimingPoint().

00111 { return GetHeader()->GetPeriod(); }

Short_t RawLITimingSummaryBlock::GetPulseHeight (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 101 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetPulseHeight().

Referenced by PulserTimingPoint::PulserTimingPoint().

00102 { return GetHeader()->GetPulseHeight(); }

Short_t RawLITimingSummaryBlock::GetPulserBox (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 95 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetPulserBox().

Referenced by PulserTimingPoint::AddSummaryBlock(), and PulserTimingPoint::PulserTimingPoint().

00096 { return GetHeader()->GetPulserBox(); }

Short_t RawLITimingSummaryBlock::GetPulses (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 107 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetPulses().

Referenced by PulserTimingPoint::PulserTimingPoint().

00108 { return GetHeader()->GetPulses(); }

Short_t RawLITimingSummaryBlock::GetPulseWidth (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 104 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetPulseWidth().

00105 { return GetHeader()->GetPulseWidth(); }

const Int_t * RawLITimingSummaryBlock::GetSpares (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 125 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetSpares().

00126 { return GetHeader()->GetSpares(); }

Int_t RawLITimingSummaryBlock::GetSpareSize (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 122 of file RawLITimingSummaryBlock.h.

References RawLIHeader::GetCalibType(), and GetHeader().

00123 { return GetHeader()->GetCalibType(); }

VldTimeStamp RawLITimingSummaryBlock::GetTimeStamp (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 119 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetTimeStamp().

Referenced by RotoObjectifier::BuildRecord().

00120 { return GetHeader()->GetTimeStamp(); }

VldContext RawLITimingSummaryBlock::GetVldContext (  )  const [inline, virtual]

Implements RawLIHeaderInterface.

Definition at line 116 of file RawLITimingSummaryBlock.h.

References GetHeader(), and RawLIHeader::GetVldContext().

Referenced by PulserTimingPoint::AddSummaryBlock(), and PulserTimingPoint::PulserTimingPoint().

00117 { return GetHeader()->GetVldContext(); }

Int_t RawLITimingSummaryBlock::IndexOf ( RawLITimingSummary rawTimingSum  )  const

Definition at line 172 of file RawLITimingSummaryBlock.cxx.

References FillRawTimingSums(), and fRawTimingSums.

00173 {
00174    // create/fill the TObjArray of RawTimingSummarys (if it doesn't exist)
00175    // return the index for this object (if contained in the list)
00176 
00177    if ( ! fRawTimingSums ) FillRawTimingSums();
00178    return fRawTimingSums->IndexOf(rawTimingSum);
00179 }

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

Definition at line 115 of file RawLITimingSummaryBlock.cxx.

References fRawCrateStatuses, fRawLIHeader, fRawTimingSums, and RawDataBlock::operator=().

00116 {
00117 
00118    // deep copy assignment
00119    if (this != &rhs) {
00120      RawDataBlock::operator=(rhs);
00121 
00122      if (fRawLIHeader) {
00123        delete fRawLIHeader;
00124        fRawLIHeader = 0;
00125      }
00126      
00127      if (fRawTimingSums) {
00128        fRawTimingSums->Delete();
00129        delete fRawTimingSums;
00130        fRawTimingSums = 0;
00131      }
00132      if (fRawCrateStatuses) {
00133        fRawCrateStatuses->Delete();
00134        delete fRawCrateStatuses;
00135        fRawCrateStatuses = 0;
00136      }
00137    }
00138    return *this;
00139 }

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

Definition at line 56 of file RawLITimingSummaryBlock.h.

References fgDebugFlags.

00056 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

not written out

Definition at line 81 of file RawLITimingSummaryBlock.h.

Referenced by FillRawTimingSums(), GetDebugFlags(), and SetDebugFlags().

TObjArray* RawLITimingSummaryBlock::fRawCrateStatuses [mutable, protected]

not written out

Definition at line 75 of file RawLITimingSummaryBlock.h.

Referenced by FillRawTimingSums(), operator=(), and ~RawLITimingSummaryBlock().

RawLIHeader* RawLITimingSummaryBlock::fRawLIHeader [mutable, protected]

Definition at line 74 of file RawLITimingSummaryBlock.h.

Referenced by FillRawTimingSums(), GetHeader(), operator=(), and ~RawLITimingSummaryBlock().

TObjArray* RawLITimingSummaryBlock::fRawTimingSums [mutable, protected]

not written out

Definition at line 76 of file RawLITimingSummaryBlock.h.

Referenced by At(), FillRawTimingSums(), GetDatumIter(), GetNumberOfSummaries(), IndexOf(), operator=(), and ~RawLITimingSummaryBlock().


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 00:56:21 2014 for loon by  doxygen 1.4.7