26 if (!vtx.
isValid())
return false;
29 if (TMath::Prob( vtx.
chi2(), vtx.
ndof() )<probMin)
return false;
33 double dbsx = vtx.
x() - beamspot.x();
34 double dbsy = vtx.
y() - beamspot.y();
35 double lxy = (mom.x()*dbsx + mom.y()*dbsy)/mom.rho();
43 if ( (*it)>nHitsBeforeVtxMax )
return false;
57 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
59 if ( ele.reco::GsfElectron::gsfTrack().isNonnull() && ele.reco::GsfElectron::gsfTrack().id()==it->id() && ele.reco::GsfElectron::gsfTrack().key()==it->key())
return true;
60 else if ( allowCkfMatch && ele.reco::GsfElectron::closestCtfTrackRef().isNonnull() && ele.reco::GsfElectron::closestCtfTrackRef().id()==it->id() && ele.reco::GsfElectron::closestCtfTrackRef().key()==it->key() )
return true;
61 if (allowAmbiguousGsfMatch) {
63 if (tk->isNonnull() && tk->id()==it->id() && tk->key()==it->key())
return true;
87 float dEta = mom.eta() - cscvector.eta();
90 if (dR>dRMax)
return false;
91 if (dEta>dEtaMax)
return false;
92 if (dPhi>dPhiMax)
return false;
105 if (trk.
isNull())
return false;
107 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
109 if (trk.
id()==it->
id() && trk.
key()==it->key())
return true;
121 if (trk.
isNull())
return false;
123 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
125 if (trk.
id()==it->
id() && trk.
key()==it->key())
return true;
137 if (trk.
isNull())
return false;
139 const std::vector<edm::RefToBase<reco::Track> > &convTracks = conv.
tracks();
141 if (trk.
id()==it->
id() && trk.
key()==it->key())
return true;
151 const math::XYZPoint &beamspot,
bool allowCkfMatch,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
157 for (ConversionCollection::const_iterator it = convCol->begin(); it!=convCol->end(); ++it) {
158 if (!matchesConversion(ele, *it, allowCkfMatch))
continue;
159 if (!isGoodConversion(*it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
171 const math::XYZPoint &beamspot,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
176 if (trk.
isNull())
return false;
178 for (ConversionCollection::const_iterator it = convCol->begin(); it!=convCol->end(); ++it) {
179 if (!matchesConversion(trk, *it))
continue;
180 if (!isGoodConversion(*it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
192 const math::XYZPoint &beamspot,
float dRMax,
float dEtaMax,
float dPhiMax,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
198 for (ConversionCollection::const_iterator it = convCol->begin(); it!=convCol->end(); ++it) {
199 if (!matchesConversion(sc, *it))
continue;
200 if (!isGoodConversion(*it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
213 const math::XYZPoint &beamspot,
bool allowCkfMatch,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
223 double minRho = 999.;
224 for (ConversionCollection::const_iterator it = convCol->begin(); it!=convCol->end(); ++it) {
225 float rho = it->conversionVertex().position().rho();
226 if (rho>minRho)
continue;
227 if (!matchesConversion(ele, *it, allowCkfMatch))
continue;
228 if (!isGoodConversion(*it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
241 const math::XYZPoint &beamspot,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
250 if (trk.
isNull())
return match;
252 double minRho = 999.;
253 for (ConversionCollection::const_iterator it = convCol->begin(); it!=convCol->end(); ++it) {
254 float rho = it->conversionVertex().position().rho();
255 if (rho>minRho)
continue;
256 if (!matchesConversion(trk, *it))
continue;
257 if (!isGoodConversion(*it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
270 const math::XYZPoint &beamspot,
float dRMax,
float dEtaMax,
float dPhiMax,
float lxyMin,
float probMin,
unsigned int nHitsBeforeVtxMax)
280 double minRho = 999.;
281 for (ConversionCollection::const_iterator it = convCol->begin(); it!=convCol->end(); ++it) {
282 float rho = it->conversionVertex().position().rho();
283 if (rho>minRho)
continue;
284 if (!matchesConversion(sc, *it, dRMax,dEtaMax,dPhiMax))
continue;
285 if (!isGoodConversion(*it,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
303 if (sc.
isNull())
return false;
305 for (GsfElectronCollection::const_iterator it = eleCol->begin(); it!=eleCol->end(); ++it) {
307 if (it->reco::GsfElectron::superCluster()!=sc)
continue;
310 if (it->gsfTrack()->trackerExpectedHitsInner().numberOfHits()>0)
continue;
313 if (hasMatchedConversion(*it,convCol,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
335 if (sc.
isNull())
return match;
337 for (GsfElectronCollection::const_iterator it = eleCol->begin(); it!=eleCol->end(); ++it) {
339 if (it->reco::GsfElectron::superCluster()!=sc)
continue;
342 if (it->gsfTrack()->trackerExpectedHitsInner().numberOfHits()>0)
continue;
345 if (hasMatchedConversion(*it,convCol,beamspot,lxyMin,probMin,nHitsBeforeVtxMax))
continue;
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
double lxy(const math::XYZPoint &myBeamSpot, const Conversion &conv)
const math::XYZPoint & position() const
cluster centroid position
GsfTrackRefVector::const_iterator ambiguousGsfTracksBegin() const
static HepMC::IO_HEPEVT conv
double y() const
y coordinate
bool isValid() const
Tells whether the vertex is valid.
bool isNull() const
Checks for null.
const Point & position() const
position
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
GsfTrackRefVector::const_iterator ambiguousGsfTracksEnd() const
bool isNull() const
Checks for null.
double dPhi(double phi1, double phi2)
double chi2() const
chi-squares
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::Ref< GsfElectronCollection > GsfElectronRef
reference to an object in a collection of GsfElectron objects
double deltaPhi(double phi1, double phi2)
double x() const
x coordinate
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
key_type key() const
Accessor for product key.
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
edm::Ref< ConversionCollection > ConversionRef
reference to an object in a collection of Conversion objects
ProductID id() const
Accessor for product ID.
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)