Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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::TrackStatePrinterTool Class Reference

#include <TrackStatePrinterTool.h>

Inheritance diagram for ActsTrk::TrackStatePrinterTool:
Collaboration diagram for ActsTrk::TrackStatePrinterTool:

Public Types

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

Public Member Functions

 TrackStatePrinterTool (const std::string &type, const std::string &name, const IInterface *parent)
 ========================================================================= More...
 
virtual ~TrackStatePrinterTool ()=default
 
virtual StatusCode initialize () override
 
void printMeasurements (const EventContext &ctx, const std::vector< const xAOD::UncalibratedMeasurementContainer * > &clusterContainers, const DetectorElementToActsGeometryIdMap &detectorElementToGeometryIdMap, const std::vector< size_t > &offsets) const
 
void printSeed (const Acts::GeometryContext &tgContext, const ActsTrk::Seed &seed, const Acts::BoundTrackParameters &initialParameters, const detail::MeasurementIndex &measurementIndexer, unsigned int 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 detail::MeasurementIndex &measurementIndexer, bool rejected=false) const
 
template<typename track_state_proxy_t >
bool printTrackState (const Acts::GeometryContext &tgContext, const track_state_proxy_t &state, const detail::MeasurementIndex &measurementIndexer, bool useFiltered=false, bool newLine=true) 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 Acts::TrackingGeometry &tracking_geometry, const DetectorElementToActsGeometryIdMap &detectorElementToGeometryIdMap, const xAOD::UncalibratedMeasurement *measurement, const std::vector< small_vector< const xAOD::SpacePoint * >> &measToSp, 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", ""}
 
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 46 of file TrackStatePrinterTool.h.

Member Typedef Documentation

◆ MeasurementInfo

Definition at line 87 of file TrackStatePrinterTool.h.

◆ small_vector

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

Definition at line 105 of file TrackStatePrinterTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackStatePrinterTool()

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

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

TrackStatePrinter class method definitions

Definition at line 434 of file TrackStatePrinterTool.cxx.

438  {}

◆ ~TrackStatePrinterTool()

virtual ActsTrk::TrackStatePrinterTool::~TrackStatePrinterTool ( )
virtualdefault

Member Function Documentation

◆ actsSurfaceName()

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

Definition at line 62 of file TrackStatePrinterTool.cxx.

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

◆ addSpacePoints()

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

Definition at line 527 of file TrackStatePrinterTool.cxx.

530  {
531  std::vector<std::vector<TrackStatePrinterTool::small_vector<const xAOD::SpacePoint *>>> measToSp{clusterContainers.size()};
532  for (std::size_t icontainer = 0; icontainer < clusterContainers.size(); ++icontainer)
533  {
534  measToSp[icontainer].resize(clusterContainers[icontainer]->size());
535  }
536 
537  for (auto &spacePointKey : m_spacePointKey)
538  {
539  ATH_MSG_DEBUG("Retrieving from input SpacePoint collection '" << spacePointKey.key() << "' ...");
540  SG::ReadHandle<xAOD::SpacePointContainer> handle = SG::makeHandle(spacePointKey, ctx);
541  if (!handle.isValid())
542  {
543  ATH_MSG_ERROR("Error retrieving from input SpacePoint collection '" << spacePointKey.key() << "'");
544  continue;
545  }
546  ATH_MSG_DEBUG(" \\__ " << handle->size() << " elements!");
547  for (const auto *sp : *handle)
548  {
549  for (const xAOD::UncalibratedMeasurement *meas : sp->measurements())
550  {
551  if (!meas)
552  continue;
553  for (std::size_t icontainer = 0; icontainer < clusterContainers.size(); ++icontainer)
554  {
555  // This measurement may well be in a different clusterContainer. Skip all but the one we are interested in.
556  if (!(meas && meas->index() < clusterContainers[icontainer]->size() && meas == clusterContainers[icontainer]->at(meas->index())))
557  continue;
558  small_vector<const xAOD::SpacePoint *> &measSp = measToSp[icontainer].at(meas->index());
559  if (!measSp.empty())
560  {
561  ATH_MSG_INFO("Cluster "
562  << (meas->index() + offsets[icontainer])
563  << " used by SpacePoints at ("
564  << sp->globalPosition()[0] << ',' << sp->globalPosition()[1] << ',' << sp->globalPosition()[2]
565  << ") and ("
566  << measSp[0]->globalPosition()[0] << ',' << measSp[0]->globalPosition()[1] << ',' << measSp[0]->globalPosition()[2]
567  << ')');
568  }
569  measSp.push_back(sp);
570  }
571  }
572  }
573  }
574  return measToSp;
575  }

◆ 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::TrackStatePrinterTool::initialize ( )
overridevirtual

Definition at line 440 of file TrackStatePrinterTool.cxx.

441  {
442  ATH_MSG_DEBUG("Initializing " << name() << "...");
443  ATH_MSG_DEBUG("Properties Summary:");
446 
447  ATH_CHECK(m_trackingGeometryTool.retrieve());
448  ATH_CHECK(m_spacePointKey.initialize());
449 
450  return StatusCode::SUCCESS;
451  }

◆ 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::TrackStatePrinterTool::printMeasurementAssociatedSpacePoint ( const Acts::GeometryContext &  tgContext,
const Acts::TrackingGeometry &  tracking_geometry,
const DetectorElementToActsGeometryIdMap detectorElementToGeometryIdMap,
const xAOD::UncalibratedMeasurement measurement,
const std::vector< small_vector< const xAOD::SpacePoint * >> &  measToSp,
size_t  offset 
) const
private

Definition at line 345 of file TrackStatePrinterTool.cxx.

351  {
352  if (!measurement)
353  return;
354 
355  std::cout << std::setw(5) << (measurement->index() + offset) << ' '
356  << std::setw(3) << measurement->numDimensions() << "D ";
357 
358  const Acts::Surface *surface_ptr = ActsTrk::getSurfaceOfMeasurement( tracking_geometry, detectorElementToGeometryIdMap, *measurement);
359  if (!surface_ptr)
360  {
361  std::cout << std::setw(20 + 22 + 20 + 2) << "** no surface for measurement **";
362  }
363  else
364  {
365  std::cout << std::left;
366  std::cout << std::setw(21) << actsSurfaceName(*surface_ptr) << ' '
367  << std::setw(22) << to_string(surface_ptr->geometryId()) << ' ';
368  std::cout << std::setw(20) << atlasSurfaceName(surface_ptr);
369  std::cout << std::right;
370  }
371 
372  if (measurement->type() == xAOD::UncalibMeasType::PixelClusterType)
373  {
374  const auto loc = measurement->localPosition<2>().cast<double>();
375  printMeasurement(tgContext, surface_ptr, {loc, loc, -1, -1}, m_compareMeasurementTransforms);
376  }
377  else if (measurement->type() == xAOD::UncalibMeasType::StripClusterType)
378  {
379  const small_vector<const xAOD::SpacePoint *> &spvec = measToSp.at(measurement->index());
380  if (spvec.empty())
381  {
382  printMeasurement(tgContext, surface_ptr,
383  localPositionStrip2D(tgContext, *measurement, surface_ptr, nullptr),
385  }
386  else
387  {
388  size_t isp = 0;
389  for (auto *sp : spvec)
390  {
391  if (isp++)
392  {
393  std::cout << '\n'
394  << std::left
395  << std::setw(76) << to_string("** Spacepoint ", isp, " **")
396  << std::right;
397  }
398  printMeasurement(tgContext, surface_ptr,
399  localPositionStrip2D(tgContext, *measurement, surface_ptr, sp),
401  }
402  }
403  }
404  else if (measurement->type() == xAOD::UncalibMeasType::HGTDClusterType) {
405  const auto loc3D = measurement->localPosition<3>().cast<double>();
406  const std::tuple<Acts::Vector2, Amg::Vector2D, int, int> locTup = {Acts::Vector2{loc3D.head<2>()}, Amg::Vector2D{loc3D.head<2>()}, -1, -1};
407  printMeasurement(tgContext, surface_ptr, locTup, m_compareMeasurementTransforms);
408  }
409  std::cout << '\n';
410  }

◆ printMeasurements()

void ActsTrk::TrackStatePrinterTool::printMeasurements ( const EventContext &  ctx,
const std::vector< const xAOD::UncalibratedMeasurementContainer * > &  clusterContainers,
const DetectorElementToActsGeometryIdMap detectorElementToGeometryIdMap,
const std::vector< size_t > &  offsets 
) const

Definition at line 493 of file TrackStatePrinterTool.cxx.

497  {
498  const Acts::TrackingGeometry *
499  acts_tracking_geometry = m_trackingGeometryTool->trackingGeometry().get();
500  if (!acts_tracking_geometry) {
501  ATH_MSG_WARNING("No Acts tracking geometry.");
502  return;
503  }
504  Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
505 
506  auto measToSp = addSpacePoints(ctx, clusterContainers, offsets);
507 
508  ATH_MSG_INFO("CKF input measurements:");
510 
511  for (std::size_t icontainer = 0; icontainer < clusterContainers.size(); ++icontainer)
512  {
513  for (const auto *measurement : *clusterContainers[icontainer])
514  {
516  *acts_tracking_geometry,
517  detectorElementToGeometryIdMap,
518  measurement,
519  measToSp[icontainer],
520  offsets[icontainer]);
521  }
522  }
523  std::cout << std::flush;
524  }

◆ printParameters()

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

Definition at line 412 of file TrackStatePrinterTool.cxx.

415  {
416  auto p = Acts::transformBoundToFreeParameters(surface, tgContext, bound);
417  std::cout << std::fixed
418  << std::setw(10) << std::setprecision(4) << bound[Acts::eBoundLoc0] << ' '
419  << std::setw(10) << std::setprecision(4) << bound[Acts::eBoundLoc1] << ' '
420  << std::setw(9) << std::setprecision(3) << p.segment<2>(Acts::eFreePos0).norm() << ' '
421  << std::setw(9) << std::setprecision(3) << p[Acts::eFreePos2] << ' '
422  << std::setw(9) << std::setprecision(3) << std::atan2(p[Acts::eFreePos1], p[Acts::eFreePos0]) / Acts::UnitConstants::degree << ' '
423  << std::setw(9) << std::setprecision(5) << std::atanh(p[Acts::eFreePos2] / p.segment<3>(Acts::eFreePos0).norm()) << ' '
424  << std::setw(9) << std::setprecision(3) << p.segment<2>(Acts::eFreeDir0).norm() / p[Acts::eFreeQOverP] << ' '
425  << std::setw(9) << std::setprecision(3) << std::atan2(p[Acts::eFreeDir1], p[Acts::eFreeDir0]) / Acts::UnitConstants::degree << ' '
426  << std::setw(9) << std::setprecision(5) << std::atanh(p[Acts::eFreeDir2])
427  << std::defaultfloat << std::setprecision(-1);
428  }

◆ printSeed()

void ActsTrk::TrackStatePrinterTool::printSeed ( const Acts::GeometryContext &  tgContext,
const ActsTrk::Seed seed,
const Acts::BoundTrackParameters &  initialParameters,
const detail::MeasurementIndex measurementIndexer,
unsigned int  iseed,
bool  isKF 
) const

Definition at line 454 of file TrackStatePrinterTool.cxx.

460  {
461  if (!isKF)
462  printHeader(1);
463 
464  std::ostringstream os;
465  size_t nos = 0;
466  for (const auto *sp : seed.sp())
467  {
468  size_t nom = 0;
469  for (const auto *el : sp->measurements())
470  {
471  if (nom > 0)
472  os << '+';
473  else if (nos > 0)
474  os << ',';
475  ++nos;
476  ++nom;
477  os << measurementIndexer.index(*el);
478  }
479  }
480 
481  std::cout << std::setw(5) << iseed << ' '
482  << std::left
483  << std::setw(4) << (!isKF ? "seed" : "KF") << ' '
484  << std::setw(21) << actsSurfaceName(initialParameters.referenceSurface()) << ' '
485  << std::setw(22) << to_string(os.str()) << ' '
486  << std::right;
487  printParameters(initialParameters.referenceSurface(), tgContext, initialParameters.parameters());
488  std::cout << '\n'
489  << std::flush;
490  }

◆ printTrack()

template<typename track_container_t >
void ActsTrk::TrackStatePrinterTool::printTrack ( const Acts::GeometryContext &  tgContext,
const track_container_t &  tracks,
const typename track_container_t::TrackProxy &  track,
const detail::MeasurementIndex measurementIndexer,
bool  rejected = false 
) const

◆ printTrackState()

template<typename track_state_proxy_t >
bool ActsTrk::TrackStatePrinterTool::printTrackState ( const Acts::GeometryContext &  tgContext,
const track_state_proxy_t &  state,
const detail::MeasurementIndex measurementIndexer,
bool  useFiltered = false,
bool  newLine = true 
) 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::TrackStatePrinterTool::trackStateName ( Acts::ConstTrackStateType  trackStateType)
staticprivate

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

TrackStatePrinter class method definitions comes later.

Definition at line 42 of file TrackStatePrinterTool.cxx.

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

◆ 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_compareMeasurementTransforms

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

Definition at line 99 of file TrackStatePrinterTool.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::TrackStatePrinterTool::m_printFilteredStates {this, "printFilteredStates", false, "print track states during filtering"}
private

Definition at line 100 of file TrackStatePrinterTool.h.

◆ m_spacePointKey

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

Definition at line 93 of file TrackStatePrinterTool.h.

◆ m_trackingGeometryTool

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

Definition at line 96 of file TrackStatePrinterTool.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::TrackStatePrinterTool::N_SP_PER_MEAS = 2
staticconstexprprivate

Definition at line 103 of file TrackStatePrinterTool.h.


The documentation for this class was generated from the following files:
ActsTrk::TrackStatePrinterTool::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: TrackStatePrinterTool.cxx:527
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
xAOD::UncalibMeasType::HGTDClusterType
@ HGTDClusterType
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:194
perfmonmt-printer.printHeader
def printHeader()
Definition: perfmonmt-printer.py:10
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::UncalibMeasType::StripClusterType
@ StripClusterType
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
skel.it
it
Definition: skel.GENtoEVGEN.py:407
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::TrackStatePrinterTool::printMeasurementAssociatedSpacePoint
void printMeasurementAssociatedSpacePoint(const Acts::GeometryContext &tgContext, const Acts::TrackingGeometry &tracking_geometry, const DetectorElementToActsGeometryIdMap &detectorElementToGeometryIdMap, const xAOD::UncalibratedMeasurement *measurement, const std::vector< small_vector< const xAOD::SpacePoint * >> &measToSp, size_t offset) const
Definition: TrackStatePrinterTool.cxx:345
ActsTrk::TrackStatePrinterTool::m_compareMeasurementTransforms
Gaudi::Property< bool > m_compareMeasurementTransforms
Definition: TrackStatePrinterTool.h:99
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
ActsTrk::getSurfaceOfMeasurement
const Acts::Surface * getSurfaceOfMeasurement(const Acts::TrackingGeometry &tracking_geometry, const DetectorElementToActsGeometryIdMap &detector_element_to_geoid, const xAOD::UncalibratedMeasurement &measurement)
Definition: SurfaceOfMeasurementUtil.h:13
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
ActsTrk::TrackStatePrinterTool::printParameters
static void printParameters(const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound)
Definition: TrackStatePrinterTool.cxx:412
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
hist_file_dump.f
f
Definition: hist_file_dump.py:141
ActsTrk::TrackStatePrinterTool::m_spacePointKey
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
Definition: TrackStatePrinterTool.h:93
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
ActsTrk::TrackStatePrinterTool::m_printFilteredStates
Gaudi::Property< bool > m_printFilteredStates
Definition: TrackStatePrinterTool.h:100
PlotSFuncertainty.nom
nom
Definition: PlotSFuncertainty.py:141
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
ActsTrk::TrackStatePrinterTool::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: TrackStatePrinterTool.h:96
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType
fitman.k
k
Definition: fitman.py:528
ActsTrk::TrackStatePrinterTool::actsSurfaceName
static std::string actsSurfaceName(const Acts::Surface &surface)
Definition: TrackStatePrinterTool.cxx:62