3 #include "CLHEP/Units/GlobalSystemOfUnits.h" 14 double sharedTrackFraction,
17 productGetter_(productGetter),
24 sharedTrackFraction_(sharedTrackFraction),
25 trackRecoToSimAssociation_(trackRecoToSimAssociation),
26 trackSimToRecoAssociation_(trackSimToRecoAssociation)
33 double sharedTrackFraction,
57 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateRecoToSim(): associating " 58 << recoVertices.
size() <<
" reco::Vertices to" << simVertices.size() <<
" TrackingVertices";
61 std::vector<size_t> simPVindices;
62 simPVindices.reserve(recoVertices.
size());
64 int current_event = -1;
65 for(
size_t iSim=0; iSim != simVertices.size(); ++iSim) {
73 simPVindices.push_back(iSim);
78 for(
size_t iReco=0; iReco != recoVertices.
size(); ++iReco) {
85 LogTrace(
"VertexAssociation") <<
" reco::Vertex at Z " << recoVertex.
z();
87 for(
const size_t iSim: simPVindices) {
89 LogTrace(
"VertexAssociation") <<
" Considering TrackingVertex at Z " << simVertex.
position().z();
105 LogTrace(
"VertexAssociation") <<
" Matched with significance " << zdiff/recoVertex.
zError() <<
" " << tdiff/recoVertex.
tError()
106 <<
" shared tracks " << sharedTracks <<
" reco Tracks " << recoVertex.
tracksSize() <<
" TrackingParticles " << simVertex.
nDaughterTracks();
116 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateRecoToSim(): finished";
128 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateSimToReco(): associating " 129 << simVertices.size() <<
" TrackingVertices to " << recoVertices.
size() <<
" reco::Vertices";
131 int current_event = -1;
132 for(
size_t iSim=0; iSim != simVertices.size(); ++iSim) {
145 LogTrace(
"VertexAssociation") <<
" TrackingVertex at Z " << simVertex.
position().z();
147 for(
size_t iReco=0; iReco != recoVertices.
size(); ++iReco) {
154 LogTrace(
"VertexAssociation") <<
" Considering reco::Vertex at Z " << recoVertex.
z();
167 LogTrace(
"VertexAssociation") <<
" Matched with significance " << zdiff/recoVertex.
zError() <<
" " << tdiff/recoVertex.
tError()
168 <<
" shared tracks " << sharedTracks <<
" reco Tracks " << recoVertex.
tracksSize() <<
" TrackingParticles " << simVertex.
nDaughterTracks();
178 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)
virtual reco::VertexSimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Vertex > > &vCH, const edm::Handle< TrackingVertexCollection > &tVCH) const
compare reco to sim the handle of reco::Vertex and TrackingVertex collections
U second(std::pair< T, U > const &p)
void post_insert()
post insert action
int bunchCrossing() const
get the detector field from this detid
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_
virtual reco::VertexRecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Vertex > > &vCH, const edm::Handle< TrackingVertexCollection > &tVCH) const
compare reco to sim the handle of reco::Vertex and TrackingVertex collections
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
virtual ~VertexAssociatorByPositionAndTracks()
unsigned int calculateVertexSharedTracks(const reco::Vertex &recoV, const TrackingVertex &simV, const reco::RecoToSimCollection &trackRecoToSimAssociation)
const reco::SimToRecoCollection * trackSimToRecoAssociation_
double tError() const
error on t
size_t tracksSize() const
number of tracks
double t() const
t coordinate
const LorentzVector & position() const