Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:04

0001 #ifndef L1Trigger_RPCConeBuilder_RPCStripsRing_h
0002 #define L1Trigger_RPCConeBuilder_RPCStripsRing_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     RPCConeBuilder
0006 // Class  :     RPCStripsRing
0007 //
0008 /**\class RPCStripsRing RPCStripsRing.h L1Trigger/RPCTrigger/interface/RPCStripsRing.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Tomasz Fruboes
0018 //         Created:  Tue Feb 26 15:13:17 CET 2008
0019 //
0020 
0021 #include <map>
0022 #include <vector>
0023 #include "CondFormats/RPCObjects/interface/L1RPCConeBuilder.h"
0024 
0025 class RPCRoll;
0026 
0027 // XXX TODO: move into namespace?
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   //                | ringId
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   // RPCDetInfo::getRingFromRollsId()
0058   static int getRingId(int etaPart, int hwPlane);
0059   int getRingId();                            /// Calculate ringId for this ring
0060   static int getRingId(const RPCRoll* roll);  /// Calculate ringId for any given RPCRoll
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;  // m_globRoll previously
0086   int m_region;
0087 
0088   bool m_isReferenceRing;  // m_isRefPlane previously
0089   bool m_didVirtuals;      // m_isRefPlane previously
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