CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
HBHEDataFrame Class Reference

#include <HBHEDataFrame.h>

Public Types

typedef HcalDetId key_type
 For the sorted collection. More...
 

Public Member Functions

constexpr const HcalElectronicsIdelecId () const
 
constexpr int fiberIdleOffset () const
 offset of bunch number for this channel relative to nominal set in the unpacker (range is +7->-7. -1000 indicates the data is invalid/unavailable) More...
 
constexpr HBHEDataFrame ()
 
constexpr HBHEDataFrame (const HcalDetId &id)
 
constexpr const HcalDetIdid () const
 
constexpr HcalQIESample const & operator[] (int i) const
 access a sample More...
 
constexpr int presamples () const
 number of samples before the sample from the triggered beam crossing (according to the hardware) More...
 
constexpr HcalQIESample const & sample (int i) const
 access a sample More...
 
constexpr void setFiberIdleOffset (int offset)
 
constexpr void setPresamples (int ps)
 
constexpr void setReadoutIds (const HcalElectronicsId &eid)
 
constexpr void setSample (int i, const HcalQIESample &sam)
 
constexpr void setSize (int size)
 
constexpr void setZSInfo (bool unsuppressed, bool markAndPass, uint32_t crossingMask=0)
 
constexpr int size () const
 total number of samples in the digi More...
 
constexpr bool validate (int firstSample=0, int nSamples=100) const
 validate appropriate DV and ER bits as well as capid rotation for the specified samples (default is all) More...
 
constexpr uint32_t zsCrossingMask () const
 zs crossing mask (which sums considered) More...
 
constexpr bool zsMarkAndPass () const
 was ZS MarkAndPass? More...
 
constexpr bool zsUnsuppressed () const
 was ZS unsuppressed? More...
 

Static Public Attributes

static const int MAXSAMPLES = 10
 

Private Attributes

HcalQIESample data_ [MAXSAMPLES]
 
HcalElectronicsId electronicsId_
 
int hcalPresamples_
 
HcalDetId id_
 
int size_
 

Detailed Description

Precision readout digi for HB and HE.

Definition at line 14 of file HBHEDataFrame.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 16 of file HBHEDataFrame.h.

Constructor & Destructor Documentation

◆ HBHEDataFrame() [1/2]

constexpr HBHEDataFrame::HBHEDataFrame ( )
inline

Definition at line 18 of file HBHEDataFrame.h.

18 : id_(0), size_(0), hcalPresamples_(0) {}
HcalDetId id_
Definition: HBHEDataFrame.h:98

◆ HBHEDataFrame() [2/2]

constexpr HBHEDataFrame::HBHEDataFrame ( const HcalDetId id)
inlineexplicit

Definition at line 19 of file HBHEDataFrame.h.

19  : id_(id), size_(0), hcalPresamples_(0) {
20  // TODO : test id for HcalBarrel or HcalEndcap
21  }
HcalDetId id_
Definition: HBHEDataFrame.h:98

Member Function Documentation

◆ elecId()

constexpr const HcalElectronicsId& HBHEDataFrame::elecId ( ) const
inline

Definition at line 24 of file HBHEDataFrame.h.

References electronicsId_.

24 { return electronicsId_; }
HcalElectronicsId electronicsId_
Definition: HBHEDataFrame.h:99

◆ fiberIdleOffset()

constexpr int HBHEDataFrame::fiberIdleOffset ( ) const
inline

offset of bunch number for this channel relative to nominal set in the unpacker (range is +7->-7. -1000 indicates the data is invalid/unavailable)

Definition at line 43 of file HBHEDataFrame.h.

References hcalPresamples_, and heppy_batch::val.

Referenced by operator<<().

43  {
44  int val = (hcalPresamples_ & 0xF00) >> 8;
45  return (val == 0) ? (-1000) : (((val & 0x8) == 0) ? (-(val & 0x7)) : (val & 0x7));
46  }

◆ id()

constexpr const HcalDetId& HBHEDataFrame::id ( ) const
inline

◆ operator[]()

constexpr HcalQIESample const& HBHEDataFrame::operator[] ( int  i) const
inline

access a sample

Definition at line 38 of file HBHEDataFrame.h.

References data_, and mps_fire::i.

38 { return data_[i]; }
HcalQIESample data_[MAXSAMPLES]

◆ presamples()

constexpr int HBHEDataFrame::presamples ( ) const
inline

number of samples before the sample from the triggered beam crossing (according to the hardware)

Definition at line 29 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

29 { return hcalPresamples_ & 0xF; }

◆ sample()

constexpr HcalQIESample const& HBHEDataFrame::sample ( int  i) const
inline

access a sample

Definition at line 40 of file HBHEDataFrame.h.

References data_, and mps_fire::i.

Referenced by HLTHcalLaserMisfireFilter::filter(), operator<<(), and HcalPedestalAnalysis::processEvent().

40 { return data_[i]; }
HcalQIESample data_[MAXSAMPLES]

◆ setFiberIdleOffset()

constexpr void HBHEDataFrame::setFiberIdleOffset ( int  offset)
inline

Definition at line 83 of file HBHEDataFrame.h.

References hcalPresamples_, and hltrates_dqm_sourceclient-live_cfg::offset.

