File indexing completed on 2024-08-09 23:47:45
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 "SimDataFormats/Associations/interface/TTClusterAssociationMap.h"
0028 #include "SimDataFormats/Associations/interface/TTStubAssociationMap.h"
0029 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0030 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0031 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0032
0033 #include "Geometry/CommonTopologies/interface/Topology.h"
0034 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0035 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0036 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0037
0038 #include "TTClusterAssociator.h"
0039
0040 #include <memory>
0041 #include <map>
0042 #include <vector>
0043
0044 template <typename T>
0045 class TTStubAssociator : public edm::stream::EDProducer<> {
0046
0047
0048 public:
0049
0050 explicit TTStubAssociator(const edm::ParameterSet& iConfig);
0051
0052 private:
0053
0054 std::vector<edm::InputTag> ttStubsInputTags_;
0055 std::vector<edm::InputTag> ttClusterTruthInputTags_;
0056
0057 std::vector<edm::EDGetTokenT<edmNew::DetSetVector<TTStub<T> > > > ttStubsTokens_;
0058 std::vector<edm::EDGetTokenT<TTClusterAssociationMap<T> > > ttClusterTruthTokens_;
0059
0060 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theTrackerGeometryToken_;
0061 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTrackerTopologyToken_;
0062
0063
0064 void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0065
0066 };
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 template <typename T>
0077 TTStubAssociator<T>::TTStubAssociator(const edm::ParameterSet& iConfig) {
0078 ttStubsInputTags_ = iConfig.getParameter<std::vector<edm::InputTag> >("TTStubs");
0079 ttClusterTruthInputTags_ = iConfig.getParameter<std::vector<edm::InputTag> >("TTClusterTruth");
0080
0081 for (const auto& iTag : ttClusterTruthInputTags_) {
0082 ttClusterTruthTokens_.push_back(consumes<TTClusterAssociationMap<T> >(iTag));
0083 }
0084
0085 for (const auto& iTag : ttStubsInputTags_) {
0086 ttStubsTokens_.push_back(consumes<edmNew::DetSetVector<TTStub<T> > >(iTag));
0087
0088 produces<TTStubAssociationMap<T> >(iTag.instance());
0089 }
0090
0091 theTrackerGeometryToken_ = esConsumes();
0092 theTrackerTopologyToken_ = esConsumes();
0093
0094
0095 edm::LogInfo("TTStubAssociator< ") << templateNameFinder<T>() << " > loaded.";
0096 }
0097
0098
0099 template <>
0100 void TTStubAssociator<Ref_Phase2TrackerDigi_>::produce(edm::Event& iEvent, const edm::EventSetup& iSetup);
0101
0102 #endif