Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawLIHeader Class Reference

#include <RawLIHeader.h>

Inheritance diagram for RawLIHeader:

RawLIHeaderInterface List of all members.

Public Member Functions

 RawLIHeader ()
 RawLIHeader (RawBlockId rbid, const Int_t *&p)
virtual ~RawLIHeader ()
Short_t GetCalibType () const
Short_t GetCalibPoint () const
Short_t GetPulserBox () const
Short_t GetLed () const
Short_t GetPulseHeight () const
Short_t GetPulseWidth () const
Short_t GetPulses () const
Short_t GetPeriod () const
Int_t GetCount () const
VldContext GetVldContext () const
VldTimeStamp GetTimeStamp () const
Int_t GetSpareSize () const
const Int_t * GetSpares () const
virtual void Print (Option_t *option="") const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const

Protected Attributes

Short_t fCalibType
Short_t fCalibPoint
Short_t fPulserBox
Short_t fLed
Short_t fPulseHeight
Short_t fPulseWidth
Short_t fPulses
Short_t fPeriod
Int_t fCount
VldContext fVldContext
Int_t fSpareSize
Int_t * fSpares

Constructor & Destructor Documentation

RawLIHeader::RawLIHeader  ) 
 

Definition at line 29 of file RawLIHeader.cxx.

00030    : fCalibType(-1), fCalibPoint(-1), fPulserBox(-1), fLed(-1),
00031      fPulseHeight(-1), fPulseWidth(-1), fPulses(-1), fPeriod(-1),
00032      fSpareSize(0), fSpares(0)
00033 {
00034    // Default constructor
00035 }

RawLIHeader::RawLIHeader RawBlockId  rbid,
const Int_t *&  p
 

Definition at line 38 of file RawLIHeader.cxx.

References det, fCalibPoint, fCalibType, fCount, fLed, fPeriod, fPulseHeight, fPulserBox, fPulses, fPulseWidth, fSpares, fSpareSize, fVldContext, RawBlockId::GetDetector(), RawBlockId::GetMinor(), and RawBlockId::GetSimFlag().

00039   : fSpareSize(0), fSpares(0)
00040 {
00041    // assume pointer is at block that looks like:
00042    //------------------------
00043    //  0   CalibType   | CalibPoint#
00044    //  1   PulserBox # | LED #
00045    //  2   PulseHeight | PulseWidth
00046    //  3   # pulses    | flashing frequency(period)
00047    //  4   T0 (1st ROP) sec
00048    //  5   T0 (1st ROP) nsec
00049    //  6   spare field 0 (v0,v1) : # pulses used in this summary (v2)
00050    //  7   spare field 1 (v0,v1) : spare field 0  (v2)
00051 
00052    const Int_t maskShort = 0xffff;
00053 
00054    fCalibType   = (*p >> 16) & maskShort;
00055    fCalibPoint  =  *p        & maskShort;
00056    p++;
00057 
00058    fPulserBox   = (*p >> 16) & maskShort;
00059    fLed         =  *p        & maskShort;
00060    p++;
00061 
00062    fPulseHeight = (*p >> 16) & maskShort;
00063    fPulseWidth  =  *p        & maskShort;
00064    p++;
00065 
00066    fPulses      = (*p >> 16) & maskShort;
00067    fPeriod      =  *p        & maskShort;
00068    p++;
00069 
00070    Detector::Detector_t det = rbid.GetDetector();
00071    SimFlag::SimFlag_t mcflag = rbid.GetSimFlag();
00072    // bad ordering:   VldTimeStamp timestamp(*p++,*p++);
00073    Int_t sec = *p++;
00074    Int_t ns  = *p++;
00075    VldTimeStamp timestamp(sec,ns);
00076    fVldContext = VldContext(det,mcflag,timestamp);
00077 
00078    if (rbid.GetMinor()<2) {
00079       fCount = 0; // didn't exist for version < 2
00080       fSpareSize = 2;
00081    } else {
00082       fCount = *p; p++;
00083       fSpareSize = 1;
00084    }
00085 
00086    if (fSpareSize>0) {
00087       fSpares = new Int_t [fSpareSize];
00088       memcpy(fSpares,p,sizeof(Int_t)*fSpareSize);
00089       p += fSpareSize;
00090    }
00091 
00092 }

RawLIHeader::~RawLIHeader  )  [virtual]
 

Definition at line 95 of file RawLIHeader.cxx.

00096 {
00097    // delete all owned sub-objects
00098    if (fSpares) delete [] fSpares;
00099 }


Member Function Documentation

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

Definition at line 108 of file RawLIHeader.cxx.

References fCalibPoint, fCalibType, fLed, fPeriod, fPulserBox, fPulses, fSpares, fSpareSize, fVldContext, and Nav::GetName().

Referenced by Print().

