CMS 3D CMS Logo

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

#include <HFDataFrame.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...
 
 HFDataFrame ()
 
 HFDataFrame (const HcalDetId &id)
 
HcalDetId const & id () const
 
HcalQIESample const & operator[] (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...
 
HcalQIESample const & sample (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 HF

Definition at line 14 of file HFDataFrame.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 16 of file HFDataFrame.h.

Constructor & Destructor Documentation

HFDataFrame::HFDataFrame ( )
inline

Definition at line 18 of file HFDataFrame.h.

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

Definition at line 21 of file HFDataFrame.h.

21  :
22  id_(id), size_(0), hcalPresamples_(0)
23  {// TODO : test id for HcalForward
24  }
HcalDetId id_
Definition: HFDataFrame.h:93
int hcalPresamples_
Definition: HFDataFrame.h:96

Member Function Documentation

HcalElectronicsId const& HFDataFrame::elecId ( ) const
inline

Definition at line 27 of file HFDataFrame.h.

References electronicsId_.

27 { return electronicsId_; }
HcalElectronicsId electronicsId_
Definition: HFDataFrame.h:94
int HFDataFrame::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 46 of file HFDataFrame.h.

References hcalPresamples_, and heppy_batch::val.

Referenced by operator<<().

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

access a sample

Definition at line 41 of file HFDataFrame.h.

References data_, and mps_fire::i.

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

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

Definition at line 32 of file HFDataFrame.h.

References hcalPresamples_.

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

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

access a sample

Definition at line 43 of file HFDataFrame.h.

References data_, and mps_fire::i.

Referenced by HFRaddamTask::_process(), HcalHFStatusBitFromDigis::hfSetFlagFromDigi(), operator<<(), and HcalPedestalAnalysis::processEvent().

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

Definition at line 83 of file HFDataFrame.h.

References hcalPresamples_, and PFRecoTauDiscriminationByIsolation_cfi::offset.

83  {
84  hcalPresamples_&=0x7FFFF0FF;
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: HFDataFrame.h:96
void HFDataFrame::setPresamples ( int  ps)
inline

Definition at line 69 of file HFDataFrame.h.

References hcalPresamples_.

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

Definition at line 80 of file HFDataFrame.h.

References runTauDisplay::eid, and electronicsId_.

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

Definition at line 79 of file HFDataFrame.h.

References data_, and mps_fire::i.

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

Definition at line 64 of file HFDataFrame.h.

References MAXSAMPLES, size(), and size_.

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

Definition at line 72 of file HFDataFrame.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: HFDataFrame.h:96
int HFDataFrame::size ( void  ) const
inline
bool HFDataFrame::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 52 of file HFDataFrame.h.

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

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

zs crossing mask (which sums considered)

Definition at line 38 of file HFDataFrame.h.

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

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

was ZS MarkAndPass?

Definition at line 34 of file HFDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

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

was ZS unsuppressed?

Definition at line 36 of file HFDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

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

Member Data Documentation

HcalQIESample HFDataFrame::data_[MAXSAMPLES]
private

Definition at line 97 of file HFDataFrame.h.

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

HcalElectronicsId HFDataFrame::electronicsId_
private

Definition at line 94 of file HFDataFrame.h.

Referenced by elecId(), and setReadoutIds().

int HFDataFrame::hcalPresamples_
private
HcalDetId HFDataFrame::id_
private

Definition at line 93 of file HFDataFrame.h.

Referenced by id().

const int HFDataFrame::MAXSAMPLES = 10
static

Definition at line 91 of file HFDataFrame.h.

Referenced by setSize().

int HFDataFrame::size_
private

Definition at line 95 of file HFDataFrame.h.

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