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);