test
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
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
 
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 HB and HE.

Definition at line 15 of file HBHEDataFrame.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 17 of file HBHEDataFrame.h.

Constructor & Destructor Documentation

HBHEDataFrame::HBHEDataFrame ( )

Definition at line 4 of file HBHEDataFrame.cc.

4  : id_(0),
5  size_(0),
7 {
8 }
HcalDetId id_
Definition: HBHEDataFrame.h:56
HBHEDataFrame::HBHEDataFrame ( const HcalDetId id)
explicit

Definition at line 10 of file HBHEDataFrame.cc.

10  :
11  id_(id),
12  size_(0),
14 {
15  // TODO : test id for HcalBarrel or HcalEndcap
16 }
HcalDetId id_
Definition: HBHEDataFrame.h:56

Member Function Documentation

const HcalElectronicsId& HBHEDataFrame::elecId ( ) const
inline

Definition at line 23 of file HBHEDataFrame.h.

References electronicsId_.

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

References hcalPresamples_.

Referenced by operator<<().

49  {
50  int val=(hcalPresamples_&0xF00)>>8;
51  return (val==0)?(-1000):(((val&0x8)==0)?(-(val&0x7)):(val&0x7));
52 }
const HcalDetId& HBHEDataFrame::id ( void  ) const
inline
const HcalQIESample& HBHEDataFrame::operator[] ( int  i) const
inline

access a sample

Definition at line 37 of file HBHEDataFrame.h.

References data_, and i.

37 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
HcalQIESample data_[MAXSAMPLES]
Definition: HBHEDataFrame.h:60
int HBHEDataFrame::presamples ( ) const
inline

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

Definition at line 28 of file HBHEDataFrame.h.

References hcalPresamples_.

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

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

Definition at line 54 of file HBHEDataFrame.cc.

References hcalPresamples_, and evf::evtn::offset().

54  {
55  hcalPresamples_&=0x7FFFF0FF;
56  if (offset>=7) hcalPresamples_|=0xF00;
57  else if (offset>=0) hcalPresamples_|=(0x800)|(offset<<8);
58  else if (offset>=-7) hcalPresamples_|=((-offset)<<8);
59  else hcalPresamples_|=0x700;
60 }
unsigned int offset(bool)
void HBHEDataFrame::setPresamples ( int  ps)

Definition at line 23 of file HBHEDataFrame.cc.

References hcalPresamples_.

23  {
24  hcalPresamples_|=ps&0xF;
25 }
void HBHEDataFrame::setReadoutIds ( const HcalElectronicsId eid)

Definition at line 26 of file HBHEDataFrame.cc.

References electronicsId_.

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

Definition at line 50 of file HBHEDataFrame.h.

References data_, and i.

Referenced by HcalRecHitsMaker::loadHcalRecHits(), and HcaluLUTTPGCoder::update().

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

Definition at line 18 of file HBHEDataFrame.cc.

References MAXSAMPLES, size(), and size_.

Referenced by HcalRecHitsMaker::loadHcalRecHits(), and HcaluLUTTPGCoder::update().

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

Definition at line 42 of file HBHEDataFrame.cc.

References hcalPresamples_.

Referenced by HcalZeroSuppressionAlgo::suppress().

42  {
43  hcalPresamples_&=0x7FC00F0F; // preserve actual presamples and fiber idle offset
44  if (markAndPass) hcalPresamples_|=0x10;
45  if (unsuppressed) hcalPresamples_|=0x20;
46  hcalPresamples_|=(crossingMask&0x3FF)<<12;
47 }
int HBHEDataFrame::size ( void  ) const
inline
bool HBHEDataFrame::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 30 of file HBHEDataFrame.cc.

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

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

zs crossing mask (which sums considered)

Definition at line 34 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

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

was ZS MarkAndPass?

Definition at line 30 of file HBHEDataFrame.h.

References hcalPresamples_.

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

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

was ZS unsuppressed?

Definition at line 32 of file HBHEDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

32 { return (hcalPresamples_&0x20); }

Member Data Documentation

HcalQIESample HBHEDataFrame::data_[MAXSAMPLES]
private

Definition at line 60 of file HBHEDataFrame.h.

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

HcalElectronicsId HBHEDataFrame::electronicsId_
private

Definition at line 57 of file HBHEDataFrame.h.

Referenced by elecId(), and setReadoutIds().

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

Definition at line 56 of file HBHEDataFrame.h.

Referenced by id().

const int HBHEDataFrame::MAXSAMPLES = 10
static

Definition at line 54 of file HBHEDataFrame.h.

Referenced by setSize().

int HBHEDataFrame::size_
private

Definition at line 58 of file HBHEDataFrame.h.

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