Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ECALPSEUDOSTRIPINPUTDIGI_H
0002 #define ECALPSEUDOSTRIPINPUTDIGI_H
0003 
0004 #include <ostream>
0005 #include <vector>
0006 #include "DataFormats/EcalDetId/interface/EcalTriggerElectronicsId.h"
0007 #include "DataFormats/EcalDigi/interface/EcalPseudoStripInputSample.h"
0008 
0009 /** \class EcalPseudoStripInputDigi
0010       
0011 */
0012 
0013 class EcalPseudoStripInputDigi {
0014 public:
0015   typedef EcalTriggerElectronicsId key_type;  ///< For the sorted collection
0016 
0017   EcalPseudoStripInputDigi();  // for persistence
0018   explicit EcalPseudoStripInputDigi(const EcalTriggerElectronicsId& id);
0019 
0020   const EcalTriggerElectronicsId& id() const { return id_; }
0021   int size() const { return size_; }
0022 
0023   const EcalPseudoStripInputSample& operator[](int i) const { return data_[i]; }
0024   const EcalPseudoStripInputSample& sample(int i) const { return data_[i]; }
0025 
0026   void setSize(int size);
0027   void setSample(int i, const EcalPseudoStripInputSample& sam) { data_[i] = sam; }
0028   void setSampleValue(int i, uint16_t value) { data_[i].setValue(value); }
0029 
0030   static const int MAXSAMPLES = 20;
0031 
0032   /// get the encoded/compressed Et of interesting sample
0033   int pseudoStripInput() const;
0034 
0035   /// get the fine-grain bit of interesting sample
0036   bool fineGrain() const;
0037 
0038   /// True if debug mode (# of samples > 1)
0039   bool isDebug() const;
0040 
0041   /// Gets the interesting sample
0042   int sampleOfInterest() const;
0043 
0044 private:
0045   EcalTriggerElectronicsId id_;
0046   int size_;
0047   std::vector<EcalPseudoStripInputSample> data_;
0048 };
0049 
0050 std::ostream& operator<<(std::ostream& s, const EcalPseudoStripInputDigi& digi);
0051 
0052 #endif