CMS 3D CMS Logo

sistrip::FEDBuffer Class Reference

#include <EventFilter/SiStripRawToDigi/interface/SiStripFEDBuffer.h>

Inheritance diagram for sistrip::FEDBuffer:

sistrip::FEDBufferBase

List of all members.

Public Member Functions

const FEDChannelchannel (uint8_t internalFEUnitNum, uint8_t internalChannelNum) const
const FEDChannelchannel (uint8_t internalFEDChannelNum) const
bool channelGood (uint8_t internalFEUnitNum, uint8_t internalChannelNum) const
bool channelGood (uint8_t internalFEDChannelNum) const
bool checkAllChannelStatusBits () const
bool checkChannelLengths () const
bool checkChannelLengthsMatchBufferLength () const
bool checkChannelPacketCodes () const
bool checkFEUnitAPVAddresses () const
bool checkFEUnitLengths () const
bool checkStatusBits (uint8_t internalFEUnitNum, uint8_t internalChannelNum) const
bool checkStatusBits (uint8_t internalFEDChannelNum) const
virtual std::string checkSummary () const
virtual bool doChecks () const
virtual bool doCorruptBufferChecks () const
 FEDBuffer (const uint8_t *fedBuffer, size_t fedBufferSize, bool allowBadBuffer=false)
bool feGood (uint8_t internalFEUnitNum) const
const FEDFEHeaderfeHeader () const
virtual void print (std::ostream &os) const
virtual ~FEDBuffer ()

Private Member Functions

uint16_t calculateFEUnitLength (uint8_t internalFEUnitNumber) const
bool fePresent (uint8_t internalFEUnitNum) const
void findChannels ()
uint8_t getCorrectPacketCode () const
uint8_t nFEUnitsPresent () const

Private Attributes

std::vector< FEDChannelchannels_
std::auto_ptr< FEDFEHeaderfeHeader_
bool fePresent_ [FEUNITS_PER_FED]
uint8_t lastValidChannel_
uint16_t payloadLength_
uint8_t * payloadPointer_


Detailed Description

Definition at line 121 of file SiStripFEDBuffer.h.


Constructor & Destructor Documentation

sistrip::FEDBuffer::FEDBuffer ( const uint8_t *  fedBuffer,
size_t  fedBufferSize,
bool  allowBadBuffer = false 
)

Definition at line 11 of file SiStripFEDBuffer.cc.

References channels_, e, Exception, sistrip::FEDCH_PER_FED, feHeader_, sistrip::FEDFullDebugHeader::fePresent(), fePresent_, sistrip::FEUNITS_PER_FED, findChannels(), sistrip::FEDBufferBase::getPointerToByteAfterEndOfPayload(), sistrip::FEDBufferBase::getPointerToDataAfterTrackerSpecialHeader(), sistrip::HEADER_TYPE_INVALID, sistrip::FEDBufferBase::headerType(), sistrip::TrackerSpecialHeader::headerTypeNibble(), lastValidChannel_, sistrip::FEDFEHeader::newFEHeader(), payloadLength_, payloadPointer_, sistrip::printHex(), ss, and sistrip::FEDBufferBase::trackerSpecialHeader().

