File indexing completed on 2023-10-25 10:05:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef L1_TRACK_TRIGGER_STUB_ASSOCIATOR_H
0015 #define L1_TRACK_TRIGGER_STUB_ASSOCIATOR_H
0016
0017 #include "FWCore/Framework/interface/Frameworkfwd.h"
0018 #include "FWCore/Framework/interface/stream/EDProducer.h"
0019 #include "FWCore/Framework/interface/Event.h"
0020 #include "FWCore/Framework/interface/EventSetup.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023
0024 #include "DataFormats/L1TrackTrigger/interface/TTStub.h"
0025
0026 #include "L1Trigger/TrackTrigger/interface/classNameFinder.h"
0027 #include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h"
0028 #include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h"
0029 #include "SimTracker/TrackTriggerAssociation/plugins/TTClusterAssociator.h"
0030 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0031 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0032 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0033
0034 #include "Geometry/CommonTopologies/interface/Topology.h"
0035 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0036 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0037 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0038
0039 #include <memory>
0040 #include <map>
0041 #include <vector>
0042
0043 template <typename T>
0044 class TTStubAssociator : public edm::stream::EDProducer<> {
0045
0046
0047 public:
0048
0049 explicit TTStubAssociator(const edm::ParameterSet& iConfig);
0050
0051
0052 ~TTStubAssociator() override;
0053
0054 private:
0055
0056 std::vector<edm::InputTag> ttStubsInputTags_;
0057 std::vector<edm::InputTag> ttClusterTruthInputTags_;
0058
0059 std::vector<edm::EDGetTokenT<edmNew::DetSetVector<TTStub<T> > > > ttStubsTokens_;
0060 std::vector<edm::EDGetTokenT<TTClusterAssociationMap<T> > > ttClusterTruthTokens_;
0061
0062 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theTrackerGeometryToken_;
0063 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTrackerTopologyToken_;
0064
0065
0066 void beginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
0067 void endRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
0068 void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0069
0070 };
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 template <typename T>
0081 TTStubAssociator<T>::TTStubAssociator(const edm::ParameterSet& iConfig) {
0082 ttStubsInputTags_ = iConfig.getParameter<std::vector<edm::InputTag> >("TTStubs");
0083 ttClusterTruthInputTags_ = iConfig.getParameter<std::vector<edm::InputTag> >("TTClusterTruth");
0084
0085 for (const auto& iTag : ttClusterTruthInputTags_) {
0086 ttClusterTruthTokens_.push_back(consumes<TTClusterAssociationMap<T> >(iTag));
0087 }
0088
0089 for (const auto& iTag : ttStubsInputTags_) {
0090 ttStubsTokens_.push_back(consumes<edmNew::DetSetVector<TTStub<T> > >(iTag));
0091
0092 produces<TTStubAssociationMap<T> >(iTag.instance());
0093 }
0094
0095 theTrackerGeometryToken_ = esConsumes();
0096 theTrackerTopologyToken_ = esConsumes();
0097 }
0098
0099
0100 template <typename T>
0101 TTStubAssociator<T>::~TTStubAssociator() {}
0102
0103
0104 template <typename T>
0105 void TTStubAssociator<T>::beginRun(const edm::Run& run, const edm::EventSetup& iSetup) {
0106
0107 edm::LogInfo("TTStubAssociator< ") << templateNameFinder<T>() << " > loaded.";
0108 }
0109
0110
0111 template <typename T>
0112 void TTStubAssociator<T>::endRun(const edm::Run& run, const edm::EventSetup& iSetup) {}
0113
0114
0115 template <>
0116 void TTStubAssociator<Ref_Phase2TrackerDigi_>::produce(edm::Event& iEvent, const edm::EventSetup& iSetup);
0117
0118 #endif