CMS 3D CMS Logo

TracksterGeneralTrackPlugin.cc
Go to the documentation of this file.
1 // Plugin setting the track pointer for TICLCandidates based on Tracksters whose seed ID and seed index refer to a
2 // track that is or inherits from a reco::Track.
3 
8 
9 namespace ticl {
11  public:
14  void setTrack(const std::vector<const Trackster*>& tracksters,
15  std::vector<TICLCandidate>& ticl_cands,
16  edm::Event& event) const override;
17  };
18 
20  : TracksterTrackPluginBase(ps, std::move(ic)) {}
21 
22  void TracksterRecoTrackPlugin::setTrack(const std::vector<const Trackster*>& tracksters,
23  std::vector<TICLCandidate>& ticl_cands,
24  edm::Event& event) const {
25  auto size = std::min(tracksters.size(), ticl_cands.size());
26  for (size_t i = 0; i < size; ++i) {
27  const auto& trackster = *tracksters[i];
28 
29  if (trackster.seedIndex() == -1 || !trackster.seedID().isValid()) {
30  return; // leave default empty track ref
31  }
32 
33  TrackPtr ptr(trackster.seedID(), trackster.seedIndex(), &event.productGetter());
34  auto& ticl_cand = ticl_cands[i];
35  ticl_cand.setTrackPtr(ptr);
36  }
37  }
38 } // namespace ticl
39 
void setTrack(const std::vector< const Trackster *> &tracksters, std::vector< TICLCandidate > &ticl_cands, edm::Event &event) const override
Definition: Common.h:10
TracksterRecoTrackPlugin(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
#define DEFINE_EDM_PLUGIN(factory, type, name)
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1