ATLAS Offline Software
Loading...
Searching...
No Matches
PassThroughTool Class Reference

#include <PassThroughTool.h>

Inheritance diagram for PassThroughTool:
Collaboration diagram for PassThroughTool:

Public Member Functions

StatusCode initialize () override
StatusCode runPassThrough (EFTrackingTransient::StripClusterAuxInput &scAux, EFTrackingTransient::PixelClusterAuxInput &pxAux, EFTrackingTransient::SpacePointAuxInput &stripSpAux, EFTrackingTransient::SpacePointAuxInput &pixelSpAux, EFTrackingTransient::Metadata *metadata, const EventContext &ctx) const
 Call this function at the DataPreparationPipeline to run the pass-through kernels.
StatusCode getInputClusterData (const xAOD::StripClusterContainer *sc, std::vector< EFTrackingTransient::StripCluster > &ef_sc, unsigned long N) const
 Convert the strip cluster from xAOD container to simple std::vector of EFTrackingTransient::StripCluster.
StatusCode getInputClusterData (const xAOD::PixelClusterContainer *pc, std::vector< EFTrackingTransient::PixelCluster > &ef_pc, unsigned long N) const
 Convert the pixel cluster from xAOD container to simple std::vector of EFTrackingTransient::PixelCluster.
StatusCode getInputSpacePointData (const xAOD::SpacePointContainer *sp, std::vector< EFTrackingTransient::SpacePoint > &ef_sp, std::vector< std::vector< const xAOD::UncalibratedMeasurement * > > &sp_meas, unsigned long N, bool isStrip) const
 Convert the space point from xAOD container to simple std::vector of EFTrackingTransient::SpacePoint.
StatusCode passThroughSW (const std::vector< EFTrackingTransient::StripCluster > &inputSC, EFTrackingTransient::StripClusterOutput &ef_scOutput, const std::vector< EFTrackingTransient::PixelCluster > &inputPC, EFTrackingTransient::PixelClusterOutput &ef_pcOutput, const std::vector< EFTrackingTransient::SpacePoint > &inputSSP, EFTrackingTransient::SpacePointOutput &ef_sspOutput, const std::vector< EFTrackingTransient::SpacePoint > &inputPSP, EFTrackingTransient::SpacePointOutput &ef_pspOutput, EFTrackingTransient::Metadata *metadata) const
 Software version of the pass-through kernel.
StatusCode passThroughSW_clusterOnly (const std::vector< EFTrackingTransient::StripCluster > &inputSC, EFTrackingTransient::StripClusterOutput &ef_scOutput, const std::vector< EFTrackingTransient::PixelCluster > &inputPC, EFTrackingTransient::PixelClusterOutput &ef_pcOutput, EFTrackingTransient::Metadata *metadata) const
 This is a cluster-only version (sw) of the pass-through kernel This is used for cluter level studies.
bool runSW () const
 A getter for the m_runSW property.

Private Attributes

Gaudi::Property< bool > m_runSW {this, "RunSW", true, "Run software mode"}
 Software mode, not running on the FPGA.
Gaudi::Property< bool > m_doSpacepoints {this, "DoSpacepoints", false, "Do spacepoints"}
 Temporary flag before spacepoints are ready.
Gaudi::Property< bool > m_clusterOnlyPassThrough
 Use the cluster-only pass through tool.
Gaudi::Property< unsigned int > m_maxClusterNum
Gaudi::Property< unsigned int > m_maxSpacePointNum
SG::ReadHandleKey< xAOD::StripClusterContainerm_stripClustersKey
SG::ReadHandleKey< xAOD::PixelClusterContainerm_pixelClustersKey
SG::ReadHandleKey< xAOD::SpacePointContainerm_spacePointsKey

Detailed Description

Definition at line 23 of file PassThroughTool.h.

Member Function Documentation

◆ getInputClusterData() [1/2]

StatusCode PassThroughTool::getInputClusterData ( const xAOD::PixelClusterContainer * pc,
std::vector< EFTrackingTransient::PixelCluster > & ef_pc,
unsigned long N ) const

Convert the pixel cluster from xAOD container to simple std::vector of EFTrackingTransient::PixelCluster.

This is needed for the kernel input.

Definition at line 489 of file PassThroughTool.cxx.

493{
494 if (N > pc->size())
495 {
496 ATH_MSG_ERROR("You want to get the "
497 << N << "th pixel cluster, but there are only " << pc->size()
498 << " pixel clusters in the container.");
499 return StatusCode::FAILURE;
500 }
501 ATH_MSG_DEBUG("Making vector of pixel clusters...");
502 for (unsigned long i = 0; i < N; i++)
503 {
504 EFTrackingTransient::PixelCluster cache;
505 // Get the data from the input xAOD::PixelClusterContainer and set it to the
506 // cache
507 cache.id = pc->at(i)->identifier();
508 cache.idHash = pc->at(i)->identifierHash();
509 cache.localPosition[0] = pc->at(i)->localPosition<2>()(0, 0);
510 cache.localPosition[1] = pc->at(i)->localPosition<2>()(1, 0);
511 cache.localCovariance[0] = pc->at(i)->localCovariance<2>()(0, 0);
512 cache.localCovariance[1] = pc->at(i)->localCovariance<2>()(1, 1);
513 cache.globalPosition[0] = pc->at(i)->globalPosition()[0];
514 cache.globalPosition[1] = pc->at(i)->globalPosition()[1];
515 cache.globalPosition[2] = pc->at(i)->globalPosition()[2];
516
517 for (long unsigned int j = 0; j < pc->at(i)->rdoList().size(); j++)
518 {
519 cache.rdoList[j] = pc->at(i)->rdoList().at(j).get_compact();
520 }
521
522 cache.channelsInPhi = pc->at(i)->channelsInPhi();
523 cache.channelsInEta = pc->at(i)->channelsInEta();
524 cache.widthInEta = pc->at(i)->widthInEta();
525
526 for (long unsigned int j = 0; j < pc->at(i)->totList().size(); j++)
527 {
528 cache.totList[j] = pc->at(i)->totList().at(j);
529 }
530
531 cache.totalToT = pc->at(i)->totalToT();
532
533 for (long unsigned int j = 0; j < pc->at(i)->chargeList().size(); j++)
534 {
535 cache.chargeList[j] = pc->at(i)->chargeList().at(j);
536 }
537
538 cache.totalCharge = pc->at(i)->totalCharge();
539 cache.energyLoss = pc->at(i)->energyLoss();
540 cache.isSplit = pc->at(i)->isSplit();
541 cache.splitProbability1 = pc->at(i)->splitProbability1();
542 cache.splitProbability2 = pc->at(i)->splitProbability2();
543 cache.lvl1a = pc->at(i)->lvl1a();
544 cache.sizeOfRDOList = pc->at(i)->rdoList().size();
545 cache.sizeOfTotList = pc->at(i)->totList().size();
546 cache.sizeOfChargeList = pc->at(i)->chargeList().size();
547
548 ef_pc.push_back(cache);
549 }
550
551 ATH_MSG_DEBUG("Made " << ef_pc.size() << " pixel clusters in the vector");
552 return StatusCode::SUCCESS;
553}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)

◆ getInputClusterData() [2/2]

StatusCode PassThroughTool::getInputClusterData ( const xAOD::StripClusterContainer * sc,
std::vector< EFTrackingTransient::StripCluster > & ef_sc,
unsigned long N ) const

Convert the strip cluster from xAOD container to simple std::vector of EFTrackingTransient::StripCluster.

This is needed for the kernel input.

Definition at line 448 of file PassThroughTool.cxx.

