CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

pat::CandKinResolution Class Reference

#include <CandKinResolution.h>

List of all members.

Public Types

typedef math::XYZTLorentzVector LorentzVector
enum  Parametrization {
  Invalid = 0, Cart = 0x04, ECart = 0x14, Spher = 0x24,
  ESpher = 0x34, MomDev = 0x44, EMomDev = 0x54, MCCart = 0x03,
  MCSpher = 0x13, MCPInvSpher = 0x23, EtEtaPhi = 0x33, EtThetaPhi = 0x43,
  MCMomDev = 0x53, EScaledMomDev = 0x63
}
typedef float Scalar

Public Member Functions

 CandKinResolution ()
 CandKinResolution (Parametrization parametrization, const std::vector< Scalar > &covariances, const std::vector< Scalar > &constraints=std::vector< Scalar >())
 CandKinResolution (Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const std::vector< Scalar > &constraints=std::vector< Scalar >())
 Fill in a cresolution object given a parametrization code, a covariance matrix and a vector of constraints.
const std::vector< Scalar > & constraints () const
 The constraints associated with this parametrization.
const AlgebraicSymMatrix44covariance () const
 Returns the full covariance matrix.
uint32_t dimension () const
 Returns the number of free parameters in this parametrization.
Parametrization parametrization () const
 Return the code of the parametrization used in this object.
double resolE (const LorentzVector &p4) const
 Resolution on energy, given the 4-momentum of the associated Candidate.
double resolEt (const LorentzVector &p4) const
 Resolution on et, given the 4-momentum of the associated Candidate.
double resolEta (const LorentzVector &p4) const
 Resolution on eta, given the 4-momentum of the associated Candidate.
double resolM (const LorentzVector &p4) const
double resolP (const LorentzVector &p4) const
 Resolution on p, given the 4-momentum of the associated Candidate.
double resolPhi (const LorentzVector &p4) const
 Resolution on phi, given the 4-momentum of the associated Candidate.
double resolPInv (const LorentzVector &p4) const
 Resolution on 1/p, given the 4-momentum of the associated Candidate.
double resolPt (const LorentzVector &p4) const
 Resolution on pt, given the 4-momentum of the associated Candidate.
double resolPx (const LorentzVector &p4) const
 Resolution on px, given the 4-momentum of the associated Candidate.
double resolPy (const LorentzVector &p4) const
 Resolution on py, given the 4-momentum of the associated Candidate.
double resolPz (const LorentzVector &p4) const
 Resolution on pz, given the 4-momentum of the associated Candidate.
double resolTheta (const LorentzVector &p4) const
 Resolution on theta, given the 4-momentum of the associated Candidate.
 ~CandKinResolution ()

Private Member Functions

void fillMatrix () const
 Fill matrix from vector.
void fillVector ()
 Fill vectoor from matrix.

Private Attributes

std::vector< Scalarconstraints_
 Constraints.
std::vector< Scalarcovariances_
 Matrix, streamed as a vector.
AlgebraicSymMatrix44 covmatrix_
 Transient copy of the full 4x4 covariance matrix.
bool hasMatrix_
 Did we make the Matrix from the vector?
Parametrization parametrization_
 Parametrization code.

Detailed Description

Definition at line 10 of file CandKinResolution.h.


Member Typedef Documentation

Parametrizations

(lowercase means values, uppercase means fixed parameters)
Cart = (px, py, pz, m) KinFitter uses (px, py, pz, m/M0) with M0 = mass of the starting p4
ECart = (px, py, pz, e) as in KinFitter
MCCart = (px, py, pz, M) as in KinFitter
Spher = (p, theta, phi, m) KinFitter uses (p, theta, phi, m/M0) with M0 = mass of the starting p4
ESpher = (p, theta, phi, e) KinFitter uses (p, theta, phi, e/E0) with E0 = energy of the starting
MCSpher = (p, eta, phi, M) as in KinFitter
MCPInvSpher = (1/p, theta, phi, M) as in KinFitter
EtEtaPhi = (et, eta, phi, M == 0) as in KinFitter
EtThetaPhi = (et, theta, phi, M == 0) as in KinFitter
MomDev = (p/P0, dp_theta, dp_phi, m/M0), so that P = [0]*|P0|*u_r + [1]*u_theta + [2]*u_phi
the "u_<xyz>" are polar unit vectors around the initial momentum P0, their directions are:
u_r ~ P0, u_phi ~ u_z x u_r, u_theta ~ u_r x u_phi M0 is the mass of the initial 4-momentum.
EMomDev = (p/P0, dp_theta, dp_phi, E/E0) with the P defined as for MomDev
MCMomDev = (p/P0, dp_theta, dp_phi, M) with the P defined as for MomDev
EScaledMomDev = (p/P0, dp_theta, dp_phi,E/P=E0/P0) with the P defined as for MomDev, fixed E/p to E0/P0

