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

HcalElectronicsId const & elecId () 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...
 
 HODataFrame ()
 
 HODataFrame (const HcalDetId &id)
 
HcalDetId const & id () 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_
 
HcalDetId id_
 
int size_
 

Detailed Description

Precision readout digi for HO

Definition at line 15 of file HODataFrame.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 17 of file HODataFrame.h.

Constructor & Destructor Documentation

HODataFrame::HODataFrame ( )
inline

Definition at line 19 of file HODataFrame.h.

20  : id_(0), size_(0), hcalPresamples_(0)
21  {}
HcalDetId id_
Definition: HODataFrame.h:93
int hcalPresamples_
Definition: HODataFrame.h:96
HODataFrame::HODataFrame ( const HcalDetId id)
inlineexplicit

Definition at line 22 of file HODataFrame.h.

23  : id_(id), size_(0), hcalPresamples_(0)
24  {// TODO : test id for HcalOuter
25  }
HcalDetId id_
Definition: HODataFrame.h:93
int hcalPresamples_
Definition: HODataFrame.h:96

Member Function Documentation

HcalElectronicsId const& HODataFrame::elecId ( ) const
inline

Definition at line 28 of file HODataFrame.h.

References electronicsId_.

Referenced by LEDTask::_process().

28 { return electronicsId_; }
HcalElectronicsId electronicsId_
Definition: HODataFrame.h:94
int HODataFrame::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 47 of file HODataFrame.h.

References hcalPresamples_, and heppy_batch::val.

Referenced by operator<<().

47  {
48  int val=(hcalPresamples_&0xF00)>>8;
49  return (val==0)?(-1000):(((val&0x8)==0)?(-(val&0x7)):(val&0x7));
50  }
int hcalPresamples_
Definition: HODataFrame.h:96
HcalDetId const& HODataFrame::id ( ) const
inline
const HcalQIESample& HODataFrame::operator[] ( int  i) const
inline

access a sample

Definition at line 42 of file HODataFrame.h.

References data_, and mps_fire::i.

42 { return data_[i]; }
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:97
int HODataFrame::presamples ( ) const
inline

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

Definition at line 33 of file HODataFrame.h.

References hcalPresamples_.

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

33 { return hcalPresamples_&0xF; }
int hcalPresamples_
Definition: HODataFrame.h:96
const HcalQIESample& HODataFrame::sample ( int  i) const
inline

access a sample

Definition at line 44 of file HODataFrame.h.

References data_, and mps_fire::i.

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

44 { return data_[i]; }
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:97
void HODataFrame::setFiberIdleOffset ( int  offset)
inline

Definition at line 83 of file HODataFrame.h.

References hcalPresamples_, and PFRecoTauDiscriminationByIsolation_cfi::offset.

83  {
84  hcalPresamples_&=0xFFFF0FF;
85  if (offset>=7) hcalPresamples_|=0xF00;
86  else if (offset>=0) hcalPresamples_|=(0x800)|(offset<<8);
87  else if (offset>=-7) hcalPresamples_|=((-offset)<<8);
88  else hcalPresamples_|=0x700;
89  }
int hcalPresamples_
Definition: HODataFrame.h:96
void HODataFrame::setPresamples ( int  ps)
inline

Definition at line 70 of file HODataFrame.h.

References hcalPresamples_.

70  {
71  hcalPresamples_|=ps&0xF;
72  }
int hcalPresamples_
Definition: HODataFrame.h:96
void HODataFrame::setReadoutIds ( const HcalElectronicsId eid)
inline

Definition at line 80 of file HODataFrame.h.

References runTauDisplay::eid, and electronicsId_.

80  {
82  }
HcalElectronicsId electronicsId_
Definition: HODataFrame.h:94
void HODataFrame::setSample ( int  i,
const HcalQIESample sam 
)
inline

Definition at line 79 of file HODataFrame.h.

References data_, and mps_fire::i.

79 { data_[i]=sam; }
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:97
void HODataFrame::setSize ( int  size)
inline

Definition at line 65 of file HODataFrame.h.

References MAXSAMPLES, size(), and size_.

65  {
67  else if (size<=0) size_=0;
68  else size_=size;
69  }
static const int MAXSAMPLES
Definition: HODataFrame.h:91
int size() const
total number of samples in the digi
Definition: HODataFrame.h:31
void HODataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass,
uint32_t  crossingMask = 0 
)
inline

Definition at line 73 of file HODataFrame.h.

References hcalPresamples_.

Referenced by HcalZeroSuppressionAlgo::suppress().

73  {
74  hcalPresamples_&=0x7FC00F0F; // preserve actual presamples and fiber idle offset
75  if (markAndPass) hcalPresamples_|=0x10;
76  if (unsuppressed) hcalPresamples_|=0x20;
77  hcalPresamples_|=(crossingMask&0x3FF)<<12;
78  }
int hcalPresamples_
Definition: HODataFrame.h:96
int HODataFrame::size ( void  ) const
inline
bool HODataFrame::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 53 of file HODataFrame.h.

References HcalQIESample::capid(), data_, CastorSimpleReconstructor_cfi::firstSample, mps_fire::i, hgc_digi::nSamples, convertSQLiteXML::ok, and size_.

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

zs crossing mask (which sums considered)

Definition at line 39 of file HODataFrame.h.

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

39 { return (hcalPresamples_&0x3FF000)>>12; }
int hcalPresamples_
Definition: HODataFrame.h:96
bool HODataFrame::zsMarkAndPass ( ) const
inline

was ZS MarkAndPass?

Definition at line 35 of file HODataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

35 { return (hcalPresamples_&0x10); }
int hcalPresamples_
Definition: HODataFrame.h:96
bool HODataFrame::zsUnsuppressed ( ) const
inline

was ZS unsuppressed?

Definition at line 37 of file HODataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

37 { return (hcalPresamples_&0x20); }
int hcalPresamples_
Definition: HODataFrame.h:96

Member Data Documentation

HcalQIESample HODataFrame::data_[MAXSAMPLES]
private

Definition at line 97 of file HODataFrame.h.

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

HcalElectronicsId HODataFrame::electronicsId_
private

Definition at line 94 of file HODataFrame.h.

Referenced by elecId(), and setReadoutIds().

int HODataFrame::hcalPresamples_
private
HcalDetId HODataFrame::id_
private

Definition at line 93 of file HODataFrame.h.

Referenced by id().

const int HODataFrame::MAXSAMPLES = 10
static

Definition at line 91 of file HODataFrame.h.

Referenced by setSize().

int HODataFrame::size_
private

Definition at line 95 of file HODataFrame.h.

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