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

RawBlockId Class Reference

#include <RawBlockId.h>

List of all members.

Public Member Functions

 RawBlockId ()
 RawBlockId (Int_t major, Int_t minor, Bool_t isDCS, Detector::Detector_t detector, SimFlag::SimFlag_t simflag)
virtual ~RawBlockId ()
 RawBlockId (const Int_t encoded)
Int_t GetEncoded () const
const Char_t * AsString (Option_t *option="") const
Int_t GetMajor () const
const Char_t * GetMajorAsString () const
Int_t GetMinor () const
Bool_t IsDCS () const
Detector::Detector_t GetDetector () const
SimFlag::SimFlag_t GetSimFlag () const
void Print (Option_t *option="") const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const

Protected Attributes

Int_t fEncoded

Friends

Bool_t operator== (const RawBlockId &lhs, const RawBlockId &rhs)
Bool_t operator!= (const RawBlockId &lhs, const RawBlockId &rhs)


Constructor & Destructor Documentation

RawBlockId::RawBlockId  )  [inline]
 

Definition at line 107 of file RawBlockId.h.

References defaultRawBlockId.

00107 : fEncoded(defaultRawBlockId) { ; }

RawBlockId::RawBlockId Int_t  major,
Int_t  minor,
Bool_t  isDCS,
Detector::Detector_t  detector,
SimFlag::SimFlag_t  simflag
 

Definition at line 35 of file RawBlockId.cxx.

References SimFlag::Compact(), fEncoded, and maskRawBlkIdIsDCS.

00038    : fEncoded(0)
00039 {
00040    // Normal ctor
00041 
00042    Int_t cmptSimFlag = SimFlag::Compact(simflag);
00043 
00044    fEncoded = 
00045       ((cmptSimFlag << shiftRawBlkIdCSimFlag) & maskRawBlkIdCSimFlag) |
00046       ((   detector << shiftRawBlkIdDetector) & maskRawBlkIdDetector) |
00047       ((isDCS) ? maskRawBlkIdIsDCS : 0)                               |
00048       ((         major << shiftRawBlkIdMajor) & maskRawBlkIdMajor)    |
00049       ((         minor << shiftRawBlkIdMinor) & maskRawBlkIdMinor);
00050 
00051 }

RawBlockId::~RawBlockId  )  [inline, virtual]
 

Definition at line 108 of file RawBlockId.h.

00108 { ; }

RawBlockId::RawBlockId const Int_t  encoded  )  [inline]
 

Definition at line 110 of file RawBlockId.h.

00110 : fEncoded(encoded) { ; }


Member Function Documentation

const Char_t * RawBlockId::AsString Option_t *  option = ""  )  const
 

Definition at line 54 of file RawBlockId.cxx.

References GetDetector(), GetMajor(), GetMajorAsString(), GetMinor(), GetSimFlag(), IsDCS(), and option.

Referenced by RotoObjectifier::BufferInflate(), RawVaTimingMonitorBlock::FillRawDigits(), RawLiTpmtDigitsBlock::FillRawDigits(), RawDigitDataBlock::FillRawDigits(), RawTOFBlock::FillRawTOFDigits(), RerootToRawDataModule::FinalizeWorkingArray(), RawDataBlock::FormatToOStream(), and FormatToOStream().

