ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::TracccMeasurementConverterAlg Class Reference

Algorithm converting traccc measurements (device buffer) to xAOD clusters (host container). More...

#include <TracccMeasurementConverterAlg.h>

Inheritance diagram for ActsTrk::TracccMeasurementConverterAlg:

Public Member Functions

virtual StatusCode initialize () override
 Function initializing the algorithm.
virtual StatusCode execute (const EventContext &ctx) const override
 Function executing the algorithm.
virtual StatusCode finalize () override
 Function finalizing the algorthm.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const PixelID * m_pixelID {nullptr}
 Conversion helpers (to retrieve module design, hash, etc.) {.
const SCT_ID * m_stripID {nullptr}
Gaudi::Property< std::string > m_idHelperName
const InDetDD::PixelDetectorManager * m_pixelManager {nullptr}
const InDetDD::SCT_DetectorManager * m_stripManager {nullptr}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared
Bolean variable deciding weather the conversion includes cell to cluster association
Gaudi::Property< bool > m_convertClustersWithCells
The input device resident cluster, measurement and cell collection names

{@

SG::ReadHandleKey< traccc::edm::measurement_collection::buffer > m_inputMeasKey
SG::ReadHandleKey< traccc::edm::silicon_cluster_collection::buffer > m_inputClusterKey
SG::ReadHandleKey< traccc::edm::silicon_cell_collection::buffer > m_inputCellsKey
The output host resident cluster container names

{@

SG::WriteHandleKey< xAOD::PixelClusterContainer > m_outputPixelKey
SG::WriteHandleKey< xAOD::SpacePointContainer > m_outputPixelSpacePointsKey
SG::WriteHandleKey< std::vector< unsigned int > > m_outputMeasToPixelSPKey
SG::WriteHandleKey< std::vector< unsigned int > > m_outputMeasToStripClKey
SG::WriteHandleKey< xAOD::StripClusterContainer > m_outputStripKey
The host memory resource tool to use for memory allocations
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
The copy tool used for copying data from device
ToolHandle< AthDevice::ICopyTool > m_copy
The map object providing the Athena<->Detray ID map
Gaudi::Property< std::string > m_geoIdMappingObjectName {this, "GeoIdMapping", "", "ID mapping between the three detector description realms."}
const ActsTrk::GeometryIdMapping * m_idMapping {nullptr}
std::atomic< int > m_nPix = 0
 The object counters for debug prints in finalize method {.
std::atomic< int > m_nStrip = 0
std::atomic< int > m_nMeas = 0

Detailed Description

Algorithm converting traccc measurements (device buffer) to xAOD clusters (host container).

This algorithm retrieves the input traccc measurement collection device buffer from the event store, copies the data to host buffer and converts the traccc measurements to xAOD clusters. In case the clusters require the associated RDOs (e.g. for truth matching), the algorithm also retrieves the traccc cluster collection device buffer from the event store, and uses the cell indices stored in the traccc clusters to construct an RDO list associated with each xAOD cluster.

Author
Neža Ribarič neza..nosp@m.riba.nosp@m.ric@c.nosp@m.ern..nosp@m.ch

Definition at line 56 of file TracccMeasurementConverterAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode ActsTrk::TracccMeasurementConverterAlg::execute ( const EventContext & ctx) const
overridevirtual

Function executing the algorithm.

Definition at line 140 of file TracccMeasurementConverterAlg.cxx.

141{
142 // ---- Retrieve measurements (always needed) ----
143 auto measurements = SG::makeHandle(m_inputMeasKey, ctx);
144 ATH_CHECK(measurements.isValid());
145
146 auto copy = m_copy->copy(ctx);
147
148 traccc::edm::measurement_collection::buffer traccc_measurements_buffer{
149 copy->get_size(*measurements), m_hostMR->mr()};
150 copy->setup(traccc_measurements_buffer)->ignore();
151 (*copy)(*measurements, traccc_measurements_buffer)->wait();
152
153 traccc::edm::measurement_collection::const_device traccc_measurements(
154 traccc_measurements_buffer);
155
156 // ---- Optionally retrieve clusters and cells ----
157 std::optional<traccc::edm::silicon_cluster_collection::buffer> traccc_clusters_buffer;
158 std::optional<traccc::edm::silicon_cell_collection::buffer> traccc_cells_buffer;
159 std::optional<traccc::edm::silicon_cluster_collection::const_device> traccc_clusters;
160 std::optional<traccc::edm::silicon_cell_collection::const_device> traccc_cells;
161
162 // ---- Create mapping from traccc measurement index to pixel spacepoint index ----
163 // for pixel the index maps to cluster container or spacepoint containe
164 // because every pixel measurement makes one spacepoint
165 std::vector<unsigned int> measToPixelSP(traccc_measurements.size(),
166 std::numeric_limits<unsigned int>::max());
167
168 // ---- Create mapping from traccc measurement index to strip cluster index ----
169 // every strip measurement does not map to one strip spacepoint therefore this map
170 // is only valid between traccc measurements and strip clusters
171 // The reason why we have two maps is that during traccc track conversion
172 // we need to figure out if a track state is coming from pixel or strip
173 // since we don't want to copy/write to SG the measurements twice
174 // we can figure this out by creating two maps at conversion,
175 // then if the meas index is not in pixel map, has to be a strip meas
176 std::vector<unsigned int> measToStripCl(traccc_measurements.size(),
177 std::numeric_limits<unsigned int>::max());
179 ATH_MSG_DEBUG("Read " << traccc_measurements.size() << " traccc measurements from " << m_inputMeasKey.key());
180 ATH_MSG_DEBUG("Read traccc clusters from '"
181 << m_inputClusterKey.key()
182 << "' and will convert them with associated cells.");
183
184 SG::ReadHandle<traccc::edm::silicon_cluster_collection::buffer> clusters{
185 m_inputClusterKey, ctx};
186 ATH_CHECK(clusters.isValid());
187 SG::ReadHandle<traccc::edm::silicon_cell_collection::buffer> cells{
188 m_inputCellsKey, ctx};
189 ATH_CHECK(cells.isValid());
190
191 traccc_clusters_buffer.emplace(copy->get_sizes(*clusters), m_hostMR->mr());
192 copy->setup(*traccc_clusters_buffer)->wait();
193 (*copy)(*clusters, *traccc_clusters_buffer)->wait();
194
195 traccc_cells_buffer.emplace(copy->get_size(*cells), m_hostMR->mr());
196 copy->setup(*traccc_cells_buffer)->wait();
197 (*copy)(*cells, *traccc_cells_buffer)->wait();
198
199 traccc_clusters.emplace(*traccc_clusters_buffer);
200 ATH_MSG_DEBUG("Copied " << traccc_clusters->size() << " clusters.");
201
202 traccc_cells.emplace(*traccc_cells_buffer);
203 ATH_MSG_DEBUG("Copied " << traccc_cells->size() << " cells.");
204 } else {
205 ATH_MSG_DEBUG("Read traccc measurements from '"
206 << m_inputMeasKey.key()
207 << "' and will convert them without associated cells.");
208 }
209
210 // ---- Count pixel vs strip ----
211 const auto [n_pixels, n_strips] = countPixelStrip(traccc_measurements);
212
213 // ---- Create output containers ----
214 auto [pixel_cont, pixel_aux] =
216 auto [pixel_spacepoint_cont, pixel_spacepoint_aux] =
218 auto [strip_cont, strip_aux] =
220
221 // ---- Convert ----
222 auto pixItr = pixel_cont->begin();
223 auto spItr = pixel_spacepoint_cont->begin();
224 auto stripItr = strip_cont->begin();
225
226 std::size_t pixel_idx = 0;
227 std::size_t strip_idx = 0;
228
229 for (std::size_t i = 0; i < traccc_measurements.size(); ++i) {
230 const auto& meas = traccc_measurements.at(i);
231 const uint64_t detrayId = meas.surface_link().value();
232 auto athenaIdOpt = m_idMapping->detrayToAthena(detrayId);
233 if (!athenaIdOpt.has_value()) {
234 ATH_MSG_FATAL("No Athena module found for detray id " << detrayId << " — skipping measurement.");
235 return StatusCode::FAILURE;
236 }
237 const Identifier athenaId = *athenaIdOpt;
238
239 // ---- Pixel ----
240 if (meas.dimensions() == 2u) {
241 xAOD::PixelCluster* xaod_pcl = *pixItr;
242 xAOD::SpacePoint* xaod_sp = *spItr;
243 ++spItr;
244 ++pixItr;
245
246 // once seeding will come into play, we will need to keep track of the
247 // mapping between traccc and xAOD clusters. The reason for this is:
248 // 1. the traccc measurements are all in one collection, and the
249 // xAOD clusters are in two separate collections (pixel and strip)
250 // 2. the traccc spacepoints are not not created in the same order as the traccc measurements
251 measToPixelSP[i] = pixel_idx;
252
253 const IdentifierHash Pixel_ModuleHash =
254 m_pixelID->wafer_hash(athenaId);
255 const InDetDD::SiDetectorElement* pDE =
256 m_pixelManager->getDetectorElement(Pixel_ModuleHash);
257 const InDetDD::PixelModuleDesign* design(
258 dynamic_cast<const InDetDD::PixelModuleDesign*>(
259 &pDE->design()));
260 if(design == nullptr){
261 ATH_MSG_FATAL("Could not retrieve module design for pixel module hash " << Pixel_ModuleHash);
262 return StatusCode::FAILURE;
263 }
264
265 fillPixelCluster(meas, athenaId, m_pixelID, m_pixelManager, *xaod_pcl,
266 pixel_idx + strip_idx);
267
269 const auto cluster = traccc_clusters->at(meas.cluster_index());
270
271 std::vector<Identifier> rdoList;
272 rdoList.reserve(cluster.cell_indices().size());
273 int phiIndicesMax = -1;
274 int etaIndicesMax = -1;
275 int phiIndicesMin = std::numeric_limits<int>::max();
276 int etaIndicesMin = std::numeric_limits<int>::max();
277
278 for (const unsigned int cell_idx : cluster.cell_indices()) {
279 const auto& cell = traccc_cells->at(cell_idx);
280
281 int const phiIndex = cell.channel0();
282 int const etaIndex = cell.channel1();
283
284 phiIndicesMax = std::max(phiIndicesMax, phiIndex);
285 etaIndicesMax = std::max(etaIndicesMax, etaIndex);
286 phiIndicesMin = std::min(phiIndicesMin, phiIndex);
287 etaIndicesMin = std::min(etaIndicesMin, etaIndex);
288
289 Identifier const hit_id =
290 m_pixelID->pixel_id(athenaId, phiIndex, etaIndex);
291 rdoList.push_back(hit_id);
292 }
293
294 double const colWidth = static_cast<double>((etaIndicesMax - etaIndicesMin) + 1);
295 double const rowWidth = static_cast<double>((phiIndicesMax - phiIndicesMin) + 1);
296 double const etaWidth =
297 design->widthFromColumnRange(etaIndicesMin, etaIndicesMax);
298 double const phiWidth = design->widthFromRowRange(phiIndicesMin, phiIndicesMax);
299
300 InDet::SiWidth siWidth(Amg::Vector2D(rowWidth, colWidth),
301 Amg::Vector2D(phiWidth, etaWidth));
302
303 float width0 = phiWidth / rowWidth;
304 float width1 = etaWidth / colWidth;
305 Eigen::Matrix<float, 2, 2> localCovariance =
306 Eigen::Matrix<float, 2, 2>::Zero();
307 localCovariance(0, 0) = width0 * width0 / 12.0f;
308 localCovariance(1, 1) = width1 * width1 / 12.0f;
309
310 Eigen::Matrix<float, 2, 1> localPosition(meas.local_position()[0], meas.local_position()[1]);
311 xaod_pcl->setMeasurement<2>(Pixel_ModuleHash, localPosition,
312 localCovariance);
313
314 std::sort(rdoList.begin(), rdoList.end());
315 xaod_pcl->setIdentifier(rdoList.front().get_compact());
316 xaod_pcl->setRDOlist(std::move(rdoList));
317 xaod_pcl->setChannelsInPhiEta(siWidth.colRow()[0],
318 siWidth.colRow()[1]);
319 float width_phiRZ = static_cast<float>(siWidth.widthPhiRZ()[1]);
320 xaod_pcl->setWidthInEta(width_phiRZ);
321
322 // using width to scale the cluster covariance for space points
323 float covTerm = width_phiRZ * width_phiRZ * (1/12.0f);
324 if( covTerm < localCovariance(1, 1) )
325 covTerm = localCovariance(1, 1);
326
327
328 const Amg::Transform3D& Tp = pDE->surface().transform();
329 float const cov_z =
330 6.f * covTerm *
331 static_cast<float>(Tp(0, 2) * Tp(0, 2) + Tp(1, 2) * Tp(1, 2));
332 float const cov_r = 6.f * covTerm *
333 static_cast<float>(Tp(2, 2) * Tp(2, 2));
334 xaod_sp->setSpacePoint(xaod_pcl->identifierHash(),
335 xaod_pcl->globalPosition(), cov_r, cov_z,
336 {xaod_pcl});
337
338 }
339 ++pixel_idx;
340
341 // ---- Strip ----
342 } else {
343 xAOD::StripCluster* xaod_scl = *stripItr;
344 ++stripItr;
345
346 // see comment above for pixel clusters, the same applies here
347 // when we eventually have strip spacepoints
348
349 const IdentifierHash Strip_ModuleHash =
350 m_stripID->wafer_hash(athenaId);
351 const InDetDD::SiDetectorElement* pDE =
352 m_stripManager->getDetectorElement(Strip_ModuleHash);
353
354 fillStripCluster(meas, athenaId, m_stripID, m_stripManager, *xaod_scl,
355 pixel_idx + strip_idx);
356
358 const auto cluster = traccc_clusters->at(meas.cluster_index());
359
360 std::vector<Identifier> rdoList;
361 rdoList.reserve(cluster.cell_indices().size());
362 int phiIndicesMax = -1;
363 int phiIndicesMin = std::numeric_limits<int>::max();
364
365 for (const unsigned int cell_idx : cluster.cell_indices()) {
366 const auto& cell = traccc_cells->at(cell_idx);
367
368 // (m_stripID->barrel_ec(athenaId) != 0) <=> endcap strip
369 // => we are working with polar coordinates (r,phi)
370 // and we have to swap the indices
371 int const phiIndex = (m_stripID->barrel_ec(athenaId) != 0)
372 ? cell.channel1()
373 : cell.channel0();
374
375 phiIndicesMax = std::max(phiIndicesMax, phiIndex);
376 phiIndicesMin = std::min(phiIndicesMin, phiIndex);
377 Identifier const hit_id =
378 m_stripID->strip_id(athenaId, int(phiIndex));
379 rdoList.push_back(hit_id);
380 }
381
382 std::sort(rdoList.begin(), rdoList.end());
383 const int firstStrip = m_stripID->strip(rdoList.front());
384 const int lastStrip = m_stripID->strip(rdoList.back());
385
386 const InDetDD::SCT_ModuleSideDesign* design;
387 if (pDE->isBarrel()) {
388 design = (static_cast<const InDetDD::SCT_ModuleSideDesign*>(
389 &pDE->design()));
390 } else {
391 design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(
392 &pDE->design()));
393 }
394
395 const int row = m_stripID->row(rdoList.front());
396 const int firstStrip1D = design->strip1Dim(firstStrip, row);
397 const int lastStrip1D = design->strip1Dim(lastStrip, row);
398 const InDetDD::SiCellId cell1(firstStrip1D);
399 const InDetDD::SiCellId cell2(lastStrip1D);
400 const InDetDD::SiLocalPosition firstStripPos(
401 pDE->rawLocalPositionOfCell(cell1));
402 const InDetDD::SiLocalPosition lastStripPos(
403 pDE->rawLocalPositionOfCell(cell2));
404 const InDetDD::SiLocalPosition centre(
405 (firstStripPos + lastStripPos) * 0.5);
406 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition>
407 ends(design->endsOfStrip(centre));
408 const double stripLength(
409 std::abs(ends.first.xEta() - ends.second.xEta()));
410 const double width =
411 design->stripPitch() * (lastStrip - firstStrip + 1);
412
413 double const phiWidth = static_cast<double>((phiIndicesMax - phiIndicesMin) + 1);
414 InDet::SiWidth siWidth(Amg::Vector2D(phiWidth, 1),
415 Amg::Vector2D(width, stripLength));
416
417 xaod_scl->setIdentifier(rdoList.front().get_compact());
418 xaod_scl->setRDOlist(std::move(rdoList));
419 xaod_scl->setChannelsInPhi(siWidth.colRow()[0]);
420
421 }
422 measToStripCl[i] = strip_idx;
423 ++strip_idx;
424 }
425 }
426
427 ATH_MSG_DEBUG("Converted " << pixel_idx << " pixel clusters, " << strip_idx
428 << " strip clusters");
429
430 m_nMeas += traccc_measurements.size();
431 m_nPix += pixel_idx;
432 m_nStrip += strip_idx;
433
434 // ---- Write outputs ----
435 SG::WriteHandle<xAOD::PixelClusterContainer> pixelHandle{m_outputPixelKey,
436 ctx};
437 ATH_CHECK(pixelHandle.record(std::move(pixel_cont), std::move(pixel_aux)));
438
439 SG::WriteHandle<xAOD::SpacePointContainer> spacePointHandle{m_outputPixelSpacePointsKey,
440 ctx};
441 ATH_CHECK(spacePointHandle.record(std::move(pixel_spacepoint_cont), std::move(pixel_spacepoint_aux)));
442
443 SG::WriteHandle<std::vector<unsigned int>> measToPixelSPHandle{m_outputMeasToPixelSPKey, ctx};
444 ATH_CHECK(measToPixelSPHandle.record(std::make_unique<std::vector<unsigned int>>(std::move(measToPixelSP))));
445
446 SG::WriteHandle<std::vector<unsigned int>> measToStripClHandle{m_outputMeasToStripClKey, ctx};
447 ATH_CHECK(measToStripClHandle.record(std::make_unique<std::vector<unsigned int>>(std::move(measToStripCl))));
448
449 SG::WriteHandle<xAOD::StripClusterContainer> stripHandle{m_outputStripKey,
450 ctx};
451 ATH_CHECK(stripHandle.record(std::move(strip_cont), std::move(strip_aux)));
452
453 ATH_MSG_DEBUG("Wrote clusters to " << m_outputPixelKey.key() << " and " << m_outputStripKey.key());
454
455 return StatusCode::SUCCESS;
456}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_FATAL(x,...)
static Double_t Tp(Double_t *t, Double_t *par)
const double width
SG::ReadHandleKey< traccc::edm::measurement_collection::buffer > m_inputMeasKey
SG::WriteHandleKey< xAOD::StripClusterContainer > m_outputStripKey
SG::WriteHandleKey< std::vector< unsigned int > > m_outputMeasToStripClKey
SG::ReadHandleKey< traccc::edm::silicon_cell_collection::buffer > m_inputCellsKey
SG::ReadHandleKey< traccc::edm::silicon_cluster_collection::buffer > m_inputClusterKey
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
std::atomic< int > m_nPix
The object counters for debug prints in finalize method {.
const PixelID * m_pixelID
Conversion helpers (to retrieve module design, hash, etc.) {.
SG::WriteHandleKey< std::vector< unsigned int > > m_outputMeasToPixelSPKey
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_outputPixelKey
SG::WriteHandleKey< xAOD::SpacePointContainer > m_outputPixelSpacePointsKey
const InDetDD::SCT_DetectorManager * m_stripManager
const InDetDD::PixelDetectorManager * m_pixelManager
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Trk::Surface & surface()
Element Surface.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
void setChannelsInPhiEta(int channelsInPhi, int channelsInEta)
Sets the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setWidthInEta(float widthInEta)
Sets the width of the cluster in eta (y) direction.
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, std::vector< const xAOD::UncalibratedMeasurement * > &&measurementIndexes)
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setChannelsInPhi(int channelsInPhi)
Sets the dimensions of the cluster in numbers of channels in phi (x).
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
void fillPixelCluster(const MEAS &meas, const Identifier &athenaId, const PixelID *pixelID, const InDetDD::PixelDetectorManager *pixelManager, xAOD::PixelCluster &xaod_pcl, std::size_t combinedIndex)
void fillStripCluster(const MEAS &meas, const Identifier &athenaId, const SCT_ID *stripID, const InDetDD::SCT_DetectorManager *stripManager, xAOD::StripCluster &xaod_scl, std::size_t combinedIndex)
std::pair< std::unique_ptr< ContainerT >, std::unique_ptr< AuxContainerT > > makeOutputContainer(const EventContext &ctx, int n)
std::pair< int, int > countPixelStrip(const traccc::edm::measurement_collection::const_device &measurements)
Count the number of measurements 2D (pixel) vs 1D (strip).
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
row
Appending html table to final .html summary file.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
bool copy
Definition calibdata.py:26
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode ActsTrk::TracccMeasurementConverterAlg::finalize ( )
overridevirtual

Function finalizing the algorthm.

Definition at line 458 of file TracccMeasurementConverterAlg.cxx.

459{
460 ATH_MSG_DEBUG("Finalizing.");
461
462 ATH_MSG_DEBUG("Received total number of measurements = " << m_nMeas
463 << ", of which pixel clusters = " << m_nPix
464 << " and strip clusters = " << m_nStrip);
465
466 ATH_MSG_DEBUG("Successfully finalized");
467 return StatusCode::SUCCESS;
468}

◆ initialize()

StatusCode ActsTrk::TracccMeasurementConverterAlg::initialize ( )
overridevirtual

Function initializing the algorithm.

Definition at line 19 of file TracccMeasurementConverterAlg.cxx.

20{
21 ATH_MSG_DEBUG("Initializing.");
22
23 ATH_CHECK(m_hostMR.retrieve());
24 ATH_CHECK(m_copy.retrieve());
25
26 ATH_CHECK(m_inputMeasKey.initialize());
29
30 ATH_CHECK(m_outputPixelKey.initialize());
34 ATH_CHECK(m_outputStripKey.initialize());
35
37 ATH_CHECK(detStore()->retrieve(m_stripID, "SCT_ID"));
38 ATH_CHECK(detStore()->retrieve(m_pixelManager, "ITkPixel"));
39 ATH_CHECK(detStore()->retrieve(m_stripManager, "ITkStrip"));
40
42
43 ATH_MSG_DEBUG("Successfully initialized");
44 return StatusCode::SUCCESS;
45}
Gaudi::Property< std::string > m_geoIdMappingObjectName
const ServiceHandle< StoreGateSvc > & detStore() const

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_convertClustersWithCells

Gaudi::Property<bool> ActsTrk::TracccMeasurementConverterAlg::m_convertClustersWithCells
private
Initial value:
{
this, "ConvertClustersWithCells", true,
"Whether to associate cells with the clusters."}

Definition at line 71 of file TracccMeasurementConverterAlg.h.

71 {
72 this, "ConvertClustersWithCells", true,
73 "Whether to associate cells with the clusters."};

◆ m_copy

ToolHandle<AthDevice::ICopyTool> ActsTrk::TracccMeasurementConverterAlg::m_copy
private
Initial value:
{
this, "CopyProviderTool", "", "Vecmem copy provider tool"}

Definition at line 111 of file TracccMeasurementConverterAlg.h.

111 {
112 this, "CopyProviderTool", "", "Vecmem copy provider tool"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_geoIdMappingObjectName

Gaudi::Property<std::string> ActsTrk::TracccMeasurementConverterAlg::m_geoIdMappingObjectName {this, "GeoIdMapping", "", "ID mapping between the three detector description realms."}
private

Definition at line 114 of file TracccMeasurementConverterAlg.h.

114{this, "GeoIdMapping", "", "ID mapping between the three detector description realms."};

◆ m_hostMR

ToolHandle<AthDevice::IMemoryResourceTool> ActsTrk::TracccMeasurementConverterAlg::m_hostMR
private
Initial value:
{
this, "HostMR", "", "Host memory resource tool"}

Definition at line 108 of file TracccMeasurementConverterAlg.h.

108 {
109 this, "HostMR", "", "Host memory resource tool"};

◆ m_idHelperName

Gaudi::Property<std::string> ActsTrk::TracccMeasurementConverterAlg::m_idHelperName
private
Initial value:
{this, "IDHelperName", "PixelID",
"Pixel-like ID helper name to retrieve from DetectorStore"}

Definition at line 128 of file TracccMeasurementConverterAlg.h.

128 {this, "IDHelperName", "PixelID",
129 "Pixel-like ID helper name to retrieve from DetectorStore"};

◆ m_idMapping

const ActsTrk::GeometryIdMapping* ActsTrk::TracccMeasurementConverterAlg::m_idMapping {nullptr}
private

Definition at line 115 of file TracccMeasurementConverterAlg.h.

115{nullptr};

◆ m_inputCellsKey

SG::ReadHandleKey<traccc::edm::silicon_cell_collection::buffer> ActsTrk::TracccMeasurementConverterAlg::m_inputCellsKey
private
Initial value:
{
this, "InputCells", "TracccCells",
"Input traccc cell collection buffer"}

Definition at line 83 of file TracccMeasurementConverterAlg.h.

83 {
84 this, "InputCells", "TracccCells",
85 "Input traccc cell collection buffer"};

◆ m_inputClusterKey

SG::ReadHandleKey<traccc::edm::silicon_cluster_collection::buffer> ActsTrk::TracccMeasurementConverterAlg::m_inputClusterKey
private
Initial value:
{
this, "InputClusters", "TracccClusters",
"Input traccc cluster collection buffer"}

Definition at line 80 of file TracccMeasurementConverterAlg.h.

80 {
81 this, "InputClusters", "TracccClusters",
82 "Input traccc cluster collection buffer"};

◆ m_inputMeasKey

SG::ReadHandleKey<traccc::edm::measurement_collection::buffer> ActsTrk::TracccMeasurementConverterAlg::m_inputMeasKey
private
Initial value:
{
this, "InputMeasurements", "TracccMeasurements",
"Input traccc measurement collection buffer"}

Definition at line 77 of file TracccMeasurementConverterAlg.h.

77 {
78 this, "InputMeasurements", "TracccMeasurements",
79 "Input traccc measurement collection buffer"};

◆ m_nMeas

std::atomic<int> ActsTrk::TracccMeasurementConverterAlg::m_nMeas = 0
mutableprivate

Definition at line 121 of file TracccMeasurementConverterAlg.h.

◆ m_nPix

std::atomic<int> ActsTrk::TracccMeasurementConverterAlg::m_nPix = 0
mutableprivate

The object counters for debug prints in finalize method {.

Definition at line 119 of file TracccMeasurementConverterAlg.h.

◆ m_nStrip

std::atomic<int> ActsTrk::TracccMeasurementConverterAlg::m_nStrip = 0
mutableprivate

Definition at line 120 of file TracccMeasurementConverterAlg.h.

◆ m_outputMeasToPixelSPKey

SG::WriteHandleKey<std::vector<unsigned int> > ActsTrk::TracccMeasurementConverterAlg::m_outputMeasToPixelSPKey
private
Initial value:
{
this, "OutputMeasToPixelSP", "ITkTracccMeasToPixelSP",
"Output mapping from traccc measurement index to pixel spacepoint index"}

Definition at line 96 of file TracccMeasurementConverterAlg.h.

96 {
97 this, "OutputMeasToPixelSP", "ITkTracccMeasToPixelSP",
98 "Output mapping from traccc measurement index to pixel spacepoint index"};

◆ m_outputMeasToStripClKey

SG::WriteHandleKey<std::vector<unsigned int> > ActsTrk::TracccMeasurementConverterAlg::m_outputMeasToStripClKey
private
Initial value:
{
this, "OutputMeasToStripCl", "ITkTracccMeasToStripCl",
"Output mapping from traccc measurement index to strip cluster index"}

Definition at line 99 of file TracccMeasurementConverterAlg.h.

99 {
100 this, "OutputMeasToStripCl", "ITkTracccMeasToStripCl",
101 "Output mapping from traccc measurement index to strip cluster index"};

◆ m_outputPixelKey

SG::WriteHandleKey<xAOD::PixelClusterContainer> ActsTrk::TracccMeasurementConverterAlg::m_outputPixelKey
private
Initial value:
{
this, "OutputPixelClusters", "ITkTracccPixelClusters",
"Output xAOD pixel cluster container"}

Definition at line 90 of file TracccMeasurementConverterAlg.h.

90 {
91 this, "OutputPixelClusters", "ITkTracccPixelClusters",
92 "Output xAOD pixel cluster container"};

◆ m_outputPixelSpacePointsKey

SG::WriteHandleKey<xAOD::SpacePointContainer> ActsTrk::TracccMeasurementConverterAlg::m_outputPixelSpacePointsKey
private
Initial value:
{
this, "OutputPixelSpacePoints", "ITkTracccPixelSpacepoints",
"Output xAOD pixel space point container"}

Definition at line 93 of file TracccMeasurementConverterAlg.h.

93 {
94 this, "OutputPixelSpacePoints", "ITkTracccPixelSpacepoints",
95 "Output xAOD pixel space point container"};

◆ m_outputStripKey

SG::WriteHandleKey<xAOD::StripClusterContainer> ActsTrk::TracccMeasurementConverterAlg::m_outputStripKey
private
Initial value:
{
this, "OutputStripClusters", "ITkTracccStripClusters",
"Output xAOD strip cluster container"}

Definition at line 102 of file TracccMeasurementConverterAlg.h.

102 {
103 this, "OutputStripClusters", "ITkTracccStripClusters",
104 "Output xAOD strip cluster container"};

◆ m_pixelID

const PixelID* ActsTrk::TracccMeasurementConverterAlg::m_pixelID {nullptr}
private

Conversion helpers (to retrieve module design, hash, etc.) {.

Definition at line 126 of file TracccMeasurementConverterAlg.h.

126{nullptr};

◆ m_pixelManager

const InDetDD::PixelDetectorManager* ActsTrk::TracccMeasurementConverterAlg::m_pixelManager {nullptr}
private

Definition at line 131 of file TracccMeasurementConverterAlg.h.

131{nullptr};

◆ m_stripID

const SCT_ID* ActsTrk::TracccMeasurementConverterAlg::m_stripID {nullptr}
private

Definition at line 127 of file TracccMeasurementConverterAlg.h.

127{nullptr};

◆ m_stripManager

const InDetDD::SCT_DetectorManager* ActsTrk::TracccMeasurementConverterAlg::m_stripManager {nullptr}
private

Definition at line 132 of file TracccMeasurementConverterAlg.h.

132{nullptr};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: