CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
HcalCalibDataFrame Class Reference

#include <HcalCalibDataFrame.h>

Public Types

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

Public Member Functions

const HcalElectronicsIdelecId () const
 
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...
 
 HcalCalibDataFrame ()
 
 HcalCalibDataFrame (const HcalCalibDetId &id)
 
const HcalCalibDetIdid () const
 
const HcalQIESampleoperator[] (int i) const
 access a sample More...
 
int presamples () const
 number of samples before the sample from the triggered beam crossing (according to the hardware) More...
 
const HcalQIESamplesample (int i) const
 access a sample More...
 
void setFiberIdleOffset (int offset)
 
void setPresamples (int ps)
 
void setReadoutIds (const HcalElectronicsId &eid)
 
void setSample (int i, const HcalQIESample &sam)
 
void setSize (int size)
 
void setZSInfo (bool unsuppressed, bool markAndPass, uint32_t crossingMask=0)
 
int size () const
 total number of samples in the digi More...
 
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...
 
uint32_t zsCrossingMask () const
 zs crossing mask (which sums considered) More...
 
bool zsMarkAndPass () const
 was ZS MarkAndPass? More...
 
bool zsUnsuppressed () const
 was ZS unsuppressed? More...
 

Static Public Attributes

static const int MAXSAMPLES = 10
 

Private Attributes

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

Detailed Description

Precision readout digi for HcalCalib

Definition at line 15 of file HcalCalibDataFrame.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 17 of file HcalCalibDataFrame.h.

Constructor & Destructor Documentation

HcalCalibDataFrame::HcalCalibDataFrame ( )

Definition at line 3 of file HcalCalibDataFrame.cc.

HcalCalibDataFrame::HcalCalibDataFrame ( const HcalCalibDetId id)
explicit

Definition at line 5 of file HcalCalibDataFrame.cc.

5  : id_(id), size_(0), hcalPresamples_(0) {
6  // TODO : test id for HcalForward
7 }

Member Function Documentation

const HcalElectronicsId& HcalCalibDataFrame::elecId ( ) const
inline

Definition at line 23 of file HcalCalibDataFrame.h.

References electronicsId_.

Referenced by HcalLedAnalysis::processLedEvent().

23 { return electronicsId_; }
HcalElectronicsId electronicsId_
int HcalCalibDataFrame::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)

Definition at line 44 of file HcalCalibDataFrame.cc.

References hcalPresamples_, and hgcalPerformanceValidation::val.

Referenced by operator<<().

44  {
45  int val = (hcalPresamples_ & 0xF00) >> 8;
46  return (val == 0) ? (-1000) : (((val & 0x8) == 0) ? (-(val & 0x7)) : (val & 0x7));
47 }
const HcalCalibDetId& HcalCalibDataFrame::id ( ) const
inline
const HcalQIESample& HcalCalibDataFrame::operator[] ( int  i) const
inline

access a sample

Definition at line 37 of file HcalCalibDataFrame.h.

References data_, and mps_fire::i.

37 { return data_[i]; }
HcalQIESample data_[MAXSAMPLES]
int HcalCalibDataFrame::presamples ( ) const
inline

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

Definition at line 28 of file HcalCalibDataFrame.h.

References hcalPresamples_.

Referenced by HcalNominalCoder::adc2fC(), operator<<(), and HcalQLPlotAnalAlgos::recoCalib().

28 { return hcalPresamples_ & 0xF; }
const HcalQIESample& HcalCalibDataFrame::sample ( int  i) const
inline

access a sample

Definition at line 39 of file HcalCalibDataFrame.h.

References data_, and mps_fire::i.

Referenced by operator<<(), and HcalLedAnalysis::ProcessCalibEvent().

39 { return data_[i]; }
HcalQIESample data_[MAXSAMPLES]
void HcalCalibDataFrame::setFiberIdleOffset ( int  offset)

Definition at line 49 of file HcalCalibDataFrame.cc.

References hcalPresamples_, and hltrates_dqm_sourceclient-live_cfg::offset.

49  {
50  hcalPresamples_ &= 0x7FFFF0FF;
51  if (offset >= 7)
52  hcalPresamples_ |= 0xF00;
53  else if (offset >= 0)
54  hcalPresamples_ |= (0x800) | (offset << 8);
55  else if (offset >= -7)
56  hcalPresamples_ |= ((-offset) << 8);
57  else
58  hcalPresamples_ |= 0x700;
59 }
void HcalCalibDataFrame::setPresamples ( int  ps)

