CMS 3D CMS Logo

ZDCDataFrame Class Reference

Precision readout digi for ZDC. More...

#include <DataFormats/HcalDigi/interface/ZDCDataFrame.h>

List of all members.

Public Types

typedef HcalZDCDetId key_type
 For the sorted collection.

Public Member Functions

const HcalElectronicsIdelecId () const
const HcalZDCDetIdid () const
const HcalQIESampleoperator[] (int i) const
 access a sample
int presamples () const
 number of samples before the sample from the triggered beam crossing (according to the hardware)
const HcalQIESamplesample (int i) const
 access a sample
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)
int size () const
 total number of samples in the digi
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)
 ZDCDataFrame (const HcalZDCDetId &id)
 ZDCDataFrame ()
bool zsMarkAndPass () const
 was ZS MarkAndPass?
bool zsUnsuppressed () const
 was ZS unsuppressed?

Static Public Attributes

static const int MAXSAMPLES = 10

Private Attributes

HcalQIESample data_ [MAXSAMPLES]
HcalElectronicsId electronicsId_
int hcalPresamples_
HcalZDCDetId id_
int size_


Detailed Description

Precision readout digi for ZDC.

Definition at line 15 of file ZDCDataFrame.h.


Member Typedef Documentation

typedef HcalZDCDetId ZDCDataFrame::key_type

For the sorted collection.

Definition at line 17 of file ZDCDataFrame.h.


Constructor & Destructor Documentation

ZDCDataFrame::ZDCDataFrame (  ) 

Definition at line 3 of file ZDCDataFrame.cc.

00003                            : id_(0), 
00004                              size_(0),
00005                              hcalPresamples_(0)
00006 {
00007 }

ZDCDataFrame::ZDCDataFrame ( const HcalZDCDetId id  )  [explicit]

Definition at line 9 of file ZDCDataFrame.cc.

00009                                                  : 
00010   id_(id), 
00011   size_(0),
00012   hcalPresamples_(0)
00013 {
00014   // TODO : test id for ZDC
00015 }


Member Function Documentation

const HcalElectronicsId& ZDCDataFrame::elecId (  )  const [inline]

Definition at line 23 of file ZDCDataFrame.h.

References electronicsId_.

00023 { return electronicsId_; }

const HcalZDCDetId& ZDCDataFrame::id ( void   )  const [inline]

Definition at line 22 of file ZDCDataFrame.h.

References id_.

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

00022 { return id_; }

const HcalQIESample& ZDCDataFrame::operator[] ( int  i  )  const [inline]

access a sample

Definition at line 35 of file ZDCDataFrame.h.

References data_.

00035 { return data_[i]; }

int ZDCDataFrame::presamples (  )  const [inline]

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

Definition at line 28 of file ZDCDataFrame.h.

References hcalPresamples_.

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

00028 { return hcalPresamples_&0xF; }

const HcalQIESample& ZDCDataFrame::sample ( int  i  )  const [inline]

access a sample

Definition at line 37 of file ZDCDataFrame.h.

References data_.

Referenced by operator<<().

00037 { return data_[i]; }

void ZDCDataFrame::setPresamples ( int  ps  ) 

Definition at line 22 of file ZDCDataFrame.cc.

References hcalPresamples_.

00022                                        {
00023   hcalPresamples_|=ps&0xF;
00024 }

void ZDCDataFrame::setReadoutIds ( const HcalElectronicsId eid  ) 

Definition at line 25 of file ZDCDataFrame.cc.

References electronicsId_.

00025                                                              {
00026   electronicsId_=eid;
00027 }

void ZDCDataFrame::setSample ( int  i,
const HcalQIESample sam 
) [inline]

Definition at line 45 of file ZDCDataFrame.h.

References data_.

00045 { data_[i]=sam; }

void ZDCDataFrame::setSize ( int  size  ) 

Definition at line 17 of file ZDCDataFrame.cc.

References MAXSAMPLES, and size_.

00017                                    {
00018   if (size>MAXSAMPLES) size_=MAXSAMPLES;
00019   else if (size<=0) size_=0;
00020   else size_=size;
00021 }

void ZDCDataFrame::setZSInfo ( bool  unsuppressed,
bool  markAndPass 
)

Definition at line 41 of file ZDCDataFrame.cc.

References hcalPresamples_.

00041                                                                 {
00042   if (markAndPass) hcalPresamples_|=0x10;
00043   if (unsuppressed) hcalPresamples_|=0x20;
00044 }

int ZDCDataFrame::size ( void   )  const [inline]

total number of samples in the digi

Definition at line 26 of file ZDCDataFrame.h.

References size_.

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

00026 { return size_&0xF; }

bool ZDCDataFrame::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 29 of file ZDCDataFrame.cc.

References HcalQIESample::capid(), data_, i, and size_.

00029                                                                {
00030   int capid=-1;
00031   bool ok=true;
00032   for (int i=0; ok && i<nSamples && i+firstSample<size_; i++) {
00033     if (data_[i+firstSample].er() || !data_[i+firstSample].dv()) ok=false;
00034     if (i==0) capid=data_[i+firstSample].capid();
00035     if (capid!=data_[i+firstSample].capid()) ok=false;
00036     capid=(capid+1)%4;
00037   }
00038   return ok;
00039 }

bool ZDCDataFrame::zsMarkAndPass (  )  const [inline]

was ZS MarkAndPass?

Definition at line 30 of file ZDCDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

00030 { return (hcalPresamples_&0x10); }

bool ZDCDataFrame::zsUnsuppressed (  )  const [inline]

was ZS unsuppressed?

Definition at line 32 of file ZDCDataFrame.h.

References hcalPresamples_.

Referenced by operator<<().

00032 { return (hcalPresamples_&0x20); }


Member Data Documentation

HcalQIESample ZDCDataFrame::data_[MAXSAMPLES] [private]

Definition at line 54 of file ZDCDataFrame.h.

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

HcalElectronicsId ZDCDataFrame::electronicsId_ [private]

Definition at line 51 of file ZDCDataFrame.h.

Referenced by elecId(), and setReadoutIds().

int ZDCDataFrame::hcalPresamples_ [private]

Definition at line 53 of file ZDCDataFrame.h.

Referenced by presamples(), setPresamples(), setZSInfo(), zsMarkAndPass(), and zsUnsuppressed().

HcalZDCDetId ZDCDataFrame::id_ [private]

Definition at line 50 of file ZDCDataFrame.h.

Referenced by id().

const int ZDCDataFrame::MAXSAMPLES = 10 [static]

Definition at line 48 of file ZDCDataFrame.h.

Referenced by setSize().

int ZDCDataFrame::size_ [private]

Definition at line 52 of file ZDCDataFrame.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:56 2009 for CMSSW by  doxygen 1.5.4