12 <<
"B-Field was not set up PFCandCommonVertexFitter.\n" 13 <<
"the following method must be called before fitting a candidate:\n" 14 <<
" PFCandCommonVertexFitter:.set( const MagneticField * )" << endl;
15 std::vector<TransientTrack>
tracks;
17 std::vector<RecoCandidate::TrackType> trackTypes;
18 fill(tracks, daughters, trackTypes, c);
19 assert(tracks.size() == daughters.size());
21 if(
fit(vertex, tracks)) {
25 std::vector<TransientTrack>::const_iterator trackIt = tracks.begin(), tracksEnd = tracks.end();
26 std::vector<Candidate *>::const_iterator daughterIt = daughters.begin();
27 std::vector<RecoCandidate::TrackType>::const_iterator trackTypeIt = trackTypes.begin();
29 for(; trackIt != tracksEnd; ++ trackIt, ++ daughterIt, ++trackTypeIt) {
32 double px = track.
px(), py = track.
py(), pz = track.
pz(),
p = track.
p();
35 if(*trackTypeIt == RecoCandidate::recoTrackType) {
37 energy =
sqrt(
p*
p + mass*mass);
39 energy = daughter.
energy();
double p() const
momentum vector magnitude
virtual void setP4(const LorentzVector &p4)=0
set 4-momentum
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
double px() const
x coordinate of momentum vector
void setVertex(const Point &vertex) override
set vertex
virtual bool fit(TransientVertex &, const std::vector< reco::TransientTrack > &) const =0
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
virtual double energy() const =0
energy
virtual void setVertex(const Point &vertex)=0
set vertex
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
void fill(std::vector< reco::TransientTrack > &, std::vector< reco::Candidate * > &, std::vector< reco::RecoCandidate::TrackType > &, reco::Candidate &) const
double chi2() const
chi-squares
double pz() const
z coordinate of momentum vector
virtual double mass() const =0
mass
math::XYZTLorentzVector LorentzVector
Lorentz vector.
reco::Vertex::CovarianceMatrix CovarianceMatrix
const MagneticField * bField_
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > const & refittedTracks() const
void setP4(const LorentzVector &p4) final
set 4-momentum
double py() const
y coordinate of momentum vector