00012     : FEDBufferBase(fedBuffer,fedBufferSize,allowBadBuffer)
00013   {
00014     channels_.reserve(FEDCH_PER_FED);
00015     //build the correct type of FE header object
00016     if (headerType() != HEADER_TYPE_INVALID) {
00017       feHeader_ = FEDFEHeader::newFEHeader(headerType(),getPointerToDataAfterTrackerSpecialHeader());
00018       payloadPointer_ = getPointerToDataAfterTrackerSpecialHeader()+feHeader_->lengthInBytes();
00019     } else {
00020       feHeader_ = std::auto_ptr<FEDFEHeader>();
00021       payloadPointer_ = getPointerToDataAfterTrackerSpecialHeader();
00022       if (!allowBadBuffer) {
00023         std::ostringstream ss;
00024         ss << "Header type is invalid. "
00025            << "Header type nibble is ";
00026         uint8_t headerNibble = trackerSpecialHeader().headerTypeNibble();
00027         printHex(&headerNibble,1,ss);
00028         ss << ". ";
00029         throw cms::Exception("FEDBuffer") << ss;
00030       }
00031     }
00032     payloadLength_ = getPointerToByteAfterEndOfPayload()-payloadPointer_;
00033     //check if FE units are present in data
00034     //only possible for FullDebug header
00035     const FEDFullDebugHeader* fdHeader = dynamic_cast<FEDFullDebugHeader*>(feHeader_.get());
00036     if (fdHeader) {
00037       for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
00038         if (fdHeader->fePresent(iFE)) fePresent_[iFE] = true;
00039         else fePresent_[iFE] = false;
00040       }
00041     } else {
00042       memset(fePresent_,true,FEUNITS_PER_FED);
00043     }
00044     //try to find channels
00045     lastValidChannel_ = 0;
00046     try {
00047       findChannels();
00048     } catch (const cms::Exception& e) {
00049       //if there was a problem either rethrow the exception or just mark channel pointers NULL
00050       if (!allowBadBuffer) throw;
00051       else {
00052         channels_.insert(channels_.end(),size_t(FEDCH_PER_FED-lastValidChannel_),FEDChannel(payloadPointer_,0));
00053       }
00054     }
00055   }

sistrip::FEDBuffer::~FEDBuffer (  )  [virtual]

Definition at line 57 of file SiStripFEDBuffer.cc.

00058   {
00059   }


Member Function Documentation

uint16_t sistrip::FEDBuffer::calculateFEUnitLength ( uint8_t  internalFEUnitNumber  )  const [private]

Definition at line 221 of file SiStripFEDBuffer.cc.

References channels_, sistrip::FEDCH_PER_FEUNIT, and sistrip::internalFEDChannelNum().

Referenced by checkFEUnitLengths(), and checkSummary().

00222   {
00223     //get length from channels
00224     uint16_t lengthFromChannels = 0;
00225     for (uint8_t iCh = 0; iCh < FEDCH_PER_FEUNIT; iCh++) {
00226       lengthFromChannels += channels_[internalFEDChannelNum(internalFEUnitNumber,iCh)].length();
00227     }
00228     return lengthFromChannels;
00229   }

const FEDChannel& sistrip::FEDBuffer::channel ( uint8_t  internalFEUnitNum,
uint8_t  internalChannelNum 
) const [inline]

Definition at line 138 of file SiStripFEDBuffer.h.

References channel(), and sistrip::internalFEDChannelNum().

00139         { return channel(internalFEDChannelNum(internalFEUnitNum,internalChannelNum)); }

const FEDChannel& sistrip::FEDBuffer::channel ( uint8_t  internalFEDChannelNum  )  const [inline]

Definition at line 137 of file SiStripFEDBuffer.h.

References channels_.

Referenced by channel().

00137 { return channels_[internalFEDChannelNum]; }

bool sistrip::FEDBuffer::channelGood ( uint8_t  internalFEUnitNum,
uint8_t  internalChannelNum 
) const [inline]

Definition at line 134 of file SiStripFEDBuffer.h.

References channelGood(), and sistrip::internalFEDChannelNum().

00135         { return channelGood(internalFEDChannelNum(internalFEUnitNum,internalChannelNum)); }

bool sistrip::FEDBuffer::channelGood ( uint8_t  internalFEDChannelNum  )  const [inline]

Definition at line 235 of file SiStripFEDBuffer.h.

References checkStatusBits(), sistrip::FEDCH_PER_FEUNIT, feGood(), and lastValidChannel_.

Referenced by channelGood(), and checkChannelPacketCodes().

bool sistrip::FEDBuffer::checkAllChannelStatusBits (  )  const

Definition at line 120 of file SiStripFEDBuffer.cc.

References checkStatusBits(), sistrip::FEDCH_PER_FED, sistrip::FEDCH_PER_FEUNIT, and feGood().

Referenced by checkSummary().