452{
453 if (N > sc->size())
454 {
455 ATH_MSG_ERROR("You want to get the "
456 << N << "th strip cluster, but there are only " << sc->size()
457 << " strip clusters in the container.");
458 return StatusCode::FAILURE;
459 }
460 ATH_MSG_DEBUG("Making vector of strip clusters...");
461 for (unsigned long i = 0; i < N; i++)
462 {
463 EFTrackingTransient::StripCluster cache;
464 // Get the data from the input xAOD::StripClusterContainer and set it to the
465 // cache
466 cache.localPosition = sc->at(i)->localPosition<1>()(0, 0);
467 cache.localCovariance = sc->at(i)->localCovariance<1>()(0, 0);
468 cache.idHash = sc->at(i)->identifierHash();
469 cache.id = sc->at(i)->identifier();
470 cache.globalPosition[0] = sc->at(i)->globalPosition()[0];
471 cache.globalPosition[1] = sc->at(i)->globalPosition()[1];
472 cache.globalPosition[2] = sc->at(i)->globalPosition()[2];
473
474 for (unsigned long j = 0; j < sc->at(i)->rdoList().size(); j++)
475 {
476 cache.rdoList[j] = sc->at(i)->rdoList().at(j).get_compact();
477 }
478
479 cache.channelsInPhi = sc->at(i)->channelsInPhi();
480 cache.sizeOfRDOList = sc->at(i)->rdoList().size();
481
482 ef_sc.push_back(cache);
483 }
484
485 ATH_MSG_DEBUG("Made " << ef_sc.size() << " strip clusters in the vector");
486 return StatusCode::SUCCESS;
487}
static Double_t sc

◆ getInputSpacePointData()

StatusCode PassThroughTool::getInputSpacePointData ( const xAOD::SpacePointContainer * sp,
std::vector< EFTrackingTransient::SpacePoint > & ef_sp,
std::vector< std::vector< const xAOD::UncalibratedMeasurement * > > & sp_meas,
unsigned long N,
bool isStrip ) const

Convert the space point from xAOD container to simple std::vector of EFTrackingTransient::SpacePoint.

This is needed for the kernel input.

Definition at line 555 of file PassThroughTool.cxx.

