339 {
340
341
342
343 unsigned int maxstrip = strips.size();
344
345 ATH_MSG_DEBUG(
" Clustering for " << setaphi(measphi) <<
" plane with " << maxstrip <<
" strips");
346
347
348
349
351 std::vector<bool> astrip;
352 IdentifierHash cscHashId;
353
354 for (unsigned int istrip = 0; istrip < strips.size(); ++istrip) {
360
361 if (pstrip) {
362 if (!newCollection) {
366 newCollection->setIdentifier(elementId);
367 }
370 return 1;
371 }
374
375 ATH_MSG_DEBUG(
" Strip " << setw(3) << istrip + 1 <<
": charge= " << setw(7) <<
int(
res.charge) <<
" time=" << setw(3)
376 <<
int(
res.time + 0.5));
377
378
379
380
381
382 }
383
384
385 stripfits.push_back(
res);
386 astrip.push_back(active);
387 }
388
389
390 bool incluster = false;
391 int first_strip = 0;
392 double qpeak = 0;
394 std::vector<const CscStripPrepData*> clusterStrips;
395 std::vector<Identifier> prd_digit_ids;
396 for (unsigned int istrip = 0; istrip < strips.size(); ++istrip) {
400
401
402 if (!astrip[istrip]) continue;
403 assert(pstrip != 0);
404
405
406 if (!incluster) {
407 incluster = true;
409 first_strip = istrip;
410 sfits.clear();
411 clusterStrips.clear();
412 prd_digit_ids.clear();
413 incluster = true;
414 }
415
416
417 sfits.push_back(sfit);
418 clusterStrips.push_back(pstrip);
419 prd_digit_ids.push_back(pstrip->
identify());
420 if (q > qpeak) qpeak =
q;
421
422
423
424 if (istrip != maxstrip - 1 && astrip[istrip + 1]) continue;
425
427
429
430
431
433 incluster = false;
434 continue;
435 }
436
438 std::vector<ICscClusterFitter::Result>
results;
439
442
445
447 }
448
449 if (fitresult == 6) {
451
454
455 for (
unsigned int i = 0;
i <
results.size(); ++
i)
ATH_MSG_VERBOSE(
" Split fit result return=" << results[i].fitStatus);
456 }
457
458
459
460
461 if (measphi || (fitresult > 0 && fitresult < 20)) {
463 ICscClusterFitter::Result
res;
469 if (fitresult) {
471 return 1;
472 } else {
474 }
475
477 res.clusterStatus = oldclustatus;
478
480 }
481 }
482
483
485 const MuonGM::MuonDetectorManager* MuonDetMgr = DetectorManagerHandle.
cptr();
486 if (MuonDetMgr == nullptr) {
487 ATH_MSG_ERROR(
"Null pointer to the MuonDetectorManager conditions object");
488 return 0;
489 }
490
491
492 unsigned int nresults =
results.size();
493 for (unsigned int ire = 0; ire < nresults; ++ire) {
497
502 unsigned int id_strip =
results[ire].strip;
503 double cluster_charge =
results[ire].charge;
504 double cluster_time =
results[ire].time;
506
507 if (id_strip >= sfits.size()) {
509 return 1;
510 }
511
513 if (id_strip < clusterStrips.size()) pstrip_id = clusterStrips[id_strip];
514 if (!pstrip_id) {
516 return 1;
517 }
518
519
520 Identifier cluster_id = pstrip_id->
identify();
522 int zsec =
m_idHelperSvc->cscIdHelper().stationEta(cluster_id);
523 int wlay =
m_idHelperSvc->cscIdHelper().wireLayer(cluster_id);
524
525
530 Amg::Vector2D plpos(measphi ? local_pos.y() : local_pos.z(), measphi ? local_pos.z() : local_pos.y());
531
534 ATH_MSG_DEBUG(
" ID strip: " << first_strip + id_strip <<
"(" << first_strip <<
":" << id_strip <<
")");
535 ATH_MSG_DEBUG(
" local position: " << plpos.x() <<
" " << plpos.y());
540 }
541 std::vector<Identifier> prd_digit_ids_submit;
542 unsigned int fstrip =
results[ire].fstrip;
543 unsigned int lstrip =
results[ire].lstrip;
544 prd_digit_ids_submit.reserve(lstrip + 1);
545 for (unsigned int ids_index = fstrip; ids_index < lstrip + 1; ++ids_index) {
546 if (ids_index >= prd_digit_ids.size())
547 ATH_MSG_WARNING(
" bad index " << ids_index <<
" maximum " << prd_digit_ids.size());
548 else
549 prd_digit_ids_submit.push_back(prd_digit_ids[ids_index]);
550 }
551
553 cluster_hash,
554 plpos,
555 prd_digit_ids_submit,
556 cov,
557 pro,
558 int(cluster_charge + 0.5),
559 cluster_time,
560 clustatus,
561 timeStatus);
563 newCollection->size());
564
565 newCollection->push_back(pclus);
566 }
567
568 incluster = false;
569 }
570 return 0;
571}
std::pair< std::vector< unsigned int >, bool > res
bool msgLvl(const MSG::Level lvl) const
ICscStripFitter::Result StripFit
std::vector< StripFit > StripFitList
Amg::Vector3D nominalLocalClusterPos(int eta, int wireLayer, int measPhi, double x0) const
ignores internal alignment parameters, hence gives generally incorrect answer (local here is the stat...
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
std::string toString(CscStripStatus cstat)
Return a string description of a CSC cluster status flag.
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
@ CscStatusUndefined
Undefined, should not happen, most likely indicates a problem.
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...