00121   {
00122     for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
00123       //if FE unit is disabled then skip all channels on it
00124       if (!feGood(iCh/FEDCH_PER_FEUNIT)) {
00125         iCh += FEDCH_PER_FEUNIT;
00126         continue;
00127       }
00128       //channel is bad then return false
00129       if (!checkStatusBits(iCh)) return false;
00130     }
00131     //if no bad channels have been found then they are all fine
00132     return true;
00133   }

bool sistrip::FEDBuffer::checkChannelLengths (  )  const

Definition at line 135 of file SiStripFEDBuffer.cc.

References sistrip::FEDCH_PER_FED, and lastValidChannel_.

Referenced by checkChannelLengthsMatchBufferLength().

00136   {
00137     return (lastValidChannel_ == FEDCH_PER_FED);
00138   }

bool sistrip::FEDBuffer::checkChannelLengthsMatchBufferLength (  )  const

Definition at line 140 of file SiStripFEDBuffer.cc.

References channels_, checkChannelLengths(), sistrip::FEDCH_PER_FEUNIT, feGood(), sistrip::internalFEDChannelNum(), sistrip::FEDChannel::length(), sistrip::FEDChannel::offset(), and payloadLength_.

Referenced by checkSummary(), and doCorruptBufferChecks().

00141   {
00142     //check they fit into buffer
00143     if (!checkChannelLengths()) return false;
00144   
00145     //payload length from length of data buffer
00146     const size_t payloadLengthInWords = payloadLength_/8;
00147   
00148     //find channel length
00149     //find last enabled FE unit
00150     uint8_t lastEnabledFeUnit = 7;
00151     while (!feGood(lastEnabledFeUnit)) lastEnabledFeUnit--;
00152     //last channel is last channel on last enabled FE unit
00153     const FEDChannel& lastChannel = channels_[internalFEDChannelNum(lastEnabledFeUnit,FEDCH_PER_FEUNIT-1)];
00154     const size_t offsetLastChannel = lastChannel.offset();
00155     const size_t offsetEndOfChannelData = offsetLastChannel+lastChannel.length();
00156     const size_t channelDataLength = offsetEndOfChannelData;
00157     //channel length in words is length in bytes rounded up to nearest word
00158     size_t channelDataLengthInWords = channelDataLength/8;
00159     if (channelDataLength % 8) channelDataLengthInWords++;
00160   
00161     //check lengths match
00162     if (channelDataLengthInWords == payloadLengthInWords) {
00163       return true;
00164     } else {
00165       return false;
00166     }
00167   }

bool sistrip::FEDBuffer::checkChannelPacketCodes (  )  const

Definition at line 169 of file SiStripFEDBuffer.cc.

References channelGood(), channels_, sistrip::FEDCH_PER_FED, sistrip::FEDCH_PER_FEUNIT, feGood(), and getCorrectPacketCode().

Referenced by checkSummary(), and doCorruptBufferChecks().

00170   {
00171     uint8_t correctPacketCode = getCorrectPacketCode();
00172     //if the readout mode if not one which has a packet code then this is set to zero. in this case return true
00173     if (!correctPacketCode) return true;
00174     for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
00175       //if FE unit is disabled then skip all channels on it
00176       if (!feGood(iCh/FEDCH_PER_FEUNIT)) {
00177         iCh += FEDCH_PER_FEUNIT;
00178         continue;
00179       }
00180       //only check enabled, working channels
00181       if (channelGood(iCh)) {
00182         //if a channel is bad then return false
00183         if (channels_[iCh].packetCode() != correctPacketCode) return false;
00184       }
00185     }
00186     //if no bad channels were found the they are all ok
00187     return true;
00188   }

bool sistrip::FEDBuffer::checkFEUnitAPVAddresses (  )  const

Definition at line 190 of file SiStripFEDBuffer.cc.

References sistrip::FEDBufferBase::apveAddress(), feGood(), feHeader_, sistrip::FEDFullDebugHeader::feUnitMajorityAddress(), and sistrip::FEUNITS_PER_FED.

Referenced by checkSummary().