83  {
84  hcalPresamples_ &= 0x7FFFF0FF;
85  if (offset >= 7)
86  hcalPresamples_ |= 0xF00;
87  else if (offset >= 0)
88  hcalPresamples_ |= (0x800) | (offset << 8);
89  else if (offset >= -7)
90  hcalPresamples_ |= ((-offset) << 8);
91  else
92  hcalPresamples_ |= 0x700;
93  }

◆ setPresamples()

constexpr void HBHEDataFrame::setPresamples ( int  ps)
inline

Definition at line 72 of file HBHEDataFrame.h.

References hcalPresamples_.

72 { hcalPresamples_ |= ps & 0xF; }

◆ setReadoutIds()

constexpr void HBHEDataFrame::setReadoutIds ( const HcalElectronicsId eid)
inline

Definition at line 82 of file HBHEDataFrame.h.

References runTauDisplay::eid, and electronicsId_.

82 { electronicsId_ = eid; }
HcalElectronicsId electronicsId_
Definition: HBHEDataFrame.h:99

◆ setSample()

constexpr void HBHEDataFrame::setSample ( int  i,
const HcalQIESample sam 
)
inline

Definition at line 81 of file HBHEDataFrame.h.

References data_, and mps_fire::i.

81 { data_[i] = sam; }
HcalQIESample data_[MAXSAMPLES]

◆ setSize()

constexpr void HBHEDataFrame::setSize ( int  size)
inline

Definition at line 64 of file HBHEDataFrame.h.

References MAXSAMPLES, size(), and size_.

64  {
65  if (size > MAXSAMPLES)
66  size_ = MAXSAMPLES;
67  else if (size <= 0)
68  size_ = 0;
69  else
70  size_ = size;
71  }
static const int MAXSAMPLES
Definition: HBHEDataFrame.h:95
constexpr int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:27

◆ setZSInfo()

constexpr void HBHEDataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass,
uint32_t  crossingMask = 0 
)
inline

Definition at line 73 of file HBHEDataFrame.h.

References hcalPresamples_, and DigiNZS_cff::markAndPass.

73  {
74  hcalPresamples_ &= 0x7FC00F0F; // preserve actual presamples and fiber idle offset
75  if (markAndPass)
76  hcalPresamples_ |= 0x10;
77  if (unsuppressed)
78  hcalPresamples_ |= 0x20;
79  hcalPresamples_ |= (crossingMask & 0x3FF) << 12;
80  }

◆ size()

constexpr int HBHEDataFrame::size ( void  ) const
inline

◆ validate()

constexpr bool HBHEDataFrame::validate ( int  firstSample = 0,
int  nSamples = 100 
) const
inline

validate appropriate DV and ER bits as well as capid rotation for the specified samples (default is all)

Definition at line 49 of file HBHEDataFrame.h.

References HcalQIESample::capid(), data_, castor_dqm_sourceclient-live_cfg::firstSample, mps_fire::i, PresampleTask_cfi::nSamples, convertSQLiteXML::ok, and size_.

49  {
50  int capid = -1;
51  bool ok = true;
52  for (int i = 0; ok && i < nSamples && i + firstSample < size_; i++) {
53  if (data_[i + firstSample].er() || !data_[i + firstSample].dv())
54  ok = false;
55  if (i == 0)
56  capid = data_[i + firstSample].capid();
57  if (capid != data_[i + firstSample].capid())
58  ok = false;
59  capid = (capid + 1) % 4;
60  }
61  return ok;
62  }
HcalQIESample data_[MAXSAMPLES]
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47

◆ zsCrossingMask()

constexpr uint32_t HBHEDataFrame::zsCrossingMask ( ) const
inline

zs crossing mask (which sums considered)

Definition at line 35 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

35 { return (hcalPresamples_ & 0x3FF000) >> 12; }

◆ zsMarkAndPass()

constexpr bool HBHEDataFrame::zsMarkAndPass ( ) const
inline

was ZS MarkAndPass?

Definition at line 31 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by reco::HcalNoiseInfoProducer::filldigis(), and operator<<().

31 { return (hcalPresamples_ & 0x10); }

◆ zsUnsuppressed()

constexpr bool HBHEDataFrame::zsUnsuppressed ( ) const
inline

was ZS unsuppressed?

Definition at line 33 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

33 { return (hcalPresamples_ & 0x20); }

Member Data Documentation

◆ data_

HcalQIESample HBHEDataFrame::data_[MAXSAMPLES]
private

Definition at line 102 of file HBHEDataFrame.h.

Referenced by operator[](), sample(), setSample(), and validate().

◆ electronicsId_

HcalElectronicsId HBHEDataFrame::electronicsId_
private

Definition at line 99 of file HBHEDataFrame.h.

Referenced by elecId(), and setReadoutIds().

◆ hcalPresamples_

int HBHEDataFrame::hcalPresamples_
private

◆ id_

HcalDetId HBHEDataFrame::id_
private

Definition at line 98 of file HBHEDataFrame.h.

Referenced by id().

◆ MAXSAMPLES

const int HBHEDataFrame::MAXSAMPLES = 10
static

Definition at line 95 of file HBHEDataFrame.h.

Referenced by setSize().

◆ size_

int HBHEDataFrame::size_
private

Definition at line 100 of file HBHEDataFrame.h.

Referenced by setSize(), size(), and validate().