00055 {
00056    // Return unpacked RawBlockId as a string
00057    // User should copy result because it points to a 
00058    // statically allocated string.
00059    // Internally uses a circular list of buffers to avoid problems
00060    // using AsString multiple times in a cout-like situation.
00061 
00062    const int nbuffers = 8;  // use a circular list of strings
00063    static char newstring[nbuffers][128];
00064    static int ibuffer = nbuffers;
00065    ibuffer = (ibuffer+1)%nbuffers;  // each time move to next buffer
00066 
00067    switch (option[0]) {
00068    case 'c':
00069       // compact rendering "DCS:225;225(F+D)"
00070       sprintf(newstring[ibuffer],"%3s:%3.3d;%3.3d(%1.1s+%1.1s)"
00071               ,(IsDCS() ? "DCS" : "DAQ")
00072               ,GetMajor(),GetMinor()
00073               ,Detector::AsString(GetDetector())
00074               ,SimFlag::AsString(GetSimFlag())
00075               );
00076       break;
00077    default:
00078       // expanded rendering "DCS:RawDigitDataBlock;225(Far+Data)"
00079       sprintf(newstring[ibuffer],"%3s:%s;%3.3d(%s+%s)"
00080               ,(IsDCS() ? "DCS" : "DAQ")
00081               ,GetMajorAsString(),GetMinor()
00082               ,Detector::AsString(GetDetector())
00083               ,SimFlag::AsString(GetSimFlag())
00084               );
00085       break;
00086    }
00087    
00088    return newstring[ibuffer];
00089 }

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

Definition at line 120 of file RawBlockId.cxx.

References AsString(), and option.

Referenced by Print().

00122 {
00123    if (os.good()) {
00124       if (os.tie()) os.tie()->flush(); // instead of opfx
00125       os << AsString(option);
00126    }
00127    // instead of os.osfx()
00128    if (os.flags() & std::ios::unitbuf) os.flush();
00129    return os;
00130 }

Detector::Detector_t RawBlockId::GetDetector  )  const [inline]
 

Definition at line 125 of file RawBlockId.h.

References fEncoded.

Referenced by FarPlaneCheckout::Ana(), AsString(), RawLITimingSummary::BuildRawChannelId(), RawLIAdcSummary::BuildRawChannelId(), RawDigit::BuildRawChannelId(), RotoObjectifier::BuildRecord(), RawQieErrorStatsBlock::FillAllMaps(), RawDeadChipBlock::FillDeadChannels(), RawOvershootBlock::FillOvershootChannels(), RawVaTimingMonitorBlock::FillRawDigits(), RawLiTpmtDigitsBlock::FillRawDigits(), RawDigitDataBlock::FillRawDigits(), RawDcsEnvMonitorBlock::GetEnvDetector(), RawDcsHvMonitorBlock::GetHvDetector(), RawDcsMagnetMonitorBlock::GetMagDetector(), RawCrateMonitorBlock::GetMasterMonitor(), RawPedestalTableBlock::GetPedValue(), RawSparsifierTableBlock::GetThresholdValue(), RawVtmTimeInfoBlock::GetVldContext(), RawVaTimingMonitorBlock::GetVldContext(), RawTriggerStatsBlock::GetVldContext(), RawSubRunEndBlock::GetVldContext(), RawSpillServerMonitorBlock::GetVldContext(), RawSnarlHeaderBlock::GetVldContext(), RawRunStartBlock::GetVldContext(), RawRunEndBlock::GetVldContext(), RawRunConfigBlock::GetVldContext(), RawRunCommentBlock::GetVldContext(), RawQieErrorStatsBlock::GetVldContext(), RawLiTpmtDigitsBlock::GetVldContext(), RawErrorStatsBlock::GetVldContext(), RawDigitDataBlock::GetVldContext(), RawDcsRpsMonitorBlock::GetVldContext(), RawDcsMagnetMonitorBlock::GetVldContext(), RawDcsHvMonitorBlock::GetVldContext(), RawDcsHeaderBlock::GetVldContext(), RawDcsEnvMonitorBlock::GetVldContext(), RawDcsChillerMonitorBlock::GetVldContext(), RawDcsCanMonitorBlock::GetVldContext(), RawDaqHeaderBlock::GetVldContext(), RawDaqDeadTimeBlock::GetVldContext(), RawCrateMonitorBlock::GetVldContext(), RawConfigFilesBlock::GetVldContext(), RawBeamMonHeaderBlock::GetVldContext(), RawLIHeader::RawLIHeader(), AlgCalDetSI::RunAlg(), RawTpSinglesSummaryBlock::UnpackQieRates(), RawTpSinglesSummaryBlock::UnpackVaRates(), RawCrateMonitorBlock::UnpackVfbMonitors(), DbuDaqMonitorModule::WriteVaChipPedsEntry(), and DbuDaqMonitorModule::WriteVaChipSparsEntry().