00110 {
00111   MsgFormat cfmt("%5d");
00112   MsgFormat sfmt("%10d");
00113   MsgFormat xfmt("%08x");
00114 
00115   os << " " << GetName()
00116      << endl
00117      << " VldContext " << fVldContext
00118      << endl
00119      << " CalibType  " << cfmt(fCalibType) 
00120      << " CalibPoint " << cfmt(fCalibPoint)
00121      << " PulserBox  " << cfmt(fPulserBox) 
00122      << " LED        " << cfmt(fLed)
00123      << endl
00124      << " Pulses     " << cfmt(fPulses)
00125      << " Period     " << cfmt(fPeriod)
00126      << endl
00127      << " nSpares    " << fSpareSize
00128      << endl;
00129   if (fSpares)
00130      for (Int_t i=0; i<fSpareSize; i++) 
00131         os << "  " << i << "  " << sfmt(fSpares[i])
00132            << " 0x" << xfmt(fSpares[i]) << endl;
00133   else os << " fSpares not allocated?" << endl;
00134      
00135   return os;
00136 }

Short_t RawLIHeader::GetCalibPoint  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 33 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetCalibPoint(), and RawLIAdcSummaryBlock::GetCalibPoint().

00033 { return fCalibPoint; }

Short_t RawLIHeader::GetCalibType  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 32 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetCalibType(), RawLIAdcSummaryBlock::GetCalibType(), RawLITimingSummaryBlock::GetSpareSize(), and RawLIAdcSummaryBlock::GetSpareSize().

00032 { return fCalibType; }

Int_t RawLIHeader::GetCount  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 40 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetCount(), and RawLIAdcSummaryBlock::GetCount().

00040 { return fCount; }

Short_t RawLIHeader::GetLed  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 35 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetLed(), and RawLIAdcSummaryBlock::GetLed().

00035 { return fLed; }

Short_t RawLIHeader::GetPeriod  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 39 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetPeriod(), and RawLIAdcSummaryBlock::GetPeriod().

00039 { return fPeriod; }

Short_t RawLIHeader::GetPulseHeight  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 36 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetPulseHeight(), and RawLIAdcSummaryBlock::GetPulseHeight().

00036 { return fPulseHeight; }

Short_t RawLIHeader::GetPulserBox  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 34 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetPulserBox(), and RawLIAdcSummaryBlock::GetPulserBox().

00034 { return fPulserBox; }

Short_t RawLIHeader::GetPulses  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 38 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetPulses(), and RawLIAdcSummaryBlock::GetPulses().

00038 { return fPulses; }

Short_t RawLIHeader::GetPulseWidth  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 37 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetPulseWidth(), and RawLIAdcSummaryBlock::GetPulseWidth().

00037 { return fPulseWidth; }

const Int_t* RawLIHeader::GetSpares  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 46 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetSpares(), and RawLIAdcSummaryBlock::GetSpares().

00046 { return fSpares; }

Int_t RawLIHeader::GetSpareSize  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 45 of file RawLIHeader.h.

00045 { return fSpareSize; }

VldTimeStamp RawLIHeader::GetTimeStamp  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 43 of file RawLIHeader.h.

References fVldContext, and VldContext::GetTimeStamp().

Referenced by RawLITimingSummaryBlock::GetTimeStamp(), and RawLIAdcSummaryBlock::GetTimeStamp().

00043 { return fVldContext.GetTimeStamp(); }

VldContext RawLIHeader::GetVldContext  )  const [inline, virtual]
 

Implements RawLIHeaderInterface.

Definition at line 42 of file RawLIHeader.h.

Referenced by RawLITimingSummaryBlock::GetVldContext(), and RawLIAdcSummaryBlock::GetVldContext().

00042 { return fVldContext; }

void RawLIHeader::Print Option_t *  option = ""  )  const [virtual]
 

Definition at line 102 of file RawLIHeader.cxx.

References FormatToOStream(), and option.

Referenced by RawLIAdcSummaryBlock::FillRawAdcSums(), and RawLITimingSummaryBlock::FillRawTimingSums().

00103 {
00104    FormatToOStream(cout,option);
00105 }


Member Data Documentation

Short_t RawLIHeader::fCalibPoint [protected]
 

Definition at line 55 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Short_t RawLIHeader::fCalibType [protected]
 

Definition at line 54 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Int_t RawLIHeader::fCount [protected]
 

Definition at line 62 of file RawLIHeader.h.

Referenced by RawLIHeader().

Short_t RawLIHeader::fLed [protected]
 

Definition at line 57 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Short_t RawLIHeader::fPeriod [protected]
 

Definition at line 61 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Short_t RawLIHeader::fPulseHeight [protected]
 

Definition at line 58 of file RawLIHeader.h.

Referenced by RawLIHeader().

Short_t RawLIHeader::fPulserBox [protected]
 

Definition at line 56 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Short_t RawLIHeader::fPulses [protected]
 

Definition at line 60 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Short_t RawLIHeader::fPulseWidth [protected]
 

Definition at line 59 of file RawLIHeader.h.

Referenced by RawLIHeader().

Int_t* RawLIHeader::fSpares [protected]
 

Definition at line 67 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

Int_t RawLIHeader::fSpareSize [protected]
 

Definition at line 66 of file RawLIHeader.h.

Referenced by FormatToOStream(), and RawLIHeader().

VldContext RawLIHeader::fVldContext [protected]
 

Definition at line 64 of file RawLIHeader.h.

Referenced by FormatToOStream(), GetTimeStamp(), and RawLIHeader().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:10 2010 for loon by  doxygen 1.3.9.1