File indexing completed on 2024-09-07 04:37:04
0001 #ifndef L1Trigger_RPCConeBuilder_RPCStripsRing_h
0002 #define L1Trigger_RPCConeBuilder_RPCStripsRing_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <map>
0022 #include <vector>
0023 #include "CondFormats/RPCObjects/interface/L1RPCConeBuilder.h"
0024
0025 class RPCRoll;
0026
0027
0028 struct TStrip {
0029 TStrip() : m_detRawId(0), m_strip(0) {}
0030 TStrip(int rawId, int stripNo) : m_detRawId(rawId), m_strip(stripNo) {}
0031 bool isVirtual() const { return m_detRawId == 0; };
0032 uint32_t m_detRawId;
0033 unsigned char m_strip;
0034 };
0035
0036 class RPCStripsRing : public std::map<float, TStrip> {
0037 public:
0038
0039 typedef std::map<int, RPCStripsRing> TIdToRindMap;
0040
0041 struct TOtherConnStruct {
0042 TOtherConnStruct() : m_logplane(0), m_logplaneSize(0), m_it(nullptr) {}
0043 short m_logplane;
0044 short m_logplaneSize;
0045 TIdToRindMap::iterator m_it;
0046 };
0047
0048 typedef std::vector<TOtherConnStruct> TOtherConnStructVec;
0049
0050 RPCStripsRing(const RPCRoll* roll, std::shared_ptr<L1RPCConeBuilder::TConMap> cmap);
0051
0052 RPCStripsRing();
0053 virtual ~RPCStripsRing() {}
0054
0055 void addRoll(const RPCRoll* roll);
0056
0057
0058 static int getRingId(int etaPart, int hwPlane);
0059 int getRingId();
0060 static int getRingId(const RPCRoll* roll);
0061
0062 static int calculateHwPlane(const RPCRoll* roll);
0063
0064 void filterOverlapingChambers();
0065 void fillWithVirtualStrips();
0066
0067 void createRefConnections(TOtherConnStructVec& otherRings, int logplane, int logplaneSize);
0068 void createOtherConnections(int tower, int PACno, int logplane, int logplanesize, float angle);
0069
0070 int getHwPlane() { return m_hwPlane; };
0071
0072 int getEtaPartition() { return m_etaPartition; };
0073 bool isReferenceRing() { return m_isReferenceRing; };
0074 int getTowerForRefRing();
0075
0076 void compressConnections();
0077 std::shared_ptr<L1RPCConeBuilder::TConMap> getConnectionsMap() { return m_connectionsMap; };
0078
0079 std::shared_ptr<L1RPCConeBuilder::TCompressedConMap> getCompressedConnectionsMap() {
0080 return m_compressedConnectionMap;
0081 };
0082
0083 private:
0084 int m_hwPlane;
0085 int m_etaPartition;
0086 int m_region;
0087
0088 bool m_isReferenceRing;
0089 bool m_didVirtuals;
0090 bool m_didFiltering;
0091
0092 std::shared_ptr<L1RPCConeBuilder::TConMap> m_connectionsMap;
0093 std::shared_ptr<L1RPCConeBuilder::TCompressedConMap> m_compressedConnectionMap;
0094 };
0095
0096 #endif