CMS 3D CMS Logo

VertexCompositePtrCandidate.h
Go to the documentation of this file.
1 #ifndef DataFormats_Candidate_VertexCompositePtrCandidate_H
2 #define DataFormats_Candidate_VertexCompositePtrCandidate_H
3 
14 
15 namespace reco {
17  public:
18  enum { dimension4D = 4 };
22  enum { size4D = dimension4D * (dimension4D + 1) / 2 };
23 
27  Charge q, const LorentzVector &p4, const Point &vtx, int pdgId = 0, int status = 0, bool integerCharge = true)
28  : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(0), ndof_(0), time_(0) {}
30  const LorentzVector &p4,
31  const Point &vtx,
32  double time,
33  int pdgId = 0,
34  int status = 0,
35  bool integerCharge = true)
36  : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(0), ndof_(0), time_(time) {}
39  const LorentzVector &p4,
40  const Point &vtx,
41  const CovarianceMatrix &err,
42  double chi2,
43  double ndof,
44  int pdgId = 0,
45  int status = 0,
46  bool integerCharge = true);
48  const LorentzVector &p4,
49  const Point &vtx,
50  double time,
51  const CovarianceMatrix4D &err,
52  double chi2,
53  double ndof,
54  int pdgId = 0,
55  int status = 0,
56  bool integerCharge = true);
61  : CompositePtrCandidate(p), chi2_(0), ndof_(0), time_(0) {}
65  VertexCompositePtrCandidate *clone() const override;
66 
68  double vertexChi2() const override { return chi2_; }
75  double vertexNdof() const override { return ndof_; }
77  double vertexNormalizedChi2() const override { return chi2_ / ndof_; }
79  double vertexCovariance(int i, int j) const override { return covariance_[idx(i, j)]; }
80  using reco::LeafCandidate::vertexCovariance; // avoid hiding the
85  return m;
86  }
87 
89  void fillVertexCovariance(CovarianceMatrix &v) const override;
92 
94  void setChi2AndNdof(double chi2, double ndof) {
95  chi2_ = chi2;
96  ndof_ = ndof;
97  }
99  void setCovariance(const CovarianceMatrix &m);
101  void setCovariance(const CovarianceMatrix4D &m);
102 
103  // set time
104  void setTime(double time) { time_ = time; }
105 
109  const Point &position() const { return vertex(); }
110  double t() const { return time_; }
111  double tError() const { return std::sqrt(vertexCovariance(3, 3)); }
112  Error error() const {
113  Error m;
115  return m;
116  }
118  Error4D error4D() const {
119  Error4D m;
121  return m;
122  }
123 
124  private:
126  Double32_t chi2_;
128  Double32_t ndof_;
130  Double32_t covariance_[size4D];
132  Double32_t time_;
134  index idx(index i, index j) const {
135  int a = (i <= j ? i : j), b = (i <= j ? j : i);
136  return b * (b + 1) / 2 + a;
137  }
138  };
139 
140 } // namespace reco
141 
142 #endif
reco::VertexCompositePtrCandidate::covariance_
Double32_t covariance_[size4D]
covariance matrix (4x4) as vector
Definition: VertexCompositePtrCandidate.h:130
reco::VertexCompositePtrCandidate::ndof_
Double32_t ndof_
number of degrees of freedom
Definition: VertexCompositePtrCandidate.h:128
reco::VertexCompositePtrCandidate::vertexChi2
double vertexChi2() const override
chi-squares
Definition: VertexCompositePtrCandidate.h:68
reco::VertexCompositePtrCandidate::VertexCompositePtrCandidate
VertexCompositePtrCandidate(Charge q, const LorentzVector &p4, const Point &vtx, double time, int pdgId=0, int status=0, bool integerCharge=true)
Definition: VertexCompositePtrCandidate.h:29
reco::VertexCompositePtrCandidate::setChi2AndNdof
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
Definition: VertexCompositePtrCandidate.h:94
reco::VertexCompositePtrCandidate::Error
math::Error< dimension >::type Error
the following functions are implemented to have a more consistent interface with the one of reco::Ver...
Definition: VertexCompositePtrCandidate.h:107
mps_fire.i
i
Definition: mps_fire.py:428
reco::LeafCandidate::vertexCovariance
CovarianceMatrix vertexCovariance() const final
return SMatrix
Definition: LeafCandidate.h:211
reco::VertexCompositePtrCandidate::error4D
Error4D error4D() const
return SMatrix 4D
Definition: VertexCompositePtrCandidate.h:118
reco::LeafCandidate::status
int status() const final
status word
Definition: LeafCandidate.h:180
reco::VertexCompositePtrCandidate::setTime
void setTime(double time)
Definition: VertexCompositePtrCandidate.h:104
reco::VertexCompositePtrCandidate::VertexCompositePtrCandidate
VertexCompositePtrCandidate(const Candidate &p)
constructor from values
Definition: VertexCompositePtrCandidate.h:58
reco::VertexCompositePtrCandidate::error
Error error() const
Definition: VertexCompositePtrCandidate.h:112
reco::VertexCompositePtrCandidate::clone
VertexCompositePtrCandidate * clone() const override
returns a clone of the candidate
Definition: VertexCompositePtrCandidate.cc:34
reco::VertexCompositePtrCandidate::CovarianceMatrix4D
math::Error< dimension4D >::type CovarianceMatrix4D
covariance error matrix (3x3)
Definition: VertexCompositePtrCandidate.h:20
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
protons_cff.time
time
Definition: protons_cff.py:35
reco::VertexCompositePtrCandidate::size4D
Definition: VertexCompositePtrCandidate.h:22
reco::VertexCompositePtrCandidate::VertexCompositePtrCandidate
VertexCompositePtrCandidate(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
Definition: VertexCompositePtrCandidate.h:26
CovarianceMatrix
Definition: CovarianceMatrix.h:28
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
findQualityFiles.v
v
Definition: findQualityFiles.py:179
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
reco::VertexCompositePtrCandidate
Definition: VertexCompositePtrCandidate.h:16
reco::VertexCompositePtrCandidate::vertexCovariance
double vertexCovariance(int i, int j) const override
(i, j)-th element of error matrix, i, j = 0, ... 3
Definition: VertexCompositePtrCandidate.h:79
ndof
Definition: HIMultiTrackSelector.h:49
reco::VertexCompositePtrCandidate::t
double t() const
Definition: VertexCompositePtrCandidate.h:110
CompositePtrCandidate.h
reco::VertexCompositePtrCandidate::vertexNdof
double vertexNdof() const override
Definition: VertexCompositePtrCandidate.h:75
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
reco::VertexCompositePtrCandidate::~VertexCompositePtrCandidate
~VertexCompositePtrCandidate() override
destructor
Definition: VertexCompositePtrCandidate.cc:32
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::VertexCompositePtrCandidate::VertexCompositePtrCandidate
VertexCompositePtrCandidate(const CompositePtrCandidate &p)
constructor from values
Definition: VertexCompositePtrCandidate.h:60
reco::VertexCompositePtrCandidate::idx
index idx(index i, index j) const
position index
Definition: VertexCompositePtrCandidate.h:134
b
double b
Definition: hdecay.h:118
reco::LeafCandidate::Charge
int Charge
electric charge type
Definition: LeafCandidate.h:21
reco::VertexCompositePtrCandidate::Error4D
math::Error< dimension4D >::type Error4D
Definition: VertexCompositePtrCandidate.h:108
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
reco::VertexCompositePtrCandidate::time_
Double32_t time_
vertex time
Definition: VertexCompositePtrCandidate.h:132
a
double a
Definition: hdecay.h:119
VertexCompositePtrCandidateFwd.h
reco::VertexCompositePtrCandidate::position
const Point & position() const
Definition: VertexCompositePtrCandidate.h:109
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
reco::VertexCompositePtrCandidate::vertexCovariance4D
CovarianceMatrix4D vertexCovariance4D() const
return SMatrix 4D
Definition: VertexCompositePtrCandidate.h:82
reco::VertexCompositePtrCandidate::chi2_
Double32_t chi2_
chi-sqared
Definition: VertexCompositePtrCandidate.h:126
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
reco::VertexCompositePtrCandidate::setCovariance
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
Definition: VertexCompositePtrCandidate.cc:51
reco::LeafCandidate::vertex
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: LeafCandidate.h:165
reco::Candidate
Definition: Candidate.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
reco::VertexCompositePtrCandidate::vertexNormalizedChi2
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
Definition: VertexCompositePtrCandidate.h:77
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
reco::Candidate::index
unsigned int index
index type
Definition: Candidate.h:50
reco::CompositePtrCandidate
Definition: CompositePtrCandidate.h:17
reco::VertexCompositePtrCandidate::fillVertexCovariance
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
Definition: VertexCompositePtrCandidate.cc:38
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::VertexCompositePtrCandidate::tError
double tError() const
Definition: VertexCompositePtrCandidate.h:111
reco::VertexCompositePtrCandidate::VertexCompositePtrCandidate
VertexCompositePtrCandidate()
Definition: VertexCompositePtrCandidate.h:24
reco::VertexCompositePtrCandidate::dimension4D
Definition: VertexCompositePtrCandidate.h:18