Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:47

0001 #ifndef L1Trigger_TrackFindingTMTT_GlobalCacheTMTT_h
0002 #define L1Trigger_TrackFindingTMTT_GlobalCacheTMTT_h
0003 
0004 // Data shared across all streams by TMTT L1 tracking.
0005 //
0006 // Provides the python configuration parameters
0007 // & optional histogramming/debugging.
0008 
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "L1Trigger/TrackFindingTMTT/interface/Settings.h"
0011 #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h"
0012 #include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h"
0013 #include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h"
0014 #include "L1Trigger/TrackFindingTMTT/interface/Histos.h"
0015 
0016 #include <list>
0017 #include <memory>
0018 
0019 namespace tmtt {
0020 
0021   class GlobalCacheTMTT {
0022   public:
0023     GlobalCacheTMTT(const edm::ParameterSet& iConfig)
0024         : settings_(iConfig),              // Python configuration params
0025           htRphiErrMon_(),                 // rphi HT error monitoring
0026           stubWindowSuggest_(&settings_),  // Recommend FE stub window sizes.
0027           hists_(&settings_)               // Histograms
0028     {
0029       hists_.book();
0030     }
0031 
0032     // Get functions
0033     const Settings& settings() const { return settings_; }
0034     HTrphi::ErrorMonitor& htRphiErrMon() const { return htRphiErrMon_; }
0035     StubWindowSuggest& stubWindowSuggest() const { return stubWindowSuggest_; }
0036     const std::list<TrackerModule>& listTrackerModule() const { return listTrackerModule_; }
0037     Histos& hists() const { return hists_; }
0038 
0039     // Set functions
0040     void setListTrackerModule(const std::list<TrackerModule>& list) const {
0041       // Allow only one thread to run this function at a time
0042       static std::mutex myMutex;
0043       std::lock_guard<std::mutex> myGuard(myMutex);
0044 
0045       // Only need one copy of tracker geometry for histogramming.
0046       if (listTrackerModule_.empty())
0047         listTrackerModule_ = list;
0048     }
0049 
0050   private:
0051     Settings settings_;
0052     mutable HTrphi::ErrorMonitor htRphiErrMon_;
0053     mutable StubWindowSuggest stubWindowSuggest_;
0054     mutable std::list<TrackerModule> listTrackerModule_;
0055     mutable Histos hists_;
0056   };
0057 
0058 }  // namespace tmtt
0059 
0060 #endif