Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:42

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() = default;
0050 
0051 //--------------
0052 // Operations --
0053 //--------------
0054 
0055 //
0056 // return Sector Processor
0057 //
0058 const L1MuDTSectorProcessor* L1MuDTSecProcMap::sp(const L1MuDTSecProcId& id) const {
0059   SPmap::const_iterator it = m_map.find(id);
0060   if (it == m_map.end()) {
0061     //    cerr << "Error: Sector Processor not in the map" << endl;
0062     return nullptr;
0063   }
0064   return (*it).second.get();
0065 }
0066 
0067 //
0068 // insert Sector Processor into container
0069 //
0070 void L1MuDTSecProcMap::insert(const L1MuDTSecProcId& id, std::unique_ptr<L1MuDTSectorProcessor> sp) {
0071   //SPmap::const_iterator it = m_map.find(id);
0072   //  if ( it != m_map.end() )
0073   //    cerr << "Error: More than one Sector Processor with same identifier"
0074   //         << endl;
0075   m_map[id] = std::move(sp);
0076 }