1212#include " FWCore/MessageLogger/interface/MessageLogger.h"
1313#include " FWCore/ParameterSet/interface/ParameterSet.h"
1414#include " SimDataFormats/Associations/interface/TTTrackAssociationMap.h"
15- #include " TMath.h"
1615#include < iostream>
1716#include < map>
1817#include < set>
@@ -42,9 +41,9 @@ class Track_Parameters {
4241 float bendchi2;
4342 float MVA1;
4443
45- float z (float x, float y) {
46- float t = std:: sinh (eta);
47- float r = TMath::Sqrt (pow (x, 2 ) + pow (y, 2 ));
44+ float trackZAtVertex (float x, float y) {
45+ float t = sinh (eta);
46+ float r = sqrt (pow (x, 2 ) + pow (y, 2 ));
4847 return (z0 +
4948 (t * r *
5049 (1 + (pow (d0, 2 ) / pow (r, 2 )) +
@@ -55,13 +54,13 @@ class Track_Parameters {
5554 float z0_in,
5655 float eta_in,
5756 float phi_in,
58- float rho_in = 0 ,
59- int index_in = - 1 ,
60- int nstubs_in = 0 ,
61- float chi2rphi_in = 0 ,
62- float chi2rz_in = 0 ,
63- float bendchi2_in = 0 ,
64- float MVA1_in = 0 ) {
57+ float rho_in,
58+ int index_in,
59+ int nstubs_in,
60+ float chi2rphi_in,
61+ float chi2rz_in,
62+ float bendchi2_in,
63+ float MVA1_in) {
6564 pt = pt_in;
6665 d0 = d0_in;
6766 z0 = z0_in;
@@ -76,8 +75,8 @@ class Track_Parameters {
7675 }
7776 index = index_in;
7877 rho = fabs (rho_in);
79- x0 = (rho + charge * d0) * TMath::Cos (phi - (charge * TMath::Pi () / 2 ));
80- y0 = (rho + charge * d0) * TMath::Sin (phi - (charge * TMath::Pi () / 2 ));
78+ x0 = (rho + charge * d0) * cos (phi - (charge * numbers::pi / 2 ));
79+ y0 = (rho + charge * d0) * sin (phi - (charge * numbers::pi / 2 ));
8180 nstubs = nstubs_in;
8281 chi2rphi = chi2rphi_in;
8382 chi2rz = chi2rz_in;
@@ -95,7 +94,7 @@ inline std::valarray<float> calcPVec(Track_Parameters a, double_t v_x, double_t
9594 p_vec *= -1 ;
9695 }
9796 if ((p_vec[0 ] != 0.0 ) || (p_vec[1 ] != 0.0 )) {
98- p_vec /= TMath::Sqrt (pow (p_vec[0 ], 2 ) + pow (p_vec[1 ], 2 ));
97+ p_vec /= sqrt (pow (p_vec[0 ], 2 ) + pow (p_vec[1 ], 2 ));
9998 }
10099 p_vec *= a.pt ;
101100 return p_vec;
@@ -127,20 +126,19 @@ class Vertex_Parameters {
127126 std::valarray<float > p_trk_1 = calcPVec (a_in, x_dv_in, y_dv_in);
128127 std::valarray<float > p_trk_2 = calcPVec (b_in, x_dv_in, y_dv_in);
129128 std::valarray<float > p_tot = p_trk_1 + p_trk_2;
130- p_mag = TMath::Sqrt (pow (p_tot[0 ], 2 ) + pow (p_tot[1 ], 2 ));
129+ p_mag = sqrt (pow (p_tot[0 ], 2 ) + pow (p_tot[1 ], 2 ));
131130 if (((p_trk_1[0 ] != 0.0 ) || (p_trk_2[1 ] != 0.0 )) && ((p_trk_2[0 ] != 0.0 ) || (p_trk_2[1 ] != 0.0 ))) {
132- openingAngle =
133- (p_trk_1[0 ] * p_trk_2[0 ] + p_trk_1[1 ] * p_trk_2[1 ]) /
134- (TMath::Sqrt (pow (p_trk_1[0 ], 2 ) + pow (p_trk_1[1 ], 2 )) * TMath::Sqrt (pow (p_trk_2[0 ], 2 ) + pow (p_trk_2[1 ], 2 )));
131+ openingAngle = (p_trk_1[0 ] * p_trk_2[0 ] + p_trk_1[1 ] * p_trk_2[1 ]) /
132+ (sqrt (pow (p_trk_1[0 ], 2 ) + pow (p_trk_1[1 ], 2 )) * sqrt (pow (p_trk_2[0 ], 2 ) + pow (p_trk_2[1 ], 2 )));
135133 }
136- R_T = TMath::Sqrt (pow (x_dv_in, 2 ) + pow (y_dv_in, 2 ));
134+ R_T = sqrt (pow (x_dv_in, 2 ) + pow (y_dv_in, 2 ));
137135 if ((R_T != 0.0 ) && ((p_tot[0 ] != 0.0 ) || (p_tot[1 ] != 0.0 ))) {
138- cos_T = (p_tot[0 ] * x_dv_in + p_tot[1 ] * y_dv_in) / (R_T * TMath::Sqrt (pow (p_tot[0 ], 2 ) + pow (p_tot[1 ], 2 )));
136+ cos_T = (p_tot[0 ] * x_dv_in + p_tot[1 ] * y_dv_in) / (R_T * sqrt (pow (p_tot[0 ], 2 ) + pow (p_tot[1 ], 2 )));
139137 }
140138 phi = atan2 (p_tot[1 ], p_tot[0 ]);
141139 d_T = fabs (cos (phi) * y_dv_in - sin (phi) * x_dv_in);
142140 p2_mag = pow (a_in.pt , 2 ) + pow (b_in.pt , 2 );
143- delta_z = fabs (a_in.z (x_dv_in, y_dv_in) - b_in.z (x_dv_in, y_dv_in));
141+ delta_z = fabs (a_in.trackZAtVertex (x_dv_in, y_dv_in) - b_in.trackZAtVertex (x_dv_in, y_dv_in));
144142 }
145143
146144 Vertex_Parameters () {};
0 commit comments