Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-02 03:45:48

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuDTSecProcMap
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/DTTrackFinder/src/L1MuDTSecProcMap.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 #include <iostream>
0025 
0026 //-------------------------------
0027 // Collaborating Class Headers --
0028 //-------------------------------
0029 
0030 #include "L1Trigger/DTTrackFinder/interface/L1MuDTSecProcId.h"
0031 #include "L1Trigger/DTTrackFinder/src/L1MuDTSectorProcessor.h"
0032 
0033 using namespace std;
0034 
0035 // --------------------------------
0036 //       class L1MuDTSecProcMap
0037 //---------------------------------
0038 
0039 //----------------
0040 // Constructors --
0041 //----------------
0042 
0043 L1MuDTSecProcMap::L1MuDTSecProcMap() : m_map() {}
0044 
0045 //--------------
0046 // Destructor --
0047 //--------------
0048 
0049 L1MuDTSecProcMap::~L1MuDTSecProcMap() {
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 L1MuDTSectorProcessor* L1MuDTSecProcMap::sp(const L1MuDTSecProcId& 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 L1MuDTSecProcMap::insert(const L1MuDTSecProcId& id, L1MuDTSectorProcessor* 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 }