CMS 3D CMS Logo

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

#include <HODataFrame.h>

Public Types

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

Public Member Functions

constexpr HcalElectronicsId const & elecId () 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...
 
 HODataFrame ()
 
constexpr HODataFrame (const HcalDetId &id)
 
constexpr HcalDetId const & id () const
 
constexpr const HcalQIESampleoperator[] (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 const HcalQIESamplesample (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 HO

Definition at line 14 of file HODataFrame.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 16 of file HODataFrame.h.

Constructor & Destructor Documentation

◆ HODataFrame() [1/2]

HODataFrame::HODataFrame ( )
inline

Definition at line 18 of file HODataFrame.h.

18 : id_(0), size_(0), hcalPresamples_(0) {}

◆ HODataFrame() [2/2]

constexpr HODataFrame::HODataFrame ( const HcalDetId id)
inlineexplicitconstexpr

Definition at line 19 of file HODataFrame.h.

20  : id_(id), size_(0), hcalPresamples_(0) { // TODO : test id for HcalOuter
21  }

Member Function Documentation

◆ elecId()

constexpr HcalElectronicsId const& HODataFrame::elecId ( ) const
inlineconstexpr

Definition at line 24 of file HODataFrame.h.

24 { return electronicsId_; }

References electronicsId_.

Referenced by LEDTask::_process(), and LaserTask::_process().

◆ fiberIdleOffset()

constexpr int HODataFrame::fiberIdleOffset ( ) const
inlineconstexpr

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 HODataFrame.h.

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

References hcalPresamples_, and heppy_batch::val.

Referenced by operator<<().

◆ id()

constexpr HcalDetId const& HODataFrame::id ( ) const
inlineconstexpr

◆ operator[]()

constexpr const HcalQIESample& HODataFrame::operator[] ( int  i) const
inlineconstexpr

access a sample

Definition at line 38 of file HODataFrame.h.

38 { return data_[i]; }

References data_, and mps_fire::i.

◆ presamples()

constexpr int HODataFrame::presamples ( ) const
inlineconstexpr

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

Definition at line 29 of file HODataFrame.h.

29 { return hcalPresamples_ & 0xF; }

References hcalPresamples_.

Referenced by LaserTask::_process(), and operator<<().

◆ sample()

constexpr const HcalQIESample& HODataFrame::sample ( int  i) const
inlineconstexpr

access a sample

Definition at line 40 of file HODataFrame.h.

40 { return data_[i]; }

References data_, and mps_fire::i.

Referenced by LEDTask::_process(), LaserTask::_process(), operator<<(), and HcalPedestalAnalysis::processEvent().

◆ setFiberIdleOffset()

constexpr void HODataFrame::setFiberIdleOffset ( int  offset)
inlineconstexpr

Definition at line 83 of file HODataFrame.h.

83  {
84  hcalPresamples_ &= 0xFFFF0FF;
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  }

References hcalPresamples_, and hltrates_dqm_sourceclient-live_cfg::offset.

◆ setPresamples()

constexpr void HODataFrame::setPresamples ( int  ps)
inlineconstexpr

Definition at line 72 of file HODataFrame.h.

72 { hcalPresamples_ |= ps & 0xF; }

References hcalPresamples_.

◆ setReadoutIds()

constexpr void HODataFrame::setReadoutIds ( const HcalElectronicsId eid)
inlineconstexpr

Definition at line 82 of file HODataFrame.h.

82 { electronicsId_ = eid; }

References runTauDisplay::eid, and electronicsId_.

◆ setSample()

constexpr void HODataFrame::setSample ( int  i,
const HcalQIESample sam 
)
inlineconstexpr

Definition at line 81 of file HODataFrame.h.

81 { data_[i] = sam; }

References data_, and mps_fire::i.

◆ setSize()

constexpr void HODataFrame::setSize ( int  size)
inlineconstexpr

Definition at line 64 of file HODataFrame.h.

64  {
65  if (size > MAXSAMPLES)
66  size_ = MAXSAMPLES;
67  else if (size <= 0)
68  size_ = 0;
69  else
70  size_ = size;
71  }

References MAXSAMPLES, size(), and size_.

◆ setZSInfo()

constexpr void HODataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass,
uint32_t  crossingMask = 0 
)
inlineconstexpr

Definition at line 73 of file HODataFrame.h.

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  }

References hcalPresamples_, and DigiNZS_cff::markAndPass.

◆ size()

constexpr int HODataFrame::size ( void  ) const
inlineconstexpr

◆ validate()

constexpr bool HODataFrame::validate ( int  firstSample = 0,
int  nSamples = 100 
) const
inlineconstexpr

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

Definition at line 49 of file HODataFrame.h.

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  }

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

◆ zsCrossingMask()

constexpr uint32_t HODataFrame::zsCrossingMask ( ) const
inlineconstexpr

zs crossing mask (which sums considered)

Definition at line 35 of file HODataFrame.h.

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

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

◆ zsMarkAndPass()

constexpr bool HODataFrame::zsMarkAndPass ( ) const
inlineconstexpr

was ZS MarkAndPass?

Definition at line 31 of file HODataFrame.h.

31 { return (hcalPresamples_ & 0x10); }

References hcalPresamples_.

Referenced by operator<<().

◆ zsUnsuppressed()

constexpr bool HODataFrame::zsUnsuppressed ( ) const
inlineconstexpr

was ZS unsuppressed?

Definition at line 33 of file HODataFrame.h.

33 { return (hcalPresamples_ & 0x20); }

References hcalPresamples_.

Referenced by operator<<().

Member Data Documentation

◆ data_

HcalQIESample HODataFrame::data_[MAXSAMPLES]
private

Definition at line 102 of file HODataFrame.h.

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

◆ electronicsId_

HcalElectronicsId HODataFrame::electronicsId_
private

Definition at line 99 of file HODataFrame.h.

Referenced by elecId(), and setReadoutIds().

◆ hcalPresamples_

int HODataFrame::hcalPresamples_
private

◆ id_

HcalDetId HODataFrame::id_
private

Definition at line 98 of file HODataFrame.h.

Referenced by id().

◆ MAXSAMPLES

const int HODataFrame::MAXSAMPLES = 10
static

Definition at line 95 of file HODataFrame.h.

Referenced by setSize().

◆ size_

int HODataFrame::size_
private

Definition at line 100 of file HODataFrame.h.

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

mps_fire.i
i
Definition: mps_fire.py:428
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
PresampleTask_cfi.nSamples
nSamples
Definition: PresampleTask_cfi.py:7
DigiNZS_cff.markAndPass
markAndPass
Definition: DigiNZS_cff.py:6
HODataFrame::MAXSAMPLES
static const int MAXSAMPLES
Definition: HODataFrame.h:95
castor_dqm_sourceclient-live_cfg.firstSample
firstSample
Definition: castor_dqm_sourceclient-live_cfg.py:64
HODataFrame::hcalPresamples_
int hcalPresamples_
Definition: HODataFrame.h:101
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
HODataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
HcalQIESample::capid
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
heppy_batch.val
val
Definition: heppy_batch.py:351
HODataFrame::id_
HcalDetId id_
Definition: HODataFrame.h:98
HODataFrame::data_
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:102
HODataFrame::size_
int size_
Definition: HODataFrame.h:100
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HODataFrame::electronicsId_
HcalElectronicsId electronicsId_
Definition: HODataFrame.h:99