#include <HcalFiberPattern.h>
Public Member Functions | |
int | crate () const |
int | fiber () const |
HcalElectronicsId | getId (int fiberChan) |
std::vector< HcalQIESample > | getSamples (int bunch, int npresamples, int nsamples, int fiberChan) |
HcalFiberPattern (const std::map< std::string, std::string > ¶ms, const std::vector< uint32_t > &data) | |
int | slot () const |
Private Member Functions | |
HcalQIESample | unpack (int bc, int fc) |
Private Attributes | |
int | crate_ |
int | dcc_ |
int | fiber_ |
std::vector< uint32_t > | pattern_ |
int | slot_ |
int | spigot_ |
int | tb_ |
HcalFiberPattern::HcalFiberPattern | ( | const std::map< std::string, std::string > & | params, |
const std::vector< uint32_t > & | data | ||
) |
int HcalFiberPattern::crate | ( | ) | const [inline] |
int HcalFiberPattern::fiber | ( | ) | const [inline] |
HcalElectronicsId HcalFiberPattern::getId | ( | int | fiberChan | ) |
std::vector< HcalQIESample > HcalFiberPattern::getSamples | ( | int | bunch, |
int | npresamples, | ||
int | nsamples, | ||
int | fiberChan | ||
) |
Definition at line 46 of file HcalFiberPattern.cc.
References Exception, i, pattern_, and unpack().
{ if (bunch<npresamples) throw cms::Exception("InvalidArgument") << "Asked for " << npresamples << " presamples with event at bunch " << bunch; if (nsamples-npresamples+bunch>=(int)(pattern_.size()/2)) throw cms::Exception("InvalidArgument") << "Asked for " << nsamples << " with event at " << bunch << " and " << npresamples << " presamples, but only " << pattern_.size()/2 << " bunches are available"; std::vector<HcalQIESample> retval; retval.reserve(nsamples); for (int i=0; i<nsamples; i++) { int bc=bunch+i-npresamples; retval.push_back(unpack(bc,fiberChan)); } return retval; }
int HcalFiberPattern::slot | ( | void | ) | const [inline] |
HcalQIESample HcalFiberPattern::unpack | ( | int | bc, |
int | fc | ||
) | [private] |
Definition at line 19 of file HcalFiberPattern.cc.
References ecalMGPA::adc(), fiber_, pattern_, and w2.
Referenced by getSamples().
{ uint32_t w1=pattern_[bc*2]; // lsw uint32_t w2=pattern_[bc*2+1]; // msw int adc=0, capid=0; bool dv=(w1&0x10000)!=0; bool er=(w1&0x20000)!=0; switch (fc) { case (0): adc=(w2&0xFE00)>>9; capid=(w1&0x0180)>>7; break; case (1): adc=(w2&0xFE)>>1; capid=(w1&0x0060)>>5; break; case (2): adc=(w1&0xFE00)>>9; capid=(w1&0x0018)>>3; break; default: break; } return HcalQIESample(adc,capid,fiber_,fc,dv,er); }
int HcalFiberPattern::crate_ [private] |
Definition at line 26 of file HcalFiberPattern.h.
Referenced by crate(), getId(), and HcalFiberPattern().
int HcalFiberPattern::dcc_ [private] |
Definition at line 26 of file HcalFiberPattern.h.
Referenced by getId(), and HcalFiberPattern().
int HcalFiberPattern::fiber_ [private] |
Definition at line 26 of file HcalFiberPattern.h.
Referenced by fiber(), getId(), HcalFiberPattern(), and unpack().
std::vector<uint32_t> HcalFiberPattern::pattern_ [private] |
Definition at line 27 of file HcalFiberPattern.h.
Referenced by getSamples(), and unpack().
int HcalFiberPattern::slot_ [private] |
Definition at line 26 of file HcalFiberPattern.h.
Referenced by getId(), HcalFiberPattern(), and slot().
int HcalFiberPattern::spigot_ [private] |
Definition at line 26 of file HcalFiberPattern.h.
Referenced by getId(), and HcalFiberPattern().
int HcalFiberPattern::tb_ [private] |
Definition at line 26 of file HcalFiberPattern.h.
Referenced by getId(), and HcalFiberPattern().