Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:39

0001 #ifndef L1Trigger_RPCBasicTrigConfig_h
0002 #define L1Trigger_RPCBasicTrigConfig_h
0003 
0004 #ifndef _STAND_ALONE
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 #endif  //_STAND_ALONE
0007 
0008 #include "L1Trigger/RPCTrigger/interface/RPCTriggerConfiguration.h"
0009 #include "L1Trigger/RPCTrigger/interface/RPCPacManager.h"
0010 #include "L1Trigger/RPCTrigger/interface/RPCConst.h"
0011 #include "L1Trigger/RPCTrigger/interface/RPCConst.h"
0012 //#include "L1Trigger/RPCTrigger/interface/RPCException.h"
0013 //---------------------------------------------------------------------------
0014 class RPCBasicTrigConfig : public RPCTriggerConfiguration {
0015 public:
0016   RPCBasicTrigConfig(RPCPacManager<RPCPacData>* pacManager);
0017 
0018   RPCBasicTrigConfig();
0019 
0020   ///returns count of Trigger Crates in system.
0021   int getTCsCnt() override;
0022 
0023   ///returns number og Trigger Boards in one Trigger Crate.
0024   int getTBsInTC() override;
0025 
0026   /** One TB covers 3 or 4 Towers. The function returns the index of m_tower
0027     * on TB. */
0028   int getTowerNumOnTb(const RPCConst::l1RpcConeCrdnts& coneCrdnts) override;
0029 
0030   ///Returns pointer to m_PAC that should run given LogCone. The PACs are holded by L1PacManager.
0031   const RPCPacData* getPac(const RPCConst::l1RpcConeCrdnts& coneCrdnts) const override;
0032 
0033   ///Returns the index of TC that should run given LogCone.
0034   int getTCNum(const RPCConst::l1RpcConeCrdnts& coneCrdnts) override;
0035 
0036   ///Returns the index of TB (in TC) that should run given LogCone.
0037   int getTBNum(const RPCConst::l1RpcConeCrdnts& coneCrdnts) override;
0038 
0039   ///Returns the count of Towers (3 or 4), that are covered by given TB.
0040   int getTowsCntOnTB(int tbNum) override;
0041 
0042   /** Converts TC GB-Sorter input m_tower address <0...35> ("m_tower number natural")
0043     * to m_tower number <-16...0...16>
0044     * TC GB-Sorter input m_tower address is 8 bits: [7...2] TB num, [1...0] m_tower num on TB.*/
0045   int towAddr2TowNum(int towAddr) override;
0046 
0047   /** Converts TC GB-Sorter output m_tower address <0...31> ("m_tower number continous")
0048     * to m_tower number 2'complement*/
0049   int towNum2TowNum2Comp(int towNum) override;
0050 
0051   ~RPCBasicTrigConfig() override {}
0052 
0053 private:
0054   static const int m_TRIGGER_CRATES_CNT;
0055 
0056   static const int m_TB_IN_TC_CNT = 9;
0057 
0058   static const int m_TOWER_ON_TB[2 * RPCConst::ITOW_MAX + 1 + 1];
0059 
0060   static const int m_TOWERS_CNT_ON_TB[m_TB_IN_TC_CNT];
0061 
0062   static const int m_TB_NUM_FOR_TOWER[2 * RPCConst::ITOW_MAX + 1];
0063 
0064   static const int m_TOW_ADDR_2_TOW_NUM[36];
0065 
0066   RPCPacManager<RPCPacData>* m_PacManager;
0067 };
0068 #endif