19 #define MAX_CLUSTER_NUM \
20 500000 // A large enough number for the current development, should be
23 #define MAX_SPACEPOINT_NUM \
24 500000 // A large enough number for the current development, should be
32 "Running the software mode. The FPGA accelerator will not be used. "
33 "Software version of the kernel is used instead.");
47 return StatusCode::SUCCESS;
63 if (!inputStripClusters.
isValid()) {
65 return StatusCode::FAILURE;
69 if (!inputPixelClusters.
isValid()) {
71 return StatusCode::FAILURE;
75 if (!inputStripSpacePoints.
isValid()) {
77 return StatusCode::FAILURE;
80 if (!inputPixelSpacePoints.
isValid()) {
82 return StatusCode::FAILURE;
87 <<
" strip cluster in this event");
89 <<
" pixel cluster in this event");
91 <<
" Strip space point in this event");
93 <<
" Pixel space point in this event");
99 for (
auto id : auxid_set) {
101 <<
" has AuxId: " <<
id);
104 const SG::auxid_set_t &auxid_set_pixel = inputPixelClusters->getAuxIDs();
105 for (
auto id : auxid_set_pixel) {
107 <<
" has AuxId: " <<
id);
110 const SG::auxid_set_t &auxid_set_ssp = inputStripSpacePoints->getAuxIDs();
111 for (
auto id : auxid_set_ssp) {
113 <<
" has AuxId: " <<
id);
116 const SG::auxid_set_t &auxid_set_psp = inputPixelSpacePoints->getAuxIDs();
117 for (
auto id : auxid_set_psp) {
119 <<
" has AuxId: " <<
id);
126 std::vector<EFTrackingDataFormats::StripCluster>
128 std::vector<EFTrackingDataFormats::PixelCluster>
130 std::vector<EFTrackingDataFormats::SpacePoint>
132 std::vector<EFTrackingDataFormats::SpacePoint>
137 std::vector<std::vector<const xAOD::UncalibratedMeasurement *>> pixelsp_meas;
138 std::vector<std::vector<const xAOD::UncalibratedMeasurement *>> stripsp_meas;
148 ef_stripSpacePoints, stripsp_meas, 10,
151 ef_pixelSpacePoints, pixelsp_meas, 10,
157 for (
int i = 0;
i < 10;
i++) {
159 <<
i <<
"]: " << ef_stripClusters.at(
i).localPosition
160 <<
", " << ef_stripClusters.at(
i).localCovariance <<
", "
161 << ef_stripClusters.at(
i).idHash <<
", "
162 << ef_stripClusters.at(
i).id <<
", "
163 << ef_stripClusters.at(
i).globalPosition[0] <<
", "
164 << ef_stripClusters.at(
i).globalPosition[1] <<
", "
165 << ef_stripClusters.at(
i).globalPosition[2] <<
", "
166 << ef_stripClusters.at(
i).rdoList[0] <<
", "
167 << ef_stripClusters.at(
i).channelsInPhi);
172 ATH_CHECK(
runSW(ef_stripClusters, ef_pixelClusters, ef_stripSpacePoints,
173 stripsp_meas, ef_pixelSpacePoints, pixelsp_meas, ctx));
175 ATH_CHECK(
runHW(ef_stripClusters, ef_pixelClusters, ef_stripSpacePoints,
176 stripsp_meas, ef_pixelSpacePoints, pixelsp_meas));
179 return StatusCode::SUCCESS;
184 std::vector<EFTrackingDataFormats::StripCluster> &ef_sc,
185 long unsigned int N)
const {
186 if (
N >
sc->size()) {
188 <<
N <<
"th strip cluster, but there are only " <<
sc->size()
189 <<
" strip clusters in the container.");
190 return StatusCode::FAILURE;
193 for (
long unsigned int i = 0;
i <
N;
i++) {
199 cache.
idHash =
sc->at(
i)->identifierHash();
200 cache.
id =
sc->at(
i)->identifier();
205 for (
long unsigned int j = 0; j <
sc->at(
i)->rdoList().size(); j++) {
206 cache.
rdoList[j] =
sc->at(
i)->rdoList().at(j).get_compact();
212 ef_sc.push_back(cache);
215 ATH_MSG_DEBUG(
"Made " << ef_sc.size() <<
" strip clusters in the vector");
216 return StatusCode::SUCCESS;
221 std::vector<EFTrackingDataFormats::PixelCluster> &ef_pc,
222 long unsigned int N)
const {
223 if (
N >
pc->size()) {
225 <<
N <<
"th pixel cluster, but there are only " <<
pc->size()
226 <<
" pixel clusters in the container.");
227 return StatusCode::FAILURE;
230 for (
long unsigned int i = 0;
i <
N;
i++) {
234 cache.
id =
pc->at(
i)->identifier();
235 cache.
idHash =
pc->at(
i)->identifierHash();
244 for (
long unsigned int j = 0; j <
pc->at(
i)->rdoList().size(); j++) {
245 cache.
rdoList[j] =
pc->at(
i)->rdoList().at(j).get_compact();
254 for (
long unsigned int j = 0; j <
pc->at(
i)->totList().size(); j++) {
255 cache.
totList[j] =
pc->at(
i)->totList().at(j);
260 for (
long unsigned int j = 0; j <
pc->at(
i)->chargeList().size(); j++) {
274 ef_pc.push_back(cache);
277 ATH_MSG_DEBUG(
"Made " << ef_pc.size() <<
" pixel clusters in the vector");
278 return StatusCode::SUCCESS;
283 std::vector<EFTrackingDataFormats::SpacePoint> &ef_sp,
284 std::vector<std::vector<const xAOD::UncalibratedMeasurement *>> &sp_meas,
285 long unsigned int N,
bool isStrip)
const {
286 if (
N > sp->
size()) {
288 <<
N <<
"th space point, but there are only " << sp->
size()
289 <<
" SpacePoint in the container.");
290 return StatusCode::FAILURE;
293 for (
long unsigned int i = 0;
i <
N;
i++) {
297 cache.
idHash[0] = sp->
at(
i)->elementIdList()[0];
302 cache.
cov_r = sp->
at(
i)->varianceR();
303 cache.
cov_z = sp->
at(
i)->varianceZ();
307 std::vector<const xAOD::UncalibratedMeasurement *> temp_vec(
308 sp->
at(
i)->measurements().size());
310 sp->
at(
i)->measurements().end(), temp_vec.begin());
312 sp_meas.push_back(temp_vec);
315 cache.
idHash[1] = sp->
at(
i)->elementIdList()[1];
319 sp->
at(
i)->topStripDirection().data() +
320 sp->
at(
i)->topStripDirection().size(),
323 sp->
at(
i)->bottomStripDirection().data() +
324 sp->
at(
i)->bottomStripDirection().size(),
327 sp->
at(
i)->stripCenterDistance().data() +
328 sp->
at(
i)->stripCenterDistance().size(),
331 sp->
at(
i)->topStripCenter().data() +
332 sp->
at(
i)->topStripCenter().size(),
335 ef_sp.push_back(cache);
338 ATH_MSG_DEBUG(
"Made " << ef_sp.size() <<
" space points in the vector");
339 return StatusCode::SUCCESS;
343 const std::vector<EFTrackingDataFormats::StripCluster> &ef_sc,
344 const std::vector<EFTrackingDataFormats::PixelCluster> &ef_pc,
345 const std::vector<EFTrackingDataFormats::SpacePoint> &ef_ssp,
346 const std::vector<std::vector<const xAOD::UncalibratedMeasurement *>>
348 const std::vector<EFTrackingDataFormats::SpacePoint> &ef_psp,
349 const std::vector<std::vector<const xAOD::UncalibratedMeasurement *>>
351 const EventContext &ctx)
const {
354 std::unique_ptr<EFTrackingDataFormats::Metadata>
metadata =
355 std::make_unique<EFTrackingDataFormats::Metadata>();
367 ef_scOutput.
scIdHash = scIdHash.data();
368 ef_scOutput.
scId = scId.data();
370 ef_scOutput.
scRdoList = scRdoList.data();
397 ef_pcOutput.
pcIdHash = pcIdHash.data();
398 ef_pcOutput.
pcId = pcId.data();
400 ef_pcOutput.
pcRdoList = pcRdoList.data();
404 ef_pcOutput.
pcOmegaX = pcOmegaX.data();
405 ef_pcOutput.
pcOmegaY = pcOmegaY.data();
406 ef_pcOutput.
pcTotList = pcTotList.data();
411 ef_pcOutput.
pcIsSplit = pcIsSplit.data();
414 ef_pcOutput.
pcLvl1a = pcLvl1a.data();
430 ef_sspOutput.
spIdHash = sspIdHash.data();
432 ef_sspOutput.
spRadius = sspRadius.data();
451 ef_pspOutput.
spIdHash = pspIdHash.data();
453 ef_pspOutput.
spRadius = pspRadius.data();
459 ef_sspOutput, ef_psp, ef_pspOutput,
metadata.get()));
462 scLocalPosition.resize(
metadata->numOfStripClusters);
463 scLocalCovariance.resize(
metadata->numOfStripClusters);
464 scIdHash.resize(
metadata->numOfStripClusters);
465 scId.resize(
metadata->numOfStripClusters);
466 scGlobalPosition.resize(
metadata->numOfStripClusters * 3);
467 scRdoList.resize(
metadata->scRdoIndexSize);
468 scChannelsInPhi.resize(
metadata->numOfStripClusters);
470 pcLocalPosition.resize(
metadata->numOfPixelClusters * 2);
471 pcLocalCovariance.resize(
metadata->numOfPixelClusters * 2);
472 pcIdHash.resize(
metadata->numOfPixelClusters);
473 pcId.resize(
metadata->numOfPixelClusters);
474 pcGlobalPosition.resize(
metadata->numOfPixelClusters * 3);
475 pcRdoList.resize(
metadata->pcRdoIndexSize);
476 pcChannelsInPhi.resize(
metadata->numOfPixelClusters);
477 pcChannelsInEta.resize(
metadata->numOfPixelClusters);
478 pcWidthInEta.resize(
metadata->numOfPixelClusters);
479 pcOmegaX.resize(
metadata->numOfPixelClusters);
480 pcOmegaY.resize(
metadata->numOfPixelClusters);
481 pcTotList.resize(
metadata->pcTotIndexSize);
482 pcTotalToT.resize(
metadata->numOfPixelClusters);
483 pcChargeList.resize(
metadata->pcChargeIndexSize);
484 pcTotalCharge.resize(
metadata->numOfPixelClusters);
485 pcEnergyLoss.resize(
metadata->numOfPixelClusters);
486 pcIsSplit.resize(
metadata->numOfPixelClusters);
487 pcSplitProbability1.resize(
metadata->numOfPixelClusters);
488 pcSplitProbability2.resize(
metadata->numOfPixelClusters);
489 pcLvl1a.resize(
metadata->numOfPixelClusters);
492 sspIdHash.resize(
metadata->numOfStripSpacePoints * 2);
493 sspGlobalPosition.resize(
metadata->numOfStripSpacePoints * 3);
494 sspRadius.resize(
metadata->numOfStripSpacePoints);
495 sspVarianceR.resize(
metadata->numOfStripSpacePoints);
496 sspVarianceZ.resize(
metadata->numOfStripSpacePoints);
497 sspTopHalfStripLength.resize(
metadata->numOfStripSpacePoints);
498 sspBottomHalfStripLength.resize(
metadata->numOfStripSpacePoints);
499 sspTopStripDirection.resize(
metadata->numOfStripSpacePoints * 3);
500 sspBottomStripDirection.resize(
metadata->numOfStripSpacePoints * 3);
501 sspStripCenterDistance.resize(
metadata->numOfStripSpacePoints * 3);
502 sspTopStripCenter.resize(
metadata->numOfStripSpacePoints * 3);
504 pspIdHash.resize(
metadata->numOfPixelSpacePoints);
505 pspGlobalPosition.resize(
metadata->numOfPixelSpacePoints * 3);
506 pspRadius.resize(
metadata->numOfPixelSpacePoints);
507 pspVarianceR.resize(
metadata->numOfPixelSpacePoints);
508 pspVarianceZ.resize(
metadata->numOfPixelSpacePoints);
511 for (
unsigned i = 0;
i <
metadata->numOfStripClusters;
i++) {
528 for (
unsigned i = 0;
i <
metadata->numOfPixelClusters;
i++) {
567 for (
unsigned i = 0;
i <
metadata->numOfStripSpacePoints;
i++) {
569 <<
", " << ef_sspOutput.
spIdHash[
i * 2 + 1]);
602 for (
unsigned i = 0;
i <
metadata->numOfPixelSpacePoints;
i++) {
626 ef_sc.size(), scAux,
metadata.get(), ctx));
649 pxAux.
lvl1a = pcLvl1a;
652 ef_pc.size(), pxAux,
metadata.get(), ctx));
658 sspAux.
radius = sspRadius;
670 ef_ssp.size(), sspAux, ssp_mes, ctx));
676 pspAux.
radius = pspRadius;
682 ef_psp.size(), pspAux, psp_mes, ctx));
688 for (
unsigned i = 0;
i <
metadata->numOfStripClusters;
i++) {
690 <<
i <<
"]->localPosition<1>()(0, 0) = "
691 << outputStripClusters->
at(
i)->localPosition<1>());
697 for (
unsigned i = 0;
i <
metadata->numOfPixelClusters;
i++) {
699 <<
i <<
"]->localPosition<2>()(0, 0) = "
700 << outputPixelClusters->
at(
i)->localPosition<2>()(0, 0));
703 return StatusCode::SUCCESS;
708 const std::vector<EFTrackingDataFormats::StripCluster> &ef_sc,
709 const std::vector<EFTrackingDataFormats::PixelCluster> &ef_pc,
710 const std::vector<EFTrackingDataFormats::SpacePoint> &ef_ssp,
711 const std::vector<std::vector<const xAOD::UncalibratedMeasurement *>>
713 const std::vector<EFTrackingDataFormats::SpacePoint> &ef_psp,
714 const std::vector<std::vector<const xAOD::UncalibratedMeasurement *>>
719 float *scLocalPosition;
720 float *scLocalCovariance;
721 unsigned int *scIdHash;
722 long unsigned int *scId;
723 float *scGlobalPosition;
724 unsigned long long *scRdoList;
725 int *scChannelsInPhi;
727 float *pcLocalPosition;
728 float *pcLocalCovariance;
729 unsigned int *pcIdHash;
730 long unsigned int *pcId;
731 float *pcGlobalPosition;
732 unsigned long long *pcRdoList;
733 int *pcChannelsInPhi;
734 int *pcChannelsInEta;
741 float *pcTotalCharge;
744 float *pcSplitProbability1;
745 float *pcSplitProbability2;
753 posix_memalign((
void **)&scLocalPosition, 4096,
755 posix_memalign((
void **)&scLocalCovariance, 4096,
757 posix_memalign((
void **)&scIdHash, 4096,
759 posix_memalign((
void **)&scId, 4096,
761 posix_memalign((
void **)&scGlobalPosition, 4096,
763 posix_memalign((
void **)&scRdoList, 4096,
765 posix_memalign((
void **)&scChannelsInPhi, 4096,
768 posix_memalign((
void **)&pcLocalPosition, 4096,
770 posix_memalign((
void **)&pcLocalCovariance, 4096,
772 posix_memalign((
void **)&pcIdHash, 4096,
774 posix_memalign((
void **)&pcId, 4096,
776 posix_memalign((
void **)&pcGlobalPosition, 4096,
778 posix_memalign((
void **)&pcRdoList, 4096,
780 posix_memalign((
void **)&pcChannelsInPhi, 4096,
782 posix_memalign((
void **)&pcChannelsInEta, 4096,
784 posix_memalign((
void **)&pcWidthInEta, 4096,
sizeof(
float) *
MAX_CLUSTER_NUM);
785 posix_memalign((
void **)&pcOmegaX, 4096,
sizeof(
float) *
MAX_CLUSTER_NUM);
786 posix_memalign((
void **)&pcOmegaY, 4096,
sizeof(
float) *
MAX_CLUSTER_NUM);
787 posix_memalign((
void **)&pcTotList, 4096,
sizeof(
int) *
MAX_CLUSTER_NUM);
788 posix_memalign((
void **)&pcTotalToT, 4096,
sizeof(
int) *
MAX_CLUSTER_NUM);
789 posix_memalign((
void **)&pcChargeList, 4096,
sizeof(
float) *
MAX_CLUSTER_NUM);
790 posix_memalign((
void **)&pcTotalCharge, 4096,
792 posix_memalign((
void **)&pcEnergyLoss, 4096,
sizeof(
float) *
MAX_CLUSTER_NUM);
793 posix_memalign((
void **)&pcIsSplit, 4096,
sizeof(
char) *
MAX_CLUSTER_NUM);
794 posix_memalign((
void **)&pcSplitProbability1, 4096,
796 posix_memalign((
void **)&pcSplitProbability2, 4096,
798 posix_memalign((
void **)&pcLvl1a, 4096,
sizeof(
int) *
MAX_CLUSTER_NUM);
800 posix_memalign((
void **)&
metadata, 4096,
810 cl::Buffer acc_stripClusters(
813 cl::Buffer acc_pixelClusters(
818 cl::Buffer acc_scLocalPosition(
819 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
821 cl::Buffer acc_scLocalCovariance(
822 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
824 cl::Buffer acc_scIdHash(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
827 cl::Buffer acc_scId(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
829 cl::Buffer acc_scGlobalPosition(
830 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
832 cl::Buffer acc_scRdoList(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
835 cl::Buffer acc_scChannelsInPhi(
836 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
840 cl::Buffer acc_pcLocalPosition(
841 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
843 cl::Buffer acc_pcLocalCovariance(
844 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
846 cl::Buffer acc_pcIdHash(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
849 cl::Buffer acc_pcId(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
851 cl::Buffer acc_pcGlobalPosition(
852 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
854 cl::Buffer acc_pcRdoList(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
857 cl::Buffer acc_pcChannelsInPhi(
858 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
860 cl::Buffer acc_pcChannelsInEta(
861 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
863 cl::Buffer acc_pcWidthInEta(
864 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
866 cl::Buffer acc_pcOmegaX(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
868 cl::Buffer acc_pcOmegaY(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
870 cl::Buffer acc_pcTotList(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
872 cl::Buffer acc_pcTotalToT(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
874 cl::Buffer acc_pcChargeList(
875 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
877 cl::Buffer acc_pcTotalCharge(
878 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
880 cl::Buffer acc_pcEnergyLoss(
881 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
883 cl::Buffer acc_pcIsSplit(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
885 cl::Buffer acc_pcSplitProbability1(
886 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
888 cl::Buffer acc_pcSplitProbability2(
889 m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
891 cl::Buffer acc_pcLvl1a(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
894 cl::Buffer acc_metadata(
m_context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
902 if (
err != CL_SUCCESS) {
904 return StatusCode::FAILURE;
911 acc_kernel.setArg<cl::Buffer>(0, acc_stripClusters);
912 acc_kernel.setArg<
int>(1, ef_sc.size());
913 acc_kernel.setArg<cl::Buffer>(2, acc_scLocalPosition);
914 acc_kernel.setArg<cl::Buffer>(3, acc_scLocalCovariance);
915 acc_kernel.setArg<cl::Buffer>(4, acc_scIdHash);
916 acc_kernel.setArg<cl::Buffer>(5, acc_scId);
917 acc_kernel.setArg<cl::Buffer>(6, acc_scGlobalPosition);
918 acc_kernel.setArg<cl::Buffer>(7, acc_scRdoList);
919 acc_kernel.setArg<cl::Buffer>(8, acc_scChannelsInPhi);
920 acc_kernel.setArg<cl::Buffer>(9, acc_pixelClusters);
921 acc_kernel.setArg<
int>(10, ef_pc.size());
922 acc_kernel.setArg<cl::Buffer>(11, acc_pcLocalPosition);
923 acc_kernel.setArg<cl::Buffer>(12, acc_pcLocalCovariance);
924 acc_kernel.setArg<cl::Buffer>(13, acc_pcIdHash);
925 acc_kernel.setArg<cl::Buffer>(14, acc_pcId);
926 acc_kernel.setArg<cl::Buffer>(15, acc_pcGlobalPosition);
927 acc_kernel.setArg<cl::Buffer>(16, acc_pcRdoList);
928 acc_kernel.setArg<cl::Buffer>(17, acc_pcChannelsInPhi);
929 acc_kernel.setArg<cl::Buffer>(18, acc_pcChannelsInEta);
930 acc_kernel.setArg<cl::Buffer>(19, acc_pcWidthInEta);
931 acc_kernel.setArg<cl::Buffer>(20, acc_pcOmegaX);
932 acc_kernel.setArg<cl::Buffer>(21, acc_pcOmegaY);
933 acc_kernel.setArg<cl::Buffer>(22, acc_pcTotList);
934 acc_kernel.setArg<cl::Buffer>(23, acc_pcTotalToT);
935 acc_kernel.setArg<cl::Buffer>(24, acc_pcChargeList);
936 acc_kernel.setArg<cl::Buffer>(25, acc_pcTotalCharge);
937 acc_kernel.setArg<cl::Buffer>(26, acc_pcEnergyLoss);
938 acc_kernel.setArg<cl::Buffer>(27, acc_pcIsSplit);
939 acc_kernel.setArg<cl::Buffer>(28, acc_pcSplitProbability1);
940 acc_kernel.setArg<cl::Buffer>(29, acc_pcSplitProbability2);
941 acc_kernel.setArg<cl::Buffer>(30, acc_pcLvl1a);
942 acc_kernel.setArg<cl::Buffer>(31, acc_metadata);
950 err = acc_queue.enqueueMigrateMemObjects(
951 {acc_stripClusters, acc_pixelClusters, acc_scLocalPosition,
952 acc_scLocalCovariance, acc_scIdHash, acc_scId, acc_scGlobalPosition,
953 acc_scRdoList, acc_scChannelsInPhi,
955 acc_pcId, acc_pcIdHash, acc_pcLocalPosition, acc_pcLocalCovariance,
956 acc_pcGlobalPosition, acc_pcRdoList, acc_pcChannelsInPhi,
957 acc_pcChannelsInEta, acc_pcWidthInEta, acc_pcOmegaX, acc_pcOmegaY,
958 acc_pcTotList, acc_pcTotalToT, acc_pcChargeList, acc_pcTotalCharge,
959 acc_pcEnergyLoss, acc_pcIsSplit, acc_pcSplitProbability1,
960 acc_pcSplitProbability2, acc_pcLvl1a, acc_metadata},
961 CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED);
963 acc_queue.enqueueTask(acc_kernel);
966 acc_queue.enqueueMigrateMemObjects(
967 {acc_scLocalPosition, acc_scLocalCovariance, acc_scIdHash, acc_scId,
968 acc_scGlobalPosition, acc_scRdoList, acc_scChannelsInPhi},
969 CL_MIGRATE_MEM_OBJECT_HOST);
972 for (
int i = 0;
i < 10;
i++) {
973 ATH_MSG_DEBUG(
"scLocalPosition[" <<
i <<
"] = " << scLocalPosition[
i]);
977 free(scLocalPosition);
978 free(scLocalCovariance);
981 free(scGlobalPosition);
983 free(scChannelsInPhi);
985 free(pcLocalPosition);
986 free(pcLocalCovariance);
989 free(pcGlobalPosition);
991 free(pcChannelsInPhi);
992 free(pcChannelsInEta);
1002 free(pcSplitProbability1);
1003 free(pcSplitProbability2);
1008 return StatusCode::SUCCESS;
1012 const std::vector<EFTrackingDataFormats::StripCluster> &inputSC,
1015 const std::vector<EFTrackingDataFormats::PixelCluster> &inputPC,
1018 const std::vector<EFTrackingDataFormats::SpacePoint> &inputSSP,
1021 const std::vector<EFTrackingDataFormats::SpacePoint> &inputPSP,
1026 int rdoIndex_counter = 0;
1028 unsigned int inputscRdoIndexSize = 0;
1029 unsigned int inputpcRdoIndexSize = 0;
1033 for (
size_t i = 0;
i < inputSC.size();
i++) {
1037 ef_scOutput.
scId[
i] = inputSC[
i].id;
1042 inputscRdoIndexSize += inputSC[
i].sizeOfRDOList;
1044 for (
int j = 0; j < inputSC[
i].sizeOfRDOList; j++) {
1045 ef_scOutput.
scRdoList[rdoIndex_counter + j] = inputSC[
i].rdoList[j];
1049 rdoIndex_counter += inputSC[
i].sizeOfRDOList;
1050 metadata[0].scRdoIndex[
i] = inputSC[
i].sizeOfRDOList;
1054 rdoIndex_counter = 0;
1055 int totIndex_counter = 0;
1056 int chargeIndex_counter = 0;
1058 unsigned int inputpcTotListsize = 0;
1059 unsigned int inputpcChargeListsize = 0;
1062 for (
size_t i = 0;
i < inputPC.size();
i++) {
1068 ef_pcOutput.
pcId[
i] = inputPC[
i].id;
1073 inputpcRdoIndexSize += inputPC[
i].sizeOfRDOList;
1075 for (
int j = 0; j < inputPC[
i].sizeOfRDOList; j++) {
1076 ef_pcOutput.
pcRdoList[rdoIndex_counter + j] = inputPC[
i].rdoList[j];
1084 inputpcTotListsize += inputPC[
i].sizeOfTotList;
1086 for (
int j = 0; j < inputPC[
i].sizeOfTotList; j++) {
1087 ef_pcOutput.
pcTotList[totIndex_counter + j] = inputPC[
i].totList[j];
1091 inputpcChargeListsize += inputPC[
i].sizeOfChargeList;
1093 for (
int j = 0; j < inputPC[
i].sizeOfChargeList; j++) {
1095 inputPC[
i].chargeList[j];
1102 ef_pcOutput.
pcLvl1a[
i] = inputPC[
i].lvl1a;
1105 rdoIndex_counter += inputPC[
i].sizeOfRDOList;
1106 totIndex_counter += inputPC[
i].sizeOfTotList;
1107 chargeIndex_counter += inputPC[
i].sizeOfChargeList;
1108 metadata[0].pcRdoIndex[
i] = inputPC[
i].sizeOfRDOList;
1109 metadata[0].pcTotIndex[
i] = inputPC[
i].sizeOfTotList;
1110 metadata[0].pcChargeIndex[
i] = inputPC[
i].sizeOfChargeList;
1114 for (
size_t i = 0;
i < inputSSP.size();
i++) {
1115 ef_sspOutput.
spIdHash[
i * 2] = inputSSP[
i].idHash[0];
1116 ef_sspOutput.
spIdHash[
i * 2 + 1] = inputSSP[
i].idHash[1];
1120 ef_sspOutput.
spRadius[
i] = inputSSP[
i].radius;
1127 inputSSP[
i].topStripDirection[1];
1129 inputSSP[
i].topStripDirection[2];
1131 inputSSP[
i].bottomStripDirection[0];
1133 inputSSP[
i].bottomStripDirection[1];
1135 inputSSP[
i].bottomStripDirection[2];
1137 inputSSP[
i].stripCenterDistance[0];
1139 inputSSP[
i].stripCenterDistance[1];
1141 inputSSP[
i].stripCenterDistance[2];
1148 for (
size_t i = 0;
i < inputPSP.size();
i++) {
1149 ef_pspOutput.
spIdHash[
i] = inputPSP[
i].idHash[0];
1153 ef_pspOutput.
spRadius[
i] = inputPSP[
i].radius;
1159 metadata[0].numOfStripClusters = inputSC.size();
1160 metadata[0].numOfPixelClusters = inputPC.size();
1161 metadata[0].numOfStripSpacePoints = inputSSP.size();
1162 metadata[0].numOfPixelSpacePoints = inputPSP.size();
1163 metadata[0].scRdoIndexSize = inputscRdoIndexSize;
1164 metadata[0].pcRdoIndexSize = inputpcRdoIndexSize;
1165 metadata[0].pcTotIndexSize = inputpcTotListsize;
1166 metadata[0].pcChargeIndexSize = inputpcChargeListsize;
1168 return StatusCode::SUCCESS;