CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

For the sorted collection.

Definition at line 17 of file ZDCDataFrame.h.

Constructor & Destructor Documentation

ZDCDataFrame::ZDCDataFrame ( )

Definition at line 3 of file ZDCDataFrame.cc.

3  : id_(0),
4  size_(0),
6 {
7 }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
HcalZDCDetId id_
Definition: ZDCDataFrame.h:56
ZDCDataFrame::ZDCDataFrame ( const HcalZDCDetId id)
explicit

Definition at line 9 of file ZDCDataFrame.cc.

9  :
10  id_(id),
11  size_(0),
13 {
14  // TODO : test id for ZDC
15 }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
HcalZDCDetId id_
Definition: ZDCDataFrame.h:56

Member Function Documentation

const HcalElectronicsId& ZDCDataFrame::elecId ( ) const
inline

Definition at line 23 of file ZDCDataFrame.h.

References electronicsId_.

Referenced by ZDCTask::analyze().

23 { return electronicsId_; }
HcalElectronicsId electronicsId_
Definition: ZDCDataFrame.h:57
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 48 of file ZDCDataFrame.cc.

References hcalPresamples_.

Referenced by operator<<().

48  {
49  int val=(hcalPresamples_&0xF00)>>8;
50  return (val==0)?(-1000):(((val&0x8)==0)?(-(val&0x7)):(val&0x7));
51 }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
const HcalZDCDetId& ZDCDataFrame::id ( ) const
inline

Definition at line 22 of file ZDCDataFrame.h.

References id_.

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

22 { return id_; }
HcalZDCDetId id_
Definition: ZDCDataFrame.h:56
const HcalQIESample& ZDCDataFrame::operator[] ( int  i) const
inline

access a sample

Definition at line 37 of file ZDCDataFrame.h.

References data_, and i.

37 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
HcalQIESample data_[MAXSAMPLES]
Definition: ZDCDataFrame.h:60
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.

References hcalPresamples_.

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

28 { return hcalPresamples_&0xF; }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
const HcalQIESample& ZDCDataFrame::sample ( int  i) const
inline

access a sample

Definition at line 39 of file ZDCDataFrame.h.

References data_, and i.

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

39 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
HcalQIESample data_[MAXSAMPLES]
Definition: ZDCDataFrame.h:60
void ZDCDataFrame::setFiberIdleOffset ( int  offset)

Definition at line 53 of file ZDCDataFrame.cc.

References hcalPresamples_, and hltrates_dqm_sourceclient-live_cfg::offset.

53  {
54  hcalPresamples_&=0x7FFFF0FF;
55  if (offset>=7) hcalPresamples_|=0xF00;
56  else if (offset>=0) hcalPresamples_|=(0x800)|(offset<<8);
57  else if (offset>=-7) hcalPresamples_|=((-offset)<<8);
58  else hcalPresamples_|=0x700;
59 }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
void ZDCDataFrame::setPresamples ( int  ps)

Definition at line 22 of file ZDCDataFrame.cc.

References hcalPresamples_.

22  {
23  hcalPresamples_|=ps&0xF;
24 }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
void ZDCDataFrame::setReadoutIds ( const HcalElectronicsId eid)

Definition at line 25 of file ZDCDataFrame.cc.

References electronicsId_.

25  {
26  electronicsId_=eid;
27 }
HcalElectronicsId electronicsId_
Definition: ZDCDataFrame.h:57
void ZDCDataFrame::setSample ( int  i,
const HcalQIESample sam 
)
inline

Definition at line 50 of file ZDCDataFrame.h.

References data_, and i.

50 { data_[i]=sam; }
int i
Definition: DBlmapReader.cc:9
HcalQIESample data_[MAXSAMPLES]
Definition: ZDCDataFrame.h:60
void ZDCDataFrame::setSize ( int  size)

Definition at line 17 of file ZDCDataFrame.cc.

References MAXSAMPLES, size(), and size_.

17  {
19  else if (size<=0) size_=0;
20  else size_=size;
21 }
static const int MAXSAMPLES
Definition: ZDCDataFrame.h:54
int size() const
total number of samples in the digi
Definition: ZDCDataFrame.h:26
void ZDCDataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass,
uint32_t  crossingMask = 0 
)

Definition at line 41 of file ZDCDataFrame.cc.

References hcalPresamples_.

41  {
42  hcalPresamples_&=0x7FC00F0F; // preserve actual presamples and fiber idle offset
43  if (markAndPass) hcalPresamples_|=0x10;
44  if (unsuppressed) hcalPresamples_|=0x20;
45  hcalPresamples_|=(crossingMask&0x3FF)<<12;
46 }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
int ZDCDataFrame::size ( void  ) const
inline

total number of samples in the digi

Definition at line 26 of file ZDCDataFrame.h.

References size_.

Referenced by HcalNominalCoder::adc2fC(), ZDCTask::analyze(), ZDCDigiStudy::analyze(), operator<<(), HcalZDCMonitor::processEvent(), and setSize().

26 { return size_&0xF; }
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 29 of file ZDCDataFrame.cc.

References HcalQIESample::capid(), data_, castor_dqm_sourceclient_file_cfg::firstSample, i, convertSQLiteXML::ok, and size_.

29  {
30  int capid=-1;
31  bool ok=true;
32  for (int i=0; ok && i<nSamples && i+firstSample<size_; i++) {
33  if (data_[i+firstSample].er() || !data_[i+firstSample].dv()) ok=false;
34  if (i==0) capid=data_[i+firstSample].capid();
35  if (capid!=data_[i+firstSample].capid()) ok=false;
36  capid=(capid+1)%4;
37  }
38  return ok;
39 }
int i
Definition: DBlmapReader.cc:9
constexpr size_t nSamples
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:26
HcalQIESample data_[MAXSAMPLES]
Definition: ZDCDataFrame.h:60
uint32_t ZDCDataFrame::zsCrossingMask ( ) const
inline

zs crossing mask (which sums considered)

Definition at line 34 of file ZDCDataFrame.h.

References hcalPresamples_.

34 { return (hcalPresamples_&0x3FF000)>>12; }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
bool ZDCDataFrame::zsMarkAndPass ( ) const
inline

was ZS MarkAndPass?

Definition at line 30 of file ZDCDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

30 { return (hcalPresamples_&0x10); }
int hcalPresamples_
Definition: ZDCDataFrame.h:59
bool ZDCDataFrame::zsUnsuppressed ( ) const
inline

was ZS unsuppressed?

Definition at line 32 of file ZDCDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

32 { return (hcalPresamples_&0x20); }
int hcalPresamples_
Definition: ZDCDataFrame.h:59

Member Data Documentation

HcalQIESample ZDCDataFrame::data_[MAXSAMPLES]
private

Definition at line 60 of file ZDCDataFrame.h.

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

HcalElectronicsId ZDCDataFrame::electronicsId_
private

Definition at line 57 of file ZDCDataFrame.h.

Referenced by elecId(), and setReadoutIds().

int ZDCDataFrame::hcalPresamples_
private
HcalZDCDetId ZDCDataFrame::id_
private

Definition at line 56 of file ZDCDataFrame.h.

Referenced by id().

const int ZDCDataFrame::MAXSAMPLES = 10
static

Definition at line 54 of file ZDCDataFrame.h.

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

int ZDCDataFrame::size_
private

Definition at line 58 of file ZDCDataFrame.h.

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