CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/L1Trigger/RPCTrigger/interface/RPCStripsRing.h

Go to the documentation of this file.
00001 #ifndef L1Trigger_RPCConeBuilder_RPCStripsRing_h
00002 #define L1Trigger_RPCConeBuilder_RPCStripsRing_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     RPCConeBuilder
00006 // Class  :     RPCStripsRing
00007 // 
00016 //
00017 // Original Author:  Tomasz Fruboes
00018 //         Created:  Tue Feb 26 15:13:17 CET 2008
00019 // $Id: RPCStripsRing.h,v 1.1 2009/06/01 13:58:16 fruboes Exp $
00020 //
00021 
00022 #include <map>
00023 #include <vector>
00024 #include "CondFormats/RPCObjects/interface/L1RPCConeBuilder.h"
00025 
00026 class RPCRoll;
00027 
00028 
00029 // XXX TODO: move into namespace?
00030 struct TStrip {
00031   TStrip() : m_detRawId(0), m_strip(0) {};
00032   TStrip(int rawId, int stripNo) : m_detRawId(rawId), m_strip(stripNo) {};
00033   bool isVirtual() const {return  m_detRawId==0;};
00034   uint32_t m_detRawId;
00035   unsigned char m_strip;
00036 };
00037 
00038 
00039 class RPCStripsRing : public std::map<float, TStrip >
00040 {
00041 
00042    public:
00043       //                | ringId
00044       typedef std::map<int, RPCStripsRing> TIdToRindMap;
00045       
00046       struct TOtherConnStruct {
00047          
00048          TOtherConnStruct() : m_logplane(0), m_logplaneSize(0), m_it(0) {};
00049          short m_logplane;
00050          short m_logplaneSize;
00051          TIdToRindMap::iterator m_it;
00052       };
00053       
00054       typedef std::vector<TOtherConnStruct> TOtherConnStructVec;
00055       
00056             
00057       RPCStripsRing(const RPCRoll * roll, 
00058                     boost::shared_ptr<L1RPCConeBuilder::TConMap > cmap);
00059                     
00060       RPCStripsRing();
00061       virtual ~RPCStripsRing() {};
00062       
00063       void addRoll(const RPCRoll * roll);
00064       
00065       // RPCDetInfo::getRingFromRollsId()
00066       static int getRingId(int etaPart, int hwPlane);
00067       int getRingId();   
00068       static int getRingId(const RPCRoll * roll); 
00069       
00070 
00071       static int calculateHwPlane(const RPCRoll * roll);
00072             
00073       void filterOverlapingChambers();
00074       void fillWithVirtualStrips();
00075 
00076       void createRefConnections(TOtherConnStructVec & otherRings, int logplane, int logplaneSize);
00077       void createOtherConnections(int tower, int PACno, int logplane, int logplanesize, float angle);
00078       
00079       
00080       int getHwPlane() {return m_hwPlane;};
00081       
00082       int getEtaPartition() {return m_etaPartition;};
00083       bool isReferenceRing(){return m_isReferenceRing;};
00084       int getTowerForRefRing();
00085       
00086       void compressConnections();
00087       boost::shared_ptr<L1RPCConeBuilder::TConMap > getConnectionsMap() 
00088               { return m_connectionsMap;};
00089               
00090       boost::shared_ptr<L1RPCConeBuilder::TCompressedConMap> getCompressedConnectionsMap() 
00091       { 
00092         return m_compressedConnectionMap;
00093       };
00094       
00095   private:
00096     
00097       
00098       int m_hwPlane;
00099       int m_etaPartition; // m_globRoll previously
00100       int m_region; 
00101 
00102       bool m_isReferenceRing; // m_isRefPlane previously
00103       bool m_didVirtuals; // m_isRefPlane previously
00104       bool m_didFiltering;    
00105       
00106       boost::shared_ptr<L1RPCConeBuilder::TConMap > m_connectionsMap;  
00107       boost::shared_ptr<L1RPCConeBuilder::TCompressedConMap > m_compressedConnectionMap;
00108 };
00109 
00110 
00111 #endif