1 #include "CLHEP/Units/GlobalSystemOfUnits.h"
15 double sharedTrackFraction,
25 sharedTrackFraction_(sharedTrackFraction),
26 trackRecoToSimAssociation_(trackRecoToSimAssociation),
27 trackSimToRecoAssociation_(trackSimToRecoAssociation) {}
34 double sharedTrackFraction,
41 absT_(
std::numeric_limits<double>::
max()),
42 sigmaT_(
std::numeric_limits<double>::
max()),
43 maxRecoT_(
std::numeric_limits<double>::
max()),
44 sharedTrackFraction_(sharedTrackFraction),
45 trackRecoToSimAssociation_(trackRecoToSimAssociation),
46 trackSimToRecoAssociation_(trackSimToRecoAssociation) {}
57 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::"
58 "associateRecoToSim(): associating "
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) {
72 if (
simVertex.eventId().bunchCrossing() != 0)
74 if (
simVertex.eventId().event() != current_event) {
75 current_event =
simVertex.eventId().event();
76 simPVindices.push_back(iSim);
81 for (
size_t iReco = 0; iReco != recoVertices.
size(); ++iReco) {
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) {
145 if (
simVertex.eventId().bunchCrossing() != 0)
147 if (
simVertex.eventId().event() != current_event) {
148 current_event =
simVertex.eventId().event();
153 LogTrace(
"VertexAssociation") <<
" TrackingVertex at Z " <<
simVertex.position().z();
155 for (
size_t iReco = 0; iReco != recoVertices.
size(); ++iReco) {
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";