CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

pat::VertexAssociationSelector Class Reference

#include <VertexAssociationSelector.h>

List of all members.

Classes

struct  Config

Public Member Functions

bool operator() (const pat::VertexAssociation &vass) const
 check if this VertexAssociation is ok
bool operator() (const reco::Candidate &c, const reco::Vertex &) const
pat::VertexAssociation simpleAssociation (const reco::Candidate &c, const reco::VertexRef &vtx) const
 VertexAssociationSelector ()
 an empty constructor is sometimes needed
 VertexAssociationSelector (const Config &conf)
 constructor from a configuration

Private Attributes

Config conf_

Detailed Description

Definition at line 9 of file VertexAssociationSelector.h.


Constructor & Destructor Documentation

pat::VertexAssociationSelector::VertexAssociationSelector ( ) [inline]

an empty constructor is sometimes needed

Definition at line 41 of file VertexAssociationSelector.h.

{} 
pat::VertexAssociationSelector::VertexAssociationSelector ( const Config conf)

constructor from a configuration

Definition at line 6 of file VertexAssociationSelector.cc.

                                                                           : 
    conf_(conf) 
{
}

Member Function Documentation

bool pat::VertexAssociationSelector::operator() ( const pat::VertexAssociation vass) const

check if this VertexAssociation is ok

Definition at line 50 of file VertexAssociationSelector.cc.

References pat::VertexAssociation::dr(), pat::VertexAssociation::dz(), pat::VertexAssociation::isNull(), Measurement1DFloat::significance(), and Measurement1DFloat::value().

                                                                               {    
    if (vass.isNull()) return false;
    if ((conf_.dZ > 0)       && ( vass.dz().value()         > conf_.dZ      )) return false;
    if ((conf_.sigmasZ > 0)  && ( vass.dz().significance()  > conf_.sigmasZ )) return false;
    if ((conf_.dZ > 0)       && ( vass.dr().value()         > conf_.dR      )) return false;
    if ((conf_.sigmasZ > 0)  && ( vass.dr().significance()  > conf_.sigmasR )) return false;
    // if ((conf_.sigmas3d > 0) && ( vass.signif3d()           > conf_.sigmas3d)) return false;
    return true;
}
bool pat::VertexAssociationSelector::operator() ( const reco::Candidate c,
const reco::Vertex vtx 
) const

check if this candidate and this vertex are compatible this will just use the basic candidate vertex position, without any fancy track extrapolation.

Definition at line 20 of file VertexAssociationSelector.cc.

References abs, reco::Vertex::error(), reco::Vertex::position(), mathSSE::sqrt(), reco::Candidate::vertex(), reco::Candidate::vx(), reco::Candidate::vy(), reco::Candidate::vz(), reco::Vertex::x(), reco::Vertex::y(), reco::Vertex::z(), and reco::Vertex::zError().

                                                                                            {    
    using std::abs;
    using std::sqrt;

    if ((conf_.dZ > 0)      && !( std::abs(c.vz() - vtx.z())                > conf_.dZ    )) return false;
    if ((conf_.sigmasZ > 0) && !( std::abs(c.vz() - vtx.z())                > conf_.sigmasZ * vtx.zError())) return false;
    if ((conf_.dR > 0)      && !( (c.vertex() - vtx.position()).Rho() > conf_.dR    )) return false;
    if ( conf_.sigmasR > 0) {
        // D = sqrt( DZ^2 + DY^2) => sigma^2(D) = d D/d X_i * cov(X_i, X_j) * d D/d X_j =>
        // d D / d X_i = DX_i / D
        // D > sigmaR * sigma(D)   if and only if D^4 > sigmaR^2 * DX_i DX_j cov(X_i,X_j)
        AlgebraicVector3 dist(c.vx() - vtx.x(), c.vy() - vtx.y(), 0);
        double D2 = dist[0]*dist[0] + dist[1]*dist[1];
        double DcovD = ROOT::Math::Similarity(dist, vtx.error());
        if ( D2*D2 > DcovD * (conf_.sigmasR*conf_.sigmasR) ) return false;
    }
    /*
    if (conf_.sigmas3d > 0) {
        // same as above, but 3D
         AlgebraicVector3 dist(c.vx() - vtx.x(), c.vy() - vtx.y(), c.vz() - vtx.z());
        double D2 = dist[0]*dist[0] + dist[1]*dist[1] + dist[2]*dist[2];
        double DcovD = ROOT::Math::Similarity(dist, vtx.error());
        if ( D2*D2 > DcovD * (conf_.sigmas3d*conf_.sigmas3d) ) return false;
    }
    */

    return true;
}
pat::VertexAssociation pat::VertexAssociationSelector::simpleAssociation ( const reco::Candidate c,
const reco::VertexRef vtx 
) const

Definition at line 12 of file VertexAssociationSelector.cc.

References run_regression::ret, pat::VertexAssociation::setDistances(), and reco::Candidate::vertex().

                                                                                                      {    
    pat::VertexAssociation ret(vtx);
    ret.setDistances(c.vertex(), vtx->position(), vtx->error());
    return ret;
}

Member Data Documentation

Definition at line 62 of file VertexAssociationSelector.h.