CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CandKinResolution.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_CandKinResolution_h
2 #define DataFormats_PatCandidates_CandKinResolution_h
3 #include <vector>
9 
10 namespace pat {
32  public:
34  typedef float Scalar;
35 
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,
52  };
54 
63  CandKinResolution(Parametrization parametrization, const std::vector<Scalar> &covariances,
64  const std::vector<Scalar> &constraints = std::vector<Scalar>()) ;
65 
68  const std::vector<Scalar> &constraints = std::vector<Scalar>()) ;
70 
73 
75  uint32_t dimension() const {
76  return (static_cast<uint32_t>(parametrization_) & 0x0F);
77  }
78 
80  const AlgebraicSymMatrix44 & covariance() const {
81  if (!hasMatrix_) { fillMatrix(); hasMatrix_ = true; }
82  return covmatrix_;
83  }
84 
86  const std::vector<Scalar> & constraints() const { return constraints_; }
87 
89  double resolEta(const LorentzVector &p4) const ;
90 
92  double resolTheta(const LorentzVector &p4) const ;
93 
95  double resolPhi(const LorentzVector &p4) const ;
96 
98  double resolE(const LorentzVector &p4) const ;
99 
101  double resolEt(const LorentzVector &p4) const ;
102 
105  double resolM(const LorentzVector &p4) const ;
106 
108  double resolP(const LorentzVector &p4) const ;
109 
111  double resolPt(const LorentzVector &p4) const ;
112 
114  double resolPInv(const LorentzVector &p4) const ;
115 
117  double resolPx(const LorentzVector &p4) const ;
118 
120  double resolPy(const LorentzVector &p4) const ;
121 
123  double resolPz(const LorentzVector &p4) const ;
124 
125  private:
126  // persistent
130  std::vector<Scalar> covariances_;
132  std::vector<Scalar> constraints_;
133 
134  // transient
135 
138 
141 
142  //methods
143 
145  void fillMatrix() const ; // const: the matrix is mutable
146 
148  void fillVector() ;
149  };
150 
151  typedef std::vector<CandKinResolution> CandKinResolutionCollection;
153 }
154 
155 #endif
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
std::vector< Scalar > constraints_
Constraints.
uint32_t dimension() const
Returns the number of free parameters in this parametrization.
const AlgebraicSymMatrix44 & covariance() const
Returns the full covariance matrix.
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonBPAG.h:55
Parametrization parametrization_
Parametrization code.
void fillMatrix() const
Fill matrix from vector.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
Parametrization parametrization() const
Return the code of the parametrization used in this object.
std::vector< Scalar > covariances_
Matrix, streamed as a vector.
edm::BoolCache hasMatrix_
Did we make the Matrix from the vector?
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
void fillVector()
Fill vectoor from matrix.
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
double p4[4]
Definition: TauolaWrapper.h:92
double resolEta(const LorentzVector &p4) const
Resolution on eta, given the 4-momentum of the associated Candidate.
const std::vector< Scalar > & constraints() const
The constraints associated with this parametrization.
edm::ValueMap< CandKinResolution > CandKinResolutionValueMap
double resolM(const LorentzVector &p4) const
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, 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.
math::XYZTLorentzVector LorentzVector
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 resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
AlgebraicSymMatrix44 covmatrix_
Transient copy of the full 4x4 covariance matrix.
std::vector< CandKinResolution > CandKinResolutionCollection
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.