CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/L1Trigger/DTTrackFinder/src/L1MuDTSecProcMap.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuDTSecProcMap
00004 //
00005 //   Description: Sector Processor container 
00006 //
00007 //
00008 //   $Date: 2011/12/21 08:39:04 $
00009 //   $Revision: 1.5 $
00010 //
00011 //   Author :
00012 //   N. Neumeister             CERN EP
00013 //
00014 //--------------------------------------------------
00015 
00016 //-----------------------
00017 // This Class's Header --
00018 //-----------------------
00019 
00020 #include "L1Trigger/DTTrackFinder/src/L1MuDTSecProcMap.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 #include <iostream>
00027 
00028 //-------------------------------
00029 // Collaborating Class Headers --
00030 //-------------------------------
00031 
00032 #include "L1Trigger/DTTrackFinder/src/L1MuDTSecProcId.h"
00033 #include "L1Trigger/DTTrackFinder/src/L1MuDTSectorProcessor.h"
00034 
00035 using namespace std;
00036 
00037 // --------------------------------
00038 //       class L1MuDTSecProcMap
00039 //---------------------------------
00040 
00041 //----------------
00042 // Constructors --
00043 //----------------
00044 
00045 L1MuDTSecProcMap::L1MuDTSecProcMap() : m_map() {}
00046 
00047 //--------------
00048 // Destructor --
00049 //--------------
00050 
00051 L1MuDTSecProcMap::~L1MuDTSecProcMap() {
00052 
00053   SPmap_iter iter = m_map.begin();
00054   while ( iter != m_map.end() ) {
00055     delete (*iter).second;
00056     iter++;
00057   }  
00058   m_map.clear();
00059 
00060 }
00061 
00062 
00063 //--------------
00064 // Operations --
00065 //--------------
00066 
00067 //
00068 // return Sector Processor
00069 //
00070 L1MuDTSectorProcessor* L1MuDTSecProcMap::sp(const L1MuDTSecProcId& id ) const {
00071 
00072   SPmap::const_iterator it = m_map.find(id);
00073   if ( it == m_map.end() ) { 
00074     //    cerr << "Error: Sector Processor not in the map" << endl;
00075     return 0;
00076   }
00077   return (*it).second;
00078 
00079 }
00080 
00081 
00082 //
00083 // insert Sector Processor into container
00084 //
00085 void L1MuDTSecProcMap::insert(const L1MuDTSecProcId& id, L1MuDTSectorProcessor* sp)  { 
00086 
00087   //SPmap::const_iterator it = m_map.find(id);
00088   //  if ( it != m_map.end() ) 
00089     //    cerr << "Error: More than one Sector Processor with same identifier" 
00090     //         << endl;    
00091   m_map[id] = sp;
00092 
00093 }