560{
561 if (N > sp->size())
562 {
563 ATH_MSG_ERROR("You want to get the "
564 << N << "th space point, but there are only " << sp->size()
565 << " SpacePoint in the container.");
566 return StatusCode::FAILURE;
567 }
568 ATH_MSG_DEBUG("Making vector of space point...");
569 for (unsigned long i = 0; i < N; i++)
570 {
571 EFTrackingTransient::SpacePoint cache;
572 const auto * thisSp = sp->at(i);
573 // Get the data from the input xAOD::SpacePointContainer and set it to the
574 // cache
575 cache.idHash[0] = thisSp->elementIdList()[0];
576 cache.globalPosition[0] = thisSp->x();
577 cache.globalPosition[1] = thisSp->y();
578 cache.globalPosition[2] = thisSp->z();
579 cache.radius = thisSp->radius();
580 cache.cov_r = thisSp->varianceR();
581 cache.cov_z = thisSp->varianceZ();
582
583 // Pass the uncalibrated measurement for later stage of xAOD container
584 // creation for spacepoint
585 std::vector<const xAOD::UncalibratedMeasurement *> temp_vec(
586 thisSp->measurements().size());
587 std::copy(thisSp->measurements().begin(),
588 thisSp->measurements().end(), temp_vec.begin());
589
590 sp_meas.push_back(std::move(temp_vec));
591
592 if (isStrip)
593 {
594 cache.idHash[1] = thisSp->elementIdList()[1];
595 cache.topHalfStripLength = thisSp->topHalfStripLength();
596 cache.bottomHalfStripLength = thisSp->bottomHalfStripLength();
597 std::copy(thisSp->topStripDirection().data(),
598 thisSp->topStripDirection().data() +
599 thisSp->topStripDirection().size(),
600 cache.topStripDirection);
601 std::copy(thisSp->bottomStripDirection().data(),
602 thisSp->bottomStripDirection().data() +
603 thisSp->bottomStripDirection().size(),
605 std::copy(thisSp->stripCenterDistance().data(),
606 thisSp->stripCenterDistance().data() +
607 thisSp->stripCenterDistance().size(),
608 cache.stripCenterDistance);
609 std::copy(thisSp->topStripCenter().data(),
610 thisSp->topStripCenter().data() +
611 thisSp->topStripCenter().size(),
612 cache.topStripCenter);
613 }
614 ef_sp.push_back(cache);
615 }
616
617 ATH_MSG_DEBUG("Made " << ef_sp.size() << " space points in the vector");
618 return StatusCode::SUCCESS;
619}
static Double_t sp

◆ initialize()

StatusCode PassThroughTool::initialize ( )
override

Definition at line 13 of file PassThroughTool.cxx.

14{
15 ATH_MSG_INFO("Initializing PassThroughTool tool");
16 ATH_CHECK(m_stripClustersKey.initialize());
17 ATH_CHECK(m_pixelClustersKey.initialize());
18 ATH_CHECK(m_spacePointsKey.initialize());
19
20 return StatusCode::SUCCESS;
21}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
SG::ReadHandleKey< xAOD::SpacePointContainer > m_spacePointsKey
SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClustersKey
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_pixelClustersKey

◆ passThroughSW()

StatusCode PassThroughTool::passThroughSW ( const std::vector< EFTrackingTransient::StripCluster > & inputSC,
EFTrackingTransient::StripClusterOutput & ef_scOutput,
const std::vector< EFTrackingTransient::PixelCluster > & inputPC,
EFTrackingTransient::PixelClusterOutput & ef_pcOutput,
const std::vector< EFTrackingTransient::SpacePoint > & inputSSP,
EFTrackingTransient::SpacePointOutput & ef_sspOutput,
const std::vector< EFTrackingTransient::SpacePoint > & inputPSP,
EFTrackingTransient::SpacePointOutput & ef_pspOutput,
EFTrackingTransient::Metadata * metadata ) const

Software version of the pass-through kernel.

The purse of this function is to mimic the FPGA output at software level.

It takes the EFTrackingTransient::StripCluster EFTrackingTransient::PixelCluster, and EFTrackingDataFormat::SpacePoints as input arguments and mimic the transfer kernel by giving array output.

Definition at line 623 of file PassThroughTool.cxx.

636{
637 // Add error checking at the beginning of the passThroughSW method
638 if (inputSC.empty()) {
639 ATH_MSG_DEBUG("No strip clusters found.");
640 // Set strip-related metadata to 0
641 metadata->numOfStripClusters = 0;
642 metadata->numOfStripSpacePoints = 0;
643 return StatusCode::SUCCESS;
644 }
645
646 if (inputPC.empty()) {
647 ATH_MSG_DEBUG("No pixel clusters found.");
648 // Set pixel-related metadata to 0
649 metadata->numOfPixelClusters = 0;
650 metadata->numOfPixelSpacePoints = 0;
651 return StatusCode::SUCCESS;
652 }
653
654 int rdoIndex_counter = 0;
655
656 unsigned int inputscRdoIndexSize = 0;
657 unsigned int inputpcRdoIndexSize = 0;
658
659 // transfer inputStripClusters
660 ATH_MSG_DEBUG("Transfering strip clusters...");
661 for (size_t i = 0; i < inputSC.size(); i++)
662 {
663 ef_scOutput.scLocalPosition[i] = inputSC[i].localPosition;
664 ef_scOutput.scLocalCovariance[i] = inputSC[i].localCovariance;
665 ef_scOutput.scIdHash[i] = inputSC[i].idHash;
666 ef_scOutput.scId[i] = inputSC[i].id;
667 ef_scOutput.scGlobalPosition[i * 3] = inputSC[i].globalPosition[0];
668 ef_scOutput.scGlobalPosition[i * 3 + 1] = inputSC[i].globalPosition[1];
669 ef_scOutput.scGlobalPosition[i * 3 + 2] = inputSC[i].globalPosition[2];
670
671 inputscRdoIndexSize += inputSC[i].sizeOfRDOList;
672
673 for (int j = 0; j < inputSC[i].sizeOfRDOList; j++)
674 {
675 ef_scOutput.scRdoList[rdoIndex_counter + j] = inputSC[i].rdoList[j];
676 }
677 // update the index counter
678 ef_scOutput.scChannelsInPhi[i] = inputSC[i].channelsInPhi;
679 rdoIndex_counter += inputSC[i].sizeOfRDOList;
680 metadata[0].scRdoIndex[i] = inputSC[i].sizeOfRDOList;
681 }
682
683 // transfer inputPC
684 rdoIndex_counter = 0;
685 int totIndex_counter = 0;
686 int chargeIndex_counter = 0;
687
688 unsigned int inputpcTotListsize = 0;
689 unsigned int inputpcChargeListsize = 0;
690
691 // trasnsfer_pc:
692 for (size_t i = 0; i < inputPC.size(); i++)
693 {
694 ef_pcOutput.pcLocalPosition[i * 2] = inputPC[i].localPosition[0];
695 ef_pcOutput.pcLocalPosition[i * 2 + 1] = inputPC[i].localPosition[1];
696 ef_pcOutput.pcLocalCovariance[i * 2] = inputPC[i].localCovariance[0];
697 ef_pcOutput.pcLocalCovariance[i * 2 + 1] = inputPC[i].localCovariance[1];
698 ef_pcOutput.pcIdHash[i] = inputPC[i].idHash;
699 ef_pcOutput.pcId[i] = inputPC[i].id;
700 ef_pcOutput.pcGlobalPosition[i * 3] = inputPC[i].globalPosition[0];
701 ef_pcOutput.pcGlobalPosition[i * 3 + 1] = inputPC[i].globalPosition[1];
702 ef_pcOutput.pcGlobalPosition[i * 3 + 2] = inputPC[i].globalPosition[2];
703
704 inputpcRdoIndexSize += inputPC[i].sizeOfRDOList;
705
706 for (int j = 0; j < inputPC[i].sizeOfRDOList; j++)
707 {
708 ef_pcOutput.pcRdoList[rdoIndex_counter + j] = inputPC[i].rdoList[j];
709 }
710 ef_pcOutput.pcChannelsInPhi[i] = inputPC[i].channelsInPhi;
711 ef_pcOutput.pcChannelsInEta[i] = inputPC[i].channelsInEta;
712 ef_pcOutput.pcWidthInEta[i] = inputPC[i].widthInEta;
713
714 inputpcTotListsize += inputPC[i].sizeOfTotList;
715
716 for (int j = 0; j < inputPC[i].sizeOfTotList; j++)
717 {
718 ef_pcOutput.pcTotList[totIndex_counter + j] = inputPC[i].totList[j];
719 }
720 ef_pcOutput.pcTotalToT[i] = inputPC[i].totalToT;
721
722 inputpcChargeListsize += inputPC[i].sizeOfChargeList;
723
724 for (int j = 0; j < inputPC[i].sizeOfChargeList; j++)
725 {
726 ef_pcOutput.pcChargeList[chargeIndex_counter + j] =
727 inputPC[i].chargeList[j];
728 }
729 ef_pcOutput.pcTotalCharge[i] = inputPC[i].totalCharge;
730 ef_pcOutput.pcEnergyLoss[i] = inputPC[i].energyLoss;
731 ef_pcOutput.pcIsSplit[i] = inputPC[i].isSplit;
732 ef_pcOutput.pcSplitProbability1[i] = inputPC[i].splitProbability1;
733 ef_pcOutput.pcSplitProbability2[i] = inputPC[i].splitProbability2;
734 ef_pcOutput.pcLvl1a[i] = inputPC[i].lvl1a;
735
736 // update the index counter
737 rdoIndex_counter += inputPC[i].sizeOfRDOList;
738 totIndex_counter += inputPC[i].sizeOfTotList;
739 chargeIndex_counter += inputPC[i].sizeOfChargeList;
740 metadata[0].pcRdoIndex[i] = inputPC[i].sizeOfRDOList;
741 metadata[0].pcTotIndex[i] = inputPC[i].sizeOfTotList;
742 metadata[0].pcChargeIndex[i] = inputPC[i].sizeOfChargeList;
743 }
744
745 // transfer metadata for clusters
746 metadata[0].numOfStripClusters = inputSC.size();
747 metadata[0].numOfPixelClusters = inputPC.size();
748 metadata[0].scRdoIndexSize = inputscRdoIndexSize;
749 metadata[0].pcRdoIndexSize = inputpcRdoIndexSize;
750 metadata[0].pcTotIndexSize = inputpcTotListsize;
751 metadata[0].pcChargeIndexSize = inputpcChargeListsize;
752
753 // Now handle space points if not in cluster-only mode
755 // Process pixel space points
756 ATH_MSG_DEBUG("Processing " << inputPSP.size() << " pixel space points");
757
758 // loop over the pixel space points and transfer the data to the output
759 for (size_t i = 0; i < inputPSP.size(); i++) {
760 ef_pspOutput.spElementIdList[i] = inputPSP[i].idHash[0];
761 ef_pspOutput.spGlobalPosition[i * 3] = inputPSP[i].globalPosition[0];
762 ef_pspOutput.spGlobalPosition[i * 3 + 1] = inputPSP[i].globalPosition[1];
763 ef_pspOutput.spGlobalPosition[i * 3 + 2] = inputPSP[i].globalPosition[2];
764 ef_pspOutput.spVarianceR[i] = inputPSP[i].cov_r;
765 ef_pspOutput.spVarianceZ[i] = inputPSP[i].cov_z;
766 ef_pspOutput.spMeasurementIndexes[i] = i; // Index for linking
767 }
768
769 // Process strip space points
770 ATH_MSG_DEBUG("Processing " << inputSSP.size() << " strip space points");
771
772 // loop over the strip space points and transfer the data to the output
773 for (size_t i = 0; i < inputSSP.size(); i++) {
774 // For strip space points, we need two element IDs per space point
775 ef_sspOutput.spElementIdList[i * 2] = inputSSP[i].idHash[0];
776 ef_sspOutput.spElementIdList[i * 2 + 1] = inputSSP[i].idHash[1];
777
778 // Position (x,y,z for each point)
779 ef_sspOutput.spGlobalPosition[i * 3] = inputSSP[i].globalPosition[0];
780 ef_sspOutput.spGlobalPosition[i * 3 + 1] = inputSSP[i].globalPosition[1];
781 ef_sspOutput.spGlobalPosition[i * 3 + 2] = inputSSP[i].globalPosition[2];
782
783 // Two measurement indexes for strip space points
784 // placeholder values
785 ef_sspOutput.spMeasurementIndexes[i * 2] = i * 2;
786 ef_sspOutput.spMeasurementIndexes[i * 2 + 1] = i * 2 + 1;
787
788 // Variance values
789 ef_sspOutput.spVarianceR[i] = inputSSP[i].cov_r;
790 ef_sspOutput.spVarianceZ[i] = inputSSP[i].cov_z;
791 }
792
793 // Update metadata for space points
794 metadata[0].numOfPixelSpacePoints = inputPSP.size();
795 metadata[0].numOfStripSpacePoints = inputSSP.size();
796 } else {
797 // If we're processing clusters only, ensure space point counts are zero
798 metadata[0].numOfPixelSpacePoints = 0;
799 metadata[0].numOfStripSpacePoints = 0;
800 }
801
802 ATH_MSG_DEBUG("Metadata: ");
803 ATH_MSG_DEBUG("numOfStripClusters: " << metadata[0].numOfStripClusters);
804 ATH_MSG_DEBUG("numOfPixelClusters: " << metadata[0].numOfPixelClusters);
805 ATH_MSG_DEBUG("numOfStripSpacePoints: " << metadata[0].numOfStripSpacePoints);
806 ATH_MSG_DEBUG("numOfPixelSpacePoints: " << metadata[0].numOfPixelSpacePoints);
807
808 if (msgLvl(MSG::DEBUG)) {
809 // Print pixel space points
810 // add guard to prevent out of bounds access
811 // in instances of not having any/enough pixel space points
812 const int maxToPrintPixelSp = std::min<int>(3,
813 static_cast<int>(inputPSP.size()));
814 ATH_MSG_DEBUG("Printing first few pixel space points:");
815 for (int i = 0; i < maxToPrintPixelSp; i++) {
816 ATH_MSG_DEBUG("PixelSpacePoint[" << i << "]: "
817 << "position=(" << inputPSP[i].globalPosition[0] << ", "
818 << inputPSP[i].globalPosition[1] << ", "
819 << inputPSP[i].globalPosition[2] << ")"
820 << ", varianceR=" << inputPSP[i].cov_r
821 << ", varianceZ=" << inputPSP[i].cov_z);
822 }
823
824 // Print strip space points
825 // add guard to prevent out of bounds access
826 // in instances of not having any/enough strip space points
827 const int maxToPrintStripSp = std::min<int>(3,
828 static_cast<int>(inputSSP.size()));
829 ATH_MSG_DEBUG("Printing first few strip space points:");
830 for (int i = 0; i < maxToPrintStripSp; i++) {
831 ATH_MSG_DEBUG("StripSpacePoint[" << i << "]: "
832 << "position=(" << inputSSP[i].globalPosition[0] << ", "
833 << inputSSP[i].globalPosition[1] << ", "
834 << inputSSP[i].globalPosition[2] << ")"
835 << ", varianceR=" << inputSSP[i].cov_r
836 << ", varianceZ=" << inputSSP[i].cov_z);
837 }
838 }
839
840 return StatusCode::SUCCESS;
841}
Gaudi::Property< bool > m_clusterOnlyPassThrough
Use the cluster-only pass through tool.

