28 const EventContext &ctx)
const
41 if (!inputStripClusters.
isValid())
44 return StatusCode::FAILURE;
48 if (!inputPixelClusters.
isValid())
51 return StatusCode::FAILURE;
55 if (!inputSpacePoints.
isValid())
58 return StatusCode::FAILURE;
61 if (msgLvl(MSG::DEBUG))
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());
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;
78 std::vector<std::vector<const xAOD::UncalibratedMeasurement*>> pixelSpMeasurements;
79 std::vector<std::vector<const xAOD::UncalibratedMeasurement*>> stripSpMeasurements;
87 inputSpacePoints->size(),
false));
89 if (msgLvl(MSG::DEBUG))
91 const int maxToPrintStripCl = std::min<int>(3, ef_stripClusters.size());
93 for (
int i = 0; i < maxToPrintStripCl; i++)
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);
107 const int maxToPrintPixelCl = std::min<int>(3, ef_pixelClusters.size());
108 for (
int i = 0; i < maxToPrintPixelCl; i++)
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);
139 ATH_MSG_INFO(
"Running the sw ver of the pass-through kernel");
153 ef_scOutput.
scIdHash = scIdHash.data();
154 ef_scOutput.
scId = scId.data();
156 ef_scOutput.
scRdoList = scRdoList.data();
183 ef_pcOutput.
pcIdHash = pcIdHash.data();
184 ef_pcOutput.
pcId = pcId.data();
186 ef_pcOutput.
pcRdoList = pcRdoList.data();
190 ef_pcOutput.
pcTotList = pcTotList.data();
195 ef_pcOutput.
pcIsSplit = pcIsSplit.data();
198 ef_pcOutput.
pcLvl1a = pcLvl1a.data();
210 ef_pspOutput.
spIdHash = pspIdHash.data();
212 ef_pspOutput.
spRadius = pspRadius.data();
228 ef_sspOutput.
spIdHash = sspIdHash.data();
230 ef_sspOutput.
spRadius = sspRadius.data();
239 ef_pixelClusters, ef_pcOutput,
243 ef_pixelClusters, ef_pcOutput,
244 ef_stripSpacePoints, ef_sspOutput,
245 ef_pixelSpacePoints, ef_pspOutput,
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);
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);
277 if (msgLvl(MSG::DEBUG)) {
280 const unsigned int nStripClustersToPrint = std::min(3u,
281 static_cast<unsigned int>(scLocalPosition.size()));
283 for (
unsigned i = 0; i < nStripClustersToPrint; i++)
301 const unsigned int nPixelClustersToPrint = std::min(3u,
302 static_cast<unsigned int>(pcLocalPosition.size()));
304 for (
unsigned i = 0; i < nPixelClustersToPrint; i++)
346 scAux.
idHash = std::move(scIdHash);
347 scAux.
id = std::move(scId);
349 scAux.
rdoList = std::move(scRdoList);
353 pxAux.
id = std::move(pcId);
354 pxAux.
idHash = std::move(pcIdHash);
358 pxAux.
rdoList = std::move(pcRdoList);
362 pxAux.
totList = std::move(pcTotList);
363 pxAux.
totalToT = std::move(pcTotalToT);
367 pxAux.
isSplit = std::move(pcIsSplit);
370 pxAux.
lvl1a = std::move(pcLvl1a);
373 for (
unsigned int i = 0; i < metadata->numOfPixelSpacePoints; i++) {
387 for (
unsigned int i = 0; i < metadata->numOfStripSpacePoints; i++) {
407 if (msgLvl(MSG::DEBUG)) {
410 const int maxToPrintStripSp = std::min<int>(3,
414 for (
int i = 0; i < maxToPrintStripSp; i++) {
419 <<
", varianceR=" << stripSpAux.
varianceR[i]
420 <<
", varianceZ=" << stripSpAux.
varianceZ[i]);
426 const int maxToPrintPixelSp = std::min<int>(3,
428 for (
int i = 0; i < maxToPrintPixelSp; i++) {
433 <<
", varianceR=" << pixelSpAux.
varianceR[i]
434 <<
", varianceZ=" << pixelSpAux.
varianceZ[i]);
442 return StatusCode::SUCCESS;
445 return StatusCode::SUCCESS;
491 std::vector<EFTrackingTransient::PixelCluster> &ef_pc,
492 unsigned long N)
const
497 << N <<
"th pixel cluster, but there are only " << pc->size()
498 <<
" pixel clusters in the container.");
499 return StatusCode::FAILURE;
502 for (
unsigned long i = 0; i < N; i++)
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];
519 for (
long unsigned int j = 0; j < pc->at(i)->rdoList().
size(); j++)
521 cache.rdoList[j] = pc->at(i)->rdoList().at(j).get_compact();
524 cache.channelsInPhi = pc->at(i)->channelsInPhi();
525 cache.channelsInEta = pc->at(i)->channelsInEta();
526 cache.widthInEta = pc->at(i)->widthInEta();
528 for (
long unsigned int j = 0; j < pc->at(i)->totList().
size(); j++)
530 cache.totList[j] = pc->at(i)->totList().at(j);
535 for (
long unsigned int j = 0; j < pc->at(i)->chargeList().
size(); j++)
537 cache.chargeList[j] = pc->at(i)->chargeList().at(j);
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();
550 ef_pc.push_back(cache);
553 ATH_MSG_DEBUG(
"Made " << ef_pc.size() <<
" pixel clusters in the vector");
554 return StatusCode::SUCCESS;
559 std::vector<EFTrackingTransient::SpacePoint> &ef_sp,
560 std::vector<std::vector<const xAOD::UncalibratedMeasurement *>> &sp_meas,
561 unsigned long N,
bool isStrip)
const
566 << N <<
"th space point, but there are only " <<
sp->size()
567 <<
" SpacePoint in the container.");
568 return StatusCode::FAILURE;
571 for (
unsigned long i = 0; i < N; i++)
574 const auto * thisSp =
sp->at(i);
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();
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());
592 sp_meas.push_back(std::move(temp_vec));
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);
616 ef_sp.push_back(cache);
619 ATH_MSG_DEBUG(
"Made " << ef_sp.size() <<
" space points in the vector");
620 return StatusCode::SUCCESS;
626 const std::vector<EFTrackingTransient::StripCluster> &inputSC,
629 const std::vector<EFTrackingTransient::PixelCluster> &inputPC,
632 const std::vector<EFTrackingTransient::SpacePoint> &inputSSP,
635 const std::vector<EFTrackingTransient::SpacePoint> &inputPSP,
640 if (inputSC.empty()) {
643 metadata->numOfStripClusters = 0;
644 metadata->numOfStripSpacePoints = 0;
645 return StatusCode::SUCCESS;
648 if (inputPC.empty()) {
651 metadata->numOfPixelClusters = 0;
652 metadata->numOfPixelSpacePoints = 0;
653 return StatusCode::SUCCESS;
656 int rdoIndex_counter = 0;
658 unsigned int inputscRdoIndexSize = 0;
659 unsigned int inputpcRdoIndexSize = 0;
663 for (
size_t i = 0; i < inputSC.size(); i++)
667 ef_scOutput.
scIdHash[i] = inputSC[i].idHash;
668 ef_scOutput.
scId[i] = inputSC[i].id;
673 inputscRdoIndexSize += inputSC[i].sizeOfRDOList;
675 for (
int j = 0; j < inputSC[i].sizeOfRDOList; j++)
677 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[i].rdoList[j];
681 rdoIndex_counter += inputSC[i].sizeOfRDOList;
682 metadata[0].scRdoIndex[i] = inputSC[i].sizeOfRDOList;
686 rdoIndex_counter = 0;
687 int totIndex_counter = 0;
688 int chargeIndex_counter = 0;
690 unsigned int inputpcTotListsize = 0;
691 unsigned int inputpcChargeListsize = 0;
694 for (
size_t i = 0; i < inputPC.size(); i++)
700 ef_pcOutput.
pcIdHash[i] = inputPC[i].idHash;
701 ef_pcOutput.
pcId[i] = inputPC[i].id;
706 inputpcRdoIndexSize += inputPC[i].sizeOfRDOList;
708 for (
int j = 0; j < inputPC[i].sizeOfRDOList; j++)
710 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[i].rdoList[j];
716 inputpcTotListsize += inputPC[i].sizeOfTotList;
718 for (
int j = 0; j < inputPC[i].sizeOfTotList; j++)
720 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[i].totList[j];
722 ef_pcOutput.
pcTotalToT[i] = inputPC[i].totalToT;
724 inputpcChargeListsize += inputPC[i].sizeOfChargeList;
726 for (
int j = 0; j < inputPC[i].sizeOfChargeList; j++)
729 inputPC[i].chargeList[j];
733 ef_pcOutput.
pcIsSplit[i] = inputPC[i].isSplit;
736 ef_pcOutput.
pcLvl1a[i] = inputPC[i].lvl1a;
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;
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;
758 ATH_MSG_DEBUG(
"Processing " << inputPSP.size() <<
" pixel space points");
761 for (
size_t i = 0; i < inputPSP.size(); i++) {
772 ATH_MSG_DEBUG(
"Processing " << inputSSP.size() <<
" strip space points");
775 for (
size_t i = 0; i < inputSSP.size(); i++) {
796 metadata[0].numOfPixelSpacePoints = inputPSP.size();
797 metadata[0].numOfStripSpacePoints = inputSSP.size();
800 metadata[0].numOfPixelSpacePoints = 0;
801 metadata[0].numOfStripSpacePoints = 0;
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);
810 if (msgLvl(MSG::DEBUG)) {
814 const int maxToPrintPixelSp = std::min<int>(3,
815 static_cast<int>(inputPSP.size()));
817 for (
int i = 0; i < maxToPrintPixelSp; 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);
829 const int maxToPrintStripSp = std::min<int>(3,
830 static_cast<int>(inputSSP.size()));
832 for (
int i = 0; i < maxToPrintStripSp; 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);
842 return StatusCode::SUCCESS;
847 const std::vector<EFTrackingTransient::StripCluster> &inputSC,
850 const std::vector<EFTrackingTransient::PixelCluster> &inputPC,
856 int rdoIndex_counter = 0;
858 unsigned int inputscRdoIndexSize = 0;
862 for (
size_t i = 0; i < inputSC.size(); i++)
866 ef_scOutput.
scIdHash[i] = inputSC[i].idHash;
867 ef_scOutput.
scId[i] = inputSC[i].id;
872 inputscRdoIndexSize += inputSC[i].sizeOfRDOList;
874 for (
int j = 0; j < inputSC[i].sizeOfRDOList; j++)
876 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[i].rdoList[j];
880 rdoIndex_counter += inputSC[i].sizeOfRDOList;
881 metadata[0].scRdoIndex[i] = inputSC[i].sizeOfRDOList;
885 rdoIndex_counter = 0;
886 int totIndex_counter = 0;
887 int chargeIndex_counter = 0;
889 unsigned int inputpcRdoIndexSize = 0;
890 unsigned int inputpcTotListsize = 0;
891 unsigned int inputpcChargeListsize = 0;
895 for (
size_t i = 0; i < inputPC.size(); i++)
901 ef_pcOutput.
pcIdHash[i] = inputPC[i].idHash;
902 ef_pcOutput.
pcId[i] = inputPC[i].id;
907 inputpcRdoIndexSize += inputPC[i].sizeOfRDOList;
909 for (
int j = 0; j < inputPC[i].sizeOfRDOList; j++)
911 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[i].rdoList[j];
917 inputpcTotListsize += inputPC[i].sizeOfTotList;
919 for (
int j = 0; j < inputPC[i].sizeOfTotList; j++)
921 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[i].totList[j];
923 ef_pcOutput.
pcTotalToT[i] = inputPC[i].totalToT;
925 inputpcChargeListsize += inputPC[i].sizeOfChargeList;
927 for (
int j = 0; j < inputPC[i].sizeOfChargeList; j++)
930 inputPC[i].chargeList[j];
934 ef_pcOutput.
pcIsSplit[i] = inputPC[i].isSplit;
937 ef_pcOutput.
pcLvl1a[i] = inputPC[i].lvl1a;
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;
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;
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);
963 metadata[0].numOfPixelSpacePoints = 0;
964 metadata[0].numOfStripSpacePoints = 0;
967 ATH_MSG_DEBUG(
"numOfPixelSpacePoints: " << metadata[0].numOfPixelSpacePoints);
968 ATH_MSG_DEBUG(
"numOfStripSpacePoints: " << metadata[0].numOfStripSpacePoints);
970 return StatusCode::SUCCESS;