17 #include <gsl/gsl_const_mksa.h>
27 template<
class T>
inline constexpr
T square(
const T&
x ) {
return x*
x; }
30 static constexpr
double speed_of_light = GSL_CONST_MKSA_SPEED_OF_LIGHT*1
e-7;
77 m_tGeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
81 m_track_map = findNode::getClass<TrackSeedContainer>(topNode,
"TpcTrackSeedContainer");
84 m_cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
87 if(
Verbosity() > 0) std::cout <<
" Using CORRECTED_TRKR_CLUSTER node " << std::endl;
91 if(
Verbosity() > 0) std::cout <<
" CORRECTED_TRKR_CLUSTER node not found, using TRKR_CLUSTER" << std::endl;
92 m_cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
121 const double radius = fabs(1./track->
get_qOverR());
124 const double center_x = track->
get_X0();
125 const double center_y = track->
get_Y0();
128 const Acts::Vector2 orig_vect = {origin.x()-center_x, origin.y()-center_y };
133 std::cout <<
"PHTpcDeltaZCorrection -"
136 <<
" center: " << center_x <<
", " << center_y
137 <<
" radius: " << radius
145 const auto& cluster_key = *key_iter;
155 if(!cluster)
continue;
161 const double delta_z = global.z() - origin.z();
164 const Acts::Vector2 cluster_vect = {global.x()-center_x, global.y()-center_y};
168 cluster_vect.y()*orig_vect.x()-cluster_vect.x()*orig_vect.y(),
169 cluster_vect.x()*orig_vect.x() + cluster_vect.y()*orig_vect.y() );
172 const double pathlength = std::sqrt(
square( delta_z ) +
square( radius*delta_phi ) );
179 const double t_correction = pathlength /speed_of_light;
180 cluster->setLocalY( cluster->getLocalY() - t_correction);
183 { std::cout <<
"PHTpcDeltaZCorrection::process_track - cluster: " << cluster_key
184 <<
" path length: " << pathlength <<
" t correction " << t_correction << std::endl; }