◆ passThroughSW_clusterOnly()

StatusCode PassThroughTool::passThroughSW_clusterOnly ( const std::vector< EFTrackingTransient::StripCluster > & inputSC,
EFTrackingTransient::StripClusterOutput & ef_scOutput,
const std::vector< EFTrackingTransient::PixelCluster > & inputPC,
EFTrackingTransient::PixelClusterOutput & ef_pcOutput,
EFTrackingTransient::Metadata * metadata ) const

This is a cluster-only version (sw) of the pass-through kernel This is used for cluter level studies.

Definition at line 844 of file PassThroughTool.cxx.

853{
854 int rdoIndex_counter = 0;
855
856 unsigned int inputscRdoIndexSize = 0;
857
858 // transfer inputStripClusters
859 ATH_MSG_DEBUG("Transfering strip clusters...");
860 for (size_t i = 0; i < inputSC.size(); i++)
861 {
862 ef_scOutput.scLocalPosition[i] = inputSC[i].localPosition;
863 ef_scOutput.scLocalCovariance[i] = inputSC[i].localCovariance;
864 ef_scOutput.scIdHash[i] = inputSC[i].idHash;
865 ef_scOutput.scId[i] = inputSC[i].id;
866 ef_scOutput.scGlobalPosition[i * 3] = inputSC[i].globalPosition[0];
867 ef_scOutput.scGlobalPosition[i * 3 + 1] = inputSC[i].globalPosition[1];
868 ef_scOutput.scGlobalPosition[i * 3 + 2] = inputSC[i].globalPosition[2];
869
870 inputscRdoIndexSize += inputSC[i].sizeOfRDOList;
871
872 for (int j = 0; j < inputSC[i].sizeOfRDOList; j++)
873 {
874 ef_scOutput.scRdoList[rdoIndex_counter + j] = inputSC[i].rdoList[j];
875 }
876 // update the index counter
877 ef_scOutput.scChannelsInPhi[i] = inputSC[i].channelsInPhi;
878 rdoIndex_counter += inputSC[i].sizeOfRDOList;
879 metadata[0].scRdoIndex[i] = inputSC[i].sizeOfRDOList;
880 }
881
882 // transfer inputPC
883 rdoIndex_counter = 0;
884 int totIndex_counter = 0;
885 int chargeIndex_counter = 0;
886
887 unsigned int inputpcRdoIndexSize = 0;
888 unsigned int inputpcTotListsize = 0;
889 unsigned int inputpcChargeListsize = 0;
890
891 // trasnsfer_pc:
892 ATH_MSG_DEBUG("Transfering pixel clusters...");
893 for (size_t i = 0; i < inputPC.size(); i++)
894 {
895 ef_pcOutput.pcLocalPosition[i * 2] = inputPC[i].localPosition[0];
896 ef_pcOutput.pcLocalPosition[i * 2 + 1] = inputPC[i].localPosition[1];
897 ef_pcOutput.pcLocalCovariance[i * 2] = inputPC[i].localCovariance[0];
898 ef_pcOutput.pcLocalCovariance[i * 2 + 1] = inputPC[i].localCovariance[1];
899 ef_pcOutput.pcIdHash[i] = inputPC[i].idHash;
900 ef_pcOutput.pcId[i] = inputPC[i].id;
901 ef_pcOutput.pcGlobalPosition[i * 3] = inputPC[i].globalPosition[0];
902 ef_pcOutput.pcGlobalPosition[i * 3 + 1] = inputPC[i].globalPosition[1];
903 ef_pcOutput.pcGlobalPosition[i * 3 + 2] = inputPC[i].globalPosition[2];
904
905 inputpcRdoIndexSize += inputPC[i].sizeOfRDOList;
906
907 for (int j = 0; j < inputPC[i].sizeOfRDOList; j++)
908 {
909 ef_pcOutput.pcRdoList[rdoIndex_counter + j] = inputPC[i].rdoList[j];
910 }
911 ef_pcOutput.pcChannelsInPhi[i] = inputPC[i].channelsInPhi;
912 ef_pcOutput.pcChannelsInEta[i] = inputPC[i].channelsInEta;
913 ef_pcOutput.pcWidthInEta[i] = inputPC[i].widthInEta;
914
915 inputpcTotListsize += inputPC[i].sizeOfTotList;
916
917 for (int j = 0; j < inputPC[i].sizeOfTotList; j++)
918 {
919 ef_pcOutput.pcTotList[totIndex_counter + j] = inputPC[i].totList[j];
920 }
921 ef_pcOutput.pcTotalToT[i] = inputPC[i].totalToT;
922
923 inputpcChargeListsize += inputPC[i].sizeOfChargeList;
924
925 for (int j = 0; j < inputPC[i].sizeOfChargeList; j++)
926 {
927 ef_pcOutput.pcChargeList[chargeIndex_counter + j] =
928 inputPC[i].chargeList[j];
929 }
930 ef_pcOutput.pcTotalCharge[i] = inputPC[i].totalCharge;
931 ef_pcOutput.pcEnergyLoss[i] = inputPC[i].energyLoss;
932 ef_pcOutput.pcIsSplit[i] = inputPC[i].isSplit;
933 ef_pcOutput.pcSplitProbability1[i] = inputPC[i].splitProbability1;
934 ef_pcOutput.pcSplitProbability2[i] = inputPC[i].splitProbability2;
935 ef_pcOutput.pcLvl1a[i] = inputPC[i].lvl1a;
936
937 // update the index counter
938 rdoIndex_counter += inputPC[i].sizeOfRDOList;
939 totIndex_counter += inputPC[i].sizeOfTotList;
940 chargeIndex_counter += inputPC[i].sizeOfChargeList;
941 metadata[0].pcRdoIndex[i] = inputPC[i].sizeOfRDOList;
942 metadata[0].pcTotIndex[i] = inputPC[i].sizeOfTotList;
943 metadata[0].pcChargeIndex[i] = inputPC[i].sizeOfChargeList;
944 }
945 // transfer metadata
946 metadata[0].numOfStripClusters = inputSC.size();
947 metadata[0].numOfPixelClusters = inputPC.size();
948 metadata[0].scRdoIndexSize = inputscRdoIndexSize;
949 metadata[0].pcRdoIndexSize = inputpcRdoIndexSize;
950 metadata[0].pcTotIndexSize = inputpcTotListsize;
951 metadata[0].pcChargeIndexSize = inputpcChargeListsize;
952
953 ATH_MSG_DEBUG("Metadata: ");
954 ATH_MSG_DEBUG("numOfStripClusters: " << metadata[0].numOfStripClusters);
955 ATH_MSG_DEBUG("numOfPixelClusters: " << metadata[0].numOfPixelClusters);
956 ATH_MSG_DEBUG("numOfStripSpacePoints: " << metadata[0].numOfStripSpacePoints);
957 ATH_MSG_DEBUG("numOfPixelSpacePoints: " << metadata[0].numOfPixelSpacePoints);
958
959 // If we're processing clusters, we should also set up space point metadata
960 // This ensures downstream code knows there are no space points yet
961 metadata[0].numOfPixelSpacePoints = 0;
962 metadata[0].numOfStripSpacePoints = 0;
963
964 ATH_MSG_DEBUG("Updated Metadata: ");
965 ATH_MSG_DEBUG("numOfPixelSpacePoints: " << metadata[0].numOfPixelSpacePoints);
966 ATH_MSG_DEBUG("numOfStripSpacePoints: " << metadata[0].numOfStripSpacePoints);
967
968 return StatusCode::SUCCESS;
969}

