RecoTauTag
RecoTau
plugins
PFTauPrimaryVertexProducer.cc
Go to the documentation of this file.
1
#include "
RecoTauTag/RecoTau/interface/PFTauPrimaryVertexProducerBase.h
"
2
#include "
FWCore/Framework/interface/MakerMacros.h
"
3
5
class
PFTauPrimaryVertexProducer
final :
public
PFTauPrimaryVertexProducerBase
{
6
public
:
7
explicit
PFTauPrimaryVertexProducer
(
const
edm::ParameterSet
& iConfig);
8
~PFTauPrimaryVertexProducer
()
override
;
9
10
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
11
12
protected
:
13
void
nonTauTracksInPV
(
const
reco::VertexRef
&,
14
const
std::vector<
edm::Ptr<reco::TrackBase>
>&,
15
std::vector<const reco::Track*>&)
override
;
16
};
17
18
PFTauPrimaryVertexProducer::PFTauPrimaryVertexProducer
(
const
edm::ParameterSet
& iConfig)
19
:
PFTauPrimaryVertexProducerBase
::
PFTauPrimaryVertexProducerBase
(iConfig) {}
20
21
PFTauPrimaryVertexProducer::~PFTauPrimaryVertexProducer
() {}
22
23
void
PFTauPrimaryVertexProducer::nonTauTracksInPV
(
const
reco::VertexRef
& thePVRef,
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
41
void
PFTauPrimaryVertexProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
42
auto
desc =
PFTauPrimaryVertexProducerBase::getDescriptionsBase
();
43
descriptions.
add
(
"pfTauPrimaryVertexProducer"
, desc);
44
}
45
46
DEFINE_FWK_MODULE
(
PFTauPrimaryVertexProducer
);
muonTagProbeFilters_cff.matched
matched
Definition:
muonTagProbeFilters_cff.py:62
PFTauPrimaryVertexProducer::PFTauPrimaryVertexProducer
PFTauPrimaryVertexProducer(const edm::ParameterSet &iConfig)
Definition:
PFTauPrimaryVertexProducer.cc:18
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition:
Vertex.h:38
PFTauPrimaryVertexProducer::~PFTauPrimaryVertexProducer
~PFTauPrimaryVertexProducer() override
Definition:
PFTauPrimaryVertexProducer.cc:21
edm::Ref< VertexCollection >
PFTauPrimaryVertexProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
PFTauPrimaryVertexProducer.cc:41
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:36
PFTauPrimaryVertexProducer
RECO/AOD implementation of the PFTauPrimaryVertexProducer plugin.
Definition:
PFTauPrimaryVertexProducer.cc:5
edm::Ptr
Definition:
AssociationVector.h:31
PFTauPrimaryVertexProducerBase.h
PFTauPrimaryVertexProducerBase::getDescriptionsBase
static edm::ParameterSetDescription getDescriptionsBase()
Definition:
PFTauPrimaryVertexProducerBase.cc:220
PFTauPrimaryVertexProducerBase
Definition:
PFTauPrimaryVertexProducerBase.h:39
PFTauPrimaryVertexProducer::nonTauTracksInPV
void nonTauTracksInPV(const reco::VertexRef &, const std::vector< edm::Ptr< reco::TrackBase > > &, std::vector< const reco::Track * > &) override
Definition:
PFTauPrimaryVertexProducer.cc:23
Generated for CMSSW Reference Manual by
1.8.16