CMS 3D CMS Logo

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

#include <HBHEDataFrame.h>

Public Types

typedef HcalDetId 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...
 
 HBHEDataFrame ()
 
 HBHEDataFrame (const HcalDetId &id)
 
const HcalDetIdid () 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 HB and HE.

Definition at line 14 of file HBHEDataFrame.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 16 of file HBHEDataFrame.h.

Constructor & Destructor Documentation

HBHEDataFrame::HBHEDataFrame ( )
inline

Definition at line 18 of file HBHEDataFrame.h.

19  : id_(0), size_(0), hcalPresamples_(0)
20  {}
HcalDetId id_
Definition: HBHEDataFrame.h:94
HBHEDataFrame::HBHEDataFrame ( const HcalDetId id)
inlineexplicit

Definition at line 21 of file HBHEDataFrame.h.

21  :
22  id_(id), size_(0), hcalPresamples_(0)
23  {
24  // TODO : test id for HcalBarrel or HcalEndcap
25  }
HcalDetId id_
Definition: HBHEDataFrame.h:94

Member Function Documentation

const HcalElectronicsId& HBHEDataFrame::elecId ( ) const
inline

Definition at line 28 of file HBHEDataFrame.h.

References electronicsId_.

28 { return electronicsId_; }
HcalElectronicsId electronicsId_
Definition: HBHEDataFrame.h:95
int HBHEDataFrame::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 HBHEDataFrame.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  }
const HcalDetId& HBHEDataFrame::id ( ) const
inline
HcalQIESample const& HBHEDataFrame::operator[] ( int  i) const
inline

access a sample

Definition at line 42 of file HBHEDataFrame.h.

References data_, and mps_fire::i.

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

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

Definition at line 33 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by HcalNominalCoder::adc2fC(), HcalTriggerPrimitiveAlgo::addSignal(), operator<<(), and HcalSignalGenerator< HBHEDigitizerTraits >::samplesInPE().

33 { return hcalPresamples_&0xF; }
HcalQIESample const& HBHEDataFrame::sample ( int  i) const
inline
void HBHEDataFrame::setFiberIdleOffset ( int  offset)
inline

Definition at line 84 of file HBHEDataFrame.h.

References hcalPresamples_, and PFRecoTauDiscriminationByIsolation_cfi::offset.

84  {
85  hcalPresamples_&=0x7FFFF0FF;
86  if (offset>=7) hcalPresamples_|=0xF00;
87  else if (offset>=0) hcalPresamples_|=(0x800)|(offset<<8);
88  else if (offset>=-7) hcalPresamples_|=((-offset)<<8);
89  else hcalPresamples_|=0x700;
90  }
void HBHEDataFrame::setPresamples ( int  ps)
inline

Definition at line 70 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by PFHBHERecHitCreatorMaxSample::importRecHits().

70  {
71  hcalPresamples_|=ps&0xF;
72  }
void HBHEDataFrame::setReadoutIds ( const HcalElectronicsId eid)
inline

Definition at line 81 of file HBHEDataFrame.h.

References runTauDisplay::eid, and electronicsId_.

81  {
83  }
HcalElectronicsId electronicsId_
Definition: HBHEDataFrame.h:95
void HBHEDataFrame::setSample ( int  i,
const HcalQIESample sam 
)
inline

Definition at line 80 of file HBHEDataFrame.h.

References data_, and mps_fire::i.

Referenced by PFHBHERecHitCreatorMaxSample::importRecHits().

80 { data_[i]=sam; }
HcalQIESample data_[MAXSAMPLES]
Definition: HBHEDataFrame.h:98
void HBHEDataFrame::setSize ( int  size)
inline

Definition at line 65 of file HBHEDataFrame.h.

References MAXSAMPLES, size(), and size_.

Referenced by PFHBHERecHitCreatorMaxSample::importRecHits().

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

Definition at line 73 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by HcalZeroSuppressionAlgo::suppress().

74  {
75  hcalPresamples_&=0x7FC00F0F; // preserve actual presamples and fiber idle offset
76  if (markAndPass) hcalPresamples_|=0x10;
77  if (unsuppressed) hcalPresamples_|=0x20;
78  hcalPresamples_|=(crossingMask&0x3FF)<<12;
79  }
int HBHEDataFrame::size ( void  ) const
inline
bool HBHEDataFrame::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 HBHEDataFrame.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  }
HcalQIESample data_[MAXSAMPLES]
Definition: HBHEDataFrame.h:98
constexpr size_t nSamples
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:65
uint32_t HBHEDataFrame::zsCrossingMask ( ) const
inline

zs crossing mask (which sums considered)

Definition at line 39 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

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

was ZS MarkAndPass?

Definition at line 35 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by reco::HcalNoiseInfoProducer::filldigis(), and operator<<().

35 { return (hcalPresamples_&0x10); }
bool HBHEDataFrame::zsUnsuppressed ( ) const
inline

was ZS unsuppressed?

Definition at line 37 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

37 { return (hcalPresamples_&0x20); }

Member Data Documentation

HcalQIESample HBHEDataFrame::data_[MAXSAMPLES]
private

Definition at line 98 of file HBHEDataFrame.h.

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

HcalElectronicsId HBHEDataFrame::electronicsId_
private

Definition at line 95 of file HBHEDataFrame.h.

Referenced by elecId(), and setReadoutIds().

int HBHEDataFrame::hcalPresamples_
private
HcalDetId HBHEDataFrame::id_
private

Definition at line 94 of file HBHEDataFrame.h.

Referenced by id().

const int HBHEDataFrame::MAXSAMPLES = 10
static

Definition at line 92 of file HBHEDataFrame.h.

Referenced by setSize().

int HBHEDataFrame::size_
private

Definition at line 96 of file HBHEDataFrame.h.

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