CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
def move
Definition: eostools.py:511
T min(T a, T b)
Definition: MathUtil.h:58
TracksterRecoTrackPlugin(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
#define DEFINE_EDM_PLUGIN(factory, type, name)
tuple size
Write out results.