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
HODataFrame Class Reference

#include <HODataFrame.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...
 
 HODataFrame ()
 
 HODataFrame (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 HO

Definition at line 16 of file HODataFrame.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 18 of file HODataFrame.h.

Constructor & Destructor Documentation

HODataFrame::HODataFrame ( )

Definition at line 4 of file HODataFrame.cc.

4  : id_(0),
5  size_(0),
7 {
8 }
HcalDetId id_
Definition: HODataFrame.h:57
int hcalPresamples_
Definition: HODataFrame.h:60
HODataFrame::HODataFrame ( const HcalDetId id)
explicit

Definition at line 10 of file HODataFrame.cc.

10  :
11  id_(id),
12  size_(0),
14 {
15  // TODO : test id for HcalOuter
16 }
HcalDetId id_
Definition: HODataFrame.h:57
int hcalPresamples_
Definition: HODataFrame.h:60

Member Function Documentation

const HcalElectronicsId& HODataFrame::elecId ( ) const
inline

Definition at line 24 of file HODataFrame.h.

References electronicsId_.

24 { return electronicsId_; }
HcalElectronicsId electronicsId_
Definition: HODataFrame.h:58
int HODataFrame::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 50 of file HODataFrame.cc.

References hcalPresamples_.

Referenced by operator<<().

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

access a sample

Definition at line 38 of file HODataFrame.h.

References data_, and i.

38 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:61
int HODataFrame::presamples ( ) const
inline

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

Definition at line 29 of file HODataFrame.h.

References hcalPresamples_.

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

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

access a sample

Definition at line 40 of file HODataFrame.h.

References data_, and i.

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

40 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:61
void HODataFrame::setFiberIdleOffset ( int  offset)

Definition at line 55 of file HODataFrame.cc.

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

55  {
56  hcalPresamples_&=0xFFFF0FF;
57  if (offset>=7) hcalPresamples_|=0xF00;
58  else if (offset>=0) hcalPresamples_|=(0x800)|(offset<<8);
59  else if (offset>=-7) hcalPresamples_|=((-offset)<<8);
60  else hcalPresamples_|=0x700;
61 }
unsigned int offset(bool)
int hcalPresamples_
Definition: HODataFrame.h:60
void HODataFrame::setPresamples ( int  ps)

Definition at line 23 of file HODataFrame.cc.

References hcalPresamples_.

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

Definition at line 26 of file HODataFrame.cc.

References electronicsId_.

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

Definition at line 51 of file HODataFrame.h.

References data_, and i.

Referenced by HcalElectronicsSim::analogToDigital().

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

Definition at line 18 of file HODataFrame.cc.

References MAXSAMPLES, size(), and size_.

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

Definition at line 42 of file HODataFrame.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 
48 }
int hcalPresamples_
Definition: HODataFrame.h:60
int HODataFrame::size ( void  ) const
inline
bool HODataFrame::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 HODataFrame.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: HODataFrame.h:61
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:26
uint32_t HODataFrame::zsCrossingMask ( ) const
inline

zs crossing mask (which sums considered)

Definition at line 35 of file HODataFrame.h.

References hcalPresamples_.

Referenced by HcalZSAlgoRealistic::shouldKeep().

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

was ZS MarkAndPass?

Definition at line 31 of file HODataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

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

was ZS unsuppressed?

Definition at line 33 of file HODataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

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

Member Data Documentation

HcalQIESample HODataFrame::data_[MAXSAMPLES]
private

Definition at line 61 of file HODataFrame.h.

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

HcalElectronicsId HODataFrame::electronicsId_
private

Definition at line 58 of file HODataFrame.h.

Referenced by elecId(), and setReadoutIds().

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

Definition at line 57 of file HODataFrame.h.

Referenced by id().

const int HODataFrame::MAXSAMPLES = 10
static

Definition at line 55 of file HODataFrame.h.

Referenced by setSize().

int HODataFrame::size_
private

Definition at line 59 of file HODataFrame.h.

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