00191   {
00192     //check can only be done for full debug headers
00193     const FEDFullDebugHeader* fdHeader = dynamic_cast<FEDFullDebugHeader*>(feHeader_.get());
00194     if (!fdHeader) return true;
00195     //get golden address
00196     const uint8_t goldenAddress = apveAddress();
00197     //check all enabled FE units
00198     for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
00199       if (!feGood(iFE)) continue;
00200       //if address is bad then return false
00201       if (fdHeader->feUnitMajorityAddress(iFE) != goldenAddress) return false;
00202     }
00203     //if no bad addresses were found then return true
00204     return true;
00205   }

bool sistrip::FEDBuffer::checkFEUnitLengths (  )  const

Definition at line 207 of file SiStripFEDBuffer.cc.

References calculateFEUnitLength(), feGood(), feHeader_, sistrip::FEDFullDebugHeader::feUnitLength(), and sistrip::FEUNITS_PER_FED.

Referenced by checkSummary(), and doCorruptBufferChecks().

00208   {
00209     //check can only be done for full debug headers
00210     const FEDFullDebugHeader* fdHeader = dynamic_cast<FEDFullDebugHeader*>(feHeader_.get());
00211     if (!fdHeader) return true;
00212     //check lengths for enabled FE units
00213     for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
00214       if (!feGood(iFE)) continue;
00215       if (calculateFEUnitLength(iFE) != fdHeader->feUnitLength(iFE)) return false;
00216     }
00217     //if no errors were encountered then return true
00218     return true;
00219   }

bool sistrip::FEDBuffer::checkStatusBits ( uint8_t  internalFEUnitNum,
uint8_t  internalChannelNum 
) const [inline]

Definition at line 162 of file SiStripFEDBuffer.h.

References checkStatusBits(), and sistrip::internalFEDChannelNum().

00163         { return checkStatusBits(internalFEDChannelNum(internalFEUnitNum,internalChannelNum)); }

bool sistrip::FEDBuffer::checkStatusBits ( uint8_t  internalFEDChannelNum  )  const [inline]

Definition at line 161 of file SiStripFEDBuffer.h.

References feHeader_.

Referenced by channelGood(), checkAllChannelStatusBits(), checkStatusBits(), and checkSummary().

00161 { return feHeader_->checkChannelStatusBits(internalFEDChannelNum); }

std::string sistrip::FEDBuffer::checkSummary (  )  const [virtual]

Reimplemented from sistrip::FEDBufferBase.

Definition at line 231 of file SiStripFEDBuffer.cc.

References sistrip::FEDBufferBase::apveAddress(), calculateFEUnitLength(), channels_, checkAllChannelStatusBits(), checkChannelLengthsMatchBufferLength(), checkChannelPacketCodes(), checkFEUnitAPVAddresses(), checkFEUnitLengths(), checkStatusBits(), sistrip::FEDBufferBase::checkSummary(), lat::endl(), sistrip::FEDCH_PER_FED, sistrip::FEDCH_PER_FEUNIT, feGood(), feHeader_, sistrip::FEDFullDebugHeader::feUnitLength(), sistrip::FEDFullDebugHeader::feUnitMajorityAddress(), sistrip::FEUNITS_PER_FED, getCorrectPacketCode(), and summary.

