5 const double mass)
const {
10 const std::vector<double>&
masses)
const {
14 if (!
vertex.tkToTkCovarianceIsAvailable()) {
15 LogDebug(
"InvariantMassFromVertex") <<
"Fit failed: vertex has not been smoothed\n";
20 LogDebug(
"InvariantMassFromVertex") <<
"Vector of masses does not have the same size as tracks in vertex\n";
24 std::vector<RefCountedVertexTrack> refTracks =
vertex.tracks();
25 std::vector<RefCountedVertexTrack>::const_iterator i_s = refTracks.begin();
26 std::vector<double>::const_iterator i_m =
masses.begin();
28 for (; i_s != refTracks.end() && i_m !=
masses.end(); ++i_s, ++i_m) {
39 if (!
vertex.tkToTkCovarianceIsAvailable()) {
40 LogDebug(
"InvariantMassFromVertex") <<
"Fit failed: vertex has not been smoothed\n";
44 std::vector<RefCountedVertexTrack> refTracks =
vertex.tracks();
45 std::vector<RefCountedVertexTrack>::const_iterator i_s = refTracks.begin();
47 for (; i_s != refTracks.end(); ++i_s) {
48 momentum_ += (**i_s).refittedState()->freeTrajectoryState().momentum();
58 const std::vector<double>&
masses)
const {
60 if (!
vertex.tkToTkCovarianceIsAvailable()) {
61 LogDebug(
"InvariantMassFromVertex") <<
"Fit failed: vertex has not been smoothed\n";
65 LogDebug(
"InvariantMassFromVertex") <<
"Vector of masses does not have the same size as tracks in vertex\n";
79 const std::vector<double>&
masses)
const {
80 std::vector<RefCountedVertexTrack> refTracks =
vertex.tracks();
81 int size = refTracks.size();
85 double energy_total = totalP4.E();
87 std::vector<RefCountedVertexTrack>::const_iterator rt_i = refTracks.begin();
88 std::vector<double>::const_iterator i_m =
masses.begin();
91 for (; rt_i != refTracks.end() && i_m !=
masses.end(); ++rt_i, ++i_m) {
94 double rho = param[0];
95 double theta = param[1];
96 double phi = param[2];
99 if ((**rt_i).linearizedTrack()->charge() != 0) {
100 a = -(**rt_i).refittedState()->freeTrajectoryState().parameters().magneticFieldInInverseGeV(
vertex.position()).
z() *
101 (**rt_i).refittedState()->freeTrajectoryState().parameters().charge();
115 jac(1, i_int * 3 + 2) =
120 jac(1, i_int * 3 + 3) = (totalP4.X() *
sin(
phi) - totalP4.Y() *
cos(
phi)) *
a / (
rho * totalP4.M());
123 cov.sub(i_int * 3 + 1, i_int * 3 + 1, asHepMatrix<6>((**rt_i).fullCovariance()).sub(4, 6));
128 for (std::vector<RefCountedVertexTrack>::const_iterator rt_j = refTracks.begin(); rt_j != refTracks.end(); rt_j++) {
131 cov.sub(i_int * 3 + 1, j_int * 3 + 1, i_k_cov_m);
132 cov.sub(j_int * 3 + 1, i_int * 3 + 1, i_k_cov_m.T());
142 return sqrt((jac * cov * jac.T())(1, 1));
ROOT::Math::PxPyPzMVector LorentzVector
LorentzVector p4(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
Sin< T >::type sin(const T &t)
double uncertainty(const LorentzVector &p4, const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
GlobalVector momentum(const CachingVertex< 5 > &vertex) const
CLHEP::HepMatrix AlgebraicMatrix
Cos< T >::type cos(const T &t)
Measurement1D invariantMass(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
Tan< T >::type tan(const T &t)
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Geom::Theta< T > theta() const