CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
pat::CandKinResolution Class Reference

#include <CandKinResolution.h>

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

Static Public Member Functions

static int dimensionFrom (Parametrization parametrization)
 
static void fillMatrixFrom (Parametrization parametrization, const std::vector< Scalar > &covariances, AlgebraicSymMatrix44 &covmatrix)
 

Private Member Functions

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

Private Attributes

std::vector< Scalarconstraints_
 Constraints. More...
 
std::vector< Scalarcovariances_
 Matrix, streamed as a vector. More...
 
AlgebraicSymMatrix44 covmatrix_
 Transient copy of the full 4x4 covariance matrix. More...
 
Parametrization parametrization_
 Parametrization code. More...
 

Detailed Description

Definition at line 10 of file CandKinResolution.h.

Member Typedef Documentation

◆ LorentzVector

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.

◆ Scalar

Definition at line 33 of file CandKinResolution.h.

Member Enumeration Documentation

◆ Parametrization

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

Definition at line 35 of file CandKinResolution.h.

35  {
36  Invalid = 0,
37  // 4D = 0xN4
38  Cart = 0x04,
39  ECart = 0x14,
40  Spher = 0x24,
41  ESpher = 0x34,
42  MomDev = 0x44,
43  EMomDev = 0x54,
44  // 3D =0xN3
45  MCCart = 0x03,
46  MCSpher = 0x13,
47  MCPInvSpher = 0x23,
48  EtEtaPhi = 0x33,
49  EtThetaPhi = 0x43,
50  MCMomDev = 0x53,
51  EScaledMomDev = 0x63
52  };

Constructor & Destructor Documentation

◆ CandKinResolution() [1/3]

pat::CandKinResolution::CandKinResolution ( )

Definition at line 5 of file CandKinResolution.cc.

◆ CandKinResolution() [2/3]

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 7 of file CandKinResolution.cc.

References fillMatrix().

◆ CandKinResolution() [3/3]

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 14 of file CandKinResolution.cc.

18  fillVector();
19  if (sizeof(double) != sizeof(Scalar)) { // should become boost::mpl::if_c
20  fillMatrix(); // forcing double => float => double conversion
21  }
22 }

References fillMatrix(), and fillVector().

◆ ~CandKinResolution()

pat::CandKinResolution::~CandKinResolution ( )

Definition at line 24 of file CandKinResolution.cc.

24 {}

Member Function Documentation

◆ constraints()

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

The constraints associated with this parametrization.

Definition at line 83 of file CandKinResolution.h.

83 { return constraints_; }

References constraints_.

◆ covariance()

const AlgebraicSymMatrix44& pat::CandKinResolution::covariance ( void  ) const
inline

Returns the full covariance matrix.

Definition at line 80 of file CandKinResolution.h.

80 { return covmatrix_; }

References covmatrix_.

◆ dimension()

uint32_t pat::CandKinResolution::dimension ( ) const
inline

Returns the number of free parameters in this parametrization.

Definition at line 77 of file CandKinResolution.h.

References dimensionFrom(), and parametrization_.

◆ dimensionFrom()

static int pat::CandKinResolution::dimensionFrom ( Parametrization  parametrization)
inlinestatic

Definition at line 122 of file CandKinResolution.h.

122  {
123  return (static_cast<uint32_t>(parametrization) & 0x0F);
124  }

References parametrization().

Referenced by dimension().

◆ fillMatrix()

void pat::CandKinResolution::fillMatrix ( )
private

Fill matrix from vector.

Definition at line 93 of file CandKinResolution.cc.

Referenced by CandKinResolution().

◆ fillMatrixFrom()

void pat::CandKinResolution::fillMatrixFrom ( Parametrization  parametrization,
const std::vector< Scalar > &  covariances,
AlgebraicSymMatrix44 covmatrix 
)
static

Definition at line 72 of file CandKinResolution.cc.

