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 
ticl::TracksterRecoTrackPlugin::setTrack
void setTrack(const std::vector< const Trackster * > &tracksters, std::vector< TICLCandidate > &ticl_cands, edm::Event &event) const override
Definition: TracksterGeneralTrackPlugin.cc:22
mps_fire.i
i
Definition: mps_fire.py:355
ticl::TracksterRecoTrackPlugin
Definition: TracksterGeneralTrackPlugin.cc:10
min
T min(T a, T b)
Definition: MathUtil.h:58
ticl
Definition: Common.h:8
ticl::TracksterRecoTrackPlugin::TrackPtr
edm::Ptr< reco::Track > TrackPtr
Definition: TracksterGeneralTrackPlugin.cc:12
MakerMacros.h
ParameterSetDescription.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:36
edmplugin::PluginFactory
Definition: PluginFactory.h:34
TracksterTrackPluginBase.h
LorentzVector.h
edm::Ptr< reco::Track >
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ConsumesCollector.h
ticl::TracksterRecoTrackPlugin::TracksterRecoTrackPlugin
TracksterRecoTrackPlugin(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Definition: TracksterGeneralTrackPlugin.cc:19
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
ticl::TracksterTrackPluginBase
Definition: TracksterTrackPluginBase.h:16
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443