Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-09 23:47:31

0001 #ifndef L1Trigger_TrackFindingTMTT_TMTrackProducer_h
0002 #define L1Trigger_TrackFindingTMTT_TMTrackProducer_h
0003 
0004 #include "L1Trigger/TrackFindingTMTT/interface/Settings.h"
0005 #include "L1Trigger/TrackFindingTMTT/interface/Histos.h"
0006 #include "L1Trigger/TrackFindingTMTT/interface/Stub.h"
0007 #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h"
0008 #include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h"
0009 #include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h"
0010 #include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h"
0011 #include "L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h"
0012 
0013 #include "FWCore/Framework/interface/stream/EDProducer.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Framework/interface/MakerMacros.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/Framework/interface/EventSetup.h"
0018 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0019 #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h"
0020 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0021 #include "SimDataFormats/Associations/interface/TTClusterAssociationMap.h"
0022 #include "SimDataFormats/Associations/interface/TTStubAssociationMap.h"
0023 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0024 #include "MagneticField/Engine/interface/MagneticField.h"
0025 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0026 #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithmRecord.h"
0027 #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h"
0028 //#include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm.h"
0029 
0030 #include <vector>
0031 #include <list>
0032 #include <string>
0033 #include <memory>
0034 
0035 namespace tmtt {
0036 
0037   class TrackFitGeneric;
0038 
0039   typedef TTStubAlgorithm<Ref_Phase2TrackerDigi_> StubAlgorithm;
0040   typedef TTStubAlgorithm_official<Ref_Phase2TrackerDigi_> StubAlgorithmOfficial;
0041 
0042   class TMTrackProducer : public edm::stream::EDProducer<edm::GlobalCache<GlobalCacheTMTT>> {
0043   public:
0044     explicit TMTrackProducer(const edm::ParameterSet &, GlobalCacheTMTT const *globalCacheTMTT);
0045     ~TMTrackProducer() override {}
0046 
0047     static std::unique_ptr<GlobalCacheTMTT> initializeGlobalCache(edm::ParameterSet const &iConfig);
0048 
0049     static void globalEndJob(GlobalCacheTMTT *globalCacheTMTT);
0050 
0051   private:
0052     typedef std::vector<TTTrack<Ref_Phase2TrackerDigi_>> TTTrackCollection;
0053 
0054     void beginRun(const edm::Run &, const edm::EventSetup &) override;
0055 
0056     void produce(edm::Event &, const edm::EventSetup &) override;
0057 
0058   private:
0059     // ES tokens
0060     edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magneticFieldToken_;
0061     edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeometryToken_;
0062     edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopologyToken_;
0063     edm::ESGetToken<StubAlgorithm, TTStubAlgorithmRecord> ttStubAlgoToken_;
0064     // ED tokens
0065     edm::EDGetTokenT<TTStubDetSetVec> stubToken_;
0066     edm::EDGetTokenT<TrackingParticleCollection> tpToken_;
0067     edm::EDGetTokenT<TTStubAssMap> stubTruthToken_;
0068     edm::EDGetTokenT<TTClusterAssMap> clusterTruthToken_;
0069     edm::EDGetTokenT<reco::GenJetCollection> genJetToken_;
0070 
0071     // Info about tracker geometry
0072     const TrackerGeometry *trackerGeometry_;
0073     const TrackerTopology *trackerTopology_;
0074     std::list<TrackerModule> listTrackerModule_;
0075 
0076     // Configuration parameters
0077     Settings settings_;
0078     std::vector<std::string> trackFitters_;
0079     std::vector<std::string> useRZfilter_;
0080     bool runRZfilter_;
0081 
0082     // Stub window sizes used by FE electronics.
0083     const StubAlgorithmOfficial *stubAlgo_;
0084     std::unique_ptr<StubFEWindows> stubFEWindows_;
0085     StubWindowSuggest &stubWindowSuggest_;
0086     std::unique_ptr<DegradeBend> degradeBend_;
0087 
0088     Histos &hists_;
0089     HTrphi::ErrorMonitor &htRphiErrMon_;
0090 
0091     std::map<std::string, std::unique_ptr<TrackFitGeneric>> fitterWorkerMap_;
0092 
0093     bool debug_;
0094   };
0095 
0096 }  // namespace tmtt
0097 
0098 #endif