CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/DataFormats/HcalDigi/src/HcalTriggerPrimitiveDigi.cc

Go to the documentation of this file.
00001 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveDigi.h"
00002 
00003 
00004 HcalTriggerPrimitiveDigi::HcalTriggerPrimitiveDigi() : size_(0), hcalPresamples_(0) {
00005 }
00006 HcalTriggerPrimitiveDigi::HcalTriggerPrimitiveDigi(const HcalTrigTowerDetId& id) : id_(id),
00007                                                                                    size_(0), hcalPresamples_(0) {
00008 }
00009   
00010 void HcalTriggerPrimitiveDigi::setSize(int size) {
00011   if (size<0) size_=0;
00012   else if (size>MAXSAMPLES) size_=MAXSAMPLES;
00013   else size_=size;
00014 }
00015 void HcalTriggerPrimitiveDigi::setPresamples(int ps) {
00016   if (ps<0) hcalPresamples_&=0xFFFFFF0;
00017   //  else if (ps>=size_) hcalPresamples_=size_-1;
00018   else hcalPresamples_|=ps&0xF;
00019 }
00020 
00021 void HcalTriggerPrimitiveDigi::setZSInfo(bool unsuppressed, bool markAndPass) {
00022   if (markAndPass) hcalPresamples_|=0x10;
00023   if (unsuppressed) hcalPresamples_|=0x20;
00024 }
00025 
00026 std::ostream& operator<<(std::ostream& s, const HcalTriggerPrimitiveDigi& digi) {
00027   s << digi.id() << " " << digi.size() << " samples "<< digi.presamples() << " presamples";
00028   if (digi.zsUnsuppressed()) s << " zsUS";
00029   if (digi.zsMarkAndPass()) s << " zsM&P";
00030   s << std::endl;
00031   for (int i=0; i<digi.size(); i++) 
00032     s << "  " << digi.sample(i) << std::endl;
00033   return s;
00034 }
00035   
00036