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  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,
52  };
54 
64  const std::vector<Scalar> &covariances,
65  const std::vector<Scalar> &constraints = std::vector<Scalar>());
66 
70  const std::vector<Scalar> &constraints = std::vector<Scalar>());
72 
75 
77  uint32_t dimension() const { return dimensionFrom(parametrization_); }
78 
80  const AlgebraicSymMatrix44 &covariance() const { return covmatrix_; }
81 
83  const std::vector<Scalar> &constraints() const { return constraints_; }
84 
86  double resolEta(const LorentzVector &p4) const;
87 
89  double resolTheta(const LorentzVector &p4) const;
90 
92  double resolPhi(const LorentzVector &p4) const;
93 
95  double resolE(const LorentzVector &p4) const;
96 
98  double resolEt(const LorentzVector &p4) const;
99 
102  double resolM(const LorentzVector &p4) const;
103 
105  double resolP(const LorentzVector &p4) const;
106 
108  double resolPt(const LorentzVector &p4) const;
109 
111  double resolPInv(const LorentzVector &p4) const;
112 
114  double resolPx(const LorentzVector &p4) const;
115 
117  double resolPy(const LorentzVector &p4) const;
118 
120  double resolPz(const LorentzVector &p4) const;
121 
123  return (static_cast<uint32_t>(parametrization) & 0x0F);
124  }
125 
127  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 } // namespace pat
156 
157 #endif
pat::CandKinResolution::parametrization_
Parametrization parametrization_
Parametrization code.
Definition: CandKinResolution.h:133
pat::CandKinResolution::resolP
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:44
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
AlgebraicObjects.h
pat::CandKinResolutionValueMap
edm::ValueMap< CandKinResolution > CandKinResolutionValueMap
Definition: CandKinResolution.h:154
pat::CandKinResolution::MCPInvSpher
Definition: CandKinResolution.h:47
pat::CandKinResolution::resolPx
double resolPx(const LorentzVector &p4) const
Resolution on px, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:53
pat::CandKinResolution::resolPhi
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:32
pat::CandKinResolution::resolPInv
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:50
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::CandKinResolutionCollection
std::vector< CandKinResolution > CandKinResolutionCollection
Definition: CandKinResolution.h:153
CandidateFwd.h
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::CandKinResolution::fillMatrix
void fillMatrix()
Fill matrix from vector.
Definition: CandKinResolution.cc:93
pat::CandKinResolution::resolPy
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:56
pat::CandKinResolution::Parametrization
Parametrization
Definition: CandKinResolution.h:35
pat::CandKinResolution::EMomDev
Definition: CandKinResolution.h:43
pat::CandKinResolution::Cart
Definition: CandKinResolution.h:38
pat::CandKinResolution::resolM
double resolM(const LorentzVector &p4) const
Definition: CandKinResolution.cc:41
pat::CandKinResolution::~CandKinResolution
~CandKinResolution()
Definition: CandKinResolution.cc:24
pat::CandKinResolution::CandKinResolution
CandKinResolution()
Definition: CandKinResolution.cc:5
pat::CandKinResolution
Definition: CandKinResolution.h:10
pat::CandKinResolution::Spher
Definition: CandKinResolution.h:40
pat::CandKinResolution::MCSpher
Definition: CandKinResolution.h:46
pat::CandKinResolution::EScaledMomDev
Definition: CandKinResolution.h:51
pat::CandKinResolution::resolPt
double resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:47
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
LorentzVector.h
pat::CandKinResolution::ESpher
Definition: CandKinResolution.h:41
p4
double p4[4]
Definition: TauolaWrapper.h:92
pat::CandKinResolution::resolE
double resolE(const LorentzVector &p4) const
Resolution on energy, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:35
pat
Definition: HeavyIon.h:7
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
ValueMap.h
pat::CandKinResolution::ECart
Definition: CandKinResolution.h:39
pat::CandKinResolution::resolTheta
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:29
pat::CandKinResolution::resolPz
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:59
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::CandKinResolution::MomDev
Definition: CandKinResolution.h:42
pat::CandKinResolution::Invalid
Definition: CandKinResolution.h:36
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
edm::ValueMap
Definition: ValueMap.h:107
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
pat::CandKinResolution::resolEta
double resolEta(const LorentzVector &p4) const
Resolution on eta, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:26
pat::CandKinResolution::LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: CandKinResolution.h:32
pat::CandKinResolution::resolEt
double resolEt(const LorentzVector &p4) const
Resolution on et, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:38