ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::AdaptiveVertexFitterTestAlg Class Reference

#include <AdaptiveVertexFitterTestAlg.h>

Inheritance diagram for Trk::AdaptiveVertexFitterTestAlg:
Collaboration diagram for Trk::AdaptiveVertexFitterTestAlg:

Public Member Functions

virtual StatusCode initialize () override
 Standard Gaudi initialize method.
virtual StatusCode execute () override
 Execute the algorithm.
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters:
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode test1 ()
StatusCode test2 ()
StatusCode test3 ()
StatusCode test4 ()
StatusCode test5 ()
StatusCode test6 ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Trk::IVertexFitterm_fitter { this, "Tool", "Trk::AdaptiveVertexFitter", "Tool to test." }
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 26 of file AdaptiveVertexFitterTestAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ AthAlgorithm()

AthAlgorithm::AthAlgorithm ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor with parameters:

Definition at line 51 of file AthAlgorithm.cxx.

25 :
27{
28 // Set up to run AthAlgorithmDHUpdate in sysInitialize before
29 // merging dependency lists. This extends the output dependency
30 // list with any symlinks implied by inheritance relations.
31 m_updateDataHandles =
32 std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
34 std::move (m_updateDataHandles));
35}
DataObjIDColl m_extendedExtraObjects
AthCommonDataStore(const std::string &name, T... args)

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Trk::AdaptiveVertexFitterTestAlg::execute ( )
overridevirtual

Execute the algorithm.

Standard Gaudi execute method.

Definition at line 438 of file AdaptiveVertexFitterTestAlg.cxx.

439{
440 ATH_MSG_VERBOSE ("execute");
441
442 ATH_CHECK( test1() );
443 ATH_CHECK( test2() );
444 ATH_CHECK( test3() );
445 return StatusCode::SUCCESS;
446}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}

◆ initialize()

StatusCode Trk::AdaptiveVertexFitterTestAlg::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Definition at line 430 of file AdaptiveVertexFitterTestAlg.cxx.

431{
432 ATH_CHECK( m_fitter.retrieve() );
433 return StatusCode::SUCCESS;
434}
ToolHandle< Trk::IVertexFitter > m_fitter

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ test1()

StatusCode Trk::AdaptiveVertexFitterTestAlg::test1 ( )
private

Definition at line 449 of file AdaptiveVertexFitterTestAlg.cxx.

450{
451 xAOD::Vertex exp_v0;
452 exp_v0.makePrivateStore();
453 exp_v0.setPosition ({4.27611, 4.35683, 1.62467});
454 exp_v0.setFitQuality (1.69878, 0.79376);
455 exp_v0.setCovariance (std::vector<float>
456 {28.318, 26.913, 37.8531, 17.3323, 17.3041, 23.6152});
457 setFitQuality (exp_v0, 0, 0.936, 1);
458 setFitQuality (exp_v0, 1, 0.000, 2);
459 setFitQuality (exp_v0, 2, 0.000, 2);
460
461 NeutralUVec_t neutrals = makeNeutrals1();
462 std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (std::vector<const Trk::TrackParameters*>(),
463 asVec (neutrals)));
464 compareVertex (*v1, exp_v0);
465
466 return StatusCode::SUCCESS;
467}
void makePrivateStore()
Create a new (empty) private store for this object.
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ test2()

StatusCode Trk::AdaptiveVertexFitterTestAlg::test2 ( )
private

Definition at line 470 of file AdaptiveVertexFitterTestAlg.cxx.

