32 #define M_PI_2 1.57079632679489661923
78 float& xWithinChamber,
91 xWithinStrip = xWithinChamber;
95 int centStrip =
nStrips / 2 + 1;
96 std::vector<float>
const& adcs = stripHit.
s_adc();
125 if (
i > (centStrip - 2) &&
i < (centStrip + 2)) {
126 std::vector<float> adcsFit;
127 for (
int t = 0;
t < 4; ++
t) {
128 int k =
t + 4 * (
i - 1);
140 std::vector<float> xtalks;
142 float dt = 50.f *
tmax - tpeak;
144 for (
int t = 0;
t < 3; ++
t) {
157 for (
int t = 0;
t < 3; ++
t) {
184 std::vector<float> nmatrix;
186 for (
int istrip = 0; istrip < 3; ++istrip) {
187 a11[istrip] = nmatrix[0 + tbin * 3 + istrip * 15];
188 a12[istrip] = nmatrix[1 + tbin * 3 + istrip * 15];
189 a13[istrip] = nmatrix[2 + tbin * 3 + istrip * 15];
190 a22[istrip] = nmatrix[3 + tbin * 3 + istrip * 15];
191 a23[istrip] = nmatrix[4 + tbin * 3 + istrip * 15];
192 a33[istrip] = nmatrix[6 + tbin * 3 + istrip * 15];
196 for (
int istrip = 0; istrip < 3; ++istrip) {
218 bool peakMismatch =
false;
252 xWithinChamber = xWithinChamber + (xWithinStrip *
stripWidth);
258 int maxConsecutiveStrips = 8;
259 if (factorStripWidth) {
260 maxConsecutiveStrips /= factorStripWidth;
262 maxConsecutiveStrips++;
264 struct ChamberTypes {
265 std::map<std::string, int> chamberTypes;
267 auto p = chamberTypes.find(
s);
268 return p != chamberTypes.end() ? (*p).second : 0;
271 chamberTypes[
"ME1/a"] = 1;
272 chamberTypes[
"ME1/b"] = 2;
273 chamberTypes[
"ME1/2"] = 3;
274 chamberTypes[
"ME1/3"] = 4;
275 chamberTypes[
"ME2/1"] = 5;
276 chamberTypes[
"ME2/2"] = 6;
277 chamberTypes[
"ME3/1"] = 7;
278 chamberTypes[
"ME3/2"] = 8;
279 chamberTypes[
"ME4/1"] = 9;
280 chamberTypes[
"ME4/2"] = 8;
283 static const ChamberTypes chamberTypes;
421 CLHEP::HepMatrix cross_talks_inv(3, 3);
426 for (
int iTime = 0; iTime < 3; iTime++) {
427 cross_talks_inv(1, 1) =
xt_lr0[iTime];
428 cross_talks_inv(1, 2) =
xt_l[1][iTime];
429 cross_talks_inv(1, 3) = 0.;
430 cross_talks_inv(2, 1) =
xt_r[0][iTime];
431 cross_talks_inv(2, 2) =
xt_lr1[iTime];
432 cross_talks_inv(2, 3) =
xt_l[2][iTime];
433 cross_talks_inv(3, 1) = 0.;
434 cross_talks_inv(3, 2) =
xt_r[1][iTime];
435 cross_talks_inv(3, 3) =
xt_lr2[iTime];
436 cross_talks_inv.invert(
err);
439 <<
"Failed to invert XTalks matrix. No cross-talk correction for this rechit.";
489 const double parm[5] = {.1989337e-02, -.6901542e-04, .8665786, 154.6177, -.680163e-03};
491 k_3 = (parm[0] * wspace /
h + parm[1]) *
492 (parm[2] * wspace / wradius + parm[3] + parm[4] * (wspace / wradius) * (wspace / wradius));
515 int stripUp = stripDown + 1;
516 if (stripUp > n_SW - 1) {
524 double half_strip_width = 0.5;
526 const int n_bins =
n_val;
527 double corr_2_xestim = 999.;
533 int xestim_bin = -999;
534 double delta_strip_width = 999.;
535 double delta_strip_widthUpDown = 999.;
536 double diff_2_strip_width = 999.;
538 delta_strip_widthUpDown = 0.1;
548 xestim_bin =
int((1. -
std::abs(x_estimated)) / half_strip_width * n_bins);
552 (delta_strip_width / delta_strip_widthUpDown) * diff_2_strip_width;
556 (delta_strip_width / delta_strip_widthUpDown) * diff_2_strip_width;
558 corr_2_xestim = -corr_2_xestim;
561 xestim_bin =
int((
std::abs(x_estimated) / half_strip_width) * n_bins);
565 (delta_strip_width / delta_strip_widthUpDown) * diff_2_strip_width;
569 (delta_strip_width / delta_strip_widthUpDown) * diff_2_strip_width;
572 if (x_estimated < 0.) {
573 corr_2_xestim = -corr_2_xestim;
577 return corr_2_xestim;
582 double x_gatti = x_estimated + x_corr;
617 double error = dXT * xt_asym;
638 double x_shift = d_xf + d_corr;
647 double x_estimated = -99.;