00232   {
00233     std::stringstream summary;
00234     summary << FEDBufferBase::checkSummary();
00235     summary << "Check channel status bits: " << ( checkAllChannelStatusBits() ? "passed" : "FAILED" ) << std::endl;
00236     if (!checkAllChannelStatusBits()) {
00237       summary << "Channels with errors: ";
00238       unsigned int badChannels = 0;
00239       for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
00240         if (!feGood(iCh/FEDCH_PER_FEUNIT)) continue;
00241         if (!checkStatusBits(iCh)) {
00242           summary << uint16_t(iCh) << " ";
00243           badChannels++;
00244         }
00245       }
00246       summary << std::endl;
00247       summary << "Number of channels with bad status bits: " << badChannels << std::endl;
00248     }
00249     summary << "Check channel lengths match buffer length: " << ( checkChannelLengthsMatchBufferLength() ? "passed" : "FAILED" ) << std::endl;
00250     summary << "Check channel packet codes: " << ( checkChannelPacketCodes() ? "passed" : "FAILED" ) << std::endl;
00251     if (!checkChannelPacketCodes()) {
00252       summary << "Channels with bad packet codes: ";
00253       for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
00254         if (!feGood(iCh/FEDCH_PER_FEUNIT)) continue;
00255         if (channels_[iCh].packetCode() != getCorrectPacketCode())
00256           summary << uint16_t(iCh) << " ";
00257       }
00258     }
00259     summary << "Check FE unit lengths: " << ( checkFEUnitLengths() ? "passed" : "FAILED" ) << std::endl;
00260     if (!checkFEUnitLengths()) {
00261       const FEDFullDebugHeader* fdHeader = dynamic_cast<FEDFullDebugHeader*>(feHeader_.get());
00262       if (fdHeader) {
00263         summary << "Bad FE units:" << std::endl;
00264         for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
00265           if (!feGood(iFE)) continue;
00266           uint16_t lengthFromChannels = calculateFEUnitLength(iFE);
00267           uint16_t lengthFromHeader = fdHeader->feUnitLength(iFE);
00268           if (lengthFromHeader != lengthFromChannels) {
00269             summary << "FE unit: " << uint16_t(iFE) 
00270                     << " length in header: " << lengthFromHeader 
00271                     << " length from channel lengths: " << lengthFromChannels << std::endl;
00272           }
00273         }
00274       }
00275     }
00276     summary << "Check FE unit APV addresses match APVe: " << ( checkFEUnitAPVAddresses() ? "passed" : "FAILED" ) << std::endl;
00277     if (!checkFEUnitAPVAddresses()) {
00278       const FEDFullDebugHeader* fdHeader = dynamic_cast<FEDFullDebugHeader*>(feHeader_.get());
00279       if (fdHeader) {
00280         const uint8_t goldenAddress = apveAddress();
00281         summary << "Address from APVe:" << uint16_t(goldenAddress) << std::endl;
00282         summary << "Bad FE units:" << std::endl;
00283         for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
00284           if (!feGood(iFE)) continue;
00285           if (fdHeader->feUnitMajorityAddress(iFE) != goldenAddress) {
00286             summary << "FE unit: " << uint16_t(iFE)
00287                     << " majority address: " << uint16_t(fdHeader->feUnitMajorityAddress(iFE)) << std::endl;
00288           }
00289         }
00290       }
00291     }
00292     return summary.str();
00293   }

bool sistrip::FEDBuffer::doChecks (  )  const [virtual]

Reimplemented from sistrip::FEDBufferBase.

Definition at line 101 of file SiStripFEDBuffer.cc.

References sistrip::FEDBufferBase::doChecks(), sistrip::FEDCH_PER_FED, and lastValidChannel_.

00102   {
00103     //check that all channels were unpacked properly
00104     if (lastValidChannel_ != FEDCH_PER_FED) return false;
00105     //do checks from base class
00106     if (!FEDBufferBase::doChecks()) return false;
00107     return true;
00108   }

bool sistrip::FEDBuffer::doCorruptBufferChecks (  )  const [virtual]

Definition at line 110 of file SiStripFEDBuffer.cc.

References checkChannelLengthsMatchBufferLength(), checkChannelPacketCodes(), sistrip::FEDBufferBase::checkCRC(), and checkFEUnitLengths().

00111   {
00112     return ( checkCRC() &&
00113              checkChannelLengthsMatchBufferLength() &&
00114              checkChannelPacketCodes() &&
00115              //checkClusterLengths() &&
00116              checkFEUnitLengths() );
00117     //checkFEUnitAPVAddresses() );
00118   }

bool sistrip::FEDBuffer::feGood ( uint8_t  internalFEUnitNum  )  const [inline]

Definition at line 131 of file SiStripFEDBuffer.h.

References sistrip::FEDBufferBase::feOverflow(), fePresent(), and sistrip::FEDBufferBase::majorityAddressErrorForFEUnit().