Definition at line 17 of file HcalCalibDataFrame.cc.

References hcalPresamples_.

17 { hcalPresamples_ |= ps & 0xF; }
void HcalCalibDataFrame::setReadoutIds ( const HcalElectronicsId eid)

Definition at line 18 of file HcalCalibDataFrame.cc.

References runTauDisplay::eid, and electronicsId_.

18 { electronicsId_ = eid; }
HcalElectronicsId electronicsId_
void HcalCalibDataFrame::setSample ( int  i,
const HcalQIESample sam 
)
inline

Definition at line 49 of file HcalCalibDataFrame.h.

References data_, and mps_fire::i.

49 { data_[i] = sam; }
HcalQIESample data_[MAXSAMPLES]
void HcalCalibDataFrame::setSize ( int  size)

Definition at line 9 of file HcalCalibDataFrame.cc.

References MAXSAMPLES, size(), and size_.

9  {
10  if (size > MAXSAMPLES)
11  size_ = MAXSAMPLES;
12  else if (size <= 0)
13  size_ = 0;
14  else
15  size_ = size;
16 }
int size() const
total number of samples in the digi
static const int MAXSAMPLES
void HcalCalibDataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass,
uint32_t  crossingMask = 0 
)

Definition at line 35 of file HcalCalibDataFrame.cc.

References hcalPresamples_.

35  {
36  hcalPresamples_ &= 0x7FC00F0F; // preserve actual presamples and fiber idle offset
37  if (markAndPass)
38  hcalPresamples_ |= 0x10;
39  if (unsuppressed)
40  hcalPresamples_ |= 0x20;
41  hcalPresamples_ |= (crossingMask & 0x3FF) << 12;
42 }
int HcalCalibDataFrame::size ( void  ) const
inline
bool HcalCalibDataFrame::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)

Definition at line 20 of file HcalCalibDataFrame.cc.

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

20  {
21  int capid = -1;
22  bool ok = true;
23  for (int i = 0; ok && i < nSamples && i + firstSample < size_; i++) {
24  if (data_[i + firstSample].er() || !data_[i + firstSample].dv())
25  ok = false;
26  if (i == 0)
27  capid = data_[i + firstSample].capid();
28  if (capid != data_[i + firstSample].capid())
29  ok = false;
30  capid = (capid + 1) % 4;
31  }
32  return ok;
33 }
HcalQIESample data_[MAXSAMPLES]
constexpr size_t nSamples
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
uint32_t HcalCalibDataFrame::zsCrossingMask ( ) const
inline

zs crossing mask (which sums considered)

Definition at line 34 of file HcalCalibDataFrame.h.

References hcalPresamples_.

34 { return (hcalPresamples_ & 0x3FF000) >> 12; }
bool HcalCalibDataFrame::zsMarkAndPass ( ) const
inline

was ZS MarkAndPass?

Definition at line 30 of file HcalCalibDataFrame.h.

References hcalPresamples_.

Referenced by HcalLaserHBHEFilter2012::filter(), HcalLaserHFFilter2012::filter(), HcalLaserHBHEHFFilter2012::filter(), and operator<<().

30 { return (hcalPresamples_ & 0x10); }
bool HcalCalibDataFrame::zsUnsuppressed ( ) const
inline

was ZS unsuppressed?

Definition at line 32 of file HcalCalibDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

32 { return (hcalPresamples_ & 0x20); }

Member Data Documentation

HcalQIESample HcalCalibDataFrame::data_[MAXSAMPLES]
private

Definition at line 61 of file HcalCalibDataFrame.h.

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

HcalElectronicsId HcalCalibDataFrame::electronicsId_
private

Definition at line 58 of file HcalCalibDataFrame.h.

Referenced by elecId(), and setReadoutIds().

int HcalCalibDataFrame::hcalPresamples_
private
HcalCalibDetId HcalCalibDataFrame::id_
private

Definition at line 57 of file HcalCalibDataFrame.h.

Referenced by id().

const int HcalCalibDataFrame::MAXSAMPLES = 10
static

Definition at line 54 of file HcalCalibDataFrame.h.

Referenced by setSize().

int HcalCalibDataFrame::size_
private

Definition at line 59 of file HcalCalibDataFrame.h.

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