Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:23:14

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuBMSecProcMap
0004 //
0005 //   Description: Sector Processor container
0006 //
0007 //
0008 //
0009 //   Author :
0010 //   N. Neumeister             CERN EP
0011 //
0012 //--------------------------------------------------
0013 
0014 //-----------------------
0015 // This Class's Header --
0016 //-----------------------
0017 
0018 #include "L1Trigger/L1TMuonBarrel/src/L1MuBMSecProcMap.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 #include <iostream>
0025 
0026 //-------------------------------
0027 // Collaborating Class Headers --
0028 //-------------------------------
0029 
0030 #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMSecProcId.h"
0031 #include "L1Trigger/L1TMuonBarrel/src/L1MuBMSectorProcessor.h"
0032 
0033 using namespace std;
0034 
0035 // --------------------------------
0036 //       class L1MuBMSecProcMap
0037 //---------------------------------
0038 
0039 //----------------
0040 // Constructors --
0041 //----------------
0042 
0043 L1MuBMSecProcMap::L1MuBMSecProcMap() : m_map() {}
0044 
0045 //--------------
0046 // Destructor --
0047 //--------------
0048 
0049 L1MuBMSecProcMap::~L1MuBMSecProcMap() {
0050   SPmap_iter iter = m_map.begin();
0051   while (iter != m_map.end()) {
0052     delete (*iter).second;
0053     iter++;
0054   }
0055   m_map.clear();
0056 }
0057 
0058 //--------------
0059 // Operations --
0060 //--------------
0061 
0062 //
0063 // return Sector Processor
0064 //
0065 L1MuBMSectorProcessor* L1MuBMSecProcMap::sp(const L1MuBMSecProcId& id) const {
0066   SPmap::const_iterator it = m_map.find(id);
0067   if (it == m_map.end()) {
0068     //    cerr << "Error: Sector Processor not in the map" << endl;
0069     return nullptr;
0070   }
0071   return (*it).second;
0072 }
0073 
0074 //
0075 // insert Sector Processor into container
0076 //
0077 void L1MuBMSecProcMap::insert(const L1MuBMSecProcId& id, L1MuBMSectorProcessor* sp) {
0078   //SPmap::const_iterator it = m_map.find(id);
0079   //  if ( it != m_map.end() )
0080   //    cerr << "Error: More than one Sector Processor with same identifier"
0081   //         << endl;
0082   m_map[id] = sp;
0083 }