CMS 3D CMS Logo

CandKinResolution.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_CandKinResolution_h
2 #define DataFormats_PatCandidates_CandKinResolution_h
3 #include <vector>
8 
9 namespace pat {
31  public:
33  typedef float Scalar;
34 
36  // 4D = 0xN4
37  Cart = 0x04,
38  ECart = 0x14,
39  Spher = 0x24,
40  ESpher = 0x34,
41  MomDev = 0x44,
42  EMomDev = 0x54,
43  // 3D =0xN3
44  MCCart = 0x03,
45  MCSpher = 0x13,
46  MCPInvSpher = 0x23,
47  EtEtaPhi = 0x33,
48  EtThetaPhi = 0x43,
49  MCMomDev = 0x53,
51  };
53 
62  CandKinResolution(Parametrization parametrization, const std::vector<Scalar> &covariances,
63  const std::vector<Scalar> &constraints = std::vector<Scalar>()) ;
64 
67  const std::vector<Scalar> &constraints = std::vector<Scalar>()) ;
69 
72 
74  uint32_t dimension() const {
76  }
77 
79  const AlgebraicSymMatrix44 & covariance() const {
80  return covmatrix_;
81  }
82 
84  const std::vector<Scalar> & constraints() const { return constraints_; }
85 
87  double resolEta(const LorentzVector &p4) const ;
88 
90  double resolTheta(const LorentzVector &p4) const ;
91 
93  double resolPhi(const LorentzVector &p4) const ;
94 
96  double resolE(const LorentzVector &p4) const ;
97 
99  double resolEt(const LorentzVector &p4) const ;
100 
103  double resolM(const LorentzVector &p4) const ;
104 
106  double resolP(const LorentzVector &p4) const ;
107 
109  double resolPt(const LorentzVector &p4) const ;
110 
112  double resolPInv(const LorentzVector &p4) const ;
113 
115  double resolPx(const LorentzVector &p4) const ;
116 
118  double resolPy(const LorentzVector &p4) const ;
119 
121  double resolPz(const LorentzVector &p4) const ;
122 
123  static int dimensionFrom(Parametrization parametrization) {
124  return (static_cast<uint32_t>(parametrization) & 0x0F);
125  }
126 
127  static void fillMatrixFrom( Parametrization parametrization, const std::vector<Scalar>& covariances,
128  AlgebraicSymMatrix44& covmatrix);
129 
130  private:
131  // persistent
135  std::vector<Scalar> covariances_;
137  std::vector<Scalar> constraints_;
138 
139  // transient
140 
143 
144  //methods
145 
147  void fillMatrix() ;
148 
150  void fillVector() ;
151  };
152 
153  typedef std::vector<CandKinResolution> CandKinResolutionCollection;
155 }
156 
157 #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.
Parametrization parametrization_
Parametrization code.
Definition: HeavyIon.h:7
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
static int dimensionFrom(Parametrization parametrization)
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.
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.
static void fillMatrixFrom(Parametrization parametrization, const std::vector< Scalar > &covariances, AlgebraicSymMatrix44 &covmatrix)
math::XYZTLorentzVector LorentzVector
void fillMatrix()
Fill matrix from vector.
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.