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"))
50 return std::make_pair(
true,
i);
52 return std::make_pair(
false, 0);
61 if (
track.curvatureAtVertex() == 0) {
64 }
else if (
track.curvatureAtVertex() > 0) {
95 int phi2 =
track.phiAtMuon() >> 2;
99 int processor =
track.sector();
122 muon.setHwPtUnconstrained(
pt2);
129 word1 = word1 |
HF << 22;
132 uint32_t word2 =
sign;
133 word2 = word2 | signValid << 1;
134 word2 = word2 |
dxy << 2;
135 word2 = word2 | trackAddr << 4;
137 word2 = word2 |
pt2 << 23;
138 muon.setDataword(word2, word1);
144 std::unique_ptr<l1t::RegionalMuonCandBxCollection>&
out) {
182 std::map<uint, uint> diffInfo;
183 for (
uint i = 0;
i < 12; ++
i) {
187 std::map<uint, uint> stubInfo;
190 int previousSector =
sector - 1;
191 int nextSector =
sector + 1;
214 for (
const auto& stub : stubs) {
217 if (stub->stNum() !=
step)
223 if (stub->scNum() == previousSector) {
224 if (stub->whNum() ==
wheel) {
232 }
else if (stub->whNum() == innerWheel) {
241 }
else if (stub->scNum() ==
sector) {
242 if (stub->whNum() ==
wheel) {
250 }
else if (stub->whNum() == innerWheel) {
259 }
else if (stub->scNum() == nextSector) {
260 if (stub->whNum() ==
wheel) {
268 }
else if (stub->whNum() == innerWheel) {
271 stubInfo[10] =
N - 1;
274 stubInfo[11] =
N - 1;
295 if (diffInfo[
s4] != 60000)
296 return std::make_pair(
true, stubInfo[
s4]);
298 return std::make_pair(
false, 0);
303 return 8 * stub->phiB();
307 if (stub->scNum() ==
sector) {
309 }
else if ((stub->scNum() ==
sector - 1) || (stub->scNum() == 11 &&
sector == 0)) {
310 return stub->phi() - 2144;
311 }
else if ((stub->scNum() ==
sector + 1) || (stub->scNum() == 0 &&
sector == 11)) {
312 return stub->phi() + 2144;
318 unsigned int mask = 0;
319 for (
const auto& stub :
track.stubs()) {
326 return bit1 * 1 + bit2 * 2 + bit3 * 4 + bit4 * 8;
332 int K =
track.curvature();
334 int phiB =
track.bendingAngle();
355 int addr = KBound / 2;
357 addr = (-KBound) / 2;
361 printf(
"propagate to vertex K=%d deltaK=%d addr=%d\n", K, deltaK,
addr);
370 ap_fixed<BITSCURV, BITSCURV> phi11 = ap_fixed<BITSPARAM + 1, 2>(
aPhi_[
step - 1]) * ap_fixed<BITSCURV, BITSCURV>(K);
371 ap_fixed<BITSPHIB, BITSPHIB> phi12 =
372 ap_fixed<BITSPARAM + 1, 2>(-
bPhi_[
step - 1]) * ap_fixed<BITSPHIB, BITSPHIB>(phiB);
375 printf(
"phi prop = %d * %f = %d, %d * %f = %d\n",
377 ap_fixed<BITSPARAM + 1, 2>(
aPhi_[
step - 1]).to_float(),
380 ap_fixed<BITSPARAM + 1, 2>(-
bPhi_[
step - 1]).to_float(),
383 int phiNew = ap_fixed<BITSPHI, BITSPHI>(
phi + phi11 + phi12);
386 ap_fixed<BITSCURV, BITSCURV> phiB11 = ap_fixed<BITSPARAM, 1>(
aPhiB_[
step - 1]) * ap_fixed<BITSCURV, BITSCURV>(K);
387 ap_fixed<BITSPHIB + 1, BITSPHIB + 1> phiB12 =
388 ap_ufixed<BITSPARAM + 1, 1>(
bPhiB_[
step - 1]) * ap_fixed<BITSPHIB, BITSPHIB>(phiB);
389 int phiBNew = ap_fixed<13, 13>(phiB11 + phiB12);
391 printf(
"phiB prop = %d * %f = %d, %d * %f = %d\n",
393 ap_fixed<BITSPARAM + 1, 2>(
aPhiB_[
step - 1]).to_float(),
396 ap_ufixed<BITSPARAM + 1, 1>(
bPhiB_[
step - 1]).to_float(),
402 int addr = KBound / 2;
405 ap_fixed<12, 12> DXY;
410 phiBNew = ap_fixed<BITSPHIB, BITSPHIB>(DXY - ap_fixed<BITSPHIB, BITSPHIB>(phiB));
412 printf(
"Vertex phiB prop = %d - %d = %d\n", DXY.to_int(), ap_fixed<BITSPHIB, BITSPHIB>(phiB).to_int(), phiBNew);
436 ROOT::Math::SMatrix<double, 3>
P(
a, 9);
438 const std::vector<double>& covLine =
track.covariance();
440 cov = ROOT::Math::Similarity(
P, cov);
446 std::vector<double>
b(6);
459 printf(
"Covariance term for phiB = %f\n", cov(2, 2));
460 printf(
"Multiple scattering term for phiB = %f\n", MS(2, 2));
463 track.setCovariance(cov);
464 track.setCoordinates(
step - 1, KNew, phiNew, phiBNew);
480 int trackK =
track.curvature();
482 int trackPhiB =
track.bendingAngle();
489 residual[1] = phiB - trackPhiB;
503 if (stub->quality() < 4)
508 const std::vector<double>& covLine =
track.covariance();
517 track.step(), fabs(trackK),
Gain(0, 0),
Gain(0, 1),
Gain(1, 0),
Gain(1, 1),
Gain(2, 0),
Gain(2, 1));
519 int KNew = (trackK +
int(
Gain(0, 0) * residual(0) +
Gain(0, 1) * residual(1)));
520 if (fabs(KNew) > 8192)
524 int phiBNew =
wrapAround(trackPhiB +
int(
Gain(2, 0) * residual(0) +
Gain(2, 1) * residual(1)), 4096);
526 track.setResidual(stub->stNum() - 1, fabs(
phi - phiNew) + fabs(phiB - phiBNew) / 8);
529 printf(
"residual %d - %d = %d %d - %d = %d\n",
phi,
trackPhi,
int(residual[0]), phiB, trackPhiB,
int(residual[1]));
530 printf(
"Gains offline: %f %f %f %f\n",
Gain(0, 0),
Gain(0, 1),
Gain(2, 0),
Gain(2, 1));
531 printf(
" K = %d + %f * %f + %f * %f\n", trackK,
Gain(0, 0), residual(0),
Gain(0, 1), residual(1));
532 printf(
" phiB = %d + %f * %f + %f * %f\n", trackPhiB,
Gain(2, 0), residual(0),
Gain(2, 1), residual(1));
535 track.setCoordinates(
track.step(), KNew, phiNew, phiBNew);
539 c(0, 0) = covNew(0, 0);
540 c(0, 1) = covNew(0, 1);
541 c(0, 2) = covNew(0, 2);
542 c(1, 0) = covNew(1, 0);
543 c(1, 1) = covNew(1, 1);
544 c(1, 2) = covNew(1, 2);
545 c(2, 0) = covNew(2, 0);
546 c(2, 1) = covNew(2, 1);
547 c(2, 2) = covNew(2, 2);
549 printf(
"Post Fit Covariance Matrix %f %f %f\n", cov(0, 0), cov(1, 1), cov(2, 2));
560 int trackK =
track.curvature();
562 int trackPhiB =
track.bendingAngle();
569 printf(
"residuals %d - %d = %d\n",
phi,
trackPhi,
int(residual));
576 const std::vector<double>& covLine =
track.covariance();
585 track.setKalmanGain(
track.step(), fabs(trackK),
Gain(0, 0), 0.0,
Gain(1, 0), 0.0,
Gain(2, 0), 0.0);
587 printf(
"Gains: %f %f\n",
Gain(0, 0),
Gain(2, 0));
591 int phiBNew =
wrapAround(trackPhiB +
int(
Gain(2, 0) * residual), 4096);
592 track.setCoordinates(
track.step(), KNew, phiNew, phiBNew);
597 printf(
"phiUpdate: %d %d\n",
int(
Gain(0, 0) * residual),
int(
Gain(2, 0) * residual));
600 c(0, 0) = covNew(0, 0);
601 c(0, 1) = covNew(0, 1);
602 c(0, 2) = covNew(0, 2);
603 c(1, 0) = covNew(1, 0);
604 c(1, 1) = covNew(1, 1);
605 c(1, 2) = covNew(1, 2);
606 c(2, 0) = covNew(2, 0);
607 c(2, 1) = covNew(2, 1);
608 c(2, 2) = covNew(2, 2);
620 int trackK =
track.curvature();
622 int trackPhiB =
track.bendingAngle();
628 ap_fixed<BITSPHI + 1, BITSPHI + 1> residualPhi =
phi -
trackPhi;
629 ap_fixed<BITSPHIB + 1, BITSPHIB + 1> residualPhiB = phiB - trackPhiB;
632 printf(
"residual %d - %d = %d %d - %d = %d\n",
635 residualPhi.to_int(),
638 residualPhiB.to_int());
640 uint absK = fabs(trackK);
644 std::vector<float> GAIN;
655 printf(
"Gains (fp): %f %f %f %f\n", GAIN[0], GAIN[1], GAIN[2], GAIN[3]);
657 printf(
"Addr=%d gain0=%f gain4=-%f\n",
659 ap_ufixed<GAIN_0, GAIN_0INT>(GAIN[0]).to_float(),
660 ap_ufixed<GAIN_4, GAIN_4INT>(GAIN[2]).to_float());
662 printf(
"Addr=%d %f -%f %f %f\n",
664 ap_fixed<GAIN2_0, GAIN2_0INT>(GAIN[0]).to_float(),
665 ap_ufixed<GAIN2_1, GAIN2_1INT>(GAIN[1]).to_float(),
666 ap_ufixed<GAIN2_4, GAIN2_4INT>(GAIN[2]).to_float(),
667 ap_ufixed<GAIN2_5, GAIN2_5INT>(GAIN[3]).to_float());
670 track.setKalmanGain(
track.step(), fabs(trackK), GAIN[0], GAIN[1], 1, 0, GAIN[2], GAIN[3]);
674 KNew = ap_fixed<BITSPHI + 9, BITSPHI + 9>(ap_fixed<BITSCURV, BITSCURV>(trackK) +
675 ap_ufixed<GAIN_0, GAIN_0INT>(GAIN[0]) * residualPhi);
677 ap_fixed<BITSPHI + 7, BITSPHI + 7> k11 = ap_fixed<GAIN2_0, GAIN2_0INT>(GAIN[0]) * residualPhi;
678 ap_fixed<BITSPHIB + 4, BITSPHIB + 4> k12 = ap_ufixed<GAIN2_1, GAIN2_1INT>(GAIN[1]) * residualPhiB;
679 KNew = ap_fixed<BITSPHI + 9, BITSPHI + 9>(ap_fixed<BITSCURV, BITSCURV>(trackK) + k11 - k12);
681 if (fabs(KNew) >= 8191)
687 ap_fixed<BITSPHI + 5, BITSPHI + 5> pbdouble_0 = ap_ufixed<GAIN2_4, GAIN2_4INT>(GAIN[2]) * residualPhi;
688 ap_fixed<BITSPHIB + 24, BITSPHIB + 4> pb_1 = ap_ufixed<GAIN2_5, GAIN2_5INT>(GAIN[3]) * residualPhiB;
689 ap_fixed<BITSPHI + 9, BITSPHI + 5> pb_0 = ap_ufixed<GAIN_4, GAIN_4INT>(GAIN[2]) * residualPhi;
692 printf(
"phiupdate %f %f %f\n", pb_0.to_float(), pb_1.to_float(), pbdouble_0.to_float());
697 phiBNew = ap_fixed<BITSPHI + 8, BITSPHI + 8>(ap_fixed<BITSPHIB, BITSPHIB>(trackPhiB) -
698 ap_ufixed<GAIN_4, GAIN_4INT>(GAIN[2]) * residualPhi);
700 if (fabs(phiBNew) >= 4095)
703 phiBNew = ap_fixed<BITSPHI + 7, BITSPHI + 7>(ap_fixed<BITSPHIB, BITSPHIB>(trackPhiB) + pb_1 - pbdouble_0);
704 if (fabs(phiBNew) >= 4095)
707 track.setCoordinates(
track.step(), KNew, phiNew, phiBNew);
723 double residual = -
track.dxy();
729 const std::vector<double>& covLine =
track.covariance();
738 printf(
"sigma3=%f sigma6=%f\n", cov(0, 3), cov(3, 3));
739 printf(
" K = %d + %f * %f\n",
track.curvature(),
Gain(0, 0), residual);
746 printf(
"Post fit impact parameter=%d\n", dxyNew);
747 track.setCoordinatesAtVertex(KNew, phiNew, -residual);
750 c(0, 0) = covNew(0, 0);
751 c(0, 1) = covNew(0, 1);
752 c(0, 2) = covNew(0, 2);
753 c(1, 0) = covNew(1, 0);
754 c(1, 1) = covNew(1, 1);
755 c(1, 2) = covNew(1, 2);
756 c(2, 0) = covNew(2, 0);
757 c(2, 1) = covNew(2, 1);
758 c(2, 2) = covNew(2, 2);
764 double residual = -
track.dxy();
770 track.setKalmanGain(
track.step(), fabs(
track.curvature()), GAIN.first, GAIN.second, -1);
772 ap_fixed<BITSCURV, BITSCURV> k_0 =
773 -(ap_ufixed<GAIN_V0, GAIN_V0INT>(fabs(GAIN.first))) * ap_fixed<BITSPHIB, BITSPHIB>(residual);
774 int KNew = ap_fixed<BITSCURV, BITSCURV>(k_0 + ap_fixed<BITSCURV, BITSCURV>(
track.curvature()));
777 printf(
"VERTEX GAIN(%d)= -%f * %d = %d\n",
779 ap_ufixed<GAIN_V0, GAIN_V0INT>(fabs(GAIN.first)).to_float(),
780 ap_fixed<BITSPHIB, BITSPHIB>(residual).to_int(),
784 int p_0 =
fp_product(GAIN.second,
int(residual), 7);
786 track.setCoordinatesAtVertex(KNew, phiNew, -residual);
792 if (
track.hasFineEta())
793 etaINT =
track.fineEta();
795 etaINT =
track.coarseEta();
798 double lsbEta = 0.010875;
802 if (
track.curvatureAtVertex() < 0)
804 double pt = double(
ptLUT(
track.curvatureAtVertex())) / 2.0;
808 double eta = etaINT * lsbEta;
812 K =
track.curvatureAtMuon();
817 K = 46 * K / fabs(K);
818 double pt = 1.0 / (
lsb * fabs(K));
828 std::vector<int> combinatorics;
830 switch (
seed->stNum()) {
847 printf(
"Something really bad happend\n");
851 seedQual =
seed->quality();
852 for (
const auto&
mask : combinatorics) {
859 charge = phiB / fabs(phiB);
862 if (
track.step() == 4 && (fabs(
seed->phiB()) > 15))
863 address =
charge * 15 * 8;
865 if (
track.step() == 3 && (fabs(
seed->phiB()) > 30))
866 address =
charge * 30 * 8;
867 if (
track.step() == 2 && (fabs(
seed->phiB()) > 127))
868 address =
charge * 127 * 8;
876 if (
seed->quality() < 4) {
884 float DK = 512 * 512.;
885 covariance(0, 0) = DK;
886 covariance(0, 1) = 0;
887 covariance(0, 2) = 0;
888 covariance(1, 0) = 0;
890 covariance(1, 2) = 0;
891 covariance(2, 0) = 0;
892 covariance(2, 1) = 0;
896 if (
seed->quality() < 4)
901 track.setCovariance(covariance);
905 printf(
"New Kalman fit staring at step=%d, phi=%d,phiB=%d with curvature=%d\n",
907 track.positionAngle(),
908 track.bendingAngle(),
911 for (
unsigned int i = 0;
i < 4; ++
i)
914 printf(
"------------------------------------------------------\n");
915 printf(
"------------------------------------------------------\n");
916 printf(
"------------------------------------------------------\n");
918 for (
const auto& stub : stubs)
919 printf(
"station=%d phi=%d phiB=%d qual=%d tag=%d sector=%d wheel=%d fineEta= %d %d\n",
929 printf(
"------------------------------------------------------\n");
930 printf(
"------------------------------------------------------\n");
933 int phiAtStation2 = 0;
935 while (
track.step() > 0) {
937 if (
track.step() == 1) {
949 printf(
"Unconstrained PT in Muon System: pt=%f\n",
track.ptUnconstrained());
954 printf(
"propagated Coordinates step:%d,phi=%d,phiB=%d,K=%d\n",
956 track.positionAngle(),
957 track.bendingAngle(),
960 if (
track.step() > 0)
962 std::pair<bool, uint> bestStub =
match(
seed, stubs,
track.step());
963 if ((!bestStub.first) || (!
update(
track, stubs[bestStub.second],
mask, seedQual)))
966 printf(
"updated Coordinates step:%d,phi=%d,phiB=%d,K=%d\n",
968 track.positionAngle(),
969 track.bendingAngle(),
974 if (
track.step() == 0) {
977 printf(
" Coordinates before vertex constraint step:%d,phi=%d,dxy=%d,K=%d\n",
981 track.curvatureAtVertex());
983 printf(
"Chi Square = %d\n",
track.approxChi2());
988 printf(
" Coordinates after vertex constraint step:%d,phi=%d,dxy=%d,K=%d maximum local chi2=%d\n",
992 track.curvatureAtVertex(),
994 printf(
"------------------------------------------------------\n");
995 printf(
"------------------------------------------------------\n");
999 track.setCoordinatesAtMuon(
track.curvatureAtMuon(), phiAtStation2,
track.phiBAtMuon());
1002 printf(
"Floating point coordinates at vertex: pt=%f, eta=%f phi=%f\n",
track.pt(),
track.eta(),
track.phi());
1003 pretracks.push_back(
track);
1011 if (!cleaned.empty()) {
1012 return std::make_pair(
true, cleaned[0]);
1014 return std::make_pair(
false, nullTrack);
1020 int K =
track.curvatureAtMuon();
1028 for (
const auto& stub :
track.stubs()) {
1031 int diff1 =
wrapAround(stubCoords - coords, 1024);
1035 printf(
"Chi Square stub for track with pattern=%d coords=%d -> AK=%d stubCoords=%d diff=%d delta=%d\n",
1054 track.setApproxChi2(chi);
1064 int K =
track.curvatureAtVertex() >> 4;
1066 if (
track.stubs().size() != 2) {
1067 track.setTrackCompatibility(0);
1072 if (
track.stubs()[0]->quality() >
track.stubs()[1]->quality())
1077 printf(
"stubsel %d phi=%d phiB=%d\n", stubSel, stub->phi(), stub->phiB());
1086 ap_fixed<12, 12>
diff = ap_int<10>(stub->phiB()) -
1087 ap_ufixed<5, 1>(
trackComp_[stub->stNum() - 1]) * ap_fixed<BITSCURV - 4, BITSCURV - 4>(K);
1088 ap_ufixed<11, 11>
delta;
1101 printf(
"delta = %d = abs(%d - %f*%d\n",
delta.to_int(), stub->phiB(),
trackComp_[stub->stNum() - 1], K);
1102 printf(
"err = %d = %f + %f*%d\n",
1125 return 160 + (
track.stubs().size()) * 20 - chi;
1129 if (
value > maximum - 1)
1131 if (
value < -maximum)
1143 }
else if (
sector == 1) {
1162 }
else if (
sector == 1) {
1179 std::map<int, int>
out;
1182 if (
track.wheel() == -2)
1184 else if (
track.wheel() == -1)
1186 else if (
track.wheel() == 0)
1188 else if (
track.wheel() == 1)
1190 else if (
track.wheel() == 2)
1204 for (
const auto& stub :
track.stubs()) {
1205 bool ownwheel = stub->whNum() ==
track.wheel();
1207 if ((stub->scNum() ==
track.sector() + 1) || (stub->scNum() == 0 &&
track.sector() == 11))
1209 if ((stub->scNum() ==
track.sector() - 1) || (stub->scNum() == 11 &&
track.sector() == 0))
1213 if (stub->stNum() == 4) {
1220 if (stub->stNum() == 3) {
1223 if (stub->stNum() == 2) {
1226 if (stub->stNum() == 1) {
1249 return (
long((
a * (1 <<
bits)) *
b)) >>
bits;
1253 int charge = (K >= 0) ? +1 : -1;
1265 FK = .8569 * FK / (1.0 + 0.1144 * FK);
1267 FK = FK -
charge * 1.23e-03;
1287 std::map<uint, int> infoRank;
1288 std::map<uint, L1MuKBMTrack> infoTrack;
1289 for (
uint i = 3;
i <= 15; ++
i) {
1290 if (
i == 4 ||
i == 8)
1303 int sel6 = infoRank[10] >= infoRank[12] ? 10 : 12;
1304 int sel5 = infoRank[14] >= infoRank[9] ? 14 : 9;
1305 int sel4 = infoRank[11] >= infoRank[13] ? 11 : 13;
1306 int sel3 = infoRank[sel6] >= infoRank[sel5] ? sel6 : sel5;
1307 int sel2 = infoRank[sel4] >= infoRank[sel3] ? sel4 : sel3;
1308 selected = infoRank[15] >= infoRank[sel2] ? 15 : sel2;
1312 int sel2 = infoRank[5] >= infoRank[6] ? 5 : 6;
1313 selected = infoRank[7] >= infoRank[sel2] ? 7 : sel2;
1318 auto search = infoTrack.find(selected);
1319 if (
search != infoTrack.end())
1326 if (stub->qeta1() != 0 && stub->qeta2() != 0) {
1329 if (stub->qeta1() == 0) {
1333 return (stub->qeta1());
1345 for (
unsigned int i = 0;
i <
track.stubs().size(); ++
i) {
1346 if (fabs(
track.stubs()[
i]->whNum()) != awheel)
1354 for (
const auto& stub :
track.stubs()) {
1360 sums +=
rank * stub->eta1();
1364 if (sumweights == 1)
1366 else if (sumweights == 2)
1368 else if (sumweights == 3)
1370 else if (sumweights == 4)
1372 else if (sumweights == 5)
1374 else if (sumweights == 6)
1394 for (
const auto& stub :
track.stubs())
1395 if (stub->stNum() == 2)
1398 ap_fixed<BITSPHI, BITSPHI>
phi =
track.phiAtMuon();
1399 ap_fixed<BITSPHIB, BITSPHIB> phiB =
track.phiBAtMuon();
1401 int phiNew = ap_fixed<BITSPHI + 1, BITSPHI + 1, AP_TRN_ZERO, AP_SAT>(
phi +
phiAt2 * phiB);
1404 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_
std::map< int, int > trackAddress(const L1MuKBMTrack &, int &)
std::vector< double > pointResolutionPhiBL_