◆ runPassThrough()

StatusCode PassThroughTool::runPassThrough ( EFTrackingTransient::StripClusterAuxInput & scAux,
EFTrackingTransient::PixelClusterAuxInput & pxAux,
EFTrackingTransient::SpacePointAuxInput & stripSpAux,
EFTrackingTransient::SpacePointAuxInput & pixelSpAux,
EFTrackingTransient::Metadata * metadata,
const EventContext & ctx ) const

Call this function at the DataPreparationPipeline to run the pass-through kernels.

Definition at line 23 of file PassThroughTool.cxx.

29{
30 // Retrieve the strip and pixel cluster container from the event store
31 SG::ReadHandle<xAOD::StripClusterContainer> inputStripClusters(
33 SG::ReadHandle<xAOD::PixelClusterContainer> inputPixelClusters(
35
36 // Retrieve the space point container from the event store
37 SG::ReadHandle<xAOD::SpacePointContainer> inputSpacePoints(
38 m_spacePointsKey, ctx);
39
40 // Check if the strip cluster container is valid
41 if (!inputStripClusters.isValid())
42 {
43 ATH_MSG_ERROR("Failed to retrieve: " << m_stripClustersKey);
44 return StatusCode::FAILURE;
45 }
46
47 // Check if the pixel cluster container is valid
48 if (!inputPixelClusters.isValid())
49 {
50 ATH_MSG_ERROR("Failed to retrieve: " << m_pixelClustersKey);
51 return StatusCode::FAILURE;
52 }
53
54 // Check if the space point container is valid
55 if (!inputSpacePoints.isValid())
56 {
57 ATH_MSG_ERROR("Failed to retrieve: " << m_spacePointsKey);
58 return StatusCode::FAILURE;
59 }
60
61 if (msgLvl(MSG::DEBUG))
62 {
63 ATH_MSG_DEBUG("StripClusterContainer is valid");
64 ATH_MSG_DEBUG("PixelClusterContainer is valid");
65 ATH_MSG_DEBUG("SpacePointContainer is valid");
66 ATH_MSG_DEBUG("Size of pixel clusters is : " << inputPixelClusters->size());
67 ATH_MSG_DEBUG("Size of strip clusters is : " << inputStripClusters->size());
68 ATH_MSG_DEBUG("Size of space points is : " << inputSpacePoints->size());
69 }
70
71 // Prepare the input data for the kernel
72 std::vector<EFTrackingTransient::StripCluster> ef_stripClusters;
73 std::vector<EFTrackingTransient::PixelCluster> ef_pixelClusters;
74 std::vector<EFTrackingTransient::SpacePoint> ef_pixelSpacePoints;
75 std::vector<EFTrackingTransient::SpacePoint> ef_stripSpacePoints;
76
77 // Store measurement pointers for space points
78 std::vector<std::vector<const xAOD::UncalibratedMeasurement*>> pixelSpMeasurements;
79 std::vector<std::vector<const xAOD::UncalibratedMeasurement*>> stripSpMeasurements;
80
81 // Get the input cluster data
82 ATH_CHECK(getInputClusterData(inputStripClusters.get(), ef_stripClusters, inputStripClusters->size()));
83 ATH_CHECK(getInputClusterData(inputPixelClusters.get(), ef_pixelClusters, inputPixelClusters->size()));
84
85 // Get the input space point data
86 ATH_CHECK(getInputSpacePointData(inputSpacePoints.get(), ef_pixelSpacePoints, pixelSpMeasurements,
87 inputSpacePoints->size(), false));
88
89 if (msgLvl(MSG::DEBUG))
90 { // add a guard to prevent out of bounds access
91 const int maxToPrintStripCl = std::min<int>(3, ef_stripClusters.size());
92 // Print a few clusters to verify the conversion
93 for (int i = 0; i < maxToPrintStripCl; i++)
94 {
95 ATH_MSG_DEBUG("StripCluster["
96 << i << "]: " << ef_stripClusters.at(i).localPosition
97 << ", " << ef_stripClusters.at(i).localCovariance << ", "
98 << ef_stripClusters.at(i).idHash << ", "
99 << ef_stripClusters.at(i).id << ", "
100 << ef_stripClusters.at(i).globalPosition[0] << ", "
101 << ef_stripClusters.at(i).globalPosition[1] << ", "
102 << ef_stripClusters.at(i).globalPosition[2] << ", "
103 << ef_stripClusters.at(i).rdoList[0] << ", "
104 << ef_stripClusters.at(i).channelsInPhi);
105 }
106 // Pixel clusters
107 const int maxToPrintPixelCl = std::min<int>(3, ef_pixelClusters.size());
108 for (int i = 0; i < maxToPrintPixelCl; i++)
109 {
110 ATH_MSG_DEBUG("PixelCluster["
111 << i << "]: " << ef_pixelClusters.at(i).id << ", "
112 << ef_pixelClusters.at(i).idHash << ", "
113 << ef_pixelClusters.at(i).localPosition[0] << ", "
114 << ef_pixelClusters.at(i).localPosition[1] << ", "
115 << ef_pixelClusters.at(i).localCovariance[0] << ", "
116 << ef_pixelClusters.at(i).localCovariance[1] << ", "
117 << ef_pixelClusters.at(i).globalPosition[0] << ", "
118 << ef_pixelClusters.at(i).globalPosition[1] << ", "
119 << ef_pixelClusters.at(i).globalPosition[2] << ", "
120 << ef_pixelClusters.at(i).rdoList[0] << ", "
121 << ef_pixelClusters.at(i).channelsInPhi << ", "
122 << ef_pixelClusters.at(i).channelsInEta << ", "
123 << ef_pixelClusters.at(i).widthInEta << ", "
124 << ef_pixelClusters.at(i).totList[0] << ", "
125 << ef_pixelClusters.at(i).totalToT << ", "
126 << ef_pixelClusters.at(i).chargeList[0] << ", "
127 << ef_pixelClusters.at(i).totalCharge << ", "
128 << ef_pixelClusters.at(i).energyLoss << ", "
129 << ef_pixelClusters.at(i).isSplit << ", "
130 << ef_pixelClusters.at(i).splitProbability1 << ", "
131 << ef_pixelClusters.at(i).splitProbability2 << ", "
132 << ef_pixelClusters.at(i).lvl1a);
133 }
134 }
135
136 // Determine if we are running sw or hw
137 if (m_runSW)
138 {
139 ATH_MSG_INFO("Running the sw ver of the pass-through kernel");
140 // Strip cluster
141 std::vector<float> scLocalPosition(m_maxClusterNum);
142 std::vector<float> scLocalCovariance(m_maxClusterNum);
143 std::vector<unsigned int> scIdHash(m_maxClusterNum);
144 std::vector<long unsigned int> scId(m_maxClusterNum);
145 std::vector<float> scGlobalPosition(m_maxClusterNum * 3);
146 std::vector<unsigned long long> scRdoList(m_maxClusterNum * 5000);
147 std::vector<int> scChannelsInPhi(m_maxClusterNum);
148
149 EFTrackingTransient::StripClusterOutput ef_scOutput;
150
151 ef_scOutput.scLocalPosition = scLocalPosition.data();
152 ef_scOutput.scLocalCovariance = scLocalCovariance.data();
153 ef_scOutput.scIdHash = scIdHash.data();
154 ef_scOutput.scId = scId.data();
155 ef_scOutput.scGlobalPosition = scGlobalPosition.data();
156 ef_scOutput.scRdoList = scRdoList.data();
157 ef_scOutput.scChannelsInPhi = scChannelsInPhi.data();
158
159 // Pixel cluster
160 std::vector<float> pcLocalPosition(m_maxClusterNum * 2);
161 std::vector<float> pcLocalCovariance(m_maxClusterNum * 2);
162 std::vector<unsigned int> pcIdHash(m_maxClusterNum);
163 std::vector<long unsigned int> pcId(m_maxClusterNum);
164 std::vector<float> pcGlobalPosition(m_maxClusterNum * 3);
165 std::vector<unsigned long long> pcRdoList(m_maxClusterNum * 5000);
166 std::vector<int> pcChannelsInPhi(m_maxClusterNum);
167 std::vector<int> pcChannelsInEta(m_maxClusterNum);
168 std::vector<float> pcWidthInEta(m_maxClusterNum);
169 std::vector<int> pcTotList(m_maxClusterNum * 5000);
170 std::vector<int> pcTotalToT(m_maxClusterNum);
171 std::vector<float> pcChargeList(m_maxClusterNum * 5000);
172 std::vector<float> pcTotalCharge(m_maxClusterNum);
173 std::vector<float> pcEnergyLoss(m_maxClusterNum);
174 std::vector<char> pcIsSplit(m_maxClusterNum);
175 std::vector<float> pcSplitProbability1(m_maxClusterNum);
176 std::vector<float> pcSplitProbability2(m_maxClusterNum);
177 std::vector<int> pcLvl1a(m_maxClusterNum);
178
179 EFTrackingTransient::PixelClusterOutput ef_pcOutput;
180
181 ef_pcOutput.pcLocalPosition = pcLocalPosition.data();
182 ef_pcOutput.pcLocalCovariance = pcLocalCovariance.data();
183 ef_pcOutput.pcIdHash = pcIdHash.data();
184 ef_pcOutput.pcId = pcId.data();
185 ef_pcOutput.pcGlobalPosition = pcGlobalPosition.data();
186 ef_pcOutput.pcRdoList = pcRdoList.data();
187 ef_pcOutput.pcChannelsInPhi = pcChannelsInPhi.data();
188 ef_pcOutput.pcChannelsInEta = pcChannelsInEta.data();
189 ef_pcOutput.pcWidthInEta = pcWidthInEta.data();
190 ef_pcOutput.pcTotList = pcTotList.data();
191 ef_pcOutput.pcTotalToT = pcTotalToT.data();
192 ef_pcOutput.pcChargeList = pcChargeList.data();
193 ef_pcOutput.pcTotalCharge = pcTotalCharge.data();
194 ef_pcOutput.pcEnergyLoss = pcEnergyLoss.data();
195 ef_pcOutput.pcIsSplit = pcIsSplit.data();
196 ef_pcOutput.pcSplitProbability1 = pcSplitProbability1.data();
197 ef_pcOutput.pcSplitProbability2 = pcSplitProbability2.data();
198 ef_pcOutput.pcLvl1a = pcLvl1a.data();
199
200 // Space point output structures
201 std::vector<unsigned int> pspIdHash(m_maxSpacePointNum);
202 std::vector<float> pspGlobalPosition(m_maxSpacePointNum * 3);
203 std::vector<float> pspRadius(m_maxSpacePointNum);
204 std::vector<float> pspVarianceR(m_maxSpacePointNum);
205 std::vector<float> pspVarianceZ(m_maxSpacePointNum);
206 std::vector<int> pspMeasurementIndexes(m_maxSpacePointNum);
207 std::vector<unsigned int> pspElementIdList(m_maxSpacePointNum);
208
209 EFTrackingTransient::SpacePointOutput ef_pspOutput;
210 ef_pspOutput.spIdHash = pspIdHash.data();
211 ef_pspOutput.spGlobalPosition = pspGlobalPosition.data();
212 ef_pspOutput.spRadius = pspRadius.data();
213 ef_pspOutput.spVarianceR = pspVarianceR.data();
214 ef_pspOutput.spVarianceZ = pspVarianceZ.data();
215 ef_pspOutput.spMeasurementIndexes = pspMeasurementIndexes.data();
216 ef_pspOutput.spElementIdList = pspElementIdList.data();
217
218 // Strip space point
219 std::vector<unsigned int> sspIdHash(m_maxSpacePointNum);
220 std::vector<float> sspGlobalPosition(m_maxSpacePointNum * 3);
221 std::vector<float> sspRadius(m_maxSpacePointNum);
222 std::vector<float> sspVarianceR(m_maxSpacePointNum);
223 std::vector<float> sspVarianceZ(m_maxSpacePointNum);
224 std::vector<int> sspMeasurementIndexes(m_maxSpacePointNum);
225 std::vector<unsigned int> sspElementIdList(m_maxSpacePointNum);
226
227 EFTrackingTransient::SpacePointOutput ef_sspOutput;
228 ef_sspOutput.spIdHash = sspIdHash.data();
229 ef_sspOutput.spGlobalPosition = sspGlobalPosition.data();
230 ef_sspOutput.spRadius = sspRadius.data();
231 ef_sspOutput.spVarianceR = sspVarianceR.data();
232 ef_sspOutput.spVarianceZ = sspVarianceZ.data();
233 ef_sspOutput.spMeasurementIndexes = sspMeasurementIndexes.data();
234 ef_sspOutput.spElementIdList = sspElementIdList.data();
235
236 // Process clusters and optionally space points if enabled
238 ATH_CHECK(passThroughSW_clusterOnly(ef_stripClusters, ef_scOutput,
239 ef_pixelClusters, ef_pcOutput,
240 metadata));
241 } else {
242 ATH_CHECK(passThroughSW(ef_stripClusters, ef_scOutput,
243 ef_pixelClusters, ef_pcOutput,
244 ef_stripSpacePoints, ef_sspOutput,
245 ef_pixelSpacePoints, ef_pspOutput,
246 metadata));
247 }
248
249 // resize the vector to be the length of the cluster
250 scLocalPosition.resize(metadata->numOfStripClusters);
251 scLocalCovariance.resize(metadata->numOfStripClusters);
252 scIdHash.resize(metadata->numOfStripClusters);
253 scId.resize(metadata->numOfStripClusters);
254 scGlobalPosition.resize(metadata->numOfStripClusters * 3);
255 scRdoList.resize(metadata->scRdoIndexSize);
256 scChannelsInPhi.resize(metadata->numOfStripClusters);
257
258 pcLocalPosition.resize(metadata->numOfPixelClusters * 2);
259 pcLocalCovariance.resize(metadata->numOfPixelClusters * 2);
260 pcIdHash.resize(metadata->numOfPixelClusters);
261 pcId.resize(metadata->numOfPixelClusters);
262 pcGlobalPosition.resize(metadata->numOfPixelClusters * 3);
263 pcRdoList.resize(metadata->pcRdoIndexSize);
264 pcChannelsInPhi.resize(metadata->numOfPixelClusters);
265 pcChannelsInEta.resize(metadata->numOfPixelClusters);
266 pcWidthInEta.resize(metadata->numOfPixelClusters);
267 pcTotList.resize(metadata->pcTotIndexSize);
268 pcTotalToT.resize(metadata->numOfPixelClusters);
269 pcChargeList.resize(metadata->pcChargeIndexSize);
270 pcTotalCharge.resize(metadata->numOfPixelClusters);
271 pcEnergyLoss.resize(metadata->numOfPixelClusters);
272 pcIsSplit.resize(metadata->numOfPixelClusters);
273 pcSplitProbability1.resize(metadata->numOfPixelClusters);
274 pcSplitProbability2.resize(metadata->numOfPixelClusters);
275 pcLvl1a.resize(metadata->numOfPixelClusters);
276
277 if (msgLvl(MSG::DEBUG)) {
278 // add guard to prevent out of bounds access
279 // in instances of not having any/enough stip clusters
280 const unsigned int nStripClustersToPrint = std::min(3u,
281 static_cast<unsigned int>(scLocalPosition.size()));
282 // print 3 strip clusters
283 for (unsigned i = 0; i < nStripClustersToPrint; i++)
284 {
285 ATH_MSG_DEBUG("scLocalPosition["
286 << i << "] = " << ef_scOutput.scLocalPosition[i]);
287 ATH_MSG_DEBUG("scLocalCovariance["
288 << i << "] = " << ef_scOutput.scLocalCovariance[i]);
289 ATH_MSG_DEBUG("scIdHash[" << i << "] = " << ef_scOutput.scIdHash[i]);
290 ATH_MSG_DEBUG("scId[" << i << "] = " << ef_scOutput.scId[i]);
291 ATH_MSG_DEBUG("scGlobalPosition["
292 << i << "] = " << ef_scOutput.scGlobalPosition[i * 3] << ", "
293 << ef_scOutput.scGlobalPosition[i * 3 + 1] << ", "
294 << ef_scOutput.scGlobalPosition[i * 3 + 2]);
295 ATH_MSG_DEBUG("scRdoList[" << i << "] = " << ef_scOutput.scRdoList[i]);
296 ATH_MSG_DEBUG("scChannelsInPhi["
297 << i << "] = " << ef_scOutput.scChannelsInPhi[i]);
298 }
299
300 // print 3 pixel clusters
301 const unsigned int nPixelClustersToPrint = std::min(3u,
302 static_cast<unsigned int>(pcLocalPosition.size()));
303 // add guard to prevent out of bounds access; same logic as above
304 for (unsigned i = 0; i < nPixelClustersToPrint; i++)
305 {
306 ATH_MSG_DEBUG("pcLocalPosition["
307 << i << "] = " << ef_pcOutput.pcLocalPosition[i * 2] << ", "
308 << ef_pcOutput.pcLocalPosition[i * 2 + 1]);
309 ATH_MSG_DEBUG("pcLocalCovariance["
310 << i << "] = " << ef_pcOutput.pcLocalCovariance[i * 2] << ", "
311 << ef_pcOutput.pcLocalCovariance[i * 2 + 1]);
312 ATH_MSG_DEBUG("pcIdHash[" << i << "] = " << ef_pcOutput.pcIdHash[i]);
313 ATH_MSG_DEBUG("pcId[" << i << "] = " << ef_pcOutput.pcId[i]);
314 ATH_MSG_DEBUG("pcGlobalPosition["
315 << i << "] = " << ef_pcOutput.pcGlobalPosition[i * 3] << ", "
316 << ef_pcOutput.pcGlobalPosition[i * 3 + 1] << ", "
317 << ef_pcOutput.pcGlobalPosition[i * 3 + 2]);
318 ATH_MSG_DEBUG("pcRdoList[" << i << "] = " << ef_pcOutput.pcRdoList[i]);
319 ATH_MSG_DEBUG("pcChannelsInPhi["
320 << i << "] = " << ef_pcOutput.pcChannelsInPhi[i]);
321 ATH_MSG_DEBUG("pcChannelsInEta["
322 << i << "] = " << ef_pcOutput.pcChannelsInEta[i]);
323 ATH_MSG_DEBUG("pcWidthInEta["
324 << i << "] = " << ef_pcOutput.pcWidthInEta[i]);
325 ATH_MSG_DEBUG("pcTotList[" << i << "] = " << ef_pcOutput.pcTotList[i]);
326 ATH_MSG_DEBUG("pcTotalToT["
327 << i << "] = " << ef_pcOutput.pcTotalToT[i]);
328 ATH_MSG_DEBUG("pcChargeList["
329 << i << "] = " << ef_pcOutput.pcChargeList[i]);
330 ATH_MSG_DEBUG("pcTotalCharge["
331 << i << "] = " << ef_pcOutput.pcTotalCharge[i]);
332 ATH_MSG_DEBUG("pcEnergyLoss["
333 << i << "] = " << ef_pcOutput.pcEnergyLoss[i]);
334 ATH_MSG_DEBUG("pcIsSplit[" << i << "] = " << ef_pcOutput.pcIsSplit[i]);
335 ATH_MSG_DEBUG("pcSplitProbability1["
336 << i << "] = " << ef_pcOutput.pcSplitProbability1[i]);
337 ATH_MSG_DEBUG("pcSplitProbability2["
338 << i << "] = " << ef_pcOutput.pcSplitProbability2[i]);
339 ATH_MSG_DEBUG("pcLvl1a[" << i << "] = " << ef_pcOutput.pcLvl1a[i]);
340 }
341 }
342
343 // Group data to make the strip cluster container
344 scAux.localPosition = std::move(scLocalPosition);
345 scAux.localCovariance = std::move(scLocalCovariance);
346 scAux.idHash = std::move(scIdHash);
347 scAux.id = std::move(scId);
348 scAux.globalPosition = std::move(scGlobalPosition);
349 scAux.rdoList = std::move(scRdoList);
350 scAux.channelsInPhi = std::move(scChannelsInPhi);
351
352 // Group data to make the pixel cluster container
353 pxAux.id = std::move(pcId);
354 pxAux.idHash = std::move(pcIdHash);
355 pxAux.localPosition = std::move(pcLocalPosition);
356 pxAux.localCovariance = std::move(pcLocalCovariance);
357 pxAux.globalPosition = std::move(pcGlobalPosition);
358 pxAux.rdoList = std::move(pcRdoList);
359 pxAux.channelsInPhi = std::move(pcChannelsInPhi);
360 pxAux.channelsInEta = std::move(pcChannelsInEta);
361 pxAux.widthInEta = std::move(pcWidthInEta);
362 pxAux.totList = std::move(pcTotList);
363 pxAux.totalToT = std::move(pcTotalToT);
364 pxAux.chargeList = std::move(pcChargeList);
365 pxAux.totalCharge = std::move(pcTotalCharge);
366 pxAux.energyLoss = std::move(pcEnergyLoss);
367 pxAux.isSplit = std::move(pcIsSplit);
368 pxAux.splitProbability1 = std::move(pcSplitProbability1);
369 pxAux.splitProbability2 = std::move(pcSplitProbability2);
370 pxAux.lvl1a = std::move(pcLvl1a);
371
372 // Transfer pixel space point data to pixelSpAux
373 for (unsigned int i = 0; i < metadata->numOfPixelSpacePoints; i++) {
374 pixelSpAux.elementIdList.push_back(ef_pspOutput.spElementIdList[i]);
375
376 // Copy x,y,z position
377 pixelSpAux.globalPosition.push_back(ef_pspOutput.spGlobalPosition[i*3]);
378 pixelSpAux.globalPosition.push_back(ef_pspOutput.spGlobalPosition[i*3+1]);
379 pixelSpAux.globalPosition.push_back(ef_pspOutput.spGlobalPosition[i*3+2]);
380
381 pixelSpAux.measurementIndexes.push_back(ef_pspOutput.spMeasurementIndexes[i]);
382 pixelSpAux.varianceR.push_back(ef_pspOutput.spVarianceR[i]);
383 pixelSpAux.varianceZ.push_back(ef_pspOutput.spVarianceZ[i]);
384 }
385
386 // Transfer strip space point data to stripSpAux
387 for (unsigned int i = 0; i < metadata->numOfStripSpacePoints; i++) {
388 // For strip space points, add both element IDs
389 stripSpAux.elementIdList.push_back(ef_sspOutput.spElementIdList[i*2]);
390 stripSpAux.elementIdList.push_back(ef_sspOutput.spElementIdList[i*2+1]);
391
392 // Add position data
393 stripSpAux.globalPosition.push_back(ef_sspOutput.spGlobalPosition[i*3]);
394 stripSpAux.globalPosition.push_back(ef_sspOutput.spGlobalPosition[i*3+1]);
395 stripSpAux.globalPosition.push_back(ef_sspOutput.spGlobalPosition[i*3+2]);
396
397 // Add measurement indexes
398 stripSpAux.measurementIndexes.push_back(ef_sspOutput.spMeasurementIndexes[i*2]);
399 stripSpAux.measurementIndexes.push_back(ef_sspOutput.spMeasurementIndexes[i*2+1]);
400
401 // Add variance data
402 stripSpAux.varianceR.push_back(ef_sspOutput.spVarianceR[i]);
403 stripSpAux.varianceZ.push_back(ef_sspOutput.spVarianceZ[i]);
404 }
405
406
407 if (msgLvl(MSG::DEBUG)) {
408 // add guard to prevent out of bounds access
409 // in instances of not having any/enough strip space points
410 const int maxToPrintStripSp = std::min<int>(3,
411 static_cast<int>(stripSpAux.elementIdList.size()));
412 // Print strip space points
413 ATH_MSG_DEBUG("Printing first few strip space points:");
414 for (int i = 0; i < maxToPrintStripSp; i++) {
415 ATH_MSG_DEBUG("StripSpacePoint[" << i << "]: "
416 << "position=(" << stripSpAux.globalPosition[i*3] << ", "
417 << stripSpAux.globalPosition[i*3+1] << ", "
418 << stripSpAux.globalPosition[i*3+2] << ")"
419 << ", varianceR=" << stripSpAux.varianceR[i]
420 << ", varianceZ=" << stripSpAux.varianceZ[i]);
421 }
422 // Print pixel space points
423 ATH_MSG_DEBUG("Printing first few pixel space points:");
424 // add guard to prevent out of bounds access
425 // in instances of not having any/enough pixel space points
426 const int maxToPrintPixelSp = std::min<int>(3,
427 static_cast<int>(pixelSpAux.elementIdList.size()));
428 for (int i = 0; i < maxToPrintPixelSp; i++) {
429 ATH_MSG_DEBUG("PixelSpacePoint[" << i << "]: "
430 << "position=(" << pixelSpAux.globalPosition[i*3] << ", "
431 << pixelSpAux.globalPosition[i*3+1] << ", "
432 << pixelSpAux.globalPosition[i*3+2] << ")"
433 << ", varianceR=" << pixelSpAux.varianceR[i]
434 << ", varianceZ=" << pixelSpAux.varianceZ[i]);
435 }
436
437 }
438 }
439 else
440 {
441 ATH_MSG_INFO("FPGA mode is not implemented yet");
442 return StatusCode::SUCCESS;
443 }
444
445 return StatusCode::SUCCESS;
446}
StatusCode getInputSpacePointData(const xAOD::SpacePointContainer *sp, std::vector< EFTrackingTransient::SpacePoint > &ef_sp, std::vector< std::vector< const xAOD::UncalibratedMeasurement * > > &sp_meas, unsigned long N, bool isStrip) const
Convert the space point from xAOD container to simple std::vector of EFTrackingTransient::SpacePoint.
Gaudi::Property< unsigned int > m_maxSpacePointNum
StatusCode getInputClusterData(const xAOD::StripClusterContainer *sc, std::vector< EFTrackingTransient::StripCluster > &ef_sc, unsigned long N) const
Convert the strip cluster from xAOD container to simple std::vector of EFTrackingTransient::StripClus...
StatusCode passThroughSW(const std::vector< EFTrackingTransient::StripCluster > &inputSC, EFTrackingTransient::StripClusterOutput &ef_scOutput, const std::vector< EFTrackingTransient::PixelCluster > &inputPC, EFTrackingTransient::PixelClusterOutput &ef_pcOutput, const std::vector< EFTrackingTransient::SpacePoint > &inputSSP, EFTrackingTransient::SpacePointOutput &ef_sspOutput, const std::vector< EFTrackingTransient::SpacePoint > &inputPSP, EFTrackingTransient::SpacePointOutput &ef_pspOutput, EFTrackingTransient::Metadata *metadata) const
Software version of the pass-through kernel.
Gaudi::Property< bool > m_runSW
Software mode, not running on the FPGA.
StatusCode passThroughSW_clusterOnly(const std::vector< EFTrackingTransient::StripCluster > &inputSC, EFTrackingTransient::StripClusterOutput &ef_scOutput, const std::vector< EFTrackingTransient::PixelCluster > &inputPC, EFTrackingTransient::PixelClusterOutput &ef_pcOutput, EFTrackingTransient::Metadata *metadata) const
This is a cluster-only version (sw) of the pass-through kernel This is used for cluter level studies.
Gaudi::Property< unsigned int > m_maxClusterNum
std::vector< unsigned long long > rdoList
std::vector< unsigned long long > rdoList

◆ runSW()

bool PassThroughTool::runSW ( ) const
inline

A getter for the m_runSW property.

Determine if the user set the tool to run at software level. If yes, the sw version of the pass-through kernel will be executed. If not, the FPGA (hw) version will be executed

Definition at line 119 of file PassThroughTool.h.

119{ return m_runSW; }

Member Data Documentation

◆ m_clusterOnlyPassThrough

Gaudi::Property<bool> PassThroughTool::m_clusterOnlyPassThrough
private
Initial value:
{this, "ClusterOnlyPassThrough", false,
"Use the cluster-only pass-through kernel"}

Use the cluster-only pass through tool.

Definition at line 125 of file PassThroughTool.h.

125 {this, "ClusterOnlyPassThrough", false,
126 "Use the cluster-only pass-through kernel"};

◆ m_doSpacepoints

Gaudi::Property<bool> PassThroughTool::m_doSpacepoints {this, "DoSpacepoints", false, "Do spacepoints"}
private

Temporary flag before spacepoints are ready.

Definition at line 124 of file PassThroughTool.h.

124{this, "DoSpacepoints", false, "Do spacepoints"};

◆ m_maxClusterNum

Gaudi::Property<unsigned int> PassThroughTool::m_maxClusterNum
private
Initial value:
{this, "MaxClusterNum", 500000,
"Maximum number of clusters that can be processed"}

Definition at line 127 of file PassThroughTool.h.

127 {this, "MaxClusterNum", 500000,
128 "Maximum number of clusters that can be processed"};

◆ m_maxSpacePointNum

Gaudi::Property<unsigned int> PassThroughTool::m_maxSpacePointNum
private
Initial value:
{this, "MaxSpacePointNum", 500000,
"Maximum number of space points that can be processed"}

Definition at line 129 of file PassThroughTool.h.

129 {this, "MaxSpacePointNum", 500000,
130 "Maximum number of space points that can be processed"};

◆ m_pixelClustersKey

SG::ReadHandleKey<xAOD::PixelClusterContainer> PassThroughTool::m_pixelClustersKey
private
Initial value:
{
this, "PixelClusterContainerKey", "ITkPixelClusters",
"Key for Pixel Cluster Containers"}

Definition at line 136 of file PassThroughTool.h.

136 {
137 this, "PixelClusterContainerKey", "ITkPixelClusters",
138 "Key for Pixel Cluster Containers"};

◆ m_runSW

Gaudi::Property<bool> PassThroughTool::m_runSW {this, "RunSW", true, "Run software mode"}
private

Software mode, not running on the FPGA.

Definition at line 123 of file PassThroughTool.h.

123{this, "RunSW", true, "Run software mode"};

◆ m_spacePointsKey

SG::ReadHandleKey<xAOD::SpacePointContainer> PassThroughTool::m_spacePointsKey
private
Initial value:
{
this, "SpacePointContainerKey", "ITkPixelSpacePoints",
"Key for Space Point Containers"}

Definition at line 139 of file PassThroughTool.h.

139 {
140 this, "SpacePointContainerKey", "ITkPixelSpacePoints",
141 "Key for Space Point Containers"};

◆ m_stripClustersKey

SG::ReadHandleKey<xAOD::StripClusterContainer> PassThroughTool::m_stripClustersKey
private
Initial value:
{
this, "StripClusterContainerKey", "ITkStripClusters",
"Key for Strip Cluster Containers"}

Definition at line 133 of file PassThroughTool.h.

133 {
134 this, "StripClusterContainerKey", "ITkStripClusters",
135 "Key for Strip Cluster Containers"};

The documentation for this class was generated from the following files: