7 : verbose_(settings.getParameter<
bool>(
"verbose")),
9 initK_(settings.getParameter<
std::
vector<double> >(
"initialK")),
10 initK2_(settings.getParameter<
std::
vector<double> >(
"initialK2")),
11 eLoss_(settings.getParameter<
std::
vector<double> >(
"eLoss")),
12 aPhi_(settings.getParameter<
std::
vector<double> >(
"aPhi")),
13 aPhiB_(settings.getParameter<
std::
vector<double> >(
"aPhiB")),
14 aPhiBNLO_(settings.getParameter<
std::
vector<double> >(
"aPhiBNLO")),
15 bPhi_(settings.getParameter<
std::
vector<double> >(
"bPhi")),
16 bPhiB_(settings.getParameter<
std::
vector<double> >(
"bPhiB")),
17 phiAt2_(settings.getParameter<double>(
"phiAt2")),
19 chiSquare_(settings.getParameter<
std::
vector<double> >(
"chiSquare")),
20 chiSquareCutPattern_(settings.getParameter<
std::
vector<
int> >(
"chiSquareCutPattern")),
21 chiSquareCutCurv_(settings.getParameter<
std::
vector<
int> >(
"chiSquareCutCurvMax")),
22 chiSquareCut_(settings.getParameter<
std::
vector<
int> >(
"chiSquareCut")),
23 trackComp_(settings.getParameter<
std::
vector<double> >(
"trackComp")),
24 trackCompErr1_(settings.getParameter<
std::
vector<double> >(
"trackCompErr1")),
25 trackCompErr2_(settings.getParameter<
std::
vector<double> >(
"trackCompErr2")),
26 trackCompPattern_(settings.getParameter<
std::
vector<
int> >(
"trackCompCutPattern")),
27 trackCompCutCurv_(settings.getParameter<
std::
vector<
int> >(
"trackCompCutCurvMax")),
28 trackCompCut_(settings.getParameter<
std::
vector<
int> >(
"trackCompCut")),
29 chiSquareCutTight_(settings.getParameter<
std::
vector<
int> >(
"chiSquareCutTight")),
30 combos4_(settings.getParameter<
std::
vector<
int> >(
"combos4")),
31 combos3_(settings.getParameter<
std::
vector<
int> >(
"combos3")),
32 combos2_(settings.getParameter<
std::
vector<
int> >(
"combos2")),
33 combos1_(settings.getParameter<
std::
vector<
int> >(
"combos1")),
35 useOfflineAlgo_(settings.getParameter<
bool>(
"useOfflineAlgo")),
36 mScatteringPhi_(settings.getParameter<
std::
vector<double> >(
"mScatteringPhi")),
37 mScatteringPhiB_(settings.getParameter<
std::
vector<double> >(
"mScatteringPhiB")),
38 pointResolutionPhi_(settings.getParameter<double>(
"pointResolutionPhi")),
39 pointResolutionPhiB_(settings.getParameter<double>(
"pointResolutionPhiB")),
40 pointResolutionPhiBH_(settings.getParameter<
std::
vector<double> >(
"pointResolutionPhiBH")),
41 pointResolutionPhiBL_(settings.getParameter<
std::
vector<double> >(
"pointResolutionPhiBL")),
42 pointResolutionVertex_(settings.getParameter<double>(
"pointResolutionVertex")),
43 useNewQualityCalculation_(settings.getParameter<
bool>(
"useNewQualityCalculation"))
51 return std::make_pair(
true,
i);
53 return std::make_pair(
false, 0);
62 if (
track.curvatureAtVertex() == 0) {
65 }
else if (
track.curvatureAtVertex() > 0) {
96 int phi2 =
track.phiAtMuon() >> 2;
100 int processor =
track.sector();
127 muon.setHwPtUnconstrained(
pt2);
134 word1 = word1 |
HF << 22;
137 uint32_t word2 =
sign;
138 word2 = word2 | signValid << 1;
139 word2 = word2 |
dxy << 2;
140 word2 = word2 | trackAddr << 4;
142 word2 = word2 |
pt2 << 23;
143 muon.setDataword(word2, word1);
149 std::unique_ptr<l1t::RegionalMuonCandBxCollection>&
out) {
187 std::map<uint, uint> diffInfo;
188 for (
uint i = 0;
i < 12; ++
i) {
192 std::map<uint, uint> stubInfo;
195 int previousSector =
sector - 1;
196 int nextSector =
sector + 1;
219 for (
const auto& stub :
stubs) {
222 if (stub->stNum() !=
step)
228 if (stub->scNum() == previousSector) {
229 if (stub->whNum() ==
wheel) {
237 }
else if (stub->whNum() == innerWheel) {
246 }
else if (stub->scNum() ==
sector) {
247 if (stub->whNum() ==
wheel) {
255 }
else if (stub->whNum() == innerWheel) {
264 }
else if (stub->scNum() == nextSector) {
265 if (stub->whNum() ==
wheel) {
273 }
else if (stub->whNum() == innerWheel) {
276 stubInfo[10] =
N - 1;
279 stubInfo[11] =
N - 1;
300 if (diffInfo[
s4] != 60000)
301 return std::make_pair(
true, stubInfo[
s4]);
303 return std::make_pair(
false, 0);
308 return 8 * stub->phiB();
312 if (stub->scNum() ==
sector) {
314 }
else if ((stub->scNum() ==
sector - 1) || (stub->scNum() == 11 &&
sector == 0)) {
315 return stub->phi() - 2144;
316 }
else if ((stub->scNum() ==
sector + 1) || (stub->scNum() == 0 &&
sector == 11)) {
317 return stub->phi() + 2144;
323 unsigned int mask = 0;
324 for (
const auto& stub :
track.stubs()) {
331 return bit1 * 1 + bit2 * 2 + bit3 * 4 + bit4 * 8;
337 int K =
track.curvature();
339 int phiB =
track.bendingAngle();
360 int addr = KBound / 2;
362 addr = (-KBound) / 2;
366 printf(
"propagate to vertex K=%d deltaK=%d addr=%d\n", K, deltaK,
addr);
375 ap_fixed<BITSCURV, BITSCURV> phi11 = ap_fixed<BITSPARAM + 1, 2>(
aPhi_[
step - 1]) * ap_fixed<BITSCURV, BITSCURV>(K);
376 ap_fixed<BITSPHIB, BITSPHIB> phi12 =
377 ap_fixed<BITSPARAM + 1, 2>(-
bPhi_[
step - 1]) * ap_fixed<BITSPHIB, BITSPHIB>(phiB);
380 printf(
"phi prop = %d * %f = %d, %d * %f = %d\n",
382 ap_fixed<BITSPARAM + 1, 2>(
aPhi_[
step - 1]).to_float(),
385 ap_fixed<BITSPARAM + 1, 2>(-
bPhi_[
step - 1]).to_float(),
388 int phiNew = ap_fixed<BITSPHI, BITSPHI>(
phi + phi11 + phi12);
391 ap_fixed<BITSCURV, BITSCURV> phiB11 = ap_fixed<BITSPARAM, 1>(
aPhiB_[
step - 1]) * ap_fixed<BITSCURV, BITSCURV>(K);
392 ap_fixed<BITSPHIB + 1, BITSPHIB + 1> phiB12 =
393 ap_ufixed<BITSPARAM + 1, 1>(
bPhiB_[
step - 1]) * ap_fixed<BITSPHIB, BITSPHIB>(phiB);
394 int phiBNew = ap_fixed<13, 13>(phiB11 + phiB12);
396 printf(
"phiB prop = %d * %f = %d, %d * %f = %d\n",
398 ap_fixed<BITSPARAM + 1, 2>(
aPhiB_[
step - 1]).to_float(),
401 ap_ufixed<BITSPARAM + 1, 1>(
bPhiB_[
step - 1]).to_float(),
407 int addr = KBound / 2;
410 ap_fixed<12, 12> DXY;
415 phiBNew = ap_fixed<BITSPHIB, BITSPHIB>(DXY - ap_fixed<BITSPHIB, BITSPHIB>(phiB));
417 printf(
"Vertex phiB prop = %d - %d = %d\n", DXY.to_int(), ap_fixed<BITSPHIB, BITSPHIB>(phiB).to_int(), phiBNew);
441 ROOT::Math::SMatrix<double, 3>
P(
a, 9);
443 const std::vector<double>& covLine =
track.covariance();
445 cov = ROOT::Math::Similarity(
P, cov);
451 std::vector<double>
b(6);
464 printf(
"Covariance term for phiB = %f\n", cov(2, 2));
465 printf(
"Multiple scattering term for phiB = %f\n", MS(2, 2));
468 track.setCovariance(cov);
469 track.setCoordinates(
step - 1, KNew, phiNew, phiBNew);
485 int trackK =
track.curvature();
487 int trackPhiB =
track.bendingAngle();
494 residual[1] = phiB - trackPhiB;
508 if (stub->quality() < 4)
513 const std::vector<double>& covLine =
track.covariance();
522 track.step(), fabs(trackK),
Gain(0, 0),
Gain(0, 1),
Gain(1, 0),
Gain(1, 1),
Gain(2, 0),
Gain(2, 1));
524 int KNew = (trackK +
int(
Gain(0, 0) * residual(0) +
Gain(0, 1) * residual(1)));
525 if (fabs(KNew) > 8192)
529 int phiBNew =
wrapAround(trackPhiB +
int(
Gain(2, 0) * residual(0) +
Gain(2, 1) * residual(1)), 4096);
531 track.setResidual(stub->stNum() - 1, fabs(
phi - phiNew) + fabs(phiB - phiBNew) / 8);
534 printf(
"residual %d - %d = %d %d - %d = %d\n",
phi,
trackPhi,
int(residual[0]), phiB, trackPhiB,
int(residual[1]));
535 printf(
"Gains offline: %f %f %f %f\n",
Gain(0, 0),
Gain(0, 1),
Gain(2, 0),
Gain(2, 1));
536 printf(
" K = %d + %f * %f + %f * %f\n", trackK,
Gain(0, 0), residual(0),
Gain(0, 1), residual(1));
537 printf(
" phiB = %d + %f * %f + %f * %f\n", trackPhiB,
Gain(2, 0), residual(0),
Gain(2, 1), residual(1));
540 track.setCoordinates(
track.step(), KNew, phiNew, phiBNew);
544 c(0, 0) = covNew(0, 0);
545 c(0, 1) = covNew(0, 1);
546 c(0, 2) = covNew(0, 2);
547 c(1, 0) = covNew(1, 0);
548 c(1, 1) = covNew(1, 1);
549 c(1, 2) = covNew(1, 2);
550 c(2, 0) = covNew(2, 0);
551 c(2, 1) = covNew(2, 1);
552 c(2, 2) = covNew(2, 2);
554 printf(
"Post Fit Covariance Matrix %f %f %f\n", cov(0, 0), cov(1, 1), cov(2, 2));
565 int trackK =
track.curvature();
567 int trackPhiB =
track.bendingAngle();
574 printf(
"residuals %d - %d = %d\n",
phi,
trackPhi,
int(residual));
581 const std::vector<double>& covLine =
track.covariance();
590 track.setKalmanGain(
track.step(), fabs(trackK),
Gain(0, 0), 0.0,
Gain(1, 0), 0.0,
Gain(2, 0), 0.0);
592 printf(
"Gains: %f %f\n",
Gain(0, 0),
Gain(2, 0));
596 int phiBNew =
wrapAround(trackPhiB +
int(
Gain(2, 0) * residual), 4096);
597 track.setCoordinates(
track.step(), KNew, phiNew, phiBNew);
602 printf(
"phiUpdate: %d %d\n",
int(
Gain(0, 0) * residual),
int(
Gain(2, 0) * residual));
605 c(0, 0) = covNew(0, 0);
606 c(0, 1) = covNew(0, 1);
607 c(0, 2) = covNew(0, 2);
608 c(1, 0) = covNew(1, 0);
609 c(1, 1) = covNew(1, 1);
610 c(1, 2) = covNew(1, 2);
611 c(2, 0) = covNew(2, 0);
612 c(2, 1) = covNew(2, 1);
613 c(2, 2) = covNew(2, 2);
625 int trackK =
track.curvature();
627 int trackPhiB =
track.bendingAngle();
633 ap_fixed<BITSPHI + 1, BITSPHI + 1> residualPhi =
phi -
trackPhi;
634 ap_fixed<BITSPHIB + 1, BITSPHIB + 1> residualPhiB = phiB - trackPhiB;
637 printf(
"residual %d - %d = %d %d - %d = %d\n",
640 residualPhi.to_int(),
643 residualPhiB.to_int());
645 uint absK = fabs(trackK);
649 std::vector<float> GAIN;
660 printf(
"Gains (fp): %f %f %f %f\n", GAIN[0], GAIN[1], GAIN[2], GAIN[3]);
662 printf(
"Addr=%d gain0=%f gain4=-%f\n",
664 ap_ufixed<GAIN_0, GAIN_0INT>(GAIN[0]).to_float(),
665 ap_ufixed<GAIN_4, GAIN_4INT>(GAIN[2]).to_float());
667 printf(
"Addr=%d %f -%f %f %f\n",
669 ap_fixed<GAIN2_0, GAIN2_0INT>(GAIN[0]).to_float(),
670 ap_ufixed<GAIN2_1, GAIN2_1INT>(GAIN[1]).to_float(),
671 ap_ufixed<GAIN2_4, GAIN2_4INT>(GAIN[2]).to_float(),
672 ap_ufixed<GAIN2_5, GAIN2_5INT>(GAIN[3]).to_float());
675 track.setKalmanGain(
track.step(), fabs(trackK), GAIN[0], GAIN[1], 1, 0, GAIN[2], GAIN[3]);
679 KNew = ap_fixed<BITSPHI + 9, BITSPHI + 9>(ap_fixed<BITSCURV, BITSCURV>(trackK) +
680 ap_ufixed<GAIN_0, GAIN_0INT>(GAIN[0]) * residualPhi);
682 ap_fixed<BITSPHI + 7, BITSPHI + 7> k11 = ap_fixed<GAIN2_0, GAIN2_0INT>(GAIN[0]) * residualPhi;
683 ap_fixed<BITSPHIB + 4, BITSPHIB + 4> k12 = ap_ufixed<GAIN2_1, GAIN2_1INT>(GAIN[1]) * residualPhiB;
684 KNew = ap_fixed<BITSPHI + 9, BITSPHI + 9>(ap_fixed<BITSCURV, BITSCURV>(trackK) + k11 - k12);
686 if (fabs(KNew) >= 8191)
692 ap_fixed<BITSPHI + 5, BITSPHI + 5> pbdouble_0 = ap_ufixed<GAIN2_4, GAIN2_4INT>(GAIN[2]) * residualPhi;
693 ap_fixed<BITSPHIB + 24, BITSPHIB + 4> pb_1 = ap_ufixed<GAIN2_5, GAIN2_5INT>(GAIN[3]) * residualPhiB;
694 ap_fixed<BITSPHI + 9, BITSPHI + 5> pb_0 = ap_ufixed<GAIN_4, GAIN_4INT>(GAIN[2]) * residualPhi;
697 printf(
"phiupdate %f %f %f\n", pb_0.to_float(), pb_1.to_float(), pbdouble_0.to_float());
702 phiBNew = ap_fixed<BITSPHI + 8, BITSPHI + 8>(ap_fixed<BITSPHIB, BITSPHIB>(trackPhiB) -
703 ap_ufixed<GAIN_4, GAIN_4INT>(GAIN[2]) * residualPhi);
705 if (fabs(phiBNew) >= 4095)
708 phiBNew = ap_fixed<BITSPHI + 7, BITSPHI + 7>(ap_fixed<BITSPHIB, BITSPHIB>(trackPhiB) + pb_1 - pbdouble_0);
709 if (fabs(phiBNew) >= 4095)
712 track.setCoordinates(
track.step(), KNew, phiNew, phiBNew);
728 double residual = -
track.dxy();
734 const std::vector<double>& covLine =
track.covariance();
743 printf(
"sigma3=%f sigma6=%f\n", cov(0, 3), cov(3, 3));
744 printf(
" K = %d + %f * %f\n",
track.curvature(),
Gain(0, 0), residual);
751 printf(
"Post fit impact parameter=%d\n", dxyNew);
752 track.setCoordinatesAtVertex(KNew, phiNew, -residual);
755 c(0, 0) = covNew(0, 0);
756 c(0, 1) = covNew(0, 1);
757 c(0, 2) = covNew(0, 2);
758 c(1, 0) = covNew(1, 0);
759 c(1, 1) = covNew(1, 1);
760 c(1, 2) = covNew(1, 2);
761 c(2, 0) = covNew(2, 0);
762 c(2, 1) = covNew(2, 1);
763 c(2, 2) = covNew(2, 2);
769 double residual = -
track.dxy();
775 track.setKalmanGain(
track.step(), fabs(
track.curvature()), GAIN.first, GAIN.second, -1);
777 ap_fixed<BITSCURV, BITSCURV> k_0 =
778 -(ap_ufixed<GAIN_V0, GAIN_V0INT>(fabs(GAIN.first))) * ap_fixed<BITSPHIB, BITSPHIB>(residual);
779 int KNew = ap_fixed<BITSCURV, BITSCURV>(k_0 + ap_fixed<BITSCURV, BITSCURV>(
track.curvature()));
782 printf(
"VERTEX GAIN(%d)= -%f * %d = %d\n",
784 ap_ufixed<GAIN_V0, GAIN_V0INT>(fabs(GAIN.first)).to_float(),
785 ap_fixed<BITSPHIB, BITSPHIB>(residual).to_int(),
789 int p_0 =
fp_product(GAIN.second,
int(residual), 7);
791 track.setCoordinatesAtVertex(KNew, phiNew, -residual);
797 if (
track.hasFineEta())
798 etaINT =
track.fineEta();
800 etaINT =
track.coarseEta();
803 double lsbEta = 0.010875;
807 if (
track.curvatureAtVertex() < 0)
809 double pt = double(
ptLUT(
track.curvatureAtVertex())) / 2.0;
813 double eta = etaINT * lsbEta;
817 K =
track.curvatureAtMuon();
822 K = 46 * K / fabs(K);
823 double pt = 1.0 / (
lsb * fabs(K));
833 std::vector<int> combinatorics;
835 switch (
seed->stNum()) {
852 printf(
"Something really bad happend\n");
856 seedQual =
seed->quality();
857 for (
const auto&
mask : combinatorics) {
864 charge = phiB / fabs(phiB);
867 if (
track.step() == 4 && (fabs(
seed->phiB()) > 15))
868 address =
charge * 15 * 8;
870 if (
track.step() == 3 && (fabs(
seed->phiB()) > 30))
871 address =
charge * 30 * 8;
872 if (
track.step() == 2 && (fabs(
seed->phiB()) > 127))
873 address =
charge * 127 * 8;
881 if (
seed->quality() < 4) {
889 float DK = 512 * 512.;
890 covariance(0, 0) = DK;
891 covariance(0, 1) = 0;
892 covariance(0, 2) = 0;
893 covariance(1, 0) = 0;
895 covariance(1, 2) = 0;
896 covariance(2, 0) = 0;
897 covariance(2, 1) = 0;
901 if (
seed->quality() < 4)
906 track.setCovariance(covariance);
910 printf(
"New Kalman fit staring at step=%d, phi=%d,phiB=%d with curvature=%d\n",
912 track.positionAngle(),
913 track.bendingAngle(),
916 for (
unsigned int i = 0;
i < 4; ++
i)
919 printf(
"------------------------------------------------------\n");
920 printf(
"------------------------------------------------------\n");
921 printf(
"------------------------------------------------------\n");
923 for (
const auto& stub :
stubs)
924 printf(
"station=%d phi=%d phiB=%d qual=%d tag=%d sector=%d wheel=%d fineEta= %d %d\n",
934 printf(
"------------------------------------------------------\n");
935 printf(
"------------------------------------------------------\n");
938 int phiAtStation2 = 0;
940 while (
track.step() > 0) {
942 if (
track.step() == 1) {
954 printf(
"Unconstrained PT in Muon System: pt=%f\n",
track.ptUnconstrained());
959 printf(
"propagated Coordinates step:%d,phi=%d,phiB=%d,K=%d\n",
961 track.positionAngle(),
962 track.bendingAngle(),
965 if (
track.step() > 0)
971 printf(
"updated Coordinates step:%d,phi=%d,phiB=%d,K=%d\n",
973 track.positionAngle(),
974 track.bendingAngle(),
979 if (
track.step() == 0) {
982 printf(
" Coordinates before vertex constraint step:%d,phi=%d,dxy=%d,K=%d\n",
986 track.curvatureAtVertex());
988 printf(
"Chi Square = %d\n",
track.approxChi2());
993 printf(
" Coordinates after vertex constraint step:%d,phi=%d,dxy=%d,K=%d maximum local chi2=%d\n",
997 track.curvatureAtVertex(),
999 printf(
"------------------------------------------------------\n");
1000 printf(
"------------------------------------------------------\n");
1004 track.setCoordinatesAtMuon(
track.curvatureAtMuon(), phiAtStation2,
track.phiBAtMuon());
1007 printf(
"Floating point coordinates at vertex: pt=%f, eta=%f phi=%f\n",
track.pt(),
track.eta(),
track.phi());
1008 pretracks.push_back(
track);
1016 if (!cleaned.empty()) {
1017 return std::make_pair(
true, cleaned[0]);
1019 return std::make_pair(
false, nullTrack);
1025 int K =
track.curvatureAtMuon();
1033 for (
const auto& stub :
track.stubs()) {
1036 int diff1 =
wrapAround(stubCoords - coords, 1024);
1040 printf(
"Chi Square stub for track with pattern=%d coords=%d -> AK=%d stubCoords=%d diff=%d delta=%d\n",
1059 track.setApproxChi2(chi);
1069 int K =
track.curvatureAtVertex() >> 4;
1071 if (
track.stubs().size() != 2) {
1072 track.setTrackCompatibility(0);
1077 if (
track.stubs()[0]->quality() >
track.stubs()[1]->quality())
1082 printf(
"stubsel %d phi=%d phiB=%d\n", stubSel, stub->phi(), stub->phiB());
1091 ap_fixed<12, 12>
diff = ap_int<10>(stub->phiB()) -
1092 ap_ufixed<5, 1>(
trackComp_[stub->stNum() - 1]) * ap_fixed<BITSCURV - 4, BITSCURV - 4>(K);
1093 ap_ufixed<11, 11>
delta;
1106 printf(
"delta = %d = abs(%d - %f*%d\n",
delta.to_int(), stub->phiB(),
trackComp_[stub->stNum() - 1], K);
1107 printf(
"err = %d = %f + %f*%d\n",
1130 return 160 + (
track.stubs().size()) * 20 - chi;
1134 if (
value > maximum - 1)
1136 if (
value < -maximum)
1148 }
else if (
sector == 1) {
1167 }
else if (
sector == 1) {
1184 std::map<int, int>
out;
1187 if (
track.wheel() == -2)
1189 else if (
track.wheel() == -1)
1191 else if (
track.wheel() == 0)
1193 else if (
track.wheel() == 1)
1195 else if (
track.wheel() == 2)
1209 for (
const auto& stub :
track.stubs()) {
1210 bool ownwheel = stub->whNum() ==
track.wheel();
1212 if ((stub->scNum() ==
track.sector() + 1) || (stub->scNum() == 0 &&
track.sector() == 11))
1214 if ((stub->scNum() ==
track.sector() - 1) || (stub->scNum() == 11 &&
track.sector() == 0))
1218 if (stub->stNum() == 4) {
1225 if (stub->stNum() == 3) {
1228 if (stub->stNum() == 2) {
1231 if (stub->stNum() == 1) {
1254 return (
long((
a * (1 <<
bits)) *
b)) >>
bits;
1258 int charge = (K >= 0) ? +1 : -1;
1270 FK = .8569 * FK / (1.0 + 0.1144 * FK);
1272 FK = FK -
charge * 1.23e-03;
1292 std::map<uint, int> infoRank;
1293 std::map<uint, L1MuKBMTrack> infoTrack;
1294 for (
uint i = 3;
i <= 15; ++
i) {
1295 if (
i == 4 ||
i == 8)
1308 int sel6 = infoRank[10] >= infoRank[12] ? 10 : 12;
1309 int sel5 = infoRank[14] >= infoRank[9] ? 14 : 9;
1310 int sel4 = infoRank[11] >= infoRank[13] ? 11 : 13;
1311 int sel3 = infoRank[sel6] >= infoRank[sel5] ? sel6 : sel5;
1312 int sel2 = infoRank[sel4] >= infoRank[sel3] ? sel4 : sel3;
1313 selected = infoRank[15] >= infoRank[sel2] ? 15 : sel2;
1317 int sel2 = infoRank[5] >= infoRank[6] ? 5 : 6;
1318 selected = infoRank[7] >= infoRank[sel2] ? 7 : sel2;
1323 auto search = infoTrack.find(selected);
1324 if (
search != infoTrack.end())
1331 if (stub->qeta1() != 0 && stub->qeta2() != 0) {
1334 if (stub->qeta1() == 0) {
1338 return (stub->qeta1());
1350 for (
unsigned int i = 0;
i <
track.stubs().size(); ++
i) {
1351 if (fabs(
track.stubs()[
i]->whNum()) != awheel)
1359 for (
const auto& stub :
track.stubs()) {
1365 sums +=
rank * stub->eta1();
1369 if (sumweights == 1)
1371 else if (sumweights == 2)
1373 else if (sumweights == 3)
1375 else if (sumweights == 4)
1377 else if (sumweights == 5)
1379 else if (sumweights == 6)
1399 for (
const auto& stub :
track.stubs())
1400 if (stub->stNum() == 2)
1403 ap_fixed<BITSPHI, BITSPHI>
phi =
track.phiAtMuon();
1404 ap_fixed<BITSPHIB, BITSPHIB> phiB =
track.phiBAtMuon();
1406 int phiNew = ap_fixed<BITSPHI + 1, BITSPHI + 1, AP_TRN_ZERO, AP_SAT>(
phi +
phiAt2 * phiB);
1409 printf(
"Phi at second station=%d\n", phiNew);
std::vector< double > bPhiB_
int correctedPhiB(const L1MuKBMTCombinedStubRef &)
l1t::RegionalMuonCand convertToBMTF(const L1MuKBMTrack &track)
std::vector< double > aPhi_
std::vector< int > combos1_
std::vector< double > aPhiB_
std::vector< double > aPhiBNLO_
L1TMuonBarrelKalmanAlgo(const edm::ParameterSet &settings)
uint coarseEta(uint, uint)
std::pair< bool, uint > match(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &, int)
double pointResolutionPhiB_
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)
std::vector< double > mScatteringPhiB_
int phiAt2(const L1MuKBMTrack &track)
bool update(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int, int)
int rank(const L1MuKBMTrack &)
std::vector< int > trackCompPattern_
std::vector< edm::Ref< L1MuKBMTCombinedStubCollection > > L1MuKBMTCombinedStubRefVector
static const int BITSCURV
bool updateOffline1D(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
double pointResolutionVertex_
void estimateCompatibility(L1MuKBMTrack &)
bool updateLUT(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int, int)
void vertexConstraintLUT(L1MuKBMTrack &)
std::pair< bool, uint > getByCode(const L1MuKBMTrackCollection &tracks, int mask)
int fp_product(float, int, uint)
std::vector< double > chiSquare_
std::vector< double > pointResolutionPhiBH_
std::vector< double > initK2_
ROOT::Math::SMatrix< double, 1, 3 > Matrix13
std::pair< float, float > vertexGain(uint, uint)
std::vector< double > trackComp_
std::vector< double > mScatteringPhi_
Abs< T >::type abs(const T &t)
L1TMuonBarrelKalmanLUTs * lutService_
void vertexConstraint(L1MuKBMTrack &)
int customBitmask(unsigned int, unsigned int, unsigned int, unsigned int)
std::vector< double > eLoss_
ROOT::Math::SMatrix< double, 3, 1 > Matrix31
bool estimateChiSquare(L1MuKBMTrack &)
void vertexConstraintOffline(L1MuKBMTrack &)
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > CovarianceMatrix2
uint matchAbs(std::map< uint, uint > &, uint, uint)
std::vector< int > combos4_
std::vector< int > chiSquareCutTight_
std::vector< double > bPhi_
std::vector< double > initK_
void updateEta(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
void setFloatingPointValues(L1MuKBMTrack &, bool)
L1MuKBMTrackCollection clean(const L1MuKBMTrackCollection &, uint)
int encode(bool ownwheel, int sector, bool tag)
std::vector< int > chiSquareCutPattern_
std::pair< bool, L1MuKBMTrack > chain(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &)
void calculateEta(L1MuKBMTrack &track)
std::pair< OmniClusterRef, TrackingParticleRef > P
std::vector< int > chiSquareCut_
void addBMTFMuon(int, const L1MuKBMTrack &, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &)
int hitPattern(const L1MuKBMTrack &)
ROOT::Math::SVector< double, 2 > Vector2
std::vector< L1MuKBMTrack > L1MuKBMTrackCollection
ROOT::Math::SMatrix< double, 2, 3 > Matrix23
int correctedPhi(const L1MuKBMTCombinedStubRef &, int)
std::vector< double > trackCompErr1_
std::vector< float > trackGain2(uint, uint, uint, uint, uint)
void propagate(L1MuKBMTrack &)
ROOT::Math::SMatrix< double, 3, 2 > Matrix32
std::vector< int > chiSquareCutCurv_
ROOT::Math::SMatrix< double, 3, 3 > Matrix33
std::vector< double > trackCompErr2_
std::vector< float > trackGain(uint, uint, uint)
math::Error< dimension >::type CovarianceMatrix
covariance error matrix (3x3)
double pointResolutionPhi_
std::vector< int > trackCompCut_
bool updateOffline(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
Power< A, B >::type pow(const A &a, const B &b)
uint etaStubRank(const L1MuKBMTCombinedStubRef &)
std::vector< int > combos3_
std::vector< int > trackCompCutCurv_
std::vector< int > combos2_
bool useNewQualityCalculation_
std::map< int, int > trackAddress(const L1MuKBMTrack &, int &)
std::vector< double > pointResolutionPhiBL_