Referenced by channelGood(), checkAllChannelStatusBits(), checkChannelLengthsMatchBufferLength(), checkChannelPacketCodes(), checkFEUnitAPVAddresses(), checkFEUnitLengths(), checkSummary(), and findChannels().

00131 { return ( !majorityAddressErrorForFEUnit(internalFEUnitNum) && !feOverflow(internalFEUnitNum) && fePresent(internalFEUnitNum) ); }

const FEDFEHeader* sistrip::FEDBuffer::feHeader (  )  const [inline]

Definition at line 129 of file SiStripFEDBuffer.h.

References feHeader_.

Referenced by SiStripFEDMonitorPlugin::analyzeChannels().

00129 { return feHeader_.get(); }

bool sistrip::FEDBuffer::fePresent ( uint8_t  internalFEUnitNum  )  const [inline, private]

Definition at line 170 of file SiStripFEDBuffer.h.

References fePresent_.

Referenced by feGood(), and nFEUnitsPresent().

00170 { return fePresent_[internalFEUnitNum]; }

void sistrip::FEDBuffer::findChannels (  )  [private]

Definition at line 61 of file SiStripFEDBuffer.cc.

References channels_, Exception, sistrip::FEDCH_PER_FED, sistrip::FEDCH_PER_FEUNIT, feGood(), i, lastValidChannel_, payloadLength_, and payloadPointer_.

Referenced by FEDBuffer().

00062   {
00063     size_t offsetBeginningOfChannel = 0;
00064     for (size_t i = 0; i < FEDCH_PER_FED; i++) {
00065       //if FE unit is not enabled then skip rest of FE unit adding NULL pointers
00066       if (!feGood(i/FEDCH_PER_FEUNIT)) {
00067         channels_.insert(channels_.end(),size_t(FEDCH_PER_FEUNIT),FEDChannel(payloadPointer_,0));
00068         i += FEDCH_PER_FEUNIT-1;
00069         lastValidChannel_ += FEDCH_PER_FEUNIT;
00070         continue;
00071       }
00072       //if FE unit is enabled
00073       //check that channel length bytes fit into buffer
00074       if (offsetBeginningOfChannel+2 >= payloadLength_) {
00075         throw cms::Exception("FEDBuffer") << "Channel " << uint16_t(i) << " does not fit into buffer. "
00076                                                  << "Channel starts at " << uint16_t(offsetBeginningOfChannel) << " in payload. "
00077                                                  << "Payload length is " << uint16_t(payloadLength_) << ". ";
00078       }
00079       channels_.push_back(FEDChannel(payloadPointer_,offsetBeginningOfChannel));
00080       //get length and check that whole channel fits into buffer
00081       uint16_t channelLength = channels_.back().length();
00082       if (offsetBeginningOfChannel+channelLength > payloadLength_) {
00083         throw cms::Exception("FEDBuffer") << "Channel " << uint16_t(i) << " does not fit into buffer. "
00084                                                  << "Channel starts at " << uint16_t(offsetBeginningOfChannel) << " in payload. "
00085                                                  << "Channel length is " << uint16_t(channelLength) << ". "
00086                                                  << "Payload length is " << uint16_t(payloadLength_) << ". ";
00087       }
00088       lastValidChannel_++;
00089       const size_t offsetEndOfChannel = offsetBeginningOfChannel+channelLength;
00090       //add padding if necessary and calculate offset for begining of next channel
00091       if (!( (i+1) % FEDCH_PER_FEUNIT )) {
00092         uint8_t numPaddingBytes = 8 - (offsetEndOfChannel % 8);
00093         if (numPaddingBytes == 8) numPaddingBytes = 0;
00094         offsetBeginningOfChannel = offsetEndOfChannel + numPaddingBytes;
00095       } else {
00096         offsetBeginningOfChannel = offsetEndOfChannel;
00097       }
00098     }
00099   }

uint8_t sistrip::FEDBuffer::getCorrectPacketCode (  )  const [private]

Definition at line 295 of file SiStripFEDBuffer.cc.

