CMS 3D CMS Logo

TTStubAssociator.h
Go to the documentation of this file.
1 
13 #ifndef L1_TRACK_TRIGGER_STUB_ASSOCIATOR_H
14 #define L1_TRACK_TRIGGER_STUB_ASSOCIATOR_H
15 
23 
25 
33 
38 
39 #include <memory>
40 #include <map>
41 #include <vector>
42 
43 template <typename T>
47 public:
49  explicit TTStubAssociator(const edm::ParameterSet& iConfig);
50 
52  ~TTStubAssociator() override;
53 
54 private:
56  std::vector<edm::InputTag> TTStubsInputTags;
57  std::vector<edm::InputTag> TTClusterTruthInputTags;
58 
59  std::vector<edm::EDGetTokenT<edmNew::DetSetVector<TTStub<T> > > > TTStubsTokens;
60  std::vector<edm::EDGetTokenT<TTClusterAssociationMap<T> > > TTClusterTruthTokens;
61 
64 
66  void beginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
67  void endRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
68  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
69 
70 };
71 
79 template <typename T>
82  TTStubsInputTags = iConfig.getParameter<std::vector<edm::InputTag> >("TTStubs");
83  TTClusterTruthInputTags = iConfig.getParameter<std::vector<edm::InputTag> >("TTClusterTruth");
84 
85  for (auto iTag = TTClusterTruthInputTags.begin(); iTag != TTClusterTruthInputTags.end(); iTag++) {
86  TTClusterTruthTokens.push_back(consumes<TTClusterAssociationMap<T> >(*iTag));
87  }
88 
89  for (auto iTag = TTStubsInputTags.begin(); iTag != TTStubsInputTags.end(); iTag++) {
90  TTStubsTokens.push_back(consumes<edmNew::DetSetVector<TTStub<T> > >(*iTag));
91 
92  produces<TTStubAssociationMap<T> >((*iTag).instance());
93  }
94 }
95 
97 template <typename T>
99 
101 template <typename T>
104  edm::LogInfo("TTStubAssociator< ") << templateNameFinder<T>() << " > loaded.";
105 
106  iSetup.get<TrackerTopologyRcd>().get(theTrackerTopology);
107  iSetup.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
108 }
109 
111 template <typename T>
113 
115 template <>
117 
118 #endif
TTStubAssociator::TTStubsTokens
std::vector< edm::EDGetTokenT< edmNew::DetSetVector< TTStub< T > > > > TTStubsTokens
Definition: TTStubAssociator.h:59
TTClusterAssociationMap
NOTE: this is needed even if it seems not.
Definition: TTClusterAssociationMap.h:33
TTStubAssociator::TTStubAssociator
TTStubAssociator(const edm::ParameterSet &iConfig)
Constructors.
Definition: TTStubAssociator.h:81
TrackerGeometry.h
PixelTopology.h
ESHandle.h
TTTypes.h
TTStubAssociator::~TTStubAssociator
~TTStubAssociator() override
Destructor.
Definition: TTStubAssociator.h:98
edm::Run
Definition: Run.h:45
TTStubAssociator::TTClusterTruthInputTags
std::vector< edm::InputTag > TTClusterTruthInputTags
Definition: TTStubAssociator.h:57
TTStubAssociator::beginRun
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Mandatory methods.
Definition: TTStubAssociator.h:102
TTStubAssociator::endRun
void endRun(const edm::Run &run, const edm::EventSetup &iSetup) override
End run.
Definition: TTStubAssociator.h:112
EDProducer.h
TTStubAssociator::TTStubsInputTags
std::vector< edm::InputTag > TTStubsInputTags
Data members.
Definition: TTStubAssociator.h:56
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
TTClusterAssociationMap.h
TTStubAssociator
Plugin to create the MC truth for TTStubs.
Definition: TTStubAssociator.h:44
MakerMacros.h
TrackerTopology.h
classNameFinder.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
TTStub
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
edm::ESHandle< TrackerGeometry >
TTStubAssociator::theTrackerTopology
edm::ESHandle< TrackerTopology > theTrackerTopology
Definition: TTStubAssociator.h:63
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
TTStubAssociationMap.h
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
edmNew::DetSetVector
Definition: DetSetNew.h:13
TTStubAssociator::TTClusterTruthTokens
std::vector< edm::EDGetTokenT< TTClusterAssociationMap< T > > > TTClusterTruthTokens
Definition: TTStubAssociator.h:60
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
PixelGeomDetUnit.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TTStub.h
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
ParameterSet.h
TTStubAssociator::theTrackerGeometry
edm::ESHandle< TrackerGeometry > theTrackerGeometry
Definition: TTStubAssociator.h:62
edm::Event
Definition: Event.h:73
Topology.h
DetSetVectorNew.h
TTClusterAssociator.h
TTStubAssociator::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override