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 // Local variable cache uses 16096 bytes of stack space
505 //coverity[STACK_USE]
506 EFTrackingTransient::PixelCluster cache;
507 // Get the data from the input xAOD::PixelClusterContainer and set it to the
508 // cache
509 cache.id = pc->at(i)->identifier();
510 cache.idHash = pc->at(i)->identifierHash();
511 cache.localPosition[0] = pc->at(i)->localPosition<2>()(0, 0);
512 cache.localPosition[1] = pc->at(i)->localPosition<2>()(1, 0);
513 cache.localCovariance[0] = pc->at(i)->localCovariance<2>()(0, 0);
514 cache.localCovariance[1] = pc->at(i)->localCovariance<2>()(1, 1);
515 cache.globalPosition[0] = pc->at(i)->globalPosition()[0];
516 cache.globalPosition[1] = pc->at(i)->globalPosition()[1];
517 cache.globalPosition[2] = pc->at(i)->globalPosition()[2];
518
519 for (long unsigned int j = 0; j < pc->at(i)->rdoList().size(); j++)
520 {
521 cache.rdoList[j] = pc->at(i)->rdoList().at(j);
522 }
523
524 cache.channelsInPhi = pc->at(i)->channelsInPhi();
525 cache.channelsInEta = pc->at(i)->channelsInEta();
526 cache.widthInEta = pc->at(i)->widthInEta();
527
528 for (long unsigned int j = 0; j < pc->at(i)->totList().size(); j++)
529 {
530 cache.totList[j] = pc->at(i)->totList().at(j);
531 }
532
534
535 for (long unsigned int j = 0; j < pc->at(i)->chargeList().size(); j++)
536 {
537 cache.chargeList[j] = pc->at(i)->chargeList().at(j);
538 }
539
541 cache.energyLoss = pc->at(i)->energyLoss();
542 cache.isSplit = false;
543 cache.splitProbability1 = 0;
544 cache.splitProbability2 = 0;
545 cache.lvl1a = pc->at(i)->lvl1a();
546 cache.sizeOfRDOList = pc->at(i)->rdoList().size();
547 cache.sizeOfTotList = pc->at(i)->totList().size();
548 cache.sizeOfChargeList = pc->at(i)->chargeList().size();
549
550 ef_pc.push_back(cache);
551 }
552
553 ATH_MSG_DEBUG("Made " << ef_pc.size() << " pixel clusters in the vector");
554 return StatusCode::SUCCESS;
555}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
size_t size() const
Number of registered mappings.
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
const IIntersectionCache * cache() const
Retrieve the associated cache block, if it exists.

◆ 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);
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 557 of file PassThroughTool.cxx.

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

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

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

◆ 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: