25 if (!vtx.
isValid())
return false;
28 if (TMath::Prob( vtx.
chi2(), vtx.
ndof() )<probMin)
return false;
32 double dbsx = vtx.
x() - beamspot.x();
33 double dbsy = vtx.
y() - beamspot.y();
34 double lxy = (mom.x()*dbsx + mom.y()*dbsy)/mom.rho();
42 if ( (*it)>nHitsBeforeVtxMax )
return false;
56 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
58 if ( ele.reco::GsfElectron::gsfTrack().isNonnull() && ele.reco::GsfElectron::gsfTrack().id()==it->id() && ele.reco::GsfElectron::gsfTrack().key()==it->key())
return true;
59 else if ( allowCkfMatch && ele.reco::GsfElectron::closestCtfTrackRef().isNonnull() && ele.reco::GsfElectron::closestCtfTrackRef().id()==it->id() && ele.reco::GsfElectron::closestCtfTrackRef().key()==it->key() )
return true;
60 if (allowAmbiguousGsfMatch) {
62 if (tk->isNonnull() && tk->id()==it->id() && tk->key()==it->key())
return true;
78 for (
const auto& trkRef : conv.
tracks() ){
80 eleCore.
gsfTrack().
key()==trkRef.key())
return true;
83 eleCore.
ctfTrack().
key()==trkRef.key() )
return true;
106 float dEta = mom.eta() - cscvector.eta();
109 if (dR>dRMax)
return false;
110 if (dEta>dEtaMax)
return false;
111 if (dPhi>dPhiMax)
return false;
124 if (trk.
isNull())
return false;
126 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
128 if (trk.
id()==it->
id() && trk.
key()==it->key())
return true;
140 if (trk.
isNull())
return false;
142 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
144 if (trk.
id()==it->
id() && trk.
key()==it->key())
return true;
156 if (trk.
isNull())
return false;
158 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
160 if (trk.
id()==it->
id() && trk.
key()==it->key())
return true;
170 const math::XYZPoint &
beamspot,
bool allowCkfMatch,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
176 for(
auto const& it : convCol) {
177 if (!matchesConversion(ele, it, allowCkfMatch))
continue;
178 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
195 if (trk.
isNull())
return false;
197 for(
auto const& it : convCol) {
198 if (!matchesConversion(trk, it))
continue;
199 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
217 for(
auto const& it : convCol) {
218 if (!matchesConversion(sc, it))
continue;
219 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
232 const math::XYZPoint &
beamspot,
bool allowCkfMatch,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
242 double minRho = 999.;
243 for(
auto const& it : convCol) {
244 float rho = it.conversionVertex().position().rho();
245 if (rho>minRho)
continue;
246 if (!matchesConversion(ele, it, allowCkfMatch))
continue;
247 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
260 const math::XYZPoint &
beamspot,
bool allowCkfMatch,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
270 double minRho = 999.;
271 for(
auto const& it : convCol) {
272 float rho = it.conversionVertex().position().rho();
273 if (rho>minRho)
continue;
274 if (!matchesConversion(eleCore, it, allowCkfMatch))
continue;
275 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
297 if (trk.
isNull())
return match;
299 double minRho = 999.;
300 for(
auto const& it : convCol) {
301 float rho = it.conversionVertex().position().rho();
302 if (rho>minRho)
continue;
303 if (!matchesConversion(trk, it))
continue;
304 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
327 double minRho = 999.;
328 for(
auto const& it : convCol) {
329 float rho = it.conversionVertex().position().rho();
330 if (rho>minRho)
continue;
331 if (!matchesConversion(sc, it, dRMax,dEtaMax,dPhiMax))
continue;
332 if (!isGoodConversion(it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
347 return !(matchedPromptElectron(sc, eleCol, convCol, beamspot,
348 allowCkfMatch, lxyMin, probMin, nHitsBeforeVtxMax) ==
nullptr);
362 if (sc.
isNull())
return match;
364 for(
auto const& it : eleCol) {
366 if (it.superCluster()!=
sc)
continue;
372 if (hasMatchedConversion(it,convCol,beamspot,allowCkfMatch,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
389 return TMath::Prob(vtx.
chi2(),vtx.
ndof()) ;
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
constexpr double deltaPhi(double phi1, double phi2)
const math::XYZPoint & position() const
cluster centroid position
bool isNonnull() const
Checks for non-null.
GsfTrackRefVector::const_iterator ambiguousGsfTracksBegin() const
static HepMC::IO_HEPEVT conv
double y() const
y coordinate
bool isValid() const
Tells whether the vertex is valid.
const GsfTrackRef & gsfTrack() const
key_type key() const
Accessor for product key.
const Point & position() const
position
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
ProductID id() const
Accessor for product ID.
GsfTrackRefVector::const_iterator ambiguousGsfTracksEnd() const
double chi2() const
chi-squares
bool isNull() const
Checks for null.
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double x() const
x coordinate
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
bool isNull() const
Checks for null.
TrackRef ctfTrack() const
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)