Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:04

0001 #include "DataFormats/EcalDigi/interface/EcalEBTriggerPrimitiveSample.h"
0002 #include <iostream>
0003 
0004 EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample() : theSample(0) {}
0005 EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(uint16_t data) : theSample(data) {}
0006 
0007 EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(int encodedEt, bool isASpike) {
0008   theSample = (encodedEt & 0x3FF) | ((isASpike) ? (0x400) : (0));
0009 }
0010 
0011 EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(int encodedEt, bool isASpike, int timing) {
0012   theSample = (encodedEt & 0x3FF) | ((isASpike) ? (0x400) : (0)) | timing << 11;
0013 }
0014 
0015 EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(int encodedEt) { theSample = encodedEt & 0x3FF; }
0016 
0017 std::ostream& operator<<(std::ostream& s, const EcalEBTriggerPrimitiveSample& samp) {
0018   return s << "ET=" << samp.encodedEt() << ", isASpike=" << samp.l1aSpike() << " timing= " << samp.time();
0019 }