6 const double mass)
const
8 return p4(vertex, std::vector<double>(vertex.
tracks().size(), mass));
12 const std::vector<double> & masses)
const
20 <<
"Fit failed: vertex has not been smoothed\n";
24 if (vertex.
tracks().size() != masses.size()) {
26 <<
"Vector of masses does not have the same size as tracks in vertex\n";
31 std::vector<RefCountedVertexTrack> refTracks = vertex.
tracks();
32 std::vector<RefCountedVertexTrack>::const_iterator i_s = refTracks.begin();
33 std::vector<double>::const_iterator i_m = masses.begin();
35 for( ;i_s !=refTracks.end() && i_m != masses.end(); ++i_s, ++i_m) {
49 <<
"Fit failed: vertex has not been smoothed\n";
53 std::vector<RefCountedVertexTrack> refTracks = vertex.
tracks();
54 std::vector<RefCountedVertexTrack>::const_iterator i_s = refTracks.begin();
56 for( ;i_s !=refTracks.end() ; ++i_s) {
57 momentum_ += (**i_s).refittedState()->freeTrajectoryState().momentum();
65 const double mass)
const
72 const std::vector<double> & masses)
const
78 <<
"Fit failed: vertex has not been smoothed\n";
81 if (vertex.
tracks().size() != masses.size()) {
83 <<
"Vector of masses does not have the same size as tracks in vertex\n";
99 std::vector<RefCountedVertexTrack> refTracks = vertex.
tracks();
100 int size = refTracks.size();
104 double energy_total = totalP4.E();
106 std::vector<RefCountedVertexTrack>::const_iterator rt_i = refTracks.begin();
107 std::vector<double>::const_iterator i_m = masses.begin();
110 for( ;rt_i !=refTracks.end() && i_m != masses.end(); ++rt_i, ++i_m) {
114 double rho = param[0];
115 double theta = param[1];
116 double phi = param[2];
119 if ((**rt_i).linearizedTrack()->charge()!=0) {
120 a = -(**rt_i).refittedState()->freeTrajectoryState().parameters().magneticFieldInInverseGeV(vertex.
position()).
z()
121 * (**rt_i).refittedState()->freeTrajectoryState().parameters ().charge();
122 if (a==0.)
throw cms::Exception(
"InvariantMassFromVertex",
"Field is 0");
127 double energy_local =
sqrt(a*a/(rho*rho)*(1+1/(
tan(theta)*
tan(theta))) + mass*mass);
129 jac(1,i_int*3+1) = (-(energy_total/energy_local*a*a/(rho*rho*rho*
sin(theta)*
sin(theta)) )
130 + totalP4.X()*a/(rho*
rho)*
cos(phi) + totalP4.Y()*a/(rho*
rho)*
sin(phi)
131 + totalP4.Z()*a/(rho*rho*
tan(theta)) )/totalP4.M();
133 jac(1,i_int*3+2) = (-(energy_total/energy_local*a*a/(rho*rho*
sin(theta)*
sin(theta)*
tan(theta)) )
134 + totalP4.Z()*a/(rho*
sin(theta)*
sin(theta)) )/totalP4.M();
136 jac(1,i_int*3+3) = ( totalP4.X()*
sin(phi) - totalP4.Y()*
cos(phi) )*a/(rho*totalP4.M());
139 cov.sub(i_int*3 + 1, i_int*3 + 1,asHepMatrix<6>((**rt_i).fullCovariance()).sub(4,6));
144 for(std::vector<RefCountedVertexTrack>::const_iterator rt_j = refTracks.begin(); rt_j != refTracks.end(); rt_j++) {
147 cov.sub(i_int*3 + 1, j_int*3 + 1,i_k_cov_m);
148 cov.sub(j_int*3 + 1, i_int*3 + 1,i_k_cov_m.T());
158 return sqrt((jac*cov*jac.T())(1,1));
ROOT::Math::PxPyPzMVector LorentzVector
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
LorentzVector p4(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
std::vector< RefCountedVertexTrack > const & tracks() 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
AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1, const RefCountedVertexTrack t2) const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
bool tkToTkCovarianceIsAvailable() const
GlobalPoint position() const
tuple size
Write out results.
Measurement1D invariantMass(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const