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++)
574 cache.
idHash[0] = sp->
at(
i)->elementIdList()[0];
579 cache.
cov_r = sp->
at(
i)->varianceR();
580 cache.
cov_z = sp->
at(
i)->varianceZ();
584 std::vector<const xAOD::UncalibratedMeasurement *> temp_vec(
585 sp->
at(
i)->measurements().size());
587 sp->
at(
i)->measurements().end(), temp_vec.begin());
589 sp_meas.push_back(temp_vec);
593 cache.
idHash[1] = sp->
at(
i)->elementIdList()[1];
597 sp->
at(
i)->topStripDirection().data() +
598 sp->
at(
i)->topStripDirection().size(),
601 sp->
at(
i)->bottomStripDirection().data() +
602 sp->
at(
i)->bottomStripDirection().size(),
605 sp->
at(
i)->stripCenterDistance().data() +
606 sp->
at(
i)->stripCenterDistance().size(),
609 sp->
at(
i)->topStripCenter().data() +
610 sp->
at(
i)->topStripCenter().size(),
613 ef_sp.push_back(cache);
616 ATH_MSG_DEBUG(
"Made " << ef_sp.size() <<
" space points in the vector");
617 return StatusCode::SUCCESS;
623 const std::vector<EFTrackingTransient::StripCluster> &inputSC,
626 const std::vector<EFTrackingTransient::PixelCluster> &inputPC,
629 const std::vector<EFTrackingTransient::SpacePoint> &inputSSP,
632 const std::vector<EFTrackingTransient::SpacePoint> &inputPSP,
637 if (inputSC.empty()) {
641 metadata->numOfStripSpacePoints = 0;
642 return StatusCode::SUCCESS;
645 if (inputPC.empty()) {
649 metadata->numOfPixelSpacePoints = 0;
650 return StatusCode::SUCCESS;
653 int rdoIndex_counter = 0;
655 unsigned int inputscRdoIndexSize = 0;
656 unsigned int inputpcRdoIndexSize = 0;
660 for (
size_t i = 0;
i < inputSC.size();
i++)
665 ef_scOutput.
scId[
i] = inputSC[
i].id;
670 inputscRdoIndexSize += inputSC[
i].sizeOfRDOList;
672 for (
int j = 0; j < inputSC[
i].sizeOfRDOList; j++)
674 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[
i].rdoList[j];
678 rdoIndex_counter += inputSC[
i].sizeOfRDOList;
679 metadata[0].scRdoIndex[
i] = inputSC[
i].sizeOfRDOList;
683 rdoIndex_counter = 0;
684 int totIndex_counter = 0;
685 int chargeIndex_counter = 0;
687 unsigned int inputpcTotListsize = 0;
688 unsigned int inputpcChargeListsize = 0;
691 for (
size_t i = 0;
i < inputPC.size();
i++)
698 ef_pcOutput.
pcId[
i] = inputPC[
i].id;
703 inputpcRdoIndexSize += inputPC[
i].sizeOfRDOList;
705 for (
int j = 0; j < inputPC[
i].sizeOfRDOList; j++)
707 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[
i].rdoList[j];
713 inputpcTotListsize += inputPC[
i].sizeOfTotList;
715 for (
int j = 0; j < inputPC[
i].sizeOfTotList; j++)
717 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[
i].totList[j];
721 inputpcChargeListsize += inputPC[
i].sizeOfChargeList;
723 for (
int j = 0; j < inputPC[
i].sizeOfChargeList; j++)
726 inputPC[
i].chargeList[j];
733 ef_pcOutput.
pcLvl1a[
i] = inputPC[
i].lvl1a;
736 rdoIndex_counter += inputPC[
i].sizeOfRDOList;
737 totIndex_counter += inputPC[
i].sizeOfTotList;
738 chargeIndex_counter += inputPC[
i].sizeOfChargeList;
739 metadata[0].pcRdoIndex[
i] = inputPC[
i].sizeOfRDOList;
740 metadata[0].pcTotIndex[
i] = inputPC[
i].sizeOfTotList;
741 metadata[0].pcChargeIndex[
i] = inputPC[
i].sizeOfChargeList;
745 metadata[0].numOfStripClusters = inputSC.size();
746 metadata[0].numOfPixelClusters = inputPC.size();
747 metadata[0].scRdoIndexSize = inputscRdoIndexSize;
748 metadata[0].pcRdoIndexSize = inputpcRdoIndexSize;
749 metadata[0].pcTotIndexSize = inputpcTotListsize;
750 metadata[0].pcChargeIndexSize = inputpcChargeListsize;
755 ATH_MSG_DEBUG(
"Processing " << inputPSP.size() <<
" pixel space points");
758 for (
size_t i = 0;
i < inputPSP.size();
i++) {
769 ATH_MSG_DEBUG(
"Processing " << inputSSP.size() <<
" strip space points");
772 for (
size_t i = 0;
i < inputSSP.size();
i++) {
793 metadata[0].numOfPixelSpacePoints = inputPSP.size();
794 metadata[0].numOfStripSpacePoints = inputSSP.size();
797 metadata[0].numOfPixelSpacePoints = 0;
798 metadata[0].numOfStripSpacePoints = 0;
811 const int maxToPrintPixelSp = std::min<int>(3,
812 static_cast<int>(inputPSP.size()));
814 for (
int i = 0;
i < maxToPrintPixelSp;
i++) {
816 <<
"position=(" << inputPSP[
i].globalPosition[0] <<
", "
817 << inputPSP[
i].globalPosition[1] <<
", "
818 << inputPSP[
i].globalPosition[2] <<
")"
819 <<
", varianceR=" << inputPSP[
i].cov_r
820 <<
", varianceZ=" << inputPSP[
i].cov_z);
826 const int maxToPrintStripSp = std::min<int>(3,
827 static_cast<int>(inputSSP.size()));
829 for (
int i = 0;
i < maxToPrintStripSp;
i++) {
831 <<
"position=(" << inputSSP[
i].globalPosition[0] <<
", "
832 << inputSSP[
i].globalPosition[1] <<
", "
833 << inputSSP[
i].globalPosition[2] <<
")"
834 <<
", varianceR=" << inputSSP[
i].cov_r
835 <<
", varianceZ=" << inputSSP[
i].cov_z);
839 return StatusCode::SUCCESS;
844 const std::vector<EFTrackingTransient::StripCluster> &inputSC,
847 const std::vector<EFTrackingTransient::PixelCluster> &inputPC,
853 int rdoIndex_counter = 0;
855 unsigned int inputscRdoIndexSize = 0;
859 for (
size_t i = 0;
i < inputSC.size();
i++)
864 ef_scOutput.
scId[
i] = inputSC[
i].id;
869 inputscRdoIndexSize += inputSC[
i].sizeOfRDOList;
871 for (
int j = 0; j < inputSC[
i].sizeOfRDOList; j++)
873 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[
i].rdoList[j];
877 rdoIndex_counter += inputSC[
i].sizeOfRDOList;
878 metadata[0].scRdoIndex[
i] = inputSC[
i].sizeOfRDOList;
882 rdoIndex_counter = 0;
883 int totIndex_counter = 0;
884 int chargeIndex_counter = 0;
886 unsigned int inputpcRdoIndexSize = 0;
887 unsigned int inputpcTotListsize = 0;
888 unsigned int inputpcChargeListsize = 0;
892 for (
size_t i = 0;
i < inputPC.size();
i++)
899 ef_pcOutput.
pcId[
i] = inputPC[
i].id;
904 inputpcRdoIndexSize += inputPC[
i].sizeOfRDOList;
906 for (
int j = 0; j < inputPC[
i].sizeOfRDOList; j++)
908 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[
i].rdoList[j];
914 inputpcTotListsize += inputPC[
i].sizeOfTotList;
916 for (
int j = 0; j < inputPC[
i].sizeOfTotList; j++)
918 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[
i].totList[j];
922 inputpcChargeListsize += inputPC[
i].sizeOfChargeList;
924 for (
int j = 0; j < inputPC[
i].sizeOfChargeList; j++)
927 inputPC[
i].chargeList[j];
934 ef_pcOutput.
pcLvl1a[
i] = inputPC[
i].lvl1a;
937 rdoIndex_counter += inputPC[
i].sizeOfRDOList;
938 totIndex_counter += inputPC[
i].sizeOfTotList;
939 chargeIndex_counter += inputPC[
i].sizeOfChargeList;
940 metadata[0].pcRdoIndex[
i] = inputPC[
i].sizeOfRDOList;
941 metadata[0].pcTotIndex[
i] = inputPC[
i].sizeOfTotList;
942 metadata[0].pcChargeIndex[
i] = inputPC[
i].sizeOfChargeList;
945 metadata[0].numOfStripClusters = inputSC.size();
946 metadata[0].numOfPixelClusters = inputPC.size();
947 metadata[0].scRdoIndexSize = inputscRdoIndexSize;
948 metadata[0].pcRdoIndexSize = inputpcRdoIndexSize;
949 metadata[0].pcTotIndexSize = inputpcTotListsize;
950 metadata[0].pcChargeIndexSize = inputpcChargeListsize;
960 metadata[0].numOfPixelSpacePoints = 0;
961 metadata[0].numOfStripSpacePoints = 0;
967 return StatusCode::SUCCESS;