ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ActsTrk::TrackStatePrinter Class Reference

#include <TrackStatePrinter.h>

Inheritance diagram for ActsTrk::TrackStatePrinter:
Collaboration diagram for ActsTrk::TrackStatePrinter:

Public Types

using MeasurementInfo = std::tuple< size_t, const ATLASUncalibSourceLink *, std::vector< const xAOD::SpacePoint * > >
 

Public Member Functions

 TrackStatePrinter (const std::string &type, const std::string &name, const IInterface *parent)
 ========================================================================= More...
 
virtual ~TrackStatePrinter ()=default
 
virtual StatusCode initialize () override
 
void printMeasurements (const EventContext &ctx, const std::vector< const xAOD::UncalibratedMeasurementContainer * > &clusterContainers, const std::vector< const InDetDD::SiDetectorElementCollection * > &detectorElementCollections, const std::vector< size_t > &offsets) const
 
void printSeed (const Acts::GeometryContext &tgContext, const ActsTrk::Seed &seed, const Acts::BoundTrackParameters &initialParameters, size_t measurementOffset, size_t iseed, bool isKF) const
 
template<typename track_container_t >
void printTrack (const Acts::GeometryContext &tgContext, const track_container_t &tracks, const typename track_container_t::TrackProxy &track, const std::vector< std::pair< const xAOD::UncalibratedMeasurementContainer *, size_t >> &offset) const
 
template<typename track_state_proxy_t >
void printTrackState (const Acts::GeometryContext &tgContext, const track_state_proxy_t &state, const std::vector< std::pair< const xAOD::UncalibratedMeasurementContainer *, size_t >> &container_offset, bool useFiltered=false) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

template<class T >
using small_vector = boost::container::small_vector< T, N_SP_PER_MEAS >
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::vector< std::vector< small_vector< const xAOD::SpacePoint * > > > addSpacePoints (const EventContext &ctx, const std::vector< const xAOD::UncalibratedMeasurementContainer * > &clusterContainers, const std::vector< size_t > &offset) const
 
void printMeasurementAssociatedSpacePoint (const Acts::GeometryContext &tgContext, const xAOD::UncalibratedMeasurement *measurement, const std::vector< small_vector< const xAOD::SpacePoint * >> &measToSp, const InDetDD::SiDetectorElementCollection *detectorElements, size_t offset) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static void printParameters (const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound)
 
static std::string actsSurfaceName (const Acts::Surface &surface)
 
static std::string trackStateName (Acts::ConstTrackStateType trackStateType)
 ========================================================================= file-local static functions and static TrackStatePrinter member functions. More...
 

Private Attributes

SG::ReadHandleKeyArray< xAOD::SpacePointContainerm_spacePointKey {this, "InputSpacePoints", {}, "Input Space Points for debugging"}
 
ToolHandle< IActsTrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", ""}
 
ToolHandle< ActsTrk::IActsToTrkConverterToolm_ATLASConverterTool {this, "ATLASConverterTool", ""}
 
Gaudi::Property< bool > m_compareMeasurementTransforms {this, "compareMeasurementTransforms", false, "compare measurement coordinates transformed with Athena or ACTS"}
 
