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 
108 }
109 
111 template <typename T>
113 
115 template <>
117 
118 #endif
T getParameter(std::string const &) const
NOTE: this is needed even if it seems not.
std::vector< edm::EDGetTokenT< TTClusterAssociationMap< T > > > TTClusterTruthTokens
int iEvent
Definition: GenABIO.cc:224
~TTStubAssociator() override
Destructor.
edm::ESHandle< TrackerGeometry > theTrackerGeometry
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
std::vector< edm::EDGetTokenT< edmNew::DetSetVector< TTStub< T > > > > TTStubsTokens
std::vector< edm::InputTag > TTStubsInputTags
Data members.
TTStubAssociator(const edm::ParameterSet &iConfig)
Constructors.
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Mandatory methods.
std::vector< edm::InputTag > TTClusterTruthInputTags
Plugin to create the MC truth for TTStubs.
T get() const
Definition: EventSetup.h:73
edm::ESHandle< TrackerTopology > theTrackerTopology
void endRun(const edm::Run &run, const edm::EventSetup &iSetup) override
End run.
Definition: Run.h:45