CMS 3D CMS Logo

CastorTriggerPrimitiveDigi.cc
Go to the documentation of this file.
2 
3 CastorTriggerPrimitiveDigi::CastorTriggerPrimitiveDigi() : size_(0), hcalPresamples_(0) {}
5  : id_(id), size_(0), hcalPresamples_(0) {}
6 
8  if (size < 0)
9  size_ = 0;
10  else if (size > MAXSAMPLES)
11  size_ = MAXSAMPLES;
12  else
13  size_ = size;
14 }
16  if (ps < 0)
17  hcalPresamples_ &= 0xFFFFFF0;
18  // else if (ps>=size_) hcalPresamples_=size_-1;
19  else
20  hcalPresamples_ |= ps & 0xF;
21 }
22 
23 void CastorTriggerPrimitiveDigi::setZSInfo(bool unsuppressed, bool markAndPass) {
24  if (markAndPass)
25  hcalPresamples_ |= 0x10;
26  if (unsuppressed)
27  hcalPresamples_ |= 0x20;
28 }
29 
30 std::ostream& operator<<(std::ostream& s, const CastorTriggerPrimitiveDigi& digi) {
31  s << digi.id() << " " << digi.size() << " samples " << digi.presamples() << " presamples";
32  if (digi.zsUnsuppressed())
33  s << " zsUS";
34  if (digi.zsMarkAndPass())
35  s << " zsM&P";
36  s << std::endl;
37  s << " SOI tpchannel=" << digi.SOI_tpchannel() << " tpdata 0x" << std::hex << digi.SOI_tpdata() << std::dec
38  << std::endl;
39  for (int i = 0; i < digi.size(); i++) {
40  s << " 0x" << std::hex << digi.sample(i).raw() << " tpdata 0x" << digi.tpdata(i) << std::dec
41  << " channel=" << digi.tpchannel(i);
42  if (digi.isSOI(i))
43  s << " SOI";
44  s << std::endl;
45  }
46  return s;
47 }
size
Write out results.
const HcalCastorDetId & id() const
bool zsMarkAndPass() const
was ZS MarkAndPass?
uint16_t raw() const
get the raw word
bool zsUnsuppressed() const
was ZS unsuppressed?
std::ostream & operator<<(std::ostream &s, const CastorTriggerPrimitiveDigi &digi)
void setZSInfo(bool unsuppressed, bool markAndPass)
const HcalTriggerPrimitiveSample & sample(int i) const