15 debug_ =
pset.getUntrackedParameter<
bool>(
"debug");
16 clean_chi2_correlation_ =
pset.getUntrackedParameter<
bool>(
"clean_chi2_correlation");
17 use_LSB_ =
pset.getUntrackedParameter<
bool>(
"use_LSB");
18 tanPsi_precision_ =
pset.getUntrackedParameter<
double>(
"tanPsi_precision");
19 x_precision_ =
pset.getUntrackedParameter<
double>(
"x_precision");
20 useBX_correlation_ =
pset.getUntrackedParameter<
bool>(
"useBX_correlation");
21 allow_confirmation_ =
pset.getUntrackedParameter<
bool>(
"allow_confirmation");
22 dT0_correlate_TP_ =
pset.getUntrackedParameter<
double>(
"dT0_correlate_TP");
23 dBX_correlate_TP_ =
pset.getUntrackedParameter<
int>(
"dBX_correlate_TP");
24 dTanPsi_correlate_TP_ =
pset.getUntrackedParameter<
double>(
"dTanPsi_correlate_TP");
25 minx_match_2digis_ =
pset.getUntrackedParameter<
double>(
"minx_match_2digis");
26 chi2corTh_ =
pset.getUntrackedParameter<
double>(
"chi2corTh");
29 LogDebug(
"MuonPathAssociator") <<
"MuonPathAssociator: constructor";
34 std::ifstream ifin3(shift_filename_.fullPath());
38 <<
"MuonPathAnalyzerPerSL::MuonPathAnalyzerPerSL() - Cannot find " << shift_filename_.fullPath();
40 while (ifin3.good()) {
41 ifin3 >> rawId >>
shift;
42 shiftinfo_[rawId] =
shift;
50 LogDebug(
"MuonPathAssociator") <<
"MuonPathAssociator: destructor";
58 LogDebug(
"MuonPathAssociator") <<
"MuonPathAssociator::initialiase";
61 dtGeo_ = &
geom.get(dtGeomH_);
67 std::vector<metaPrimitive> &inMPaths,
68 std::vector<metaPrimitive> &outMPaths) {
69 if (dT0_correlate_TP_)
70 correlateMPaths(digis, inMPaths, outMPaths);
72 outMPaths.insert(outMPaths.end(), inMPaths.begin(), inMPaths.end());
78 LogDebug(
"MuonPathAssociator") <<
"MuonPathAssociator: finish";
82 std::vector<metaPrimitive> &inMPaths,
83 std::vector<metaPrimitive> &outMPaths) {
84 int x_prec_inv = (
int)(1. / (10. * x_precision_));
90 LogDebug(
"MuonPathAssociator") <<
"starting correlation";
92 for (
int wh = -2; wh <= 2; wh++) {
93 for (
int st = 1; st <= 4; st++) {
94 for (
int se = 1; se <= 14; se++) {
95 if (se >= 13 && st != 4)
103 std::vector<metaPrimitive> SL1metaPrimitives;
104 for (
const auto &metaprimitiveIt : inMPaths) {
105 if (metaprimitiveIt.rawId == sl1Id.
rawId())
106 SL1metaPrimitives.push_back(metaprimitiveIt);
110 std::vector<metaPrimitive> SL3metaPrimitives;
111 for (
const auto &metaprimitiveIt : inMPaths) {
112 if (metaprimitiveIt.rawId == sl3Id.
rawId())
113 SL3metaPrimitives.push_back(metaprimitiveIt);
116 if (SL1metaPrimitives.empty() and SL3metaPrimitives.empty())
120 LogDebug(
"MuonPathAssociator") <<
"correlating " << SL1metaPrimitives.size() <<
" metaPrim in SL1 and "
121 << SL3metaPrimitives.size() <<
" in SL3 for " << sl3Id;
123 bool at_least_one_correlation =
false;
124 bool at_least_one_SL1_confirmation =
false;
125 bool at_least_one_SL3_confirmation =
false;
127 bool useFitSL1[SL1metaPrimitives.size()];
128 for (
unsigned int i = 0;
i < SL1metaPrimitives.size();
i++)
129 useFitSL1[
i] =
false;
130 bool useFitSL3[SL3metaPrimitives.size()];
131 for (
unsigned int i = 0;
i < SL3metaPrimitives.size();
i++)
132 useFitSL3[
i] =
false;
135 vector<metaPrimitive> chamberMetaPrimitives;
136 vector<metaPrimitive> confirmedMetaPrimitives;
137 vector<metaPrimitive> normalMetaPrimitives;
140 for (
auto SL1metaPrimitive = SL1metaPrimitives.begin(); SL1metaPrimitive != SL1metaPrimitives.end();
141 ++SL1metaPrimitive, sl1++, sl3 = -1) {
142 if (clean_chi2_correlation_)
143 at_least_one_correlation =
false;
144 for (
auto SL3metaPrimitive = SL3metaPrimitives.begin(); SL3metaPrimitive != SL3metaPrimitives.end();
145 ++SL3metaPrimitive, sl3++) {
146 if (
std::abs(SL1metaPrimitive->tanPhi - SL3metaPrimitive->tanPhi) > dTanPsi_correlate_TP_)
148 if (useBX_correlation_) {
150 round(SL3metaPrimitive->t0 / (
float)
LHC_CLK_FREQ)) > dBX_correlate_TP_)
153 if (
std::abs(SL1metaPrimitive->t0 - SL3metaPrimitive->t0) >= dT0_correlate_TP_)
156 long int PosSL1 = (
int)round(10 * SL1metaPrimitive->x / (10 * x_precision_));
157 long int PosSL3 = (
int)round(10 * SL3metaPrimitive->x / (10 * x_precision_));
158 double NewSlope = -999.;
160 long int newConstant = (
int)(139.5 * 4);
161 long int difPos_mm_x4 = PosSL3 - PosSL1;
162 long int tanPsi_x4096_x128 = (difPos_mm_x4)*newConstant;
163 long int tanPsi_x4096 = tanPsi_x4096_x128 / ((
long int)
pow(2, 5 + numberOfBits));
164 if (tanPsi_x4096 < 0 && tanPsi_x4096_x128 % ((
long int)
pow(2, 5 + numberOfBits)) != 0)
166 NewSlope = -tanPsi_x4096 * tanPsi_precision_;
168 double MeanT0 = (SL1metaPrimitive->t0 + SL3metaPrimitive->t0) / 2;
169 double MeanPos = (PosSL3 + PosSL1) / (2. / (x_precision_));
171 MeanPos = floor(round(10. * (MeanPos / x_precision_)) * 0.1) * x_precision_;
179 int wi[8], tdc[8], lat[8];
180 wi[0] = SL1metaPrimitive->wi1;
181 tdc[0] = SL1metaPrimitive->tdc1;
182 lat[0] = SL1metaPrimitive->lat1;
183 wi[1] = SL1metaPrimitive->wi2;
184 tdc[1] = SL1metaPrimitive->tdc2;
185 lat[1] = SL1metaPrimitive->lat2;
186 wi[2] = SL1metaPrimitive->wi3;
187 tdc[2] = SL1metaPrimitive->tdc3;
188 lat[2] = SL1metaPrimitive->lat3;
189 wi[3] = SL1metaPrimitive->wi4;
190 tdc[3] = SL1metaPrimitive->tdc4;
191 lat[3] = SL1metaPrimitive->lat4;
192 wi[4] = SL3metaPrimitive->wi1;
193 tdc[4] = SL3metaPrimitive->tdc1;
194 lat[4] = SL3metaPrimitive->lat1;
195 wi[5] = SL3metaPrimitive->wi2;
196 tdc[5] = SL3metaPrimitive->tdc2;
197 lat[5] = SL3metaPrimitive->lat2;
198 wi[6] = SL3metaPrimitive->wi3;
199 tdc[6] = SL3metaPrimitive->tdc3;
200 lat[6] = SL3metaPrimitive->lat3;
201 wi[7] = SL3metaPrimitive->wi4;
202 tdc[7] = SL3metaPrimitive->tdc4;
203 lat[7] = SL3metaPrimitive->lat4;
207 long int CH_CENTER_TO_MID_SL_P = (
long int)(117.5 * 4);
208 long int Z_FACTOR_CORR[8] = {-6, -2, 2, 6, -6, -2, 2, 6};
210 for (
int i = 0;
i < 8;
i++) {
211 int sign = 2 * (
i / 4) - 1;
212 Z_FACTOR_CORR[
i] = Z_FACTOR_CORR[
i] *
CELL_HEIGHT + CH_CENTER_TO_MID_SL_P *
sign;
214 long int sum_A, sum_B;
215 for (
int i = 0;
i < 8;
i++) {
216 long int shift, slTime;
218 shift = round(shiftinfo_[wireId1.
rawId()] / x_precision_);
219 slTime = SL1metaPrimitive->t0;
221 shift = round(shiftinfo_[wireId3.
rawId()] / x_precision_);
222 slTime = SL3metaPrimitive->t0;
225 long int drift_speed_new = 889;
226 long int drift_dist_um_x4 = drift_speed_new * (((
long int)tdc[
i]) - slTime);
227 long int wireHorizPos_x4 = (42 * wi[
i] + ((
i + 1) % 2) * 21) / (10 * x_precision_);
231 pos_mm_x4 = wireHorizPos_x4 - (drift_dist_um_x4 >> 10);
233 pos_mm_x4 = wireHorizPos_x4 + (drift_dist_um_x4 >> 10);
235 sum_A =
shift + pos_mm_x4 - (
long int)round(MeanPos / x_precision_);
236 sum_A = sum_A << (14 - numberOfBits);
237 sum_B = Z_FACTOR_CORR[
i] * (
long int)round(-NewSlope / tanPsi_precision_);
238 chi2 += ((sum_A - sum_B) * (sum_A - sum_B)) >> 2;
242 double newChi2 = (double)(
chi2 >> 16) / (1024. * 100.);
244 if (newChi2 > chi2corTh_)
248 useFitSL1[sl1] =
true;
249 useFitSL3[sl3] =
true;
252 if (SL3metaPrimitive->quality <= 2 and SL1metaPrimitive->quality <= 2)
255 if ((SL3metaPrimitive->quality >= 3 && SL1metaPrimitive->quality <= 2)
or
256 (SL1metaPrimitive->quality >= 3 && SL3metaPrimitive->quality <= 2))
259 if (SL3metaPrimitive->quality >= 3 && SL1metaPrimitive->quality >= 3)
263 if (
ChId.station() >= 3)
267 int thisec =
ChId.sector();
272 double phi = jm_x_cmssw_global.
phi() - 0.5235988 * (thisec - 1);
273 double psi = atan(NewSlope);
274 double phiB = hasPosRF(
ChId.wheel(),
ChId.sector()) ?
psi - phi : -
psi - phi;
276 if (!clean_chi2_correlation_)
277 outMPaths.emplace_back(
ChId.rawId(),
285 SL1metaPrimitive->wi1,
286 SL1metaPrimitive->tdc1,
287 SL1metaPrimitive->lat1,
288 SL1metaPrimitive->wi2,
289 SL1metaPrimitive->tdc2,
290 SL1metaPrimitive->lat2,
291 SL1metaPrimitive->wi3,
292 SL1metaPrimitive->tdc3,
293 SL1metaPrimitive->lat3,
294 SL1metaPrimitive->wi4,
295 SL1metaPrimitive->tdc4,
296 SL1metaPrimitive->lat4,
297 SL3metaPrimitive->wi1,
298 SL3metaPrimitive->tdc1,
299 SL3metaPrimitive->lat1,
300 SL3metaPrimitive->wi2,
301 SL3metaPrimitive->tdc2,
302 SL3metaPrimitive->lat2,
303 SL3metaPrimitive->wi3,
304 SL3metaPrimitive->tdc3,
305 SL3metaPrimitive->lat3,
306 SL3metaPrimitive->wi4,
307 SL3metaPrimitive->tdc4,
308 SL3metaPrimitive->lat4);
310 chamberMetaPrimitives.emplace_back(
ChId.rawId(),
318 SL1metaPrimitive->wi1,
319 SL1metaPrimitive->tdc1,
320 SL1metaPrimitive->lat1,
321 SL1metaPrimitive->wi2,
322 SL1metaPrimitive->tdc2,
323 SL1metaPrimitive->lat2,
324 SL1metaPrimitive->wi3,
325 SL1metaPrimitive->tdc3,
326 SL1metaPrimitive->lat3,
327 SL1metaPrimitive->wi4,
328 SL1metaPrimitive->tdc4,
329 SL1metaPrimitive->lat4,
330 SL3metaPrimitive->wi1,
331 SL3metaPrimitive->tdc1,
332 SL3metaPrimitive->lat1,
333 SL3metaPrimitive->wi2,
334 SL3metaPrimitive->tdc2,
335 SL3metaPrimitive->lat2,
336 SL3metaPrimitive->wi3,
337 SL3metaPrimitive->tdc3,
338 SL3metaPrimitive->lat3,
339 SL3metaPrimitive->wi4,
340 SL3metaPrimitive->tdc4,
341 SL3metaPrimitive->lat4);
343 at_least_one_correlation =
true;
346 if (at_least_one_correlation ==
false &&
347 allow_confirmation_ ==
true) {
348 int matched_digis = 0;
349 double minx = minx_match_2digis_;
350 double min2x = minx_match_2digis_;
361 for (
const auto &dtLayerId_It : *dtdigis) {
362 const DTLayerId dtLId = dtLayerId_It.first;
367 if (dtLId.
layer() == 4)
369 else if (dtLId.
layer() == 3)
371 else if (dtLId.
layer() == 2)
373 else if (dtLId.
layer() == 1)
375 double x_inSL3 = SL1metaPrimitive->x - SL1metaPrimitive->tanPhi * (23.5 + l_shift);
376 for (
auto digiIt = (dtLayerId_It.second).first; digiIt != (dtLayerId_It.second).
second; ++digiIt) {
377 DTWireId wireId(dtLId, (*digiIt).wire());
378 int x_wire = shiftinfo_[wireId.rawId()] + ((*digiIt).time() - SL1metaPrimitive->t0) * 0.00543;
379 int x_wire_left = shiftinfo_[wireId.rawId()] - ((*digiIt).time() - SL1metaPrimitive->t0) * 0.00543;
382 x_wire = x_wire_left;
385 if (
std::abs(x_inSL3 - x_wire) < minx) {
387 next_wire = best_wire;
389 next_layer = best_layer;
392 best_wire = (*digiIt).wire();
393 best_tdc = (*digiIt).time();
394 best_layer = dtLId.
layer();
397 }
else if ((
std::abs(x_inSL3 - x_wire) >= minx) && (
std::abs(x_inSL3 - x_wire) < min2x)) {
399 next_wire = (*digiIt).wire();
400 next_tdc = (*digiIt).time();
401 next_layer = dtLId.
layer();
407 if (matched_digis >= 2 and best_layer != -1 and next_layer != -1) {
409 if (SL1metaPrimitive->quality <= 2)
425 if (next_layer == 1) {
430 if (next_layer == 2) {
435 if (next_layer == 3) {
440 if (next_layer == 4) {
446 if (best_layer == 1) {
451 if (best_layer == 2) {
456 if (best_layer == 3) {
461 if (best_layer == 4) {
467 if (!clean_chi2_correlation_)
469 SL1metaPrimitive->t0,
471 SL1metaPrimitive->tanPhi,
472 SL1metaPrimitive->phi,
473 SL1metaPrimitive->phiB,
474 SL1metaPrimitive->chi2,
476 SL1metaPrimitive->wi1,
477 SL1metaPrimitive->tdc1,
478 SL1metaPrimitive->lat1,
479 SL1metaPrimitive->wi2,
480 SL1metaPrimitive->tdc2,
481 SL1metaPrimitive->lat2,
482 SL1metaPrimitive->wi3,
483 SL1metaPrimitive->tdc3,
484 SL1metaPrimitive->lat3,
485 SL1metaPrimitive->wi4,
486 SL1metaPrimitive->tdc4,
487 SL1metaPrimitive->lat4,
503 SL1metaPrimitive->t0,
505 SL1metaPrimitive->tanPhi,
506 SL1metaPrimitive->phi,
507 SL1metaPrimitive->phiB,
508 SL1metaPrimitive->chi2,
510 SL1metaPrimitive->wi1,
511 SL1metaPrimitive->tdc1,
512 SL1metaPrimitive->lat1,
513 SL1metaPrimitive->wi2,
514 SL1metaPrimitive->tdc2,
515 SL1metaPrimitive->lat2,
516 SL1metaPrimitive->wi3,
517 SL1metaPrimitive->tdc3,
518 SL1metaPrimitive->lat3,
519 SL1metaPrimitive->wi4,
520 SL1metaPrimitive->tdc4,
521 SL1metaPrimitive->lat4,
535 useFitSL1[sl1] =
true;
536 at_least_one_SL1_confirmation =
true;
545 for (
auto SL3metaPrimitive = SL3metaPrimitives.begin(); SL3metaPrimitive != SL3metaPrimitives.end();
546 ++SL3metaPrimitive, sl3++) {
549 if ((at_least_one_correlation ==
false || clean_chi2_correlation_) &&
550 allow_confirmation_) {
552 int matched_digis = 0;
553 double minx = minx_match_2digis_;
554 double min2x = minx_match_2digis_;
565 for (
const auto &dtLayerId_It : *dtdigis) {
566 const DTLayerId dtLId = dtLayerId_It.first;
571 if (dtLId.
layer() == 4)
573 if (dtLId.
layer() == 3)
575 if (dtLId.
layer() == 2)
577 if (dtLId.
layer() == 1)
579 double x_inSL1 = SL3metaPrimitive->x + SL3metaPrimitive->tanPhi * (23.5 - l_shift);
580 for (
auto digiIt = (dtLayerId_It.second).first; digiIt != (dtLayerId_It.second).
second; ++digiIt) {
581 DTWireId wireId(dtLId, (*digiIt).wire());
582 int x_wire = shiftinfo_[wireId.rawId()] + ((*digiIt).time() - SL3metaPrimitive->t0) * 0.00543;
583 int x_wire_left = shiftinfo_[wireId.rawId()] - ((*digiIt).time() - SL3metaPrimitive->t0) * 0.00543;
586 x_wire = x_wire_left;
589 if (
std::abs(x_inSL1 - x_wire) < minx) {
591 next_wire = best_wire;
593 next_layer = best_layer;
596 best_wire = (*digiIt).wire();
597 best_tdc = (*digiIt).time();
598 best_layer = dtLId.
layer();
601 }
else if ((
std::abs(x_inSL1 - x_wire) >= minx) && (
std::abs(x_inSL1 - x_wire) < min2x)) {
603 next_wire = (*digiIt).wire();
604 next_tdc = (*digiIt).time();
605 next_layer = dtLId.
layer();
611 if (matched_digis >= 2 and best_layer != -1 and next_layer != -1) {
613 if (SL3metaPrimitive->quality <= 2)
629 if (next_layer == 1) {
634 if (next_layer == 2) {
639 if (next_layer == 3) {
644 if (next_layer == 4) {
650 if (best_layer == 1) {
655 if (best_layer == 2) {
660 if (best_layer == 3) {
665 if (best_layer == 4) {
671 if (!clean_chi2_correlation_)
673 SL3metaPrimitive->t0,
675 SL3metaPrimitive->tanPhi,
676 SL3metaPrimitive->phi,
677 SL3metaPrimitive->phiB,
678 SL3metaPrimitive->chi2,
692 SL3metaPrimitive->wi1,
693 SL3metaPrimitive->tdc1,
694 SL3metaPrimitive->lat1,
695 SL3metaPrimitive->wi2,
696 SL3metaPrimitive->tdc2,
697 SL3metaPrimitive->lat2,
698 SL3metaPrimitive->wi3,
699 SL3metaPrimitive->tdc3,
700 SL3metaPrimitive->lat3,
701 SL3metaPrimitive->wi4,
702 SL3metaPrimitive->tdc4,
703 SL3metaPrimitive->lat4,
707 SL3metaPrimitive->t0,
709 SL3metaPrimitive->tanPhi,
710 SL3metaPrimitive->phi,
711 SL3metaPrimitive->phiB,
712 SL3metaPrimitive->chi2,
726 SL3metaPrimitive->wi1,
727 SL3metaPrimitive->tdc1,
728 SL3metaPrimitive->lat1,
729 SL3metaPrimitive->wi2,
730 SL3metaPrimitive->tdc2,
731 SL3metaPrimitive->lat2,
732 SL3metaPrimitive->wi3,
733 SL3metaPrimitive->tdc3,
734 SL3metaPrimitive->lat3,
735 SL3metaPrimitive->wi4,
736 SL3metaPrimitive->tdc4,
737 SL3metaPrimitive->lat4,
739 useFitSL3[sl3] =
true;
740 at_least_one_SL3_confirmation =
true;
745 if (clean_chi2_correlation_) {
747 LogDebug(
"MuonPathAssociator") <<
"Pushing back correlated MPs to the MPs collection";
748 removeSharingFits(chamberMetaPrimitives, outMPaths);
750 if (clean_chi2_correlation_) {
752 LogDebug(
"MuonPathAssociator") <<
"Pushing back confirmed MPs to the complete vector";
753 removeSharingHits(confirmedMetaPrimitives, chamberMetaPrimitives, outMPaths);
757 if (at_least_one_correlation ==
false || clean_chi2_correlation_) {
758 if (debug_ && !at_least_one_correlation)
760 <<
"correlation we found zero correlations, adding both collections as they are to the outMPaths";
763 <<
"correlation sizes:" << SL1metaPrimitives.size() <<
" " << SL3metaPrimitives.size();
764 if (at_least_one_SL1_confirmation ==
false || clean_chi2_correlation_) {
766 for (
auto SL1metaPrimitive = SL1metaPrimitives.begin(); SL1metaPrimitive != SL1metaPrimitives.end();
767 ++SL1metaPrimitive, sl1++) {
774 SL1metaPrimitive->t0,
776 SL1metaPrimitive->tanPhi,
777 SL1metaPrimitive->phi,
778 SL1metaPrimitive->phiB,
779 SL1metaPrimitive->chi2,
780 SL1metaPrimitive->quality,
781 SL1metaPrimitive->wi1,
782 SL1metaPrimitive->tdc1,
783 SL1metaPrimitive->lat1,
784 SL1metaPrimitive->wi2,
785 SL1metaPrimitive->tdc2,
786 SL1metaPrimitive->lat2,
787 SL1metaPrimitive->wi3,
788 SL1metaPrimitive->tdc3,
789 SL1metaPrimitive->lat3,
790 SL1metaPrimitive->wi4,
791 SL1metaPrimitive->tdc4,
792 SL1metaPrimitive->lat4,
817 if (!clean_chi2_correlation_)
818 outMPaths.push_back(newSL1metaPrimitive);
820 normalMetaPrimitives.push_back(newSL1metaPrimitive);
823 if (at_least_one_SL3_confirmation ==
false || clean_chi2_correlation_) {
825 for (
auto SL3metaPrimitive = SL3metaPrimitives.begin(); SL3metaPrimitive != SL3metaPrimitives.end();
826 ++SL3metaPrimitive, sl3++) {
832 SL3metaPrimitive->t0,
834 SL3metaPrimitive->tanPhi,
835 SL3metaPrimitive->phi,
836 SL3metaPrimitive->phiB,
837 SL3metaPrimitive->chi2,
838 SL3metaPrimitive->quality,
851 SL3metaPrimitive->wi1,
852 SL3metaPrimitive->tdc1,
853 SL3metaPrimitive->lat1,
854 SL3metaPrimitive->wi2,
855 SL3metaPrimitive->tdc2,
856 SL3metaPrimitive->lat2,
857 SL3metaPrimitive->wi3,
858 SL3metaPrimitive->tdc3,
859 SL3metaPrimitive->lat3,
860 SL3metaPrimitive->wi4,
861 SL3metaPrimitive->tdc4,
862 SL3metaPrimitive->lat4,
865 if (!clean_chi2_correlation_)
866 outMPaths.push_back(newSL3metaPrimitive);
868 normalMetaPrimitives.push_back(newSL3metaPrimitive);
873 SL1metaPrimitives.clear();
874 SL1metaPrimitives.erase(SL1metaPrimitives.begin(), SL1metaPrimitives.end());
875 SL3metaPrimitives.clear();
876 SL3metaPrimitives.erase(SL3metaPrimitives.begin(), SL3metaPrimitives.end());
878 vector<metaPrimitive> auxMetaPrimitives;
879 if (clean_chi2_correlation_) {
881 LogDebug(
"MuonPathAssociator") <<
"Pushing back normal MPs to the auxiliar vector";
882 removeSharingHits(normalMetaPrimitives, confirmedMetaPrimitives, auxMetaPrimitives);
884 if (clean_chi2_correlation_) {
886 LogDebug(
"MuonPathAssociator") <<
"Pushing back normal MPs to the MPs collection";
887 removeSharingHits(auxMetaPrimitives, chamberMetaPrimitives, outMPaths);
895 bool useFit[chamberMPaths.size()];
896 for (
unsigned int i = 0;
i < chamberMPaths.size();
i++) {
899 for (
unsigned int i = 0;
i < chamberMPaths.size();
i++) {
901 LogDebug(
"MuonPathAssociator") <<
"Looking at prim" <<
i;
904 for (
unsigned int j =
i + 1;
j < chamberMPaths.size();
j++) {
906 LogDebug(
"MuonPathAssociator") <<
"Comparing with prim " <<
j;
928 printmPC(chamberMPaths[
i]);
929 allMPaths.push_back(chamberMPaths[
i]);
933 LogDebug(
"MuonPathAssociator") <<
"---Swapping chamber---";
937 std::vector<metaPrimitive> &secondMPaths,
938 std::vector<metaPrimitive> &allMPaths) {
939 for (
auto &firstMP : firstMPaths) {
941 LogDebug(
"MuonPathAssociator") <<
"----------------------------------";
943 LogDebug(
"MuonPathAssociator") <<
"Turn for ";
947 for (
auto &secondMP : secondMPaths) {
949 LogDebug(
"MuonPathAssociator") <<
"Comparing with ";
952 if (!isNotAPrimo(firstMP, secondMP)) {
958 allMPaths.push_back(firstMP);
963 LogDebug(
"MuonPathAssociator") <<
"----------------------------------";
977 if (lay1 && lay2 && lay3 && lay4) {
978 if (lay5 || lay6 || lay7 || lay8)
982 }
else if (lay5 && lay6 && lay7 && lay8) {
983 if (lay1 || lay2 || lay3 || lay4)
1004 return (((!lay1 && !lay2 && !lay3 && !lay4) || hitsSL1 < 3) && ((!lay5 && !lay6 && !lay7 && !lay8) || hitsSL3 < 3));
1010 <<
" " << setw(2) << left << mP.
wi1 <<
" " << setw(2) << left << mP.
wi2 <<
" "
1011 << setw(2) << left << mP.
wi3 <<
" " << setw(2) << left << mP.
wi4 <<
" " << setw(2)
1012 << left << mP.
wi5 <<
" " << setw(2) << left << mP.
wi6 <<
" " << setw(2) << left
1013 << mP.
wi7 <<
" " << setw(2) << left << mP.
wi8 <<
" " << setw(5) << left << mP.
tdc1
1014 <<
" " << setw(5) << left << mP.
tdc2 <<
" " << setw(5) << left << mP.
tdc3 <<
" "
1015 << setw(5) << left << mP.
tdc4 <<
" " << setw(5) << left << mP.
tdc5 <<
" " << setw(5)
1016 << left << mP.
tdc6 <<
" " << setw(5) << left << mP.
tdc7 <<
" " << setw(5) << left
1017 << mP.
tdc8 <<
" " << setw(2) << left << mP.
lat1 <<
" " << setw(2) << left << mP.
lat2
1018 <<
" " << setw(2) << left << mP.
lat3 <<
" " << setw(2) << left << mP.
lat4 <<
" "
1019 << setw(2) << left << mP.
lat5 <<
" " << setw(2) << left << mP.
lat6 <<
" " << setw(2)
1020 << left << mP.
lat7 <<
" " << setw(2) << left << mP.
lat8 <<
" " << setw(10) << right
1021 << mP.
x <<
" " << setw(9) << left << mP.
tanPhi <<
" " << setw(5) << left << mP.
t0
1022 <<
" " << setw(13) << left << mP.
chi2 <<
" \n";