File indexing completed on 2024-04-06 12:04:04
0001 #ifndef ECALTRIGGERPRIMITIVEDIGI_H
0002 #define ECALTRIGGERPRIMITIVEDIGI_H 1
0003
0004 #include <ostream>
0005 #include <vector>
0006
0007 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
0008 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h"
0009
0010
0011
0012
0013
0014
0015
0016 class EcalTriggerPrimitiveDigi {
0017 public:
0018 typedef EcalTrigTowerDetId key_type;
0019
0020 EcalTriggerPrimitiveDigi();
0021 explicit EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id);
0022
0023 void swap(EcalTriggerPrimitiveDigi& rh) {
0024 std::swap(id_, rh.id_);
0025 std::swap(size_, rh.size_);
0026 std::swap(data_, rh.data_);
0027 }
0028
0029 const EcalTrigTowerDetId& id() const { return id_; }
0030 int size() const { return size_; }
0031
0032 const EcalTriggerPrimitiveSample& operator[](int i) const { return data_[i]; }
0033 const EcalTriggerPrimitiveSample& sample(int i) const { return data_[i]; }
0034
0035 void setSize(int size);
0036 void setSample(int i, const EcalTriggerPrimitiveSample& sam) { data_[i] = sam; }
0037 void setSampleValue(int i, uint16_t value) { data_[i].setValue(value); }
0038
0039 static const int MAXSAMPLES = 20;
0040
0041
0042 int compressedEt() const;
0043
0044
0045 bool fineGrain() const;
0046
0047
0048 int ttFlag() const;
0049
0050
0051
0052
0053 int sFGVB() const;
0054
0055
0056
0057
0058
0059 int l1aSpike() const { return sFGVB(); }
0060
0061
0062 bool isDebug() const;
0063
0064
0065 int sampleOfInterest() const;
0066
0067 private:
0068 EcalTrigTowerDetId id_;
0069 int size_;
0070 std::vector<EcalTriggerPrimitiveSample> data_;
0071 };
0072
0073 inline void swap(EcalTriggerPrimitiveDigi& lh, EcalTriggerPrimitiveDigi& rh) { lh.swap(rh); }
0074
0075 std::ostream& operator<<(std::ostream& s, const EcalTriggerPrimitiveDigi& digi);
0076
0077 #endif