00126 { 
00127    Int_t bitField = (fEncoded & maskRawBlkIdDetector) >> shiftRawBlkIdDetector;
00128    return (Detector::Detector_t) bitField;   
00129 }

Int_t RawBlockId::GetEncoded  )  const [inline]
 

Definition at line 111 of file RawBlockId.h.

Referenced by RawTofConverter::ConstructTofBlocks(), RerootToRawDataModule::FinalizeWorkingArray(), RawDataBlock::FormatToOStream(), RecordSetupModule::Get(), DigitListModule::Get(), and RawTpSinglesSummaryBlock::RawTpSinglesSummaryBlock().

00112 { return fEncoded; }

Int_t RawBlockId::GetMajor  )  const [inline]
 

Definition at line 114 of file RawBlockId.h.

References fEncoded.

Referenced by FarPlaneCheckout::Ana(), AsString(), RotoObjectifier::BufferInflate(), GetMajorAsString(), Cutter::OverShootCutter(), RawRecord::PromoteRawDataBlocks(), and AlgCalDetSI::SetDataPointers().

00115 { return (fEncoded & maskRawBlkIdMajor) >> shiftRawBlkIdMajor; }

const Char_t * RawBlockId::GetMajorAsString  )  const
 

Definition at line 92 of file RawBlockId.cxx.

References GetMajor(), RawBlockProxy::GetName(), RawBlockRegistry::Instance(), IsDCS(), and RawBlockRegistry::LookUp().

Referenced by AsString().

00093 {
00094    // Return major id # expanded as a string
00095 
00096    RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00097    RawBlockProxy*    rbp = rbr.LookUp(IsDCS(),GetMajor());
00098 
00099    static char unknownstring[128];
00100 
00101    if (rbp) {
00102       return rbp->GetName();
00103    } 
00104    else {
00105       sprintf(unknownstring,"Unknown%3sBlock0x%2.2x",
00106               (IsDCS() ? "DCS" : "DAQ"),GetMajor());
00107       return unknownstring;
00108    }
00109 
00110 }

Int_t RawBlockId::GetMinor  )  const [inline]
 

Definition at line 117 of file RawBlockId.h.

References fEncoded.

Referenced by FarPlaneCheckout::Ana(), AsString(), RawLIAdcSummaryBlock::FillRawAdcSums(), RawLITimingSummaryBlock::FillRawTimingSums(), RawSubRunEndBlock::FormatToOStream(), RawRunEndBlock::FormatToOStream(), RawRunCommentBlock::FormatToOStream(), RawSubRunEndBlock::GetDeadTime(), RawRunEndBlock::GetDeadTime(), RawSubRunEndBlock::GetDroppedTimeFrames(), RawRunEndBlock::GetDroppedTimeFrames(), RawLITimingSummary::GetMean(), RawLIAdcSummary::GetMean(), RawDataBlock::GetMinorId(), RawTOFDigit::GetNumberOfEntries(), RawLITimingSummary::GetRms(), RawLIAdcSummary::GetRms(), RawRunCommentBlock::GetRun(), RawRunCommentBlock::GetRunComment(), RawRunCommentBlock::GetRunType(), RawRunCommentBlock::GetSubRun(), RawTOFDigit::GetTdcArraySize(), RawRunCommentBlock::GetTime(), RawSubRunEndBlock::GetTotalTimeFrames(), RawRunEndBlock::GetTotalTimeFrames(), RawLIAdcSummary::RawLIAdcSummary(), RawLIHeader::RawLIHeader(), RawLITimingSummary::RawLITimingSummary(), and RawTpSinglesSummaryBlock::UnpackRates().

00118 { return (fEncoded & maskRawBlkIdMinor) >> shiftRawBlkIdMinor; }

SimFlag::SimFlag_t RawBlockId::GetSimFlag  )  const [inline]
 

