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";
60 for(
size_t iReco=0; iReco != recoVertices.
size(); ++iReco) {
67 LogTrace(
"VertexAssociation") <<
" reco::Vertex at Z " << recoVertex.
z();
69 int current_event = -1;
70 for(
size_t iSim=0; iSim != simVertices.size(); ++iSim) {
83 LogTrace(
"VertexAssociation") <<
" Considering TrackingVertex at Z " << simVertex.
position().z();
99 LogTrace(
"VertexAssociation") <<
" Matched with significance " << zdiff/recoVertex.
zError() <<
" " << tdiff/recoVertex.
tError()
100 <<
" shared tracks " << sharedTracks <<
" reco Tracks " << recoVertex.
tracksSize() <<
" TrackingParticles " << simVertex.
nDaughterTracks();
110 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateRecoToSim(): finished";
122 LogDebug(
"VertexAssociation") <<
"VertexAssociatorByPositionAndTracks::associateSimToReco(): associating " 123 << simVertices.size() <<
" TrackingVertices to " << recoVertices.
size() <<
" reco::Vertices";
125 int current_event = -1;
126 for(
size_t iSim=0; iSim != simVertices.size(); ++iSim) {
139 LogTrace(
"VertexAssociation") <<
" TrackingVertex at Z " << simVertex.
position().z();
141 for(
size_t iReco=0; iReco != recoVertices.
size(); ++iReco) {
148 LogTrace(
"VertexAssociation") <<
" Considering reco::Vertex at Z " << recoVertex.
z();
161 LogTrace(
"VertexAssociation") <<
" Matched with significance " << zdiff/recoVertex.
zError() <<
" " << tdiff/recoVertex.
tError()
162 <<
" shared tracks " << sharedTracks <<
" reco Tracks " << recoVertex.
tracksSize() <<
" TrackingParticles " << simVertex.
nDaughterTracks();
172 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