12 if (!iConfig.
empty()) {
15 throw cms::Exception(
"Configuration") <<
"VertexingHelper: you must configure either 'vertices' (to produce " 16 "associations) or 'vertexAssociations' (to read them from disk), " 17 <<
"you can't specify both, nor you can specify none!\n";
32 assoSelector_ = reco::modules::make<pat::VertexAssociationSelector>(iConfig);
43 iEvent.getByToken(vertexAssociationsToken_, vertexAssoMap_);
45 iEvent.getByToken(verticesToken_, vertexHandle_);
58 <<
"VertexingHelper: if this module was configured to read associations from the event," 59 <<
" you must use 'operator()' passing a candidate ref, and not 'associate()' directly!\n";
61 reco::VertexCollection::const_iterator
vtx, end;
66 if (!ttBuilder_.isValid())
68 <<
"VertexingHelper: If you use 'useTracks', you must call newEvent(iEvent,iSetup)!\n";
72 tt = ttBuilder_->build(*tk);
74 for (
vtx = vertexHandle_->begin(), end = vertexHandle_->end(), ivtx = 0;
vtx != end; ++
vtx, ++ivtx) {
76 if (useTracks_ ==
false) {
T getParameter(std::string const &) const
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttToken_
std::vector< Vertex > VertexCollection
collection of Vertex objects
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
bool useTracks_
use tracks inside candidates
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
virtual TrackBaseRef bestTrackRef() const
best track RefToBase
reco::TrackBaseRef getTrack_(const reco::Candidate &c) const
Get out the track from the Candidate / RecoCandidate / PFCandidate.
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
edm::EDGetTokenT< edm::ValueMap< pat::VertexAssociation > > vertexAssociationsToken_
bool isNull() const
Checks for null.
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) 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.
pat::VertexAssociation associate(const reco::Candidate &) const
bool enabled_
true if it has non null configuration
Particle reconstructed by the particle flow algorithm.
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
reco::TrackRef trackRef() const
Analysis-level structure for vertex-related information.
pat::VertexAssociationSelector assoSelector_
selector of associations