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 DetectorElementToActsGeometryIdMap &detectorElementToGeometryIdMap, const std::vector< size_t > &offsets) const
 
void printSeed (const Acts::GeometryContext &tgContext, const ActsTrk::Seed &seed, const Acts::BoundTrackParameters &initialParameters, const std::vector< std::pair< const xAOD::UncalibratedMeasurementContainer *, size_t >> &offset, 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 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 TrackStatePrinter.h.

Member Typedef Documentation

◆ MeasurementInfo

Definition at line 84 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 102 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 428 of file TrackStatePrinter.cxx.

432  {
433  }

◆ ~TrackStatePrinter()

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

Member Function Documentation

◆ actsSurfaceName()

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

Definition at line 62 of file TrackStatePrinter.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< 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 522 of file TrackStatePrinter.cxx.

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

◆ 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 435 of file TrackStatePrinter.cxx.

436  {
437  ATH_MSG_DEBUG("Initializing " << name() << "...");
438  ATH_MSG_DEBUG("Properties Summary:");
441 
442  ATH_CHECK(m_trackingGeometryTool.retrieve());
443  ATH_CHECK(m_spacePointKey.initialize());
444 
445  return StatusCode::SUCCESS;
446  }

◆ 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 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 342 of file TrackStatePrinter.cxx.

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

◆ printMeasurements()

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

Definition at line 488 of file TrackStatePrinter.cxx.

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

◆ printParameters()

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

Definition at line 409 of file TrackStatePrinter.cxx.

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

◆ printSeed()

void ActsTrk::TrackStatePrinter::printSeed ( const Acts::GeometryContext &  tgContext,
const ActsTrk::Seed seed,
const Acts::BoundTrackParameters &  initialParameters,
const std::vector< std::pair< const xAOD::UncalibratedMeasurementContainer *, size_t >> &  offset,
size_t  iseed,
bool  isKF 
) const

Definition at line 449 of file TrackStatePrinter.cxx.

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

◆ 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 42 of file TrackStatePrinter.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::TrackStatePrinter::m_compareMeasurementTransforms {this, "compareMeasurementTransforms", false, "compare measurement coordinates transformed with Athena or ACTS"}
private

Definition at line 96 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 97 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 90 of file TrackStatePrinter.h.

◆ m_trackingGeometryTool

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

Definition at line 93 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 100 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:62
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
xAOD::UncalibMeasType::HGTDClusterType
@ HGTDClusterType
ActsTrk::TrackStatePrinter::m_compareMeasurementTransforms
Gaudi::Property< bool > m_compareMeasurementTransforms
Definition: TrackStatePrinter.h:96
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:186
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:522
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:396
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:93
ActsTrk::TrackStatePrinter::m_spacePointKey
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
Definition: TrackStatePrinter.h:90
ActsTrk::TrackStatePrinter::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: TrackStatePrinter.cxx:342
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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:27
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
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:135
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:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ActsTrk::TrackStatePrinter::m_printFilteredStates
Gaudi::Property< bool > m_printFilteredStates
Definition: TrackStatePrinter.h:97
ActsTrk::TrackStatePrinter::printParameters
static void printParameters(const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound)
Definition: TrackStatePrinter.cxx:409
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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: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