CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QIE10DataFrame.cc
Go to the documentation of this file.
3 
4 void QIE10DataFrame::setSample(edm::DataFrame::size_type isample, int adc, int le_tdc, int fe_tdc, int capid, bool soi, bool ok) {
5  if (isample>=size()) return;
7  edm::DataFrame::operator[](isample*WORDS_PER_SAMPLE+HEADER_WORDS+1)=(le_tdc&Sample::MASK_LE_TDC)|((fe_tdc&Sample::MASK_TE_TDC)<<Sample::OFFSET_TE_TDC)|((capid&Sample::MASK_CAPID)<<Sample::OFFSET_CAPID)|0x4000; // 0x4000 marks this as second word of a pair
8 }
9 
10 void QIE10DataFrame::setFlags(uint16_t v) {
12 }
13 
14 
15 std::ostream& operator<<(std::ostream& s, const QIE10DataFrame& digi) {
16  if (digi.detid().det()==DetId::Hcal) {
17  s << HcalGenericDetId(digi.detid());
18  } else {
19  s << "DetId(" << digi.detid().rawId() << ")";
20  }
21  s << " " << digi.samples() << " samples";
22  if (digi.linkError()) s << " LinkError ";
23  if (digi.wasMarkAndPass()) s << " MaP ";
24  s << std::endl;
25  for (int i=0; i<digi.samples(); i++) {
26  s << " ADC=" << digi[i].adc() << " TDC(LE)=" << digi[i].le_tdc() << " TDC(TE)=" << digi[i].te_tdc() << " CAPID=" << digi[i].capid();
27  if (digi[i].soi()) s << " SOI ";
28  if (!digi[i].ok()) s << " !OK ";
29  s << std::endl;
30  }
31  return s;
32 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
static const int MASK_OK
int i
Definition: DBlmapReader.cc:9
static const int MASK_SOI
void setFlags(uint16_t v)
set the flag word
static const int MASK_CAPID
static const int MASK_LE_TDC
void setSample(edm::DataFrame::size_type isample, int adc, int le_tdc, int fe_tdc, int capid, bool soi=false, bool ok=true)
set the sample contents
bool linkError() const
static const int WORDS_PER_SAMPLE
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int MASK_ADC
unsigned int size_type
Definition: DataFrame.h:18
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool wasMarkAndPass() const
data_type & operator[](size_type i)
Definition: DataFrame.h:38
DetId detid() const
Get the detector id.
static const int OFFSET_TE_TDC
static const int HEADER_WORDS
static const int MASK_TE_TDC
size_type size() const
Definition: DataFrame.h:64
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
static const int OFFSET_CAPID