13 if (!iConfig.
empty()) {
17 "VertexingHelper: you must configure either 'vertices' (to produce associations) or 'vertexAssociations' (to read them from disk), " <<
18 "you can't specify both, nor you can specify none!\n";
32 assoSelector_ = reco::modules::make<pat::VertexAssociationSelector>(iConfig);
41 iEvent.
getByLabel(vertexAssociations_, vertexAssoMap_);
56 if (playback_)
throw cms::Exception(
"Configuration") <<
"VertexingHelper: if this module was configured to read associations from the event," <<
57 " you must use 'operator()' passing a candidate ref, and not 'associate()' directly!\n";
59 reco::VertexCollection::const_iterator vtx,
end;
64 if (!ttBuilder_.isValid())
throw cms::Exception(
"Configuration") <<
"VertexingHelper: If you use 'useTracks', you must call newEvent(iEvent,iSetup)!\n";
67 tt = ttBuilder_->build(*tk);
69 for (vtx = vertexHandle_->begin(), end = vertexHandle_->end(), ivtx = 0; vtx !=
end; ++vtx, ++ivtx) {
71 if (useTracks_ ==
false) {
78 association.
setDistances(trackPos, vtx->position(), trackErr + vtx->error());
80 if (assoSelector_(association))
return association;
void setDistances(const AlgebraicVector3 &dist, const AlgebraicSymMatrix33 &err)
Set dz and dr given the distance and the 3x3 total covariance matrix of the distance.
T getParameter(std::string const &) const
edm::InputTag vertexAssociations_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
reco::TrackBaseRef getTrack_(const reco::Candidate &c) const
Get out the track from the Candidate / RecoCandidate / PFCandidate.
bool isNull() const
Checks for null.
reco::TrackRef trackRef() const
bool useTracks_
use tracks inside candidates
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
TrackBaseRef bestTrackRef() const
best track RefToBase
pat::VertexAssociation associate(const reco::Candidate &) const
virtual const Point & vertex() const =0
vertex position
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool playback_
true if it's just reading the associations from the event
void newEvent(const edm::Event &event)
To be called for each new event, reads in the vertex collection.
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const GlobalPoint &point) const
bool enabled_
true if it has non null configuration
Particle reconstructed by the particle flow algorithm.
Analysis-level structure for vertex-related information.
pat::VertexAssociationSelector assoSelector_
selector of associations