Back to home page

Project CMSSW displayed by LXR

 
 

    


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 /** \class HcalTTPDigi
0009   *  
0010   * \author J. Mans - Minnesota
0011   */
0012 class HcalTTPDigi {
0013 public:
0014   typedef int key_type;  // Needed for the sorted collection
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   /** get the input bit pattern for the given sample (relative to the SOI)
0021         the vector will be empty if there is no data for the requested sample
0022     */
0023   std::vector<bool> inputPattern(int relativeSample = 0) const;
0024   /** get the output trigger bit set for the given sample (relative to the SOI)
0025         the vector will be empty if there is no data for the requested sample
0026     */
0027   uint8_t triggerOutput(int relativeSample = 0) const;
0028   /** get the "algorithm-dependent-word" for the given sample */
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];  // length = 5*samples_
0049   uint32_t algoDepend_[8];         // length = samples_
0050   uint8_t triggerOutput_[8];       // length = samples_
0051 };
0052 
0053 std::ostream& operator<<(std::ostream&, const HcalTTPDigi&);
0054 
0055 #endif