1 #include "CLHEP/Units/GlobalSystemOfUnits.h" 15 double sharedTrackFraction,
18 : productGetter_(productGetter),
25 sharedTrackFraction_(sharedTrackFraction),
26 trackRecoToSimAssociation_(trackRecoToSimAssociation),
27 trackSimToRecoAssociation_(trackSimToRecoAssociation) {}
34 double sharedTrackFraction,
57 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::" 58 "associateRecoToSim(): associating " 59 << recoVertices.
size() <<
" reco::Vertices to" << simVertices.size()
60 <<
" TrackingVertices";
63 std::vector<size_t> simPVindices;
64 simPVindices.reserve(recoVertices.
size());
66 int current_event = -1;
67 for (
size_t iSim = 0; iSim != simVertices.size(); ++iSim) {
76 simPVindices.push_back(iSim);
81 for (
size_t iReco = 0; iReco != recoVertices.
size(); ++iReco) {
88 LogTrace(
"VertexAssociation") <<
" reco::Vertex at Z " << recoVertex.
z();
90 for (
const size_t iSim : simPVindices) {
92 LogTrace(
"VertexAssociation") <<
" Considering TrackingVertex at Z " << simVertex.
position().z();
109 LogTrace(
"VertexAssociation") <<
" Matched with significance " << zdiff / recoVertex.
zError() <<
" " 110 << tdiff / recoVertex.
tError() <<
" shared tracks " << sharedTracks
111 <<
" reco Tracks " << recoVertex.
tracksSize() <<
" TrackingParticles " 122 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateRecoToSim(): finished";
134 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::" 135 "associateSimToReco(): associating " 136 << simVertices.size() <<
" TrackingVertices to " << recoVertices.
size()
137 <<
" reco::Vertices";
139 int current_event = -1;
140 for (
size_t iSim = 0; iSim != simVertices.size(); ++iSim) {
153 LogTrace(
"VertexAssociation") <<
" TrackingVertex at Z " << simVertex.
position().z();
155 for (
size_t iReco = 0; iReco != recoVertices.
size(); ++iReco) {
160 recoVertex.
ndof() < 0.)
163 LogTrace(
"VertexAssociation") <<
" Considering reco::Vertex at Z " << recoVertex.
z();
176 LogTrace(
"VertexAssociation") <<
" Matched with significance " << zdiff / recoVertex.
zError() <<
" " 177 << tdiff / recoVertex.
tError() <<
" shared tracks " << sharedTracks
178 <<
" reco Tracks " << recoVertex.
tracksSize() <<
" TrackingParticles " 189 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateSimToReco(): finished";
int event() const
get the contents of the subdetector field (should be protected?)
double zError() const
error on z
bool isValid() const
Tells whether the vertex is valid.
const reco::RecoToSimCollection * trackRecoToSimAssociation_
const edm::EDProductGetter * productGetter_
EDProductGetter const * productGetter(std::atomic< void const * > const &iCache)
U second(std::pair< T, U > const &p)
void post_insert()
post insert action
int bunchCrossing() const
get the detector field from this detid
reco::VertexRecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Vertex >> &vCH, const edm::Handle< TrackingVertexCollection > &tVCH) const override
Abs< T >::type abs(const T &t)
double z() const
z coordinate
VertexAssociatorByPositionAndTracks(const edm::EDProductGetter *productGetter, double absZ, double sigmaZ, double maxRecoZ, double absT, double sigmaT, double maxRecoT, double sharedTrackFraction, const reco::RecoToSimCollection *trackRecoToSimAssociation, const reco::SimToRecoCollection *trackSimToRecoAssociation)
const double sharedTrackFraction_
edm::Ref< TrackingVertexCollection > TrackingVertexRef
unsigned int nDaughterTracks() const
void insert(const key_type &k, const data_type &v)
insert an association
std::vector< TrackingVertex > TrackingVertexCollection
const EncodedEventId & eventId() const
~VertexAssociatorByPositionAndTracks() override
unsigned int calculateVertexSharedTracks(const reco::Vertex &recoV, const TrackingVertex &simV, const reco::RecoToSimCollection &trackRecoToSimAssociation)
const reco::SimToRecoCollection * trackSimToRecoAssociation_
double tError() const
error on t
reco::VertexSimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Vertex >> &vCH, const edm::Handle< TrackingVertexCollection > &tVCH) const override
size_t tracksSize() const
number of tracks
double t() const
t coordinate
const LorentzVector & position() const