20 return StatusCode::SUCCESS;
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;
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));
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);
280 const unsigned int nStripClustersToPrint =
std::min(3
u,
281 static_cast<unsigned int>(scLocalPosition.size()));
283 for (
unsigned i = 0;
i < nStripClustersToPrint;
i++)
301 const unsigned int nPixelClustersToPrint =
std::min(3
u,
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++) {
410 const int maxToPrintStripSp = std::min<int>(3,
414 for (
int i = 0;
i < maxToPrintStripSp;
i++) {
420 <<
", varianceZ=" << stripSpAux.
varianceZ[
i]);
426 const int maxToPrintPixelSp = std::min<int>(3,
428 for (
int i = 0;
i < maxToPrintPixelSp;
i++) {
434 <<
", varianceZ=" << pixelSpAux.
varianceZ[
i]);
442 return StatusCode::SUCCESS;
445 return StatusCode::SUCCESS;
450 std::vector<EFTrackingTransient::StripCluster> &ef_sc,
451 unsigned long N)
const
456 <<
N <<
"th strip cluster, but there are only " <<
sc->size()
457 <<
" strip clusters in the container.");
458 return StatusCode::FAILURE;
461 for (
unsigned long i = 0;
i <
N;
i++)
468 cache.
idHash =
sc->at(
i)->identifierHash();
469 cache.
id =
sc->at(
i)->identifier();
474 for (
unsigned long j = 0; j <
sc->at(
i)->rdoList().size(); j++)
476 cache.
rdoList[j] =
sc->at(
i)->rdoList().at(j).get_compact();
482 ef_sc.push_back(cache);
485 ATH_MSG_DEBUG(
"Made " << ef_sc.size() <<
" strip clusters in the vector");
486 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++)
507 cache.
id =
pc->at(
i)->identifier();
508 cache.
idHash =
pc->at(
i)->identifierHash();
517 for (
long unsigned int j = 0; j <
pc->at(
i)->rdoList().size(); j++)
519 cache.
rdoList[j] =
pc->at(
i)->rdoList().at(j).get_compact();
526 for (
long unsigned int j = 0; j <
pc->at(
i)->totList().size(); j++)
528 cache.
totList[j] =
pc->at(
i)->totList().at(j);
533 for (
long unsigned int j = 0; j <
pc->at(
i)->chargeList().size(); j++)
548 ef_pc.push_back(cache);
551 ATH_MSG_DEBUG(
"Made " << ef_pc.size() <<
" pixel clusters in the vector");
552 return StatusCode::SUCCESS;
557 std::vector<EFTrackingTransient::SpacePoint> &ef_sp,
558 std::vector<std::vector<const xAOD::UncalibratedMeasurement *>> &sp_meas,
559 unsigned long N,
bool isStrip)
const
564 <<
N <<
"th space point, but there are only " << sp->
size()
565 <<
" SpacePoint in the container.");
566 return StatusCode::FAILURE;
569 for (
unsigned long i = 0;
i <
N;
i++)
572 const auto * thisSp = sp->
at(
i);
575 cache.
idHash[0] = thisSp->elementIdList()[0];
579 cache.
radius = thisSp->radius();
580 cache.
cov_r = thisSp->varianceR();
581 cache.
cov_z = thisSp->varianceZ();
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());
590 sp_meas.push_back(std::move(temp_vec));
594 cache.
idHash[1] = thisSp->elementIdList()[1];
597 std::copy(thisSp->topStripDirection().data(),
598 thisSp->topStripDirection().data() +
599 thisSp->topStripDirection().size(),
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(),
609 std::copy(thisSp->topStripCenter().data(),
610 thisSp->topStripCenter().data() +
611 thisSp->topStripCenter().size(),
614 ef_sp.push_back(cache);
617 ATH_MSG_DEBUG(
"Made " << ef_sp.size() <<
" space points in the vector");
618 return StatusCode::SUCCESS;
624 const std::vector<EFTrackingTransient::StripCluster> &inputSC,
627 const std::vector<EFTrackingTransient::PixelCluster> &inputPC,
630 const std::vector<EFTrackingTransient::SpacePoint> &inputSSP,
633 const std::vector<EFTrackingTransient::SpacePoint> &inputPSP,
638 if (inputSC.empty()) {
642 metadata->numOfStripSpacePoints = 0;
643 return StatusCode::SUCCESS;
646 if (inputPC.empty()) {
650 metadata->numOfPixelSpacePoints = 0;
651 return StatusCode::SUCCESS;
654 int rdoIndex_counter = 0;
656 unsigned int inputscRdoIndexSize = 0;
657 unsigned int inputpcRdoIndexSize = 0;
661 for (
size_t i = 0;
i < inputSC.size();
i++)
666 ef_scOutput.
scId[
i] = inputSC[
i].id;
671 inputscRdoIndexSize += inputSC[
i].sizeOfRDOList;
673 for (
int j = 0; j < inputSC[
i].sizeOfRDOList; j++)
675 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[
i].rdoList[j];
679 rdoIndex_counter += inputSC[
i].sizeOfRDOList;
680 metadata[0].scRdoIndex[
i] = inputSC[
i].sizeOfRDOList;
684 rdoIndex_counter = 0;
685 int totIndex_counter = 0;
686 int chargeIndex_counter = 0;
688 unsigned int inputpcTotListsize = 0;
689 unsigned int inputpcChargeListsize = 0;
692 for (
size_t i = 0;
i < inputPC.size();
i++)
699 ef_pcOutput.
pcId[
i] = inputPC[
i].id;
704 inputpcRdoIndexSize += inputPC[
i].sizeOfRDOList;
706 for (
int j = 0; j < inputPC[
i].sizeOfRDOList; j++)
708 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[
i].rdoList[j];
714 inputpcTotListsize += inputPC[
i].sizeOfTotList;
716 for (
int j = 0; j < inputPC[
i].sizeOfTotList; j++)
718 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[
i].totList[j];
722 inputpcChargeListsize += inputPC[
i].sizeOfChargeList;
724 for (
int j = 0; j < inputPC[
i].sizeOfChargeList; j++)
727 inputPC[
i].chargeList[j];
734 ef_pcOutput.
pcLvl1a[
i] = inputPC[
i].lvl1a;
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;
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;
756 ATH_MSG_DEBUG(
"Processing " << inputPSP.size() <<
" pixel space points");
759 for (
size_t i = 0;
i < inputPSP.size();
i++) {
770 ATH_MSG_DEBUG(
"Processing " << inputSSP.size() <<
" strip space points");
773 for (
size_t i = 0;
i < inputSSP.size();
i++) {
794 metadata[0].numOfPixelSpacePoints = inputPSP.size();
795 metadata[0].numOfStripSpacePoints = inputSSP.size();
798 metadata[0].numOfPixelSpacePoints = 0;
799 metadata[0].numOfStripSpacePoints = 0;
812 const int maxToPrintPixelSp = std::min<int>(3,
813 static_cast<int>(inputPSP.size()));
815 for (
int i = 0;
i < maxToPrintPixelSp;
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);
827 const int maxToPrintStripSp = std::min<int>(3,
828 static_cast<int>(inputSSP.size()));
830 for (
int i = 0;
i < maxToPrintStripSp;
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);
840 return StatusCode::SUCCESS;
845 const std::vector<EFTrackingTransient::StripCluster> &inputSC,
848 const std::vector<EFTrackingTransient::PixelCluster> &inputPC,
854 int rdoIndex_counter = 0;
856 unsigned int inputscRdoIndexSize = 0;
860 for (
size_t i = 0;
i < inputSC.size();
i++)
865 ef_scOutput.
scId[
i] = inputSC[
i].id;
870 inputscRdoIndexSize += inputSC[
i].sizeOfRDOList;
872 for (
int j = 0; j < inputSC[
i].sizeOfRDOList; j++)
874 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[
i].rdoList[j];
878 rdoIndex_counter += inputSC[
i].sizeOfRDOList;
879 metadata[0].scRdoIndex[
i] = inputSC[
i].sizeOfRDOList;
883 rdoIndex_counter = 0;
884 int totIndex_counter = 0;
885 int chargeIndex_counter = 0;
887 unsigned int inputpcRdoIndexSize = 0;
888 unsigned int inputpcTotListsize = 0;
889 unsigned int inputpcChargeListsize = 0;
893 for (
size_t i = 0;
i < inputPC.size();
i++)
900 ef_pcOutput.
pcId[
i] = inputPC[
i].id;
905 inputpcRdoIndexSize += inputPC[
i].sizeOfRDOList;
907 for (
int j = 0; j < inputPC[
i].sizeOfRDOList; j++)
909 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[
i].rdoList[j];
915 inputpcTotListsize += inputPC[
i].sizeOfTotList;
917 for (
int j = 0; j < inputPC[
i].sizeOfTotList; j++)
919 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[
i].totList[j];
923 inputpcChargeListsize += inputPC[
i].sizeOfChargeList;
925 for (
int j = 0; j < inputPC[
i].sizeOfChargeList; j++)
928 inputPC[
i].chargeList[j];
935 ef_pcOutput.
pcLvl1a[
i] = inputPC[
i].lvl1a;
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;
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;
961 metadata[0].numOfPixelSpacePoints = 0;
962 metadata[0].numOfStripSpacePoints = 0;
968 return StatusCode::SUCCESS;