471{
472 xAOD::Vertex exp_v0;
473 exp_v0.makePrivateStore();
474 exp_v0.setPosition ({-0.666051, 1.88126, -4.2844});
475 exp_v0.setFitQuality (1.36804, 6.60783);
476 exp_v0.setCovariance (std::vector<float>
477 {25.8826, 26.6122, 91.0458, 6.34189, 14.6174, 13.9884});
478 setRefittedPerigee(
479 exp_v0,
480 0,
481 1,
482 { 1.58753, 0.380882, -10.2063 },
483 { 399.6301520, 600.2463141, 200.0002601 },
484 { 1.58278, -0.618193, -0.821391, 0.00010879, -0.171884, -0.618193,
485 2.32566, 0.908938, 0.800925, 0.346876, -0.821391, 0.908938,
486 1.20816, -0.000294073, 0.461137, 0.00010879, 0.800925, -0.000294073,
487 1, -0.000269915, -0.171884, 0.346876, 0.461137, -0.000269915,
488 1 });
489 setFitQuality (exp_v0, 0, 0.000, 2);
490 setRefittedPerigee(
491 exp_v0,
492 1,
493 -1,
494 { -0.209537, 1.1947, -2.59698 },
495 { 600.4814296, 399.2766328, -200.0005578 },
496 { 3.53014, 0.466334, -2.04043, 0.000621337, -0.653413, 0.466334,
497 3.53405, -0.415368, 1.56192, -0.206492, -2.04043, -0.415368,
498 1.81448, -0.000856625, 0.901728, 0.000621337, 1.56192, -0.000856625,
499 1, -0.000578862, -0.653413, -0.206492, 0.901728, -0.000578862,
500 1 });
501 setFitQuality (exp_v0, 1, 0.017, 2);
502 setRefittedPerigee(exp_v0,
503 2,
504 -1,
505 { 1.20591, 1.3197, -6.99803 },
506 { 299.9873170, 1000.0038041, 100.0000072 },
507 { 1.00049,
508 0.00413671,
509 0.0221412,
510 -2.7918e-08,
511 -0.000147081,
512 0.00413671,
513 1.03551,
514 0.18734,
515 -0.0223173,
516 -0.00248881,
517 0.0221412,
518 0.18734,
519 1.00242,
520 -1.91988e-06,
521 -0.0133167,
522 -2.7918e-08,
523 -0.0223173,
524 -1.91988e-06,
525 1,
526 7.24261e-06,
527 -0.000147081,
528 -0.00248881,
529 -0.0133167,
530 7.24261e-06,
531 1 });
532 setFitQuality (exp_v0, 2, 0.020, 2);
533 setFitQuality (exp_v0, 3, 0.136, 2);
534 setFitQuality (exp_v0, 4, 0.000, 2);
535 setFitQuality (exp_v0, 5, 0.000, 2);
536
537 Amg::Vector3D pnt1 (5, 6, -3);
538
539 TrackUVec_t tracks = makeTracks (makePerigees1());
540 setInitialPerigees (exp_v0, tracks);
541
542 PerigeeUVec_t perigees = makePerigees1();
543 NeutralUVec_t neutrals = makeNeutrals1();
544 std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (asVec (perigees),
545 asVec (neutrals),
546 pnt1));
547 compareVertex (*v1, exp_v0);
548
549 xAODTPUVec_t xtps = makexAODTP (makePerigees1());
550 xAODNPUVec_t xaodnp = makexAODNP (makeNeutrals1());
551 std::unique_ptr<xAOD::Vertex> v2 (m_fitter->fit (asVec (xtps),
552 asVec (xaodnp),
553 pnt1));
554 clearInitialPerigees (exp_v0);
555 compareVertex (*v2, exp_v0);
556
557 return StatusCode::SUCCESS;
558}
Eigen::Matrix< double, 3, 1 > Vector3D

◆ test3()

StatusCode Trk::AdaptiveVertexFitterTestAlg::test3 ( )
private

Definition at line 562 of file AdaptiveVertexFitterTestAlg.cxx.

