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;
16 std::vector<Candidate *> daughters;
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) {
30 const Track & track = trackIt->track();
32 double px = track.
px(), py = track.
py(), pz = track.
pz(),
p = track.
p();
36 double mass = daughter.
mass();
37 energy =
sqrt(
p*
p + mass*mass);
39 energy = daughter.
energy();
59 std::vector<Candidate *> & daughters,
60 std::vector<RecoCandidate::TrackType> & trackTypes,
63 for(
unsigned int j = 0;
j < nDau ; ++
j) {
67 message <<
"Can't access in write mode candidate daughters. "
68 <<
"pdgId = " << c.
pdgId() <<
".\n";
71 message <<
"Null daughter also found in read-only mode\n";
73 message <<
"Daughter found in read-only mode with id: " << d1->
pdgId() <<
"\n";
77 fill(tracks, daughters, trackTypes, * d);
89 daughters.push_back(d);
90 trackTypes.push_back(type);
92 cerr <<
">>> warning: candidate of type " << d->
pdgId()
93 <<
" has no track reference." << endl;
double p() const
momentum vector magnitude
virtual double energy() const =0
energy
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual float mass() const =0
mass
virtual void setP4(const LorentzVector &p4)=0
set 4-momentum
void fill(CovarianceMatrix &v) const
fill SMatrix
math::Error< 5 >::type CovarianceMatrix
double px() const
x coordinate of momentum vector
reco::TrackRef trackRef() const
virtual size_type numberOfDaughters() const =0
number of daughters
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
virtual bool hasMasterClone() const =0
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
virtual void setVertex(const Point &vertex)
set vertex
double pz() const
z coordinate of momentum vector
virtual int pdgId() const =0
PDG identifier.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
void set(const MagneticField *bField)
Particle reconstructed by the particle flow algorithm.
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > const & refittedTracks() const
T const * get() const
Returns C++ pointer to the item.
value_type const * get() const
double py() const
y coordinate of momentum vector
virtual const CandidateBaseRef & masterClone() const =0