CMS 3D CMS Logo

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

#include <ZDCDataFrame.h>

Public Types

typedef HcalZDCDetId 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...
 
const HcalZDCDetIdid () 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...
 
 ZDCDataFrame ()
 
 ZDCDataFrame (const HcalZDCDetId &id)
 
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_
 
HcalZDCDetId id_
 
int size_
 

Detailed Description

Precision readout digi for ZDC

Definition at line 15 of file ZDCDataFrame.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 17 of file ZDCDataFrame.h.

Constructor & Destructor Documentation

◆ ZDCDataFrame() [1/2]

ZDCDataFrame::ZDCDataFrame ( )

Definition at line 3 of file ZDCDataFrame.cc.

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

◆ ZDCDataFrame() [2/2]

ZDCDataFrame::ZDCDataFrame ( const HcalZDCDetId id)
explicit

Definition at line 5 of file ZDCDataFrame.cc.

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

Member Function Documentation

◆ elecId()

const HcalElectronicsId& ZDCDataFrame::elecId ( ) const
inline

Definition at line 23 of file ZDCDataFrame.h.

23 { return electronicsId_; }

References electronicsId_.

◆ fiberIdleOffset()

int ZDCDataFrame::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 ZDCDataFrame.cc.

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

References hcalPresamples_, and heppy_batch::val.

Referenced by operator<<().

◆ id()

const HcalZDCDetId& ZDCDataFrame::id ( ) const
inline

Definition at line 22 of file ZDCDataFrame.h.

22 { return id_; }

References id_.

Referenced by HcalNominalCoder::adc2fC(), ZDCDigiStudy::analyze(), and operator<<().

◆ operator[]()

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

access a sample

Definition at line 37 of file ZDCDataFrame.h.

37 { return data_[i]; }

References data_, and mps_fire::i.

◆ presamples()

int ZDCDataFrame::presamples ( ) const
inline

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

Definition at line 28 of file ZDCDataFrame.h.

28 { return hcalPresamples_ & 0xF; }

References hcalPresamples_.

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

◆ sample()

const HcalQIESample& ZDCDataFrame::sample ( int  i) const
inline

access a sample

Definition at line 39 of file ZDCDataFrame.h.

39 { return data_[i]; }

References data_, and mps_fire::i.

Referenced by ZDCDigiStudy::analyze(), and operator<<().

◆ setFiberIdleOffset()

void ZDCDataFrame::setFiberIdleOffset ( int  offset)

Definition at line 49 of file ZDCDataFrame.cc.

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 }

References hcalPresamples_, and hltrates_dqm_sourceclient-live_cfg::offset.

◆ setPresamples()

void ZDCDataFrame::setPresamples ( int  ps)

Definition at line 17 of file ZDCDataFrame.cc.

17 { hcalPresamples_ |= ps & 0xF; }

References hcalPresamples_.

◆ setReadoutIds()

void ZDCDataFrame::setReadoutIds ( const HcalElectronicsId eid)

Definition at line 18 of file ZDCDataFrame.cc.

18 { electronicsId_ = eid; }

References runTauDisplay::eid, and electronicsId_.

◆ setSample()

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

Definition at line 50 of file ZDCDataFrame.h.

50 { data_[i] = sam; }

References data_, and mps_fire::i.

◆ setSize()

void ZDCDataFrame::setSize ( int  size)

Definition at line 9 of file ZDCDataFrame.cc.

9  {
10  if (size > MAXSAMPLES)
11  size_ = MAXSAMPLES;
12  else if (size <= 0)
13  size_ = 0;
14  else
15  size_ = size;
16 }

References MAXSAMPLES, size(), and size_.

◆ setZSInfo()

void ZDCDataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass,
uint32_t  crossingMask = 0 
)

Definition at line 35 of file ZDCDataFrame.cc.

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 }

References hcalPresamples_, and DigiNZS_cff::markAndPass.

◆ size()

int ZDCDataFrame::size ( void  ) const
inline

total number of samples in the digi

Definition at line 26 of file ZDCDataFrame.h.

26 { return size_ & 0xF; }

References size_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), HcalNominalCoder::adc2fC(), ZDCDigiStudy::analyze(), operator<<(), and setSize().

◆ validate()

bool ZDCDataFrame::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 ZDCDataFrame.cc.

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 }

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

◆ zsCrossingMask()

uint32_t ZDCDataFrame::zsCrossingMask ( ) const
inline

zs crossing mask (which sums considered)

Definition at line 34 of file ZDCDataFrame.h.

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

References hcalPresamples_.

◆ zsMarkAndPass()

bool ZDCDataFrame::zsMarkAndPass ( ) const
inline

was ZS MarkAndPass?

Definition at line 30 of file ZDCDataFrame.h.

30 { return (hcalPresamples_ & 0x10); }

References hcalPresamples_.

Referenced by operator<<().

◆ zsUnsuppressed()

bool ZDCDataFrame::zsUnsuppressed ( ) const
inline

was ZS unsuppressed?

Definition at line 32 of file ZDCDataFrame.h.

32 { return (hcalPresamples_ & 0x20); }

References hcalPresamples_.

Referenced by operator<<().

Member Data Documentation

◆ data_

HcalQIESample ZDCDataFrame::data_[MAXSAMPLES]
private

Definition at line 61 of file ZDCDataFrame.h.

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

◆ electronicsId_

HcalElectronicsId ZDCDataFrame::electronicsId_
private

Definition at line 58 of file ZDCDataFrame.h.

Referenced by elecId(), and setReadoutIds().

◆ hcalPresamples_

int ZDCDataFrame::hcalPresamples_
private

◆ id_

HcalZDCDetId ZDCDataFrame::id_
private

Definition at line 57 of file ZDCDataFrame.h.

Referenced by id().

◆ MAXSAMPLES

const int ZDCDataFrame::MAXSAMPLES = 10
static

Definition at line 54 of file ZDCDataFrame.h.

Referenced by setSize(), and ZdcUnpacker::ZdcUnpacker().

◆ size_

int ZDCDataFrame::size_
private

Definition at line 59 of file ZDCDataFrame.h.

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

mps_fire.i
i
Definition: mps_fire.py:355
ZDCDataFrame::electronicsId_
HcalElectronicsId electronicsId_
Definition: ZDCDataFrame.h:58
ZDCDataFrame::hcalPresamples_
int hcalPresamples_
Definition: ZDCDataFrame.h:60
ZDCDataFrame::MAXSAMPLES
static const int MAXSAMPLES
Definition: ZDCDataFrame.h:54
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
ZDCDataFrame::data_
HcalQIESample data_[MAXSAMPLES]
Definition: ZDCDataFrame.h:61
PresampleTask_cfi.nSamples
nSamples
Definition: PresampleTask_cfi.py:7
ZDCDataFrame::size
int size() const
total number of samples in the digi
Definition: ZDCDataFrame.h:26
DigiNZS_cff.markAndPass
markAndPass
Definition: DigiNZS_cff.py:6
castor_dqm_sourceclient-live_cfg.firstSample
firstSample
Definition: castor_dqm_sourceclient-live_cfg.py:58
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
HcalQIESample::capid
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
heppy_batch.val
val
Definition: heppy_batch.py:351
ZDCDataFrame::size_
int size_
Definition: ZDCDataFrame.h:59
ZDCDataFrame::id_
HcalZDCDetId id_
Definition: ZDCDataFrame.h:57
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78