CMS 3D CMS Logo

VertexCompositePtrCandidate.cc
Go to the documentation of this file.
2 
3 using namespace reco;
4 
6  const CovarianceMatrix & err, double chi2, double ndof,
7  int pdgId, int status, bool integerCharge) :
8  CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge),
9  chi2_(chi2), ndof_(ndof), time_(0.) {
10  setCovariance(err);
11 }
12 
14  double time, const CovarianceMatrix4D & err, double chi2,
15  double ndof, int pdgId, int status, bool integerCharge) :
16  CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge),
17  chi2_(chi2), ndof_(ndof), time_(time) {
18  setCovariance(err);
19 }
20 
22 
24  return new VertexCompositePtrCandidate(*this);
25 }
26 
28  Error4D temp;
30  err = temp.Sub<Error>(0,0);
31 }
32 
34  index idx = 0;
35  for(index i = 0; i < dimension4D; ++i)
36  for(index j = 0; j <= i; ++ j)
37  err(i, j) = covariance_[idx++];
38 }
39 
41  index idx = 0;
42  for(index i = 0; i < dimension4D; ++i) {
43  for(index j = 0; j <= i; ++j) {
44  if( i == dimension || j == dimension ) {
45  covariance_[ idx ++ ] = 0.0;
46  } else {
47  covariance_[ idx ++ ] = err( i, j );
48  }
49  }
50  }
51 }
52 
54  index idx = 0;
55  for(index i = 0; i < dimension4D; ++i)
56  for(index j = 0; j <= i; ++j)
57  covariance_[idx++] = err(i, j);
58 }
59 
int pdgId() const final
PDG identifier.
int Charge
electric charge type
Definition: Candidate.h:35
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
Double32_t ndof_
number of degrees of freedom
math::Error< dimension >::type Error
the following functions are implemented to have a more consistent interface with the one of reco::Ver...
VertexCompositePtrCandidate * clone() const override
returns a clone of the candidate
math::Error< dimension4D >::type CovarianceMatrix4D
covariance error matrix (3x3)
double p4[4]
Definition: TauolaWrapper.h:92
index idx(index i, index j) const
position index
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
unsigned int index
index type
Definition: Candidate.h:51
math::Error< dimension4D >::type Error4D
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
int status() const final
status word
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
Double32_t covariance_[size4D]
covariance matrix (4x4) as vector