CMS 3D CMS Logo

PFTauPrimaryVertexProducer.cc
Go to the documentation of this file.
3 
6 public:
7  explicit PFTauPrimaryVertexProducer(const edm::ParameterSet& iConfig);
9 
10  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
11 
12 protected:
15  std::vector<const reco::Track*>&) override;
16 };
17 
20 
22 
24  const std::vector<edm::Ptr<reco::TrackBase> >& tauTracks,
25  std::vector<const reco::Track*>& nonTauTracks) {
26  //Find non-tau tracks associated to thePV
27  for (reco::Vertex::trackRef_iterator vtxTrkRef = thePVRef->tracks_begin(); vtxTrkRef != thePVRef->tracks_end();
28  vtxTrkRef++) {
29  bool matched = false;
30  for (const auto& tauTrack : tauTracks) {
31  if (tauTrack.id() == vtxTrkRef->id() && tauTrack.key() == vtxTrkRef->key()) {
32  matched = true;
33  break;
34  }
35  }
36  if (!matched)
37  nonTauTracks.push_back((*vtxTrkRef).get());
38  }
39 }
40 
43  descriptions.add("pfTauPrimaryVertexProducer", desc);
44 }
45 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
RECO/AOD implementation of the PFTauPrimaryVertexProducer plugin.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void nonTauTracksInPV(const reco::VertexRef &, const std::vector< edm::Ptr< reco::TrackBase > > &, std::vector< const reco::Track *> &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static edm::ParameterSetDescription getDescriptionsBase()
PFTauPrimaryVertexProducer(const edm::ParameterSet &iConfig)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38