CMS 3D CMS Logo

TTTrackAssociator.h
Go to the documentation of this file.
1 
14 #ifndef L1_TRACK_TRIGGER_TRACK_ASSOCIATOR_H
15 #define L1_TRACK_TRIGGER_TRACK_ASSOCIATOR_H
16 
24 
26 
35 
36 #include <memory>
37 #include <map>
38 #include <vector>
39 
40 template <typename T>
44 public:
46  explicit TTTrackAssociator(const edm::ParameterSet& iConfig);
47 
49  ~TTTrackAssociator() override;
50 
51 private:
53  std::vector<edm::InputTag> ttTracksInputTags_;
54 
55  std::vector<edm::EDGetTokenT<std::vector<TTTrack<T> > > > ttTracksTokens_;
58 
60 
62  void beginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
63  void endRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
64  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
65 
66 };
67 
75 template <typename T>
78  ttTracksInputTags_ = iConfig.getParameter<std::vector<edm::InputTag> >("TTTracks");
79  ttClusterTruthToken_ = consumes<TTClusterAssociationMap<T> >(iConfig.getParameter<edm::InputTag>("TTClusterTruth"));
80  ttStubTruthToken_ = consumes<TTStubAssociationMap<T> >(iConfig.getParameter<edm::InputTag>("TTStubTruth"));
81  TTTrackAllowOneFalse2SStub = iConfig.getParameter<bool>("TTTrackAllowOneFalse2SStub");
83  edm::LogInfo("TTTrackAssociator< ") << "Allow track if no more than one 2S stub doesn't match truth.";
84  } else {
85  edm::LogInfo("TTTrackAssociator< ") << "All 2S stubs must match truth.";
86  }
87 
88  for (const auto& iTag : ttTracksInputTags_) {
89  ttTracksTokens_.push_back(consumes<std::vector<TTTrack<T> > >(iTag));
90 
91  produces<TTTrackAssociationMap<T> >(iTag.instance());
92  }
93 }
94 
96 template <typename T>
98 
100 template <typename T>
103  edm::LogInfo("TTStubAssociator< ") << "TTTrackAssociator< " << templateNameFinder<T>() << " > loaded.";
104 }
105 
107 template <typename T>
109 
111 template <>
113 
114 #endif
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
~TTTrackAssociator() override
Destructor.
TTTrackAssociator(const edm::ParameterSet &iConfig)
Constructors.
std::vector< edm::EDGetTokenT< std::vector< TTTrack< T > > > > ttTracksTokens_
std::vector< edm::InputTag > ttTracksInputTags_
Data members.
int iEvent
Definition: GenABIO.cc:224
Plugin to create the MC truth for TTTracks.
void endRun(const edm::Run &run, const edm::EventSetup &iSetup) override
End run.
Log< level::Info, false > LogInfo
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
edm::EDGetTokenT< TTStubAssociationMap< T > > ttStubTruthToken_
edm::EDGetTokenT< TTClusterAssociationMap< T > > ttClusterTruthToken_
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Mandatory methods.
Definition: Run.h:45