29 return StatusCode::SUCCESS;
33 std::unique_ptr<InDet::PixelClusterCollection> PixelCollFromHits = std::make_unique<InDet::PixelClusterCollection>();
34 std::unique_ptr<InDet::SCT_ClusterCollection> SCTCollFromHits = std::make_unique<InDet::SCT_ClusterCollection>();
36 std::unique_ptr<InDet::PixelClusterCollection> PixelCollFromClusters = std::make_unique<InDet::PixelClusterCollection>();
37 std::unique_ptr<InDet::SCT_ClusterCollection> SCTCollFromClusters = std::make_unique<InDet::SCT_ClusterCollection>();
39 std::unique_ptr<InDet::SCT_ClusterCollection> SCTCollFromSP = std::make_unique<InDet::SCT_ClusterCollection>();
40 std::unique_ptr<xAOD::PixelClusterContainer> PixelContFromHits = std::make_unique<xAOD::PixelClusterContainer>();
41 std::unique_ptr<xAOD::PixelClusterAuxContainer> PixelAuxContFromHits = std::make_unique<xAOD::PixelClusterAuxContainer>();
42 PixelContFromHits->setStore (PixelAuxContFromHits.get());
44 std::unique_ptr<xAOD::StripClusterContainer> SCTContFromHits = std::make_unique<xAOD::StripClusterContainer>();
45 std::unique_ptr<xAOD::StripClusterAuxContainer> SCTAuxContFromHits = std::make_unique<xAOD::StripClusterAuxContainer>();
46 SCTContFromHits->setStore(SCTAuxContFromHits.get() );
48 std::unique_ptr<xAOD::PixelClusterContainer> PixelContFromClusters = std::make_unique<xAOD::PixelClusterContainer>();
49 std::unique_ptr<xAOD::PixelClusterAuxContainer> PixelAuxContFromClusters = std::make_unique<xAOD::PixelClusterAuxContainer>();
50 PixelContFromClusters->setStore (PixelAuxContFromClusters.get());
52 std::unique_ptr<xAOD::StripClusterContainer> SCTContFromClusters = std::make_unique<xAOD::StripClusterContainer>();
53 std::unique_ptr<xAOD::StripClusterAuxContainer> SCTAuxContFromClusters = std::make_unique<xAOD::StripClusterAuxContainer>();
54 SCTContFromClusters->setStore(SCTAuxContFromClusters.get() );
56 std::unique_ptr<xAOD::SpacePointContainer> StripSPCont = std::make_unique<xAOD::SpacePointContainer>();
57 std::unique_ptr<xAOD::SpacePointAuxContainer> StripSPAuxCont = std::make_unique<xAOD::SpacePointAuxContainer>();
58 StripSPCont->setStore(StripSPAuxCont.get() );
60 std::unique_ptr<xAOD::SpacePointContainer> PixelSPCont = std::make_unique<xAOD::SpacePointContainer>();
61 std::unique_ptr<xAOD::SpacePointAuxContainer> PixelSPAuxCont = std::make_unique<xAOD::SpacePointAuxContainer>();
62 PixelSPCont->setStore(PixelSPAuxCont.get() );
64 std::unique_ptr<ActsTrk::ProtoTrackCollection> ProtoTracksFromRoads = std::make_unique<ActsTrk::ProtoTrackCollection>();
65 std::unique_ptr<ActsTrk::ProtoTrackCollection> ProtoTracksFromTracks = std::make_unique<ActsTrk::ProtoTrackCollection>();
71 if (FPGAClustersHandle.
isValid()) {
83 if (!FPGARoadsHandle.
isValid()) {
84 ATH_MSG_FATAL(
"Failed to retrieve 1st stage FPGATrackSimRoadCollection");
85 return StatusCode::FAILURE;
91 if (!FPGAHitsInRoadsHandle.
isValid()) {
92 ATH_MSG_FATAL(
"Failed to retrieve 1st stage FPGATrackSimItInRoadCollection");
93 return StatusCode::FAILURE;
98 if (!FPGATracksHandle.
isValid()) {
99 ATH_MSG_FATAL(
"Failed to retrieve 1st stage FPGATrackSimTrackCollection");
100 return StatusCode::FAILURE;
104 if (PixelContFromClusters->
size()+SCTContFromClusters->
size() > 0) {
105 ATH_CHECK(
m_ActsTrkConverter->findProtoTracks(ctx,*PixelContFromClusters,*SCTContFromClusters,*ProtoTracksFromRoads, *FPGAHitsInRoadsCont, *FPGARoadColl ));
106 ATH_CHECK(
m_ActsTrkConverter->findProtoTracks(ctx,*PixelContFromClusters,*SCTContFromClusters,*ProtoTracksFromTracks, *FPGATrackColl ));
117 ATH_CHECK(
m_ClusterConverter->convertSpacePoints(*FPGASPColl, *FPGAClustersColl, *StripSPCont, *PixelSPCont, *SCTContFromClusters, *PixelContFromClusters) );
119 else {{
ATH_MSG_WARNING(
"Failed to retrieve 1st stage FPGATrackSimSpacePointCollection. Will skip SP conversion ");}}
123 else {
ATH_MSG_WARNING(
"Failed to retrieve 1st stage FPGATrackSimClusterCollection. Will skip clusters and track conversion ");}
127 ATH_CHECK( xAODPixelClusterFromFPGAClusterHandle.
record (std::move(PixelContFromClusters), std::move(PixelAuxContFromClusters)));
128 ATH_CHECK( xAODStripClusterFromFPGAClusterHandle.
record (std::move(SCTContFromClusters), std::move(SCTAuxContFromClusters)));
133 ATH_CHECK( ActsProtoTrackFromFPGARoadHandle.
record (std::move(ProtoTracksFromRoads)));
134 ATH_CHECK( ActsProtoTrackFromFPGATrackHandle.
record (std::move(ProtoTracksFromTracks)));
140 ATH_CHECK( xAODStripSpacePointFromFPGAHandle.
record (std::move(StripSPCont), std::move(StripSPAuxCont)));
141 ATH_CHECK( xAODPixelSpacePointFromFPGAHandle.
record (std::move(PixelSPCont), std::move(PixelSPAuxCont)));
152 if (FPGAHitsHandle.
isValid()) {
162 else {
ATH_MSG_WARNING(
"Failed to retrieve 1st stage FPGATrackSimHitCollection. Will skip hit conversion ");}
167 ATH_CHECK( xAODPixelClusterFromFPGAHitHandle.
record (std::move(PixelContFromHits),std::move(PixelAuxContFromHits)));
168 ATH_CHECK( xAODStripClusterFromFPGAHitHandle.
record (std::move(SCTContFromHits),std::move(SCTAuxContFromHits)));
171 return StatusCode::SUCCESS;
175 template <
typename T>
181 static_assert(
false,
"Bad type <T>. Should be InDet::PixelCluster or InDet::SCT_Cluster");
182 return StatusCode::FAILURE;
185 std::unique_ptr<Trk::PrepRawDataContainer<Trk::PrepRawDataCollection<T>>> outputContainer = std::make_unique<Trk::PrepRawDataContainer<Trk::PrepRawDataCollection<T>>>(
SG::VIEW_ELEMENTS);
188 if (!inputCollection || inputCollection->
empty()){
189 outputContainerHandle.record(std::move(outputContainer));
190 return StatusCode::SUCCESS;
195 for (
const T* clus : *inputCollection) {
196 newCol->
push_back(std::make_unique<T>(*clus));
197 ATH_MSG_DEBUG(
"NewCol cluster identifier " << clus->identify());
203 if(outputContainerHandle.record(std::move(outputContainer)).isFailure()){
204 ATH_MSG_ERROR(
"Could not record InDetSCTClusterContainer object with "
205 << outputContainerHandle.key()
206 <<
" into Event Store");
207 return StatusCode::FAILURE;
210 return StatusCode::SUCCESS;