File indexing completed on 2024-09-10 02:58:37
0001 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h"
0002
0003 HcalTriggerPrimitiveSample::HcalTriggerPrimitiveSample() : theSample(0) {}
0004 HcalTriggerPrimitiveSample::HcalTriggerPrimitiveSample(uint16_t data) : theSample(data) {}
0005
0006 HcalTriggerPrimitiveSample::HcalTriggerPrimitiveSample(int encodedEt, bool fineGrain, int slb, int slbchan) {
0007 theSample = (((slb) & 0x7) << 13) | ((slbchan & 0x3) << 11) | (encodedEt & 0xFF) | ((fineGrain) ? (0x100) : (0));
0008 }
0009
0010 HcalTriggerPrimitiveSample::HcalTriggerPrimitiveSample(int encodedEt, int fineGrainExt) {
0011 theSample = (encodedEt & 0xFF) | ((fineGrainExt & 0x3F) << 8);
0012 }
0013
0014 std::ostream& operator<<(std::ostream& s, const HcalTriggerPrimitiveSample& samp) {
0015 return s << "Value=" << samp.compressedEt() << ", FG=" << samp.fineGrain();
0016 }