26 const int nclusters = clusters->size();
27 std::vector<resultType> hitData;
29 for (
int icluster = 0; icluster < nclusters; icluster++) {
30 auto& cluster = clusters->at(icluster);
31 auto hit =
MakeHit(icluster, &cluster);
32 if (hit.Address() == -1)
continue;
33 hitData.emplace_back(hit, cluster.GetRecDigis());
45 if (!hitFlag)
return hit;
57 const int n0 = hitF.
fSignal.size() - 2;
58 auto [dx, dy] = hitF.
GetDxDy(n0);
65 for (
int ia = 0; ia <=
NANODE; ia++) {
66 const float ya = -1.35 + ia * 0.3;
67 if (dy > ya + 0.15)
continue;
72 const double parX[] = {0.713724, -0.318667, 0.0366036};
73 const double parY[] = {0.0886413, 0., 0.0435141};
74 const int nex = std::min(n0, 7);
75 const double edx = (n0 < 3) ? 1. : parX[0] + parX[1] * nex + parX[2] * nex * nex;
76 const double edy = (n0 < 3) ? 1. : parY[0] + parY[2] * dy * dy;
77 const double edt = (n0 < 3) ? 60. : 26.33;
81 for (
int idx = 1; idx <= n0; idx++) {
84 t_avg += (sig.
t - dtFEE);
88 const double time = (n0 > 1) ? t_avg / n0 : -21.;
89 const double tdrift = 100.;
92 const double e_avg = 1.e-9
94 [](
int sum,
const auto& sig) { return sum + sig.s; });
96 CalibrateHit(
h, dx, dy, edx, edy, edt, time, tdrift, e_avg, hitF);
102 const double edt,
const double time,
const double tdrift,
const double eloss,
106 const ROOT::Math::XYZVector local(local_pad.X() + dx, local_pad.Y() + dy, local_pad.Z());
131 L_(debug) <<
"TrdModuleRec2D::ProjectDigis : Requested cluster not found.";
136 std::vector<HitFactory2D::signal>& hitSig = hitF.
fSignal;
148 const double re = 100.;
149 const double te = 100.;
151 int j(0), col(-1), col0(0);
174 if (ddt < dt0) dt0 = ddt;
176 if (nt > 1) t *= 0.5;
177 err = te * (nt > 1 ? 0.707 : 1);
186 hitF.
viM = hitSig.size();
192 hitSig.emplace_back(t, err, ddt, xc, 0.035);
197 if (ddt < dt0) dt0 = ddt;
200 if (nr > 1) r *= 0.5;
201 err = re * (nr > 1 ? 0.707 : 1);
210 hitF.
viM = hitSig.size();
216 hitSig.emplace_back(r, err, ddt, xc, 0.);
224 if (std::abs(hitSig[0].s) > 1.e-3) {
226 char ddt = hitSig[0].t;
227 hitSig.emplace(hitSig.begin(), 0., 300., ddt, xc - 0.5, 0.);
230 int n(hitSig.size() - 1);
231 if (std::abs(hitSig[n].s) > 1.e-3) {
232 xc = hitSig[n].x + 0.5;
233 char ddt = hitSig[n].t;
234 hitSig.emplace_back(0., 300., ddt, xc, 0.035);
237 n0 = hitSig.size() - 2;
239 int nR = n0 + 1 - hitF.
viM;
240 if (nR == hitF.
viM) {
242 if (hitSig.size() % 2) {
243 double LS(0.), RS(0.);
244 for (UChar_t idx(0); idx < hitF.
viM; idx++)
246 for (uint idx(hitF.
viM + 1); idx < hitSig.size(); idx++)
255 else if (hitF.
viM > nR)
260 for (
auto& sig : hitSig) {
269 if (ovf < 0) hitF.
SetOvf();
270 return std::make_pair(ovf * (hitSig.size() - 2), hitF);
friend fscal max(fscal x, fscal y)
Data class with information on a STS local track.
uint64_t GetTimeDAQ() const
Getter for global DAQ time [clk]. Differs for each ASIC. In FASP case DAQ time is already stored in f...
int32_t GetAddressChannel() const
Getter read-out id.
Data Container for TRD clusters.
const std::vector< DigiRec > & GetRecDigis() const
Get array of calibrated digis.
double GetTiltCharge(bool &on) const
Return calibrated tilt signal.
double GetTiltTime() const
Return calibrated tilt time [ns].
double GetRectCharge(bool &on) const
Return calibrated rect signal.
double GetRectTime() const
Return calibrated rect time [ns].
void SetBiasY(bool set=1)
std::pair< double, double > GetDxDy(const int n0)
std::pair< double, double > CorrectPosition(double dx, double dy, const double xcorr, const double padSizeX, const double padSizeY)
Shift graph representation to [-0.5, 0.5].
void SetMaxTilt(bool set=1)
void SetSymmHit(bool set=1)
std::vector< signal > fSignal
void SetLeftSgn(bool set=1)
uint8_t vcM
start time of current hit [clk]
int GetHitClass() const
Hit classification wrt center pad.
double GetXcorr(double dx, int typ, int cls=0) const
void SetLeftHit(bool set=1)
void SetBiasX(bool set=1)
static Double_t fgDT[3]
hit time offset for synchronization
HitFinder2DModPar fParams
Parameter container.
Hit MakeHit(int cId, const Cluster2D *cluster)
void CalibrateHit(Hit *h, const double dx, const double dy, const double edx, const double edy, const double edt, const double time, const double tdrift, const double eloss, const HitFactory2D &hitF)
int GetPadRowCol(int address, int &c)
Addressing ASIC on module based on id.
std::vector< resultType > operator()(std::vector< Cluster2D > *clusters)
Steering routine for building hits.
HitFinder2D()
Default constructor.
std::pair< int, HitFactory2D > ProjectDigis(const Cluster2D *cluster)
bool BuildHit(Hit *h, HitFactory2D &hitF)
Implement topologic cuts for hit merging.
A light-weight TRD hit class for online reconstruction, based on CbmTrdHit. .
void SetRefId(int32_t refId)
void SetAddress(int32_t address)
char t
working copy of signal errors from cluster
double xe
working copy of signal relative positions
double x
working copy of signal relative timing
ROOT::Math::Rotation3D rotation
std::vector< HitFinder2DRowPar > rowPar
ROOT::Math::XYZVector translation