Definition at line 32 of file CandKinResolution.h.

Definition at line 33 of file CandKinResolution.h.


Member Enumeration Documentation

Enumerator:
Invalid 
Cart 
ECart 
Spher 
ESpher 
MomDev 
EMomDev 
MCCart 
MCSpher 
MCPInvSpher 
EtEtaPhi 
EtThetaPhi 
MCMomDev 
EScaledMomDev 

Definition at line 35 of file CandKinResolution.h.

                             { Invalid=0, 
                // 4D = 0xN4
                Cart          = 0x04, 
                ECart         = 0x14, 
                Spher         = 0x24, 
                ESpher        = 0x34, 
                MomDev        = 0x44, 
                EMomDev       = 0x54, 
                // 3D =0xN3
                MCCart        = 0x03, 
                MCSpher       = 0x13, 
                MCPInvSpher   = 0x23, 
                EtEtaPhi      = 0x33, 
                EtThetaPhi    = 0x43,
                MCMomDev      = 0x53, 
                EScaledMomDev = 0x63
                };

Constructor & Destructor Documentation

pat::CandKinResolution::CandKinResolution ( )

Definition at line 6 of file CandKinResolution.cc.

pat::CandKinResolution::CandKinResolution ( Parametrization  parametrization,
const std::vector< Scalar > &  covariances,
const std::vector< Scalar > &  constraints = std::vector<Scalar>() 
)

Create a resolution object given a parametrization code, a covariance matrix (streamed as a vector) and a vector of constraints.

In the vector you can put either the full triangular block or just the diagonal terms

The triangular block should be written in a way that the constructor AlgebraicSymMatrixNN(covariance.begin(), covariance.end()) works (N = 3 or 4)

Definition at line 14 of file CandKinResolution.cc.

References fillMatrix().

pat::CandKinResolution::CandKinResolution ( Parametrization  parametrization,
const AlgebraicSymMatrix44 covariance,
const std::vector< Scalar > &  constraints = std::vector<Scalar>() 
)

Fill in a cresolution object given a parametrization code, a covariance matrix and a vector of constraints.

Definition at line 24 of file CandKinResolution.cc.

References fillMatrix(), and fillVector().

                                                                                                                                                     :
    parametrization_(parametrization),
    covariances_(), 
    constraints_(constraints),
    hasMatrix_(true),
    covmatrix_(covariance)
{
    fillVector();
    if (sizeof(double) != sizeof(Scalar)) { // should become boost::mpl::if_c
        fillMatrix(); // forcing double => float => double conversion 
    }
}
pat::CandKinResolution::~CandKinResolution ( )

Definition at line 37 of file CandKinResolution.cc.

                                         {
}

Member Function Documentation

const std::vector<Scalar>& pat::CandKinResolution::constraints ( ) const [inline]

The constraints associated with this parametrization.

Definition at line 85 of file CandKinResolution.h.

References constraints_.

{ return constraints_; }
const AlgebraicSymMatrix44& pat::CandKinResolution::covariance ( void  ) const [inline]

Returns the full covariance matrix.

Definition at line 79 of file CandKinResolution.h.

References covmatrix_, fillMatrix(), and hasMatrix_.

                                                         { 
            if (!hasMatrix_) { fillMatrix(); hasMatrix_ = true; }
            return covmatrix_; 
        }
uint32_t pat::CandKinResolution::dimension ( ) const [inline]

Returns the number of free parameters in this parametrization.

Definition at line 74 of file CandKinResolution.h.

References parametrization_.

                                   { 
            return (static_cast<uint32_t>(parametrization_) & 0x0F);
        }
void pat::CandKinResolution::fillMatrix ( ) const [private]

Fill matrix from vector.

Definition at line 109 of file CandKinResolution.cc.

References pat::helper::ParametrizationHelper::dimension(), and i.

Referenced by CandKinResolution(), and covariance().

                                            { 
    if (dimension() == 3) {
        if (covariances_.size() == 3) {
            for (int i = 0; i < 3; ++i) covmatrix_(i,i) = covariances_[i];
        } else {
            covmatrix_.Place_at(AlgebraicSymMatrix33(covariances_.begin(), covariances_.end()), 0, 0);
        }
    } else if (dimension() == 4) {
        if (covariances_.size() == 4) {
            for (int i = 0; i < 4; ++i) covmatrix_(i,i) = covariances_[i];
        } else {
            covmatrix_ = AlgebraicSymMatrix44(covariances_.begin(), covariances_.end());
        }
    }
}
void pat::CandKinResolution::fillVector ( ) [private]

Fill vectoor from matrix.

Definition at line 101 of file CandKinResolution.cc.

References pat::helper::ParametrizationHelper::dimension().

Referenced by CandKinResolution().

                                      { 
    if (dimension() == 3) {
        AlgebraicSymMatrix33 sub = covmatrix_.Sub<AlgebraicSymMatrix33>(0,0);
        covariances_.insert(covariances_.end(), sub.begin(), sub.end());
    } else {
        covariances_.insert(covariances_.end(), covmatrix_.begin(), covmatrix_.end());
    }
}
Parametrization pat::CandKinResolution::parametrization ( ) const [inline]

Return the code of the parametrization used in this object.

Definition at line 71 of file CandKinResolution.h.

References parametrization_.

{ return parametrization_; }
double pat::CandKinResolution::resolE ( const LorentzVector p4) const

Resolution on energy, given the 4-momentum of the associated Candidate.

Definition at line 55 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolE().

Referenced by pat::PATObject< reco::Muon >::resolE().

double pat::CandKinResolution::resolEt ( const LorentzVector p4) const

Resolution on et, given the 4-momentum of the associated Candidate.

Definition at line 60 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolEt().

Referenced by pat::PATObject< reco::Muon >::resolEt().

double pat::CandKinResolution::resolEta ( const LorentzVector p4) const

Resolution on eta, given the 4-momentum of the associated Candidate.

Definition at line 40 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolEta().

Referenced by pat::PATObject< reco::Muon >::resolEta().

double pat::CandKinResolution::resolM ( const LorentzVector p4) const

Resolution on the invariant mass, given the 4-momentum of the associated Candidate Warning: returns 0 for mass-constrained parametrizations.

Definition at line 65 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolM().

Referenced by pat::PATObject< reco::Muon >::resolM().

double pat::CandKinResolution::resolP ( const LorentzVector p4) const

Resolution on p, given the 4-momentum of the associated Candidate.

Definition at line 70 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolP().

Referenced by pat::PATObject< reco::Muon >::resolP().

double pat::CandKinResolution::resolPhi ( const LorentzVector p4) const

Resolution on phi, given the 4-momentum of the associated Candidate.

Definition at line 50 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPhi().

Referenced by pat::PATObject< reco::Muon >::resolPhi().

double pat::CandKinResolution::resolPInv ( const LorentzVector p4) const

Resolution on 1/p, given the 4-momentum of the associated Candidate.

Definition at line 80 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPInv().

Referenced by pat::PATObject< reco::Muon >::resolPInv().

double pat::CandKinResolution::resolPt ( const LorentzVector p4) const

Resolution on pt, given the 4-momentum of the associated Candidate.

Definition at line 75 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPt().

Referenced by pat::PATObject< reco::Muon >::resolPt().

double pat::CandKinResolution::resolPx ( const LorentzVector p4) const

Resolution on px, given the 4-momentum of the associated Candidate.

Definition at line 85 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPx().

Referenced by pat::PATObject< reco::Muon >::resolPx().

double pat::CandKinResolution::resolPy ( const LorentzVector p4) const

Resolution on py, given the 4-momentum of the associated Candidate.

Definition at line 90 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPy().

Referenced by pat::PATObject< reco::Muon >::resolPy().

double pat::CandKinResolution::resolPz ( const LorentzVector p4) const

Resolution on pz, given the 4-momentum of the associated Candidate.

Definition at line 95 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPz().

Referenced by pat::PATObject< reco::Muon >::resolPz().

double pat::CandKinResolution::resolTheta ( const LorentzVector p4) const

Resolution on theta, given the 4-momentum of the associated Candidate.

Definition at line 45 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolTheta().

Referenced by pat::PATObject< reco::Muon >::resolTheta().


Member Data Documentation

Constraints.

Definition at line 131 of file CandKinResolution.h.

Referenced by constraints().

Matrix, streamed as a vector.

Definition at line 129 of file CandKinResolution.h.

Transient copy of the full 4x4 covariance matrix.

Definition at line 139 of file CandKinResolution.h.

Referenced by covariance().

bool pat::CandKinResolution::hasMatrix_ [mutable, private]

Did we make the Matrix from the vector?

Definition at line 136 of file CandKinResolution.h.

Referenced by covariance().

Parametrization code.

Definition at line 127 of file CandKinResolution.h.

Referenced by dimension(), and parametrization().