5 bool UnbExtHitBaseData::Fill(AMSEventR *evPtr,
bool use_trd) {
7 auto fillHit = [
this](
ExtHit type, TrRecHitR *hit,
int imult,
float beta,
const TVector3 &interp_direction) {
8 float tof_dxdz = interp_direction.x() / interp_direction.z();
9 float tof_dydz = interp_direction.y() / interp_direction.z();
11 m_hits[type].ChargeStatus = hit->GetQStatus();
12 m_hits[type].HitPosX = hit->GetCoord(imult).x();
13 m_hits[type].HitPosY = hit->GetCoord(imult).y();
30 TrRecHitR *hitL1 =
nullptr;
31 TrRecHitR *hitL9 =
nullptr;
37 float prev_charge1 = 0;
38 float prev_charge9 = 0;
39 for (TrRecHitR &hit : evPtr->TrRecHit()) {
40 if (hit.OnlyY() || (hit.GetLayerJ() != 1 && hit.GetLayerJ() != 9))
47 AMSPoint interp_point = AMSPoint(vInterp[0], vInterp[1], vInterp[2]);
48 hit.HitPointDist(interp_point, imult);
50 float interp_dxdz = interp_direction.x() / interp_direction.z();
51 float interp_dydz = interp_direction.y() / interp_direction.z();
53 float hit_charge = hit.GetQYJ(2, tof_beta, 0, imult, interp_dxdz, interp_dydz);
55 if (hit.GetLayerJ() == 1) {
56 if (hit_charge > prev_charge1) {
59 prev_charge1 = hit_charge;
61 }
else if (hit.GetLayerJ() == 9) {
62 if (hit_charge > prev_charge9) {
65 prev_charge9 = hit_charge;
70 if (hitL1 !=
nullptr) {
71 fillHit(
ExtHit::L1, hitL1, multL1, tof_beta, interp_direction);
73 if (hitL9 !=
nullptr) {
74 fillHit(
ExtHit::L9, hitL9, multL9, tof_beta, interp_direction);
84 AMSPoint interp_point_L1 = AMSPoint(vL1Int[0], vL1Int[1], vL1Int[2]);
85 AMSPoint interp_point_L9 = AMSPoint(vL9Int[0], vL9Int[1], vL9Int[2]);
87 float prev_dist1 = std::numeric_limits<float>::max();
88 float prev_dist9 = std::numeric_limits<float>::max();
89 int mult1 = -1, mult9 = -1;
91 for (TrRecHitR &hit : evPtr->TrRecHit()) {
92 if (hit.OnlyY() || (hit.GetLayerJ() != 1 && hit.GetLayerJ() != 9))
95 if (hit.GetLayerJ() == 1) {
96 if (hit.HitPointDist(interp_point_L1, mult1).norm() < prev_dist1) {
98 prev_dist1 = hitL1->HitPointDist(interp_point_L1, mult1).norm();
100 }
else if (hit.GetLayerJ() == 9) {
101 if (hit.HitPointDist(interp_point_L9, mult9).norm() < prev_dist9) {
103 prev_dist9 = hitL9->HitPointDist(interp_point_L9, mult9).norm();
108 if (hitL1 !=
nullptr)
109 fillHit(
ExtHit::L1, hitL1, mult1, tof_beta, interp_direction);
110 if (hitL9 !=
nullptr)
111 fillHit(
ExtHit::L9, hitL9, mult9, tof_beta, interp_direction);
UnbExtHit container class description.
const TrdKBaseData * trdBase
needed to get basic info without computing twice
TofBetaVariable< float > Beta
Beta measurement, one for each type. See Tof::BetaType for list of types.
constexpr std::array< float, numFitPositionHeights > fitPositionHeightZ
Charge estimated using the upper half of the TRD.
TVector3 InterpolateAtZ(float z) const
Get Trd track interpolation at given height.
TVector3 InterpolateAtZ(float z) const
Get Tof track interpolation at given height.
TofChargeVariable< float > Charge
Charge measurement obtained using only layers for which GoodPathl is true. One for each type...
const TofBaseData * tofBase
std::map< ExtHit, HitData > m_hits
const TVector3 & GetLineDirection() const
Get the direction of the Tof clusters linear fit.
ExtHit
Handy enum to distinguish L1 and L9.
std::enable_if< std::is_convertible< Key, size_t >::value, bool >::type ContainsKeys(const std::array< T, N > &container, Key key)
const TVector3 & GetLineDirection() const
Get the direction of the TrdK clusters linear fit.
Standard tracker charge reconstruction.