File indexing completed on 2025-08-06 08:18:02
0001
0002
0003
0004
0005
0006
0007 #include "TpcClusterZCrossingCorrection.h"
0008
0009 #include <phool/sphenix_constants.h>
0010
0011 #include <cmath>
0012 #include <iostream>
0013 #include <limits>
0014
0015
0016 float TpcClusterZCrossingCorrection::_vdrift = 8.0e-03;
0017
0018
0019 float TpcClusterZCrossingCorrection::_time_between_crossings = sphenix_constants::time_between_crossings;
0020
0021
0022 float TpcClusterZCrossingCorrection::correctZ(float zinit, unsigned int side, short int crossing)
0023 {
0024 if (crossing == std::numeric_limits<short>::max())
0025 {
0026 return std::numeric_limits<float>::quiet_NaN();
0027 }
0028
0029 float z_bunch_separation = _time_between_crossings * _vdrift;
0030
0031
0032
0033
0034 float corrected_z;
0035 if (side == 0)
0036 {
0037 corrected_z = zinit - (float) crossing * z_bunch_separation;
0038 }
0039 else
0040 {
0041 corrected_z = zinit + (float) crossing * z_bunch_separation;
0042 }
0043
0044
0045
0046 return corrected_z;
0047 }