5 const double mass)
const {
6 return p4(vertex, std::vector<double>(vertex.
tracks().size(),
mass));
10 const std::vector<double>& masses)
const {
15 LogDebug(
"InvariantMassFromVertex") <<
"Fit failed: vertex has not been smoothed\n";
19 if (vertex.
tracks().size() != masses.size()) {
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) {
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 {
61 LogDebug(
"InvariantMassFromVertex") <<
"Fit failed: vertex has not been smoothed\n";
64 if (vertex.
tracks().size() != masses.size()) {
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();
108 double energy_local =
sqrt(a * a / (rho * rho) * (1 + 1 / (
tan(theta) *
tan(theta))) + mass * mass);
110 jac(1, i_int * 3 + 1) = (-(energy_total / energy_local * a * a / (rho * rho * rho *
sin(theta) *
sin(theta))) +
111 totalP4.X() * a / (rho *
rho) *
cos(phi) + totalP4.Y() * a / (rho *
rho) *
sin(phi) +
112 totalP4.Z() * a / (rho * rho *
tan(theta))) /
115 jac(1, i_int * 3 + 2) =
116 (-(energy_total / energy_local * a * a / (rho * rho *
sin(theta) *
sin(theta) *
tan(theta))) +
117 totalP4.Z() * a / (rho *
sin(theta) *
sin(theta))) /
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
std::vector< RefCountedVertexTrack > tracks() const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
LorentzVector p4(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
CLHEP::HepMatrix AlgebraicMatrix
Cos< T >::type cos(const T &t)
double uncertainty(const LorentzVector &p4, const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
Tan< T >::type tan(const T &t)
GlobalVector momentum(const CachingVertex< 5 > &vertex) const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1, const RefCountedVertexTrack t2) const
bool tkToTkCovarianceIsAvailable() const
GlobalPoint position() const
tuple size
Write out results.
Measurement1D invariantMass(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const