Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HCALTRIGGERPRIMITIVEDIGI_H
0002 #define HCALTRIGGERPRIMITIVEDIGI_H 1
0003 
0004 #include <ostream>
0005 #include <vector>
0006 #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
0007 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h"
0008 
0009 /** \class HcalTriggerPrimitiveDigi
0010     
0011 \author J. Mans - Minnesota
0012 */
0013 class HcalTriggerPrimitiveDigi {
0014 public:
0015   typedef HcalTrigTowerDetId key_type;  ///< For the sorted collection
0016 
0017   HcalTriggerPrimitiveDigi();  // for persistence
0018   explicit HcalTriggerPrimitiveDigi(const HcalTrigTowerDetId& id);
0019 
0020   const HcalTrigTowerDetId& id() const { return id_; }
0021   int size() const { return (size_ & 0xF); }
0022   int presamples() const { return hcalPresamples_ & 0xF; }
0023 
0024   /// was ZS MarkAndPass?
0025   bool zsMarkAndPass() const { return (hcalPresamples_ & 0x10); }
0026   /// was ZS unsuppressed?
0027   bool zsUnsuppressed() const { return (hcalPresamples_ & 0x20); }
0028 
0029   void setZSInfo(bool unsuppressed, bool markAndPass);
0030 
0031   const HcalTriggerPrimitiveSample& operator[](int i) const { return data_[i]; }
0032   const HcalTriggerPrimitiveSample& sample(int i) const { return data_[i]; }
0033 
0034   /// Full "Sample of Interest"
0035   const HcalTriggerPrimitiveSample& t0() const { return data_[presamples()]; }
0036   /// Fine-grain bit for the "Sample of Interest"
0037   bool SOI_fineGrain(int i = 0) const { return t0().fineGrain(i); }
0038   /// Compressed ET for the "Sample of Interest"
0039   int SOI_compressedEt() const { return t0().compressedEt(); }
0040 
0041   void setSize(int size);
0042   void setPresamples(int ps);
0043   void setSample(int i, const HcalTriggerPrimitiveSample& sam) { data_[i] = sam; }
0044 
0045   static const int MAXSAMPLES = 10;
0046 
0047 private:
0048   HcalTrigTowerDetId id_;
0049   int size_;
0050   int hcalPresamples_;
0051   HcalTriggerPrimitiveSample data_[MAXSAMPLES];
0052 };
0053 
0054 std::ostream& operator<<(std::ostream& s, const HcalTriggerPrimitiveDigi& digi);
0055 
0056 #endif