Definition at line 131 of file RawBlockId.h.

References SimFlag::Expand(), and fEncoded.

Referenced by AsString(), RotoObjectifier::BuildRecord(), RawLIAdcSummaryBlock::FillRawAdcSums(), RawVaTimingMonitorBlock::FillRawDigits(), RawLiTpmtDigitsBlock::FillRawDigits(), RawDigitDataBlock::FillRawDigits(), RawLITimingSummaryBlock::FillRawTimingSums(), RawTOFBlock::FillRawTOFDigits(), RawVtmTimeInfoBlock::GetVldContext(), RawVaTimingMonitorBlock::GetVldContext(), RawTriggerStatsBlock::GetVldContext(), RawSubRunEndBlock::GetVldContext(), RawSpillServerMonitorBlock::GetVldContext(), RawSnarlHeaderBlock::GetVldContext(), RawRunStartBlock::GetVldContext(), RawRunEndBlock::GetVldContext(), RawRunConfigBlock::GetVldContext(), RawRunCommentBlock::GetVldContext(), RawQieErrorStatsBlock::GetVldContext(), RawLiTpmtDigitsBlock::GetVldContext(), RawErrorStatsBlock::GetVldContext(), RawDigitDataBlock::GetVldContext(), RawDcsRpsMonitorBlock::GetVldContext(), RawDcsMagnetMonitorBlock::GetVldContext(), RawDcsHvMonitorBlock::GetVldContext(), RawDcsHeaderBlock::GetVldContext(), RawDcsEnvMonitorBlock::GetVldContext(), RawDcsChillerMonitorBlock::GetVldContext(), RawDcsCanMonitorBlock::GetVldContext(), RawDaqHeaderBlock::GetVldContext(), RawDaqDeadTimeBlock::GetVldContext(), RawCrateMonitorBlock::GetVldContext(), RawConfigFilesBlock::GetVldContext(), RawBeamMonHeaderBlock::GetVldContext(), RawLIHeader::RawLIHeader(), DbuDaqMonitorModule::WriteVaChipPedsEntry(), and DbuDaqMonitorModule::WriteVaChipSparsEntry().

00132 {
00133    Int_t bitField = (fEncoded & maskRawBlkIdCSimFlag) >> shiftRawBlkIdCSimFlag;
00134    return SimFlag::Expand(bitField);
00135 }

Bool_t RawBlockId::IsDCS  )  const [inline]
 

Definition at line 120 of file RawBlockId.h.

References fEncoded.

Referenced by FarPlaneCheckout::Ana(), AsString(), RotoObjectifier::BufferInflate(), GetMajorAsString(), and RawRecord::PromoteRawDataBlocks().

00121 {
00122    return (fEncoded & maskRawBlkIdIsDCS) >> shiftRawBlkIdIsDCS;
00123 }

void RawBlockId::Print Option_t *  option = ""  )  const
 

Definition at line 113 of file RawBlockId.cxx.

References FormatToOStream(), and option.

00114 {
00115    // Print the (decoded) value
00116    FormatToOStream(cout,option);
00117 }


Friends And Related Function Documentation

Bool_t operator!= const RawBlockId lhs,
const RawBlockId rhs
[friend]
 

Definition at line 104 of file RawBlockId.h.

00105 { return (lhs.fEncoded) != (rhs.fEncoded); }

Bool_t operator== const RawBlockId lhs,
const RawBlockId rhs
[friend]
 

Definition at line 101 of file RawBlockId.h.

00102 { return (lhs.fEncoded) == (rhs.fEncoded); }


Member Data Documentation

Int_t RawBlockId::fEncoded [protected]
 

Definition at line 57 of file RawBlockId.h.

Referenced by GetDetector(), GetMajor(), GetMinor(), GetSimFlag(), IsDCS(), operator!=(), operator==(), and RawBlockId().


The documentation for this class was generated from the following files:
Generated on Sat Nov 7 01:32:10 2009 for loon by  doxygen 1.3.9.1