563{
564 xAOD::Vertex exp_v0;
565 exp_v0.makePrivateStore();
566 exp_v0.setPosition ({4.85208, 5.949, -3.1349});
567 exp_v0.setFitQuality (2.38503, 8.54327);
568 exp_v0.setCovariance (std::vector<float>
569 {1.183, 0.0323074, 1.21271,
570 0.00903037, 0.0167373, 1.12584});
571 setRefittedPerigee(
572 exp_v0,
573 0,
574 1,
575 { 5.1719083, 5.7335618, -8.4196568 },
576 { 402.8346276, 598.1012479, 199.9979000 },
577 { 135.368, 4.54292, 41.4349, -0.0182748, -10.0936,
578 4.54292, 38.8427, 1.48244, -6.13913, -0.389733,
579 41.4349, 1.48244, 13.5349, -0.00640884, -3.54057,
580 -0.0182748, -6.13913, -0.00640884, 1, 0.00218082,
581 -10.0936, -0.389733, -3.54057, 0.00218082, 1 });
582 setFitQuality (exp_v0, 0, 0.682, 2);
583
584 setRefittedPerigee(exp_v0,
585 1,
586 -1,
587 { 5.4869777, 5.0058724, -4.4978936 },
588 { 598.2006961, 402.6869274, -199.9979142 },
589 { 111.922, -11.1715, 35.7532, -0.0162277, -9.04482,
590 -11.1715, 35.9577, -3.83303, -5.80842, 1.04702,
591 35.7532, -3.83303, 12.2632, -0.0060222, -3.35579,
592 -0.0162277, -5.80842, -0.0060222, 1, 0.00216502,
593 -9.04482, 1.04702, -3.35579, 0.00216502, 1 });
594 setFitQuality (exp_v0, 1, 0.061, 2);
595
596 setRefittedPerigee(
597 exp_v0,
598 2,
599 -1,
600 { 2.7708142, 6.5661849, -6.4736255 },
601 { 296.8467752, 1000.9403742, 100.0017963 },
602 { 114.181, -7.37341, 35.593, -0.0172367, -9.10529,
603 -7.37341, 32.345, -2.46816, -5.55155, 0.684107,
604 35.593, -2.46816, 11.9239, -0.00626001, -3.30551,
605 -0.0172367, -5.55155, -0.00626001, 1, 0.00180269,
606 -9.10529, 0.684107, -3.30551, 0.00180269, 1 });
607 setFitQuality (exp_v0, 2, 0.352, 2);
608 setFitQuality (exp_v0, 3, 1.119, 1);
609 setFitQuality (exp_v0, 4, 0.000, 2);
610 setFitQuality (exp_v0, 5, 0.000, 2);
611
612 Amg::Vector3D pnt1 (5, 6, -3);
613 xAOD::Vertex pnt2;
614 pnt2.makePrivateStore();
615 pnt2.setPosition (pnt1);
616 AmgSymMatrix(3) pnt2covar;
617 pnt2covar.setIdentity();
618 pnt2.setCovariancePosition (pnt2covar);
619
620 TrackUVec_t tracks = makeTracks (makePerigees1());
621 setInitialPerigees (exp_v0, tracks);
622
623 PerigeeUVec_t perigees = makePerigees1();
624 NeutralUVec_t neutrals = makeNeutrals1();
625 std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (asVec (perigees),
626 asVec (neutrals),
627 pnt2));
628 compareVertex (*v1, exp_v0);
629
630 xAODTPUVec_t xtps = makexAODTP (makePerigees1());
631 xAODNPUVec_t xaodnp = makexAODNP (makeNeutrals1());
632 std::unique_ptr<xAOD::Vertex> v2 (m_fitter->fit (asVec (xtps),
633 asVec (xaodnp),
634 pnt2));
635 clearInitialPerigees (exp_v0);
636 compareVertex (*v2, exp_v0);
637
638 return StatusCode::SUCCESS;
639}
#define AmgSymMatrix(dim)
boost::graph_traits< boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS > >::vertex_descriptor Vertex

◆ test4()

StatusCode Trk::AdaptiveVertexFitterTestAlg::test4 ( )
private

◆ test5()

StatusCode Trk::AdaptiveVertexFitterTestAlg::test5 ( )
private

◆ test6()

StatusCode Trk::AdaptiveVertexFitterTestAlg::test6 ( )
private

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fitter

ToolHandle<Trk::IVertexFitter> Trk::AdaptiveVertexFitterTestAlg::m_fitter { this, "Tool", "Trk::AdaptiveVertexFitter", "Tool to test." }
private

Definition at line 49 of file AdaptiveVertexFitterTestAlg.h.

50{ this, "Tool", "Trk::AdaptiveVertexFitter", "Tool to test." };

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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