CMS 3D CMS Logo

VertexCompositePtrCandidate.cc
Go to the documentation of this file.
2 
3 using namespace reco;
4 
6  const LorentzVector& p4,
7  const Point& vtx,
8  const CovarianceMatrix& err,
9  double chi2,
10  double ndof,
11  int pdgId,
12  int status,
13  bool integerCharge)
14  : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(chi2), ndof_(ndof), time_(0.) {
16 }
17 
19  const LorentzVector& p4,
20  const Point& vtx,
21  double time,
22  const CovarianceMatrix4D& err,
23  double chi2,
24  double ndof,
25  int pdgId,
26  int status,
27  bool integerCharge)
28  : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(chi2), ndof_(ndof), time_(time) {
30 }
31 
33 
35  return new VertexCompositePtrCandidate(*this);
36 }
37 
39  Error4D temp;
41  err = temp.Sub<Error>(0, 0);
42 }
43 
45  index idx = 0;
46  for (index i = 0; i < dimension4D; ++i)
47  for (index j = 0; j <= i; ++j)
48  err(i, j) = covariance_[idx++];
49 }
50 
52  index idx = 0;
53  for (index i = 0; i < dimension4D; ++i) {
54  for (index j = 0; j <= i; ++j) {
55  if (i == dimension || j == dimension) {
56  covariance_[idx++] = 0.0;
57  } else {
58  covariance_[idx++] = err(i, j);
59  }
60  }
61  }
62 }
63 
65  index idx = 0;
66  for (index i = 0; i < dimension4D; ++i)
67  for (index j = 0; j <= i; ++j)
68  covariance_[idx++] = err(i, j);
69 }
VertexCompositePtrCandidate * clone() const override
returns a clone of the candidate
int Charge
electric charge type
Definition: Candidate.h:34
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
math::Error< dimension >::type Error
the following functions are implemented to have a more consistent interface with the one of reco::Ver...
index idx(index i, index j) const
position index
math::Error< dimension4D >::type CovarianceMatrix4D
covariance error matrix (3x3)
unsigned int index
index type
Definition: Candidate.h:50
math::Error< dimension4D >::type Error4D
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
Double32_t covariance_[size4D]
covariance matrix (4x4) as vector