35 if ( iConfig.
exists(
"checkClosestZVertex") ) {
36 checkClosestZVertex_ = iConfig.
getParameter<
bool>(
"checkClosestZVertex");
38 checkClosestZVertex_ =
false;
42 produces<reco::PileUpPFCandidateCollection>();
64 auto_ptr< reco::PileUpPFCandidateCollection >
70 iEvent.
getByLabel( inputTagPFCandidates_, pfCandidates);
76 iEvent.
getByLabel( inputTagVertices_, vertices);
78 for(
unsigned i=0;
i<pfCandidates->size();
i++ ) {
87 switch( candptr->particleId() ) {
89 vertexref = chargedHadronVertex( vertices, *candptr );
98 vertexref.
key()==0 )
continue;
101 pOutput->back().setSourceCandidatePtr( candptr );
104 iEvent.
put( pOutput );
118 unsigned nFoundVertex = 0;
119 typedef reco::VertexCollection::const_iterator IV;
121 for(IV iv=vertices->begin(); iv!=vertices->end(); ++iv, ++
index) {
136 if(baseRef == trackBaseRef ) {
149 edm::LogWarning(
"TrackOnTwoVertex")<<
"a track is shared by at least two verteces. Used to be an assert";
155 if ( checkClosestZVertex_ ) {
157 double dzmin = 10000;
158 double ztrack = pfcand.
vertex().z();
159 bool foundVertex =
false;
161 for(IV iv=vertices->begin(); iv!=vertices->end(); ++iv, ++
index) {
163 double dz = fabs(ztrack - iv->z());
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void produce(edm::Event &, const edm::EventSetup &)
trackRef_iterator tracks_end() const
last iterator over tracks
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::TrackRef trackRef() const
bool isNull() const
Checks for null.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
virtual const Point & vertex() const
vertex position
std::vector< LinkConnSpec >::const_iterator IT
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< reco::PileUpPFCandidate > PileUpPFCandidateCollection
collection of PileUpPFCandidates
key_type key() const
Accessor for product key.
Particle reconstructed by the particle flow algorithm.
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
PFPileUp(const edm::ParameterSet &)
trackRef_iterator tracks_begin() const
first iterator over tracks
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Particle reconstructed by the particle flow algorithm.
reco::VertexRef chargedHadronVertex(const edm::Handle< reco::VertexCollection > &vertices, const reco::PFCandidate &pfcand) const