File indexing completed on 2024-04-06 12:04:18
0001 #ifndef DATAFORMATS_HCALDIGI_HCALTTPDIGI_H
0002 #define DATAFORMATS_HCALDIGI_HCALTTPDIGI_H 1
0003
0004 #include <cstdint>
0005 #include <vector>
0006 #include <ostream>
0007
0008
0009
0010
0011
0012 class HcalTTPDigi {
0013 public:
0014 typedef int key_type;
0015 HcalTTPDigi();
0016 HcalTTPDigi(int identifier, int samples, int presamples, unsigned int fwVersion, int algorithm, unsigned int lPipe);
0017
0018 void setSample(int relativeSample, const uint16_t* triggerInputs, const uint32_t algodep, const uint8_t outputTrigger);
0019
0020
0021
0022
0023 std::vector<bool> inputPattern(int relativeSample = 0) const;
0024
0025
0026
0027 uint8_t triggerOutput(int relativeSample = 0) const;
0028
0029 uint32_t algorithmWord(int relativeSample = 0) const;
0030
0031 int id() const { return identifier_; }
0032 int size() const { return samples_; }
0033 int presamples() const { return presamples_; }
0034 int algorithm() const { return algorithm_; }
0035 unsigned int fwVersion() const { return fwVersion_; }
0036 unsigned int pipelineLength() const { return lPipe_; }
0037
0038 bool operator==(const HcalTTPDigi& digi) const;
0039 bool operator!=(const HcalTTPDigi& digi) const { return !(*this == digi); }
0040
0041 private:
0042 int identifier_;
0043 int samples_, presamples_;
0044 unsigned int fwVersion_;
0045 int algorithm_;
0046 unsigned int lPipe_;
0047
0048 uint16_t triggerInputs_[5 * 8];
0049 uint32_t algoDepend_[8];
0050 uint8_t triggerOutput_[8];
0051 };
0052
0053 std::ostream& operator<<(std::ostream&, const HcalTTPDigi&);
0054
0055 #endif