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 >
45 {
48  public:
50  explicit TTStubAssociator( const edm::ParameterSet& iConfig );
51 
53  ~TTStubAssociator() override;
54 
55  private:
57  std::vector< edm::InputTag > TTStubsInputTags;
58  std::vector< edm::InputTag > TTClusterTruthInputTags;
59 
60  std::vector<edm::EDGetTokenT< edmNew::DetSetVector< TTStub< T > > > > TTStubsTokens;
61  std::vector<edm::EDGetTokenT< TTClusterAssociationMap< T > > > TTClusterTruthTokens;
62 
65 
67  void beginRun( const edm::Run& run, const edm::EventSetup& iSetup ) override;
68  void endRun( const edm::Run& run, const edm::EventSetup& iSetup ) override;
69  void produce( edm::Event& iEvent, const edm::EventSetup& iSetup ) override;
70 
71 };
72 
80 template< typename T >
83 {
84  TTStubsInputTags = iConfig.getParameter< std::vector< edm::InputTag > >( "TTStubs" );
85  TTClusterTruthInputTags = iConfig.getParameter< std::vector< edm::InputTag > >( "TTClusterTruth" );
86 
87 
88  for ( auto iTag = TTClusterTruthInputTags.begin(); iTag!= TTClusterTruthInputTags.end(); iTag++ )
89  {
90  TTClusterTruthTokens.push_back(consumes< TTClusterAssociationMap< T > >(*iTag));
91  }
92 
93  for ( auto iTag = TTStubsInputTags.begin(); iTag!= TTStubsInputTags.end(); iTag++ )
94  {
95  TTStubsTokens.push_back(consumes< edmNew::DetSetVector< TTStub< T > > >(*iTag));
96 
97  produces< TTStubAssociationMap< T > >( (*iTag).instance() );
98  }
99 }
100 
102 template< typename T >
104 
106 template< typename T >
108 {
110  edm::LogInfo("TTStubAssociator< ") << templateNameFinder< T >() << " > loaded.";
111 
114 }
115 
117 template< typename T >
119 
121 template< >
123 
124 #endif
125 
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< TTClusterAssociationMap< T > > > TTClusterTruthTokens
NOTE: this is needed even if it seems not.
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
TTStubAssociator(const edm::ParameterSet &iConfig)
Constructors.
std::vector< edm::EDGetTokenT< edmNew::DetSetVector< TTStub< T > > > > TTStubsTokens
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:71
std::vector< edm::InputTag > TTStubsInputTags
Data members.
edm::ESHandle< TrackerTopology > theTrackerTopology
void endRun(const edm::Run &run, const edm::EventSetup &iSetup) override
End run.
Definition: Run.h:45