References sistrip::PACKET_CODE_PROC_RAW, sistrip::PACKET_CODE_SCOPE, sistrip::PACKET_CODE_VIRGIN_RAW, sistrip::PACKET_CODE_ZERO_SUPPRESSED, sistrip::READOUT_MODE_INVALID, sistrip::READOUT_MODE_PROC_RAW, sistrip::READOUT_MODE_SCOPE, sistrip::READOUT_MODE_VIRGIN_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE, and sistrip::FEDBufferBase::readoutMode().

Referenced by checkChannelPacketCodes(), and checkSummary().

00296   {
00297     switch(readoutMode()) {
00298     case READOUT_MODE_SCOPE:
00299       return PACKET_CODE_SCOPE;
00300       break;
00301     case READOUT_MODE_VIRGIN_RAW:
00302       return PACKET_CODE_VIRGIN_RAW;
00303       break;
00304     case READOUT_MODE_PROC_RAW:
00305       return PACKET_CODE_PROC_RAW;
00306       break;
00307     case READOUT_MODE_ZERO_SUPPRESSED:
00308       return PACKET_CODE_ZERO_SUPPRESSED;
00309       break;
00310     case READOUT_MODE_ZERO_SUPPRESSED_LITE:
00311     case READOUT_MODE_INVALID:
00312     default:
00313       return 0;
00314     }
00315   }

uint8_t sistrip::FEDBuffer::nFEUnitsPresent (  )  const [private]

Definition at line 317 of file SiStripFEDBuffer.cc.

References fePresent(), sistrip::FEUNITS_PER_FED, and HLT_VtxMuL3::result.

Referenced by print().

00318   {
00319     uint8_t result = 0;
00320     for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
00321       if (fePresent(iFE)) result++;
00322     }
00323     return result;
00324   }

void sistrip::FEDBuffer::print ( std::ostream &  os  )  const [virtual]

Reimplemented from sistrip::FEDBufferBase.

Definition at line 326 of file SiStripFEDBuffer.cc.

References lat::endl(), sistrip::HEADER_TYPE_FULL_DEBUG, sistrip::FEDBufferBase::headerType(), nFEUnitsPresent(), and print().

00327   {
00328     FEDBufferBase::print(os);
00329     if (headerType() == HEADER_TYPE_FULL_DEBUG) os << "FE units with data: " << uint16_t(nFEUnitsPresent()) << std::endl;
00330   }


Member Data Documentation

std::vector<FEDChannel> sistrip::FEDBuffer::channels_ [private]

Definition at line 175 of file SiStripFEDBuffer.h.

Referenced by calculateFEUnitLength(), channel(), checkChannelLengthsMatchBufferLength(), checkChannelPacketCodes(), checkSummary(), FEDBuffer(), and findChannels().

std::auto_ptr<FEDFEHeader> sistrip::FEDBuffer::feHeader_ [private]

Definition at line 176 of file SiStripFEDBuffer.h.

Referenced by checkFEUnitAPVAddresses(), checkFEUnitLengths(), checkStatusBits(), checkSummary(), FEDBuffer(), and feHeader().

bool sistrip::FEDBuffer::fePresent_[FEUNITS_PER_FED] [private]

Definition at line 180 of file SiStripFEDBuffer.h.

Referenced by FEDBuffer(), and fePresent().

uint8_t sistrip::FEDBuffer::lastValidChannel_ [private]

Definition at line 179 of file SiStripFEDBuffer.h.

Referenced by channelGood(), checkChannelLengths(), doChecks(), FEDBuffer(), and findChannels().

uint16_t sistrip::FEDBuffer::payloadLength_ [private]

Definition at line 178 of file SiStripFEDBuffer.h.

Referenced by checkChannelLengthsMatchBufferLength(), FEDBuffer(), and findChannels().

uint8_t* sistrip::FEDBuffer::payloadPointer_ [private]

Definition at line 177 of file SiStripFEDBuffer.h.

Referenced by FEDBuffer(), and findChannels().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:52:34 2009 for CMSSW by  doxygen 1.5.4