Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:27

0001 // -*- C++ -*-
0002 //
0003 // Package:     DataFormats/L1GlobalMuonTrigger
0004 // Class  :     L1MuGMTReadoutCollection
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Mon, 04 Nov 2013 17:08:29 GMT
0011 //
0012 
0013 // system include files
0014 #include "oneapi/tbb/concurrent_unordered_map.h"
0015 
0016 // user include files
0017 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
0018 
0019 static tbb::concurrent_unordered_map<int, L1MuGMTReadoutRecord> s_empty_record_cache;
0020 
0021 L1MuGMTReadoutRecord const& L1MuGMTReadoutCollection::getDefaultFor(int bx) {
0022   // if bx not found return empty readout record
0023   auto itFound = s_empty_record_cache.find(bx);
0024   if (itFound == s_empty_record_cache.end()) {
0025     auto foundPair = s_empty_record_cache.insert(std::make_pair(bx, L1MuGMTReadoutRecord(bx)));
0026     itFound = foundPair.first;
0027   }
0028   return itFound->second;
0029 }