Gaudi::Property< bool > m_printFilteredStates {this, "printFilteredStates", false, "print track states during filtering"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Static Private Attributes

static constexpr unsigned int N_SP_PER_MEAS = 2
 

Detailed Description

Definition at line 50 of file TrackStatePrinter.h.

Member Typedef Documentation

◆ MeasurementInfo

Definition at line 88 of file TrackStatePrinter.h.

◆ small_vector

template<class T >
using ActsTrk::TrackStatePrinter::small_vector = boost::container::small_vector<T, N_SP_PER_MEAS>
private

Definition at line 107 of file TrackStatePrinter.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackStatePrinter()

ActsTrk::TrackStatePrinter::TrackStatePrinter ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

=========================================================================

TrackStatePrinter class method definitions

Definition at line 406 of file TrackStatePrinter.cxx.

410  {
411  }

◆ ~TrackStatePrinter()

virtual ActsTrk::TrackStatePrinter::~TrackStatePrinter ( )
virtualdefault

Member Function Documentation

◆ actsSurfaceName()

std::string ActsTrk::TrackStatePrinter::actsSurfaceName ( const Acts::Surface &  surface)
staticprivate

Definition at line 59 of file TrackStatePrinter.cxx.

60  {
61  std::string name = surface.name();
62  if (name.compare(0, 6, "Acts::") == 0)
63  {
64  name.erase(0, 6);
65  }
66  if (name.size() > 7 && name.compare(name.size() - 7, 7, "Surface") == 0)
67  {
68  name.erase(name.size() - 7, 7);
69  }
70  static const std::map<Acts::SurfaceBounds::BoundsType, const char *> boundsNames{{
71  {Acts::SurfaceBounds::BoundsType::eCone, "Cone"},
72  {Acts::SurfaceBounds::BoundsType::eCylinder, "Cylinder"},
73  {Acts::SurfaceBounds::BoundsType::eDiamond, "Diamond"},
74  {Acts::SurfaceBounds::BoundsType::eDisc, "Disc"},
75  {Acts::SurfaceBounds::BoundsType::eEllipse, "Ellipse"},
76  {Acts::SurfaceBounds::BoundsType::eLine, "Line"},
77  {Acts::SurfaceBounds::BoundsType::eRectangle, "Rectangle"},
78  {Acts::SurfaceBounds::BoundsType::eTrapezoid, "Trapezoid"},
79  {Acts::SurfaceBounds::BoundsType::eTriangle, "Triangle"},
80  {Acts::SurfaceBounds::BoundsType::eDiscTrapezoid, "DiscTrapezoid"},
81  {Acts::SurfaceBounds::BoundsType::eConvexPolygon, "ConvexPolygon"},
82  {Acts::SurfaceBounds::BoundsType::eAnnulus, "Annulus"},
83  {Acts::SurfaceBounds::BoundsType::eBoundless, "Boundless"},
84  {Acts::SurfaceBounds::BoundsType::eOther, "Other"},
85  }};
86  if (auto it = boundsNames.find(surface.bounds().type());
87  it != boundsNames.end() && it->second != name)
88  {
89  name += ' ';
90  name += it->second;
91  }
92  return name;
93  }

◆ addSpacePoints()

std::vector< std::vector< TrackStatePrinter::small_vector< const xAOD::SpacePoint * > > > ActsTrk::TrackStatePrinter::addSpacePoints ( const EventContext &  ctx,
const std::vector< const xAOD::UncalibratedMeasurementContainer * > &  clusterContainers,
const std::vector< size_t > &  offset 
) const
private

Definition at line 491 of file TrackStatePrinter.cxx.

494  {
495  std::vector<std::vector<TrackStatePrinter::small_vector<const xAOD::SpacePoint *>>> measToSp{clusterContainers.size()};
496  for (std::size_t icontainer = 0; icontainer < clusterContainers.size(); ++icontainer)
497  {
498  measToSp[icontainer].resize(clusterContainers[icontainer]->size());
499  }
500 
501  for (auto &spacePointKey : m_spacePointKey)
502  {
503  ATH_MSG_DEBUG("Retrieving from input SpacePoint collection '" << spacePointKey.key() << "' ...");
504  SG::ReadHandle<xAOD::SpacePointContainer> handle = SG::makeHandle(spacePointKey, ctx);
505  if (!handle.isValid())
506  {
507  ATH_MSG_ERROR("Error retrieving from input SpacePoint collection '" << spacePointKey.key() << "'");
508  continue;
509  }
510  ATH_MSG_DEBUG(" \\__ " << handle->size() << " elements!");
511  for (const auto *sp : *handle)
512  {
513  for (const xAOD::UncalibratedMeasurement *meas : sp->measurements())
514  {
515  if (!meas)
516  continue;
517  for (std::size_t icontainer = 0; icontainer < clusterContainers.size(); ++icontainer)
518  {
519  // This measurement may well be in a different clusterContainer. Skip all but the one we are interested in.
520  if (!(meas && meas->index() < clusterContainers[icontainer]->size() && meas == clusterContainers[icontainer]->at(meas->index())))
521  continue;
522  small_vector<const xAOD::SpacePoint *> &measSp = measToSp[icontainer].at(meas->index());
523  if (!measSp.empty())
524  {
525  ATH_MSG_INFO("Cluster "
526  << (meas->index() + offsets[icontainer])
527  << " used by SpacePoints at ("
528  << sp->globalPosition()[0] << ',' << sp->globalPosition()[1] << ',' << sp->globalPosition()[2]
529  << ") and ("
530  << measSp[0]->globalPosition()[0] << ',' << measSp[0]->globalPosition()[1] << ',' << measSp[0]->globalPosition()[2]
531  << ')');
532  }
533  measSp.push_back(sp);
534  }
535  }
536  }
537  }
538  return measToSp;
539  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ initialize()

StatusCode ActsTrk::TrackStatePrinter::initialize ( )
overridevirtual

Definition at line 413 of file TrackStatePrinter.cxx.

414  {
415  ATH_MSG_DEBUG("Initializing " << name() << "...");
416  ATH_MSG_DEBUG("Properties Summary:");
419 
420  ATH_CHECK(m_trackingGeometryTool.retrieve());
421  ATH_CHECK(m_spacePointKey.initialize());
422 
423  return StatusCode::SUCCESS;
424  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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.

◆ printMeasurementAssociatedSpacePoint()

void ActsTrk::TrackStatePrinter::printMeasurementAssociatedSpacePoint ( const Acts::GeometryContext &  tgContext,
const xAOD::UncalibratedMeasurement measurement,
const std::vector< small_vector< const xAOD::SpacePoint * >> &  measToSp,
const InDetDD::SiDetectorElementCollection detectorElements,
size_t  offset 
) const
private

Definition at line 324 of file TrackStatePrinter.cxx.

329  {
330  if (!measurement || !detectorElements)
331  return;
332 
333  std::cout << std::setw(5) << (measurement->index() + offset) << ' '
334  << std::setw(3) << measurement->numDimensions() << "D ";
335 
336  const InDetDD::SiDetectorElement *detElem = detectorElements->getDetectorElement(measurement->identifierHash());
337  const Acts::Surface *surface_ptr = nullptr;
338  if (!detElem)
339  {
340  std::cout << std::setw(20 + 22 + 20 + 2) << "** no DetElem **";
341  }
342  else
343  {
344  surface_ptr = &m_ATLASConverterTool->trkSurfaceToActsSurface(detElem->surface());
345  std::cout << std::left;
346  std::cout << std::setw(21) << actsSurfaceName(*surface_ptr) << ' '
347  << std::setw(22) << to_string(surface_ptr->geometryId()) << ' ';
348  std::cout << std::setw(20) << atlasSurfaceName(*detElem);
349  std::cout << std::right;
350  }
351 
352  if (measurement->type() == xAOD::UncalibMeasType::PixelClusterType)
353  {
354  const auto loc = measurement->localPosition<2>().cast<double>();
355  printMeasurement(tgContext, surface_ptr, detElem, {loc, loc, -1, -1}, m_compareMeasurementTransforms);
356  }
357  else if (measurement->type() == xAOD::UncalibMeasType::StripClusterType)
358  {
359  const small_vector<const xAOD::SpacePoint *> &spvec = measToSp.at(measurement->index());
360  if (spvec.empty())
361  {
362  printMeasurement(tgContext, surface_ptr, detElem,
363  localPositionStrip2D(tgContext, *measurement, surface_ptr, nullptr),
365  }
366  else
367  {
368  size_t isp = 0;
369  for (auto *sp : spvec)
370  {
371  if (isp++)
372  {
373  std::cout << '\n'
374  << std::left
375  << std::setw(76) << to_string("** Spacepoint ", isp, " **")
376  << std::right;
377  }
378  printMeasurement(tgContext, surface_ptr, detElem,
379  localPositionStrip2D(tgContext, *measurement, surface_ptr, sp),
381  }
382  }
383  }
384  std::cout << '\n';
385  }

◆ printMeasurements()

void ActsTrk::TrackStatePrinter::printMeasurements ( const EventContext &  ctx,
const std::vector< const xAOD::UncalibratedMeasurementContainer * > &  clusterContainers,
const std::vector< const InDetDD::SiDetectorElementCollection * > &  detectorElementCollections,
const std::vector< size_t > &  offsets 
) const

Definition at line 467 of file TrackStatePrinter.cxx.

471  {
472  auto trackingGeometry = m_trackingGeometryTool->trackingGeometry();
473  Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
474 
475  auto measToSp = addSpacePoints(ctx, clusterContainers, offsets);
476 
477  ATH_MSG_INFO("CKF input measurements:");
479 
480  for (std::size_t icontainer = 0; icontainer < clusterContainers.size(); ++icontainer)
481  {
482  for (const auto *measurement : *clusterContainers[icontainer])
483  {
484  printMeasurementAssociatedSpacePoint(tgContext, measurement, measToSp[icontainer], detectorElementCollections[icontainer], offsets[icontainer]);
485  }
486  }
487  std::cout << std::flush;
488  }

◆ printParameters()

void ActsTrk::TrackStatePrinter::printParameters ( const Acts::Surface &  surface,
const Acts::GeometryContext &  tgContext,
const Acts::BoundVector &  bound 
)
staticprivate

Definition at line 387 of file TrackStatePrinter.cxx.

388  {
389  auto p = Acts::transformBoundToFreeParameters(surface, tgContext, bound);
390  std::cout << std::fixed
391  << std::setw(10) << std::setprecision(4) << bound[Acts::eBoundLoc0] << ' '
392  << std::setw(10) << std::setprecision(4) << bound[Acts::eBoundLoc1] << ' '
393  << std::setw(9) << std::setprecision(3) << p.segment<2>(Acts::eFreePos0).norm() << ' '
394  << std::setw(9) << std::setprecision(3) << std::atan2(p[Acts::eFreePos1], p[Acts::eFreePos0]) / Acts::UnitConstants::degree << ' '
395  << std::setw(9) << std::setprecision(5) << std::atanh(p[Acts::eFreePos2] / p.segment<3>(Acts::eFreePos0).norm()) << ' '
396  << std::setw(9) << std::setprecision(3) << p.segment<2>(Acts::eFreeDir0).norm() / p[Acts::eFreeQOverP] << ' '
397  << std::setw(9) << std::setprecision(3) << std::atan2(p[Acts::eFreeDir1], p[Acts::eFreeDir0]) / Acts::UnitConstants::degree << ' '
398  << std::setw(9) << std::setprecision(5) << std::atanh(p[Acts::eFreeDir2])
399  << std::defaultfloat << std::setprecision(-1);
400  }

◆ printSeed()

void ActsTrk::TrackStatePrinter::printSeed ( const Acts::GeometryContext &  tgContext,
const ActsTrk::Seed seed,
const Acts::BoundTrackParameters &  initialParameters,
size_t  measurementOffset,
size_t  iseed,
bool  isKF 
) const

Definition at line 427 of file TrackStatePrinter.cxx.

433  {
434  if (!isKF)
435  printHeader(1);
436 
437  std::ostringstream os;
438  size_t nos = 0;
439  for (const auto *sp : seed.sp())
440  {
441  size_t nom = 0;
442  for (const auto *el : sp->measurements())
443  {
444  std::size_t index = el->index();
445  if (nom > 0)
446  os << '+';
447  else if (nos > 0)
448  os << ',';
449  ++nos;
450  ++nom;
451  os << measurementOffset + index;
452  }
453  }
454 
455  std::cout << std::setw(5) << iseed << ' '
456  << std::left
457  << std::setw(4) << (!isKF ? "seed" : "KF") << ' '
458  << std::setw(21) << actsSurfaceName(initialParameters.referenceSurface()) << ' '
459  << std::setw(22) << to_string(os.str()) << ' '
460  << std::right;
461  printParameters(initialParameters.referenceSurface(), tgContext, initialParameters.parameters());
462  std::cout << '\n'
463  << std::flush;
464  }

◆ printTrack()

template<typename track_container_t >
void ActsTrk::TrackStatePrinter::printTrack ( const Acts::GeometryContext &  tgContext,
const track_container_t &  tracks,
const typename track_container_t::TrackProxy &  track,
const std::vector< std::pair< const xAOD::UncalibratedMeasurementContainer *, size_t >> &  offset 
) const

◆ printTrackState()

template<typename track_state_proxy_t >
void ActsTrk::TrackStatePrinter::printTrackState ( const Acts::GeometryContext &  tgContext,
const track_state_proxy_t &  state,
const std::vector< std::pair< const xAOD::UncalibratedMeasurementContainer *, size_t >> &  container_offset,
bool  useFiltered = false 
) const

◆ 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< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ trackStateName()

std::string ActsTrk::TrackStatePrinter::trackStateName ( Acts::ConstTrackStateType  trackStateType)
staticprivate

========================================================================= file-local static functions and static TrackStatePrinter member functions.

TrackStatePrinter class method definitions comes later.

Definition at line 39 of file TrackStatePrinter.cxx.

40  {
41  static constexpr std::array<std::tuple<bool, Acts::TrackStateFlag, char>, 6> trackStateNames{{
42  {false, Acts::TrackStateFlag::ParameterFlag, '-'},
43  {true, Acts::TrackStateFlag::MeasurementFlag, 'M'},
44  {true, Acts::TrackStateFlag::OutlierFlag, 'O'},
45  {true, Acts::TrackStateFlag::HoleFlag, 'H'},
46  {true, Acts::TrackStateFlag::MaterialFlag, 'm'},
47  {true, Acts::TrackStateFlag::SharedHitFlag, 'S'},
48  }};
49  std::string s;
50  for (const auto &[b, f, c] : trackStateNames)
51  {
52  if (trackStateType.test(f) == b)
53  s += c;
54  }
55  return s;
56  }

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_ATLASConverterTool

ToolHandle<ActsTrk::IActsToTrkConverterTool> ActsTrk::TrackStatePrinter::m_ATLASConverterTool {this, "ATLASConverterTool", ""}
private

Definition at line 98 of file TrackStatePrinter.h.

◆ m_compareMeasurementTransforms

Gaudi::Property<bool> ActsTrk::TrackStatePrinter::m_compareMeasurementTransforms {this, "compareMeasurementTransforms", false, "compare measurement coordinates transformed with Athena or ACTS"}
private

Definition at line 101 of file TrackStatePrinter.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_printFilteredStates

Gaudi::Property<bool> ActsTrk::TrackStatePrinter::m_printFilteredStates {this, "printFilteredStates", false, "print track states during filtering"}
private

Definition at line 102 of file TrackStatePrinter.h.

◆ m_spacePointKey

SG::ReadHandleKeyArray<xAOD::SpacePointContainer> ActsTrk::TrackStatePrinter::m_spacePointKey {this, "InputSpacePoints", {}, "Input Space Points for debugging"}
private

Definition at line 94 of file TrackStatePrinter.h.

◆ m_trackingGeometryTool

ToolHandle<IActsTrackingGeometryTool> ActsTrk::TrackStatePrinter::m_trackingGeometryTool {this, "TrackingGeometryTool", ""}
private

Definition at line 97 of file TrackStatePrinter.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ N_SP_PER_MEAS

constexpr unsigned int ActsTrk::TrackStatePrinter::N_SP_PER_MEAS = 2
staticconstexprprivate

Definition at line 105 of file TrackStatePrinter.h.


The documentation for this class was generated from the following files:
ActsTrk::TrackStatePrinter::actsSurfaceName
static std::string actsSurfaceName(const Acts::Surface &surface)
Definition: TrackStatePrinter.cxx:59
xAOD::UncalibratedMeasurement_v1::identifierHash
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
ActsTrk::TrackStatePrinter::m_compareMeasurementTransforms
Gaudi::Property< bool > m_compareMeasurementTransforms
Definition: TrackStatePrinter.h:101
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:168
perfmonmt-printer.printHeader
def printHeader()
Definition: perfmonmt-printer.py:10
ActsTrk::TrackStatePrinter::addSpacePoints
std::vector< std::vector< small_vector< const xAOD::SpacePoint * > > > addSpacePoints(const EventContext &ctx, const std::vector< const xAOD::UncalibratedMeasurementContainer * > &clusterContainers, const std::vector< size_t > &offset) const
Definition: TrackStatePrinter.cxx:491
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
xAOD::UncalibMeasType::StripClusterType
@ StripClusterType
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ActsTrk::TrackStatePrinter::printMeasurementAssociatedSpacePoint
void printMeasurementAssociatedSpacePoint(const Acts::GeometryContext &tgContext, const xAOD::UncalibratedMeasurement *measurement, const std::vector< small_vector< const xAOD::SpacePoint * >> &measToSp, const InDetDD::SiDetectorElementCollection *detectorElements, size_t offset) const
Definition: TrackStatePrinter.cxx:324
skel.it
it
Definition: skel.GENtoEVGEN.py:423
InDetDD::SolidStateDetectorElementBase::surface
Trk::Surface & surface()
Element Surface.
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ActsTrk::TrackStatePrinter::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: TrackStatePrinter.h:97
ActsTrk::TrackStatePrinter::m_spacePointKey
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
Definition: TrackStatePrinter.h:94
bound
@ bound
Definition: L1CaloPprPlotManager.h:74
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
xAOD::UncalibratedMeasurement_v1::localPosition
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
xAOD::UncalibratedMeasurement_v1::numDimensions
virtual unsigned int numDimensions() const =0
Returns the number of dimensions of the measurement.
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
PlotSFuncertainty.nom
nom
Definition: PlotSFuncertainty.py:141
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
ActsTrk::TrackStatePrinter::m_ATLASConverterTool
ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool
Definition: TrackStatePrinter.h:98
DeMoScan.index
string index
Definition: DeMoScan.py:362
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ActsTrk::TrackStatePrinter::m_printFilteredStates
Gaudi::Property< bool > m_printFilteredStates
Definition: TrackStatePrinter.h:102
ActsTrk::TrackStatePrinter::printParameters
static void printParameters(const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound)
Definition: TrackStatePrinter.cxx:387
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
InDetDD::SiDetectorElementCollection::getDetectorElement
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Definition: SiDetectorElementCollection.cxx:15
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType
fitman.k
k
Definition: fitman.py:528