74  {
76  if (dimension == 3) {
77  if (covariances.size() == 3) {
78  for (int i = 0; i < 3; ++i)
79  covmatrix(i, i) = covariances[i];
80  } else {
81  covmatrix.Place_at(AlgebraicSymMatrix33(covariances.begin(), covariances.end()), 0, 0);
82  }
83  } else if (dimension == 4) {
84  if (covariances.size() == 4) {
85  for (int i = 0; i < 4; ++i)
86  covmatrix(i, i) = covariances[i];
87  } else {
88  covmatrix = AlgebraicSymMatrix44(covariances.begin(), covariances.end());
89  }
90  }
91 }

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

◆ fillVector()

void pat::CandKinResolution::fillVector ( )
private

Fill vectoor from matrix.

Definition at line 63 of file CandKinResolution.cc.

63  {
64  if (dimension() == 3) {
66  covariances_.insert(covariances_.end(), sub.begin(), sub.end());
67  } else {
68  covariances_.insert(covariances_.end(), covmatrix_.begin(), covmatrix_.end());
69  }
70 }

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

Referenced by CandKinResolution().

◆ parametrization()

Parametrization pat::CandKinResolution::parametrization ( ) const
inline

Return the code of the parametrization used in this object.

Definition at line 74 of file CandKinResolution.h.

74 { return parametrization_; }

References parametrization_.

Referenced by dimensionFrom().

◆ resolE()

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

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

Definition at line 35 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolE(), and p4.

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

◆ resolEt()

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

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

Definition at line 38 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolEt(), and p4.

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

◆ resolEta()

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

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

Definition at line 26 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolEta(), and p4.

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

◆ resolM()

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 41 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolM(), and p4.

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

◆ resolP()

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

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

Definition at line 44 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolP(), and p4.

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

◆ resolPhi()

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

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

Definition at line 32 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPhi(), and p4.

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

◆ resolPInv()

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

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

Definition at line 50 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPInv(), and p4.

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

◆ resolPt()

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

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

Definition at line 47 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPt(), and p4.

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

◆ resolPx()

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

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

Definition at line 53 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPx(), and p4.

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

◆ resolPy()

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

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

Definition at line 56 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPy(), and p4.

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

◆ resolPz()

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

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

Definition at line 59 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolPz(), and p4.

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

◆ resolTheta()

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

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

Definition at line 29 of file CandKinResolution.cc.

References pat::helper::ResolutionHelper::getResolTheta(), and p4.

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

Member Data Documentation

◆ constraints_

std::vector<Scalar> pat::CandKinResolution::constraints_
private

Constraints.

Definition at line 137 of file CandKinResolution.h.

Referenced by constraints().

◆ covariances_

std::vector<Scalar> pat::CandKinResolution::covariances_
private

Matrix, streamed as a vector.

Definition at line 135 of file CandKinResolution.h.

◆ covmatrix_

AlgebraicSymMatrix44 pat::CandKinResolution::covmatrix_
private

Transient copy of the full 4x4 covariance matrix.

Definition at line 142 of file CandKinResolution.h.

Referenced by covariance().

◆ parametrization_

Parametrization pat::CandKinResolution::parametrization_
private

Parametrization code.

Definition at line 133 of file CandKinResolution.h.

Referenced by dimension(), and parametrization().

pat::CandKinResolution::parametrization_
Parametrization parametrization_
Parametrization code.
Definition: CandKinResolution.h:133
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
mps_fire.i
i
Definition: mps_fire.py:428
pat::CandKinResolution::parametrization
Parametrization parametrization() const
Return the code of the parametrization used in this object.
Definition: CandKinResolution.h:74
pat::CandKinResolution::covariances_
std::vector< Scalar > covariances_
Matrix, streamed as a vector.
Definition: CandKinResolution.h:135
pat::CandKinResolution::MCPInvSpher
Definition: CandKinResolution.h:47
pat::helper::ResolutionHelper::getResolEta
double getResolEta(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:455
pat::CandKinResolution::constraints
const std::vector< Scalar > & constraints() const
The constraints associated with this parametrization.
Definition: CandKinResolution.h:83
pat::CandKinResolution::dimensionFrom
static int dimensionFrom(Parametrization parametrization)
Definition: CandKinResolution.h:122
pat::helper::ResolutionHelper::getResolEt
double getResolEt(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:326
pat::CandKinResolution::covariance
const AlgebraicSymMatrix44 & covariance() const
Returns the full covariance matrix.
Definition: CandKinResolution.h:80
pat::CandKinResolution::Scalar
float Scalar
Definition: CandKinResolution.h:33
pat::helper::ResolutionHelper::getResolTheta
double getResolTheta(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:479
pat::CandKinResolution::fillMatrix
void fillMatrix()
Fill matrix from vector.
Definition: CandKinResolution.cc:93
pat::helper::ResolutionHelper::getResolPy
double getResolPy(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:178
pat::helper::ResolutionHelper::getResolP
double getResolP(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:34
pat::CandKinResolution::EMomDev
Definition: CandKinResolution.h:43
pat::CandKinResolution::Cart
Definition: CandKinResolution.h:38
pat::helper::ResolutionHelper::getResolPt
double getResolPt(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:68
pat::helper::ResolutionHelper::getResolPhi
double getResolPhi(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:511
pat::CandKinResolution::Spher
Definition: CandKinResolution.h:40
pat::helper::ResolutionHelper::getResolPInv
double getResolPInv(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:110
pat::CandKinResolution::MCSpher
Definition: CandKinResolution.h:46
pat::CandKinResolution::EScaledMomDev
Definition: CandKinResolution.h:51
pat::CandKinResolution::covmatrix_
AlgebraicSymMatrix44 covmatrix_
Transient copy of the full 4x4 covariance matrix.
Definition: CandKinResolution.h:142
pat::CandKinResolution::MCCart
Definition: CandKinResolution.h:45
pat::CandKinResolution::MCMomDev
Definition: CandKinResolution.h:50
pat::CandKinResolution::ESpher
Definition: CandKinResolution.h:41
p4
double p4[4]
Definition: TauolaWrapper.h:92
pat::helper::ResolutionHelper::getResolPx
double getResolPx(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:137
AlgebraicSymMatrix44
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
Definition: AlgebraicROOTObjects.h:22
pat::CandKinResolution::fillMatrixFrom
static void fillMatrixFrom(Parametrization parametrization, const std::vector< Scalar > &covariances, AlgebraicSymMatrix44 &covmatrix)
Definition: CandKinResolution.cc:72
pat::helper::ResolutionHelper::getResolM
double getResolM(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:408
pat::CandKinResolution::ECart
Definition: CandKinResolution.h:39
pat::helper::ResolutionHelper::getResolPz
double getResolPz(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:219
pat::CandKinResolution::constraints_
std::vector< Scalar > constraints_
Constraints.
Definition: CandKinResolution.h:137
pat::CandKinResolution::dimension
uint32_t dimension() const
Returns the number of free parameters in this parametrization.
Definition: CandKinResolution.h:77
pat::helper::ResolutionHelper::getResolE
double getResolE(pat::CandKinResolution::Parametrization parametrization, const AlgebraicSymMatrix44 &covariance, const pat::CandKinResolution::LorentzVector &p4)
Definition: ResolutionHelper.cc:267
pat::CandKinResolution::MomDev
Definition: CandKinResolution.h:42
pat::CandKinResolution::Invalid
Definition: CandKinResolution.h:36
pat::CandKinResolution::EtThetaPhi
Definition: CandKinResolution.h:49
pat::CandKinResolution::EtEtaPhi
Definition: CandKinResolution.h:48
pat::CandKinResolution::fillVector
void fillVector()
Fill vectoor from matrix.
Definition: CandKinResolution.cc:63