File indexing completed on 2024-09-07 04:35:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef DataFormatsL1GlobalMuonTrigger_L1MuGMTReadoutCollection_h
0015 #define DataFormatsL1GlobalMuonTrigger_L1MuGMTReadoutCollection_h
0016
0017
0018
0019
0020
0021 #include <vector>
0022 #include <map>
0023 #include <iostream>
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutRecord.h"
0034
0035
0036
0037
0038
0039 class L1MuGMTReadoutCollection {
0040 public:
0041 L1MuGMTReadoutCollection() {}
0042 L1MuGMTReadoutCollection(int nbx) { m_Records.reserve(nbx); }
0043
0044 virtual ~L1MuGMTReadoutCollection() {}
0045
0046 void reset() {
0047 for (unsigned int i = 0; i < m_Records.size(); i++)
0048 m_Records[i].reset();
0049 };
0050
0051
0052 std::vector<L1MuGMTReadoutRecord> const& getRecords() const { return m_Records; };
0053
0054
0055 L1MuGMTReadoutRecord const& getRecord(int bx = 0) const {
0056 std::vector<L1MuGMTReadoutRecord>::const_iterator iter;
0057 for (iter = m_Records.begin(); iter != m_Records.end(); iter++) {
0058 if ((*iter).getBxCounter() == bx)
0059 return (*iter);
0060 }
0061 return getDefaultFor(bx);
0062 };
0063
0064
0065 void addRecord(L1MuGMTReadoutRecord const& rec) { m_Records.push_back(rec); };
0066
0067 private:
0068 static L1MuGMTReadoutRecord const& getDefaultFor(int bx);
0069
0070 std::vector<L1MuGMTReadoutRecord> m_Records;
0071 };
0072
0073 #endif