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

#include <TrkVKalVrtFitterTestAlg.h>

Inheritance diagram for Trk::TrkVKalVrtFitterTestAlg:
Collaboration diagram for Trk::TrkVKalVrtFitterTestAlg:

Public Member Functions

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

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode test1 (const EventContext &ctx) const
StatusCode test2 (const EventContext &ctx) const
StatusCode test3 (const EventContext &ctx) const
StatusCode test4 (const EventContext &ctx) const
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::TrkVKalVertexFitter", "Tool to test." }
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 25 of file TrkVKalVrtFitterTestAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Trk::TrkVKalVrtFitterTestAlg::execute ( const EventContext & ctx) const
overridevirtual

Execute the algorithm.

Standard Gaudi execute method.

Definition at line 367 of file TrkVKalVrtFitterTestAlg.cxx.

368{
369 ATH_MSG_VERBOSE ("execute");
370
371 ATH_CHECK( test1(ctx) );
372 ATH_CHECK( test2(ctx) );
373 ATH_CHECK( test3(ctx) );
374
375 return StatusCode::SUCCESS;
376}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
StatusCode test2(const EventContext &ctx) const
StatusCode test1(const EventContext &ctx) const
StatusCode test3(const EventContext &ctx) const

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

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

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

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

◆ initialize()

StatusCode Trk::TrkVKalVrtFitterTestAlg::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Definition at line 357 of file TrkVKalVrtFitterTestAlg.cxx.

358{
359 ATH_CHECK( m_fitter.retrieve() );
360 return StatusCode::SUCCESS;
361}
ToolHandle< Trk::IVertexFitter > m_fitter

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

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

Specify if the algorithm is clonable.

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

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

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ test1()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test1 ( const EventContext & ctx) const
private

Definition at line 382 of file TrkVKalVrtFitterTestAlg.cxx.

383{
384 xAOD::Vertex exp_v0;
385 exp_v0.makePrivateStore();
386 exp_v0.setPosition ({-5.58116, -8.50767, -4.76804});
387 exp_v0.setFitQuality (0.541406, 3);
388 exp_v0.setCovariance(std::vector<float>{
389 259.128, 394.824, 764.131, 144.775, 266.345, 155.231,
390 -30152, -6184.95, -2642.5, 4.60831e+13, 10912.8, -4760.06,
391 6318.67, 1.0494e+14, 2.4226e+14, -12079, -23269.1, -40859.3,
392 2.00894e+13, 4.51754e+13, 9.12659e+12});
393 setFitQuality(exp_v0, 0, 0.311, 2);
394 setFitQuality (exp_v0, 1, 0.138, 2);
395 setFitQuality (exp_v0, 2, 0.082, 2);
396
397 NeutralUVec_t neutrals = makeNeutrals1();
398 std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (ctx, std::vector<const Trk::TrackParameters*>(),
399 asVec (neutrals)));
400 compareVertex (*v1, exp_v0);
401
402 return StatusCode::SUCCESS;
403}
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::TrkVKalVrtFitterTestAlg::test2 ( const EventContext & ctx) const
private

Definition at line 408 of file TrkVKalVrtFitterTestAlg.cxx.

409{
410 xAOD::Vertex exp_v0;
411 exp_v0.makePrivateStore();
412 exp_v0.setPosition ({ 24.131, 38.8186, 13.2978});
413 exp_v0.setFitQuality (0.564942, 3);
414 exp_v0.setCovariance(std::vector<float>{
415 21964.5, 32891.5, 51244.9, 13612.1, 20963.9,
416 9573.41, 816688, 1.09315e+06, 393680, 1.92433e+14,
417 1.10804e+06, 1.87392e+06, 616429, 3.20119e+14, 5.41674e+14,
418 401502, 640572, 338398, 1.97024e+14, 3.42617e+14,
419 2.25906e+14});
420 setFitQuality(exp_v0, 0, 0.306, 2);
421 setFitQuality(exp_v0, 1, 0.00660789, 2);
422 setFitQuality(exp_v0, 2, 0.266975, 2);
423
424 Amg::Vector3D pnt1(5, 6, -3);
425
426 NeutralUVec_t neutrals = makeNeutrals1();
427 std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (ctx, std::vector<const Trk::TrackParameters*>(),
428 asVec (neutrals),
429 pnt1));
430 compareVertex (*v1, exp_v0);
431
432 // ??? This gives a different result due to different reference frame
433 // handling in CvtNeutralParameters vs CvtNeutralParticle
434 xAOD::Vertex exp_v1;
435 exp_v1.makePrivateStore();
436 exp_v1.setPosition ({27.7411, 46.5526, 14.3721});
437 exp_v1.setFitQuality (0.537727, 3);
438 exp_v1.setCovariance(std::vector<float>{
439 32598.3, 50372.7, 80773.1, 18537.3, 29396.9,
440 12058.1, 850485, 1.1479e+06, 380180, 1.54295e+14,
441 1.21881e+06, 2.11418e+06, 643860, 2.55981e+14, 4.31589e+14,
442 417309, 683027, 356607, 1.51101e+14, 2.64837e+14,
443 1.77033e+14});
444 setFitQuality(exp_v1, 0, 0.281, 2);
445 setFitQuality(exp_v1, 1, 0.010, 2);
446 setFitQuality(exp_v1, 2, 0.248, 2);
447
448 xAODNPUVec_t xaodnp = makexAODNP(makeNeutrals1());
449 std::unique_ptr<xAOD::Vertex> v2 (m_fitter->fit (ctx, std::vector<const xAOD::TrackParticle*>(),
450 asVec (xaodnp),
451 pnt1));
452 compareVertex (*v2, exp_v1);
453
454 return StatusCode::SUCCESS;
455}
Eigen::Matrix< double, 3, 1 > Vector3D

◆ test3()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test3 ( const EventContext & ctx) const
private

Definition at line 459 of file TrkVKalVrtFitterTestAlg.cxx.

460{
461 xAOD::Vertex exp_v0;
462 exp_v0.makePrivateStore();
463 exp_v0.setPosition ({5.05085, 6.19647, -2.81445});
464 exp_v0.setFitQuality (2.20220, 6);
465 exp_v0.setCovariance (std::vector<float>
466 { 0.955506, 0.0266418, 0.95407, -0.0110041,
467 -0.0101241, 0.953395, 530.063, -411.644,
468 -325.151, 3.03883e+14, -711.821, 1110.92,
469 -551.227, 2.09286e+14, 2.49946e+14, 123.813,
470 386.78, 892.698, -3.14264e+12, 1.04832e+14,
471 1.10053e+14 });
472 setFitQuality (exp_v0, 0, 0.396, 2);
473 setFitQuality (exp_v0, 1, 0.752, 2);
474 setFitQuality (exp_v0, 2, 1.055, 2);
475
476 Amg::Vector3D pnt1 (5, 6, -3);
477 xAOD::Vertex pnt2;
478 pnt2.makePrivateStore();
479 pnt2.setPosition (pnt1);
480 AmgSymMatrix(3) pnt2covar;
481 pnt2covar.setIdentity();
482 pnt2.setCovariancePosition (pnt2covar);
483
484 NeutralUVec_t neutrals = makeNeutrals1();
485 std::unique_ptr<xAOD::Vertex> v1 (m_fitter->fit (ctx, std::vector<const Trk::TrackParameters*>(),
486 asVec (neutrals),
487 pnt2));
488 compareVertex (*v1, exp_v0);
489
490 // ??? This gives a different result due to different reference frame
491 // handling in CvtNeutralParameters vs CvtNeutralParticle
492 xAOD::Vertex exp_v1;
493 exp_v1.makePrivateStore();
494 exp_v1.setPosition ({5.00912, 6.23591, -2.82707});
495 exp_v1.setFitQuality (2.25019, 6);
496 exp_v1.setCovariance (std::vector<float>
497 { 0.968686, 0.0228402, 0.951705, -0.00910123,
498 -0.0098848, 0.950267, 435.6, -418.438,
499 -276.022, 3.17041e+14, -401.428, 987.01,
500 -336.323, 1.592e+14, 1.35435e+14, 183.46,
501 272.759, 988.474, -1.22294e+13, 5.57451e+13,
502 7.21632e+13 });
503 setFitQuality (exp_v1, 0, 0.313, 2);
504 setFitQuality (exp_v1, 1, 0.692, 2);
505 setFitQuality (exp_v1, 2, 1.246, 2);
506
507 xAODNPUVec_t xaodnp = makexAODNP (makeNeutrals1());
508 std::unique_ptr<xAOD::Vertex> v2 (m_fitter->fit (ctx, std::vector<const xAOD::TrackParticle*>(),
509 asVec (xaodnp),
510 pnt2));
511 compareVertex (*v2, exp_v1);
512
513 return StatusCode::SUCCESS;
514}
#define AmgSymMatrix(dim)
boost::graph_traits< boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS > >::vertex_descriptor Vertex
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ test4()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test4 ( const EventContext & ctx) const
private

Definition at line 585 of file TrkVKalVrtFitterTestAlg.cxx.

586{
587 const Trk::IVertexCascadeFitter* fitter =
588 dynamic_cast<const Trk::IVertexCascadeFitter*> (m_fitter.get());
589 if (!fitter)[[unlikely]]{
590 ATH_MSG_ERROR("TrkVKalVrtFitterTestAlg::test4: 'fitter' is nullptr");
591 return StatusCode::FAILURE;
592 }
593 xAODTPUVec_t tracks1 = makexAODTP (makePerigees2());
594
595 std::unique_ptr<IVKalState> state (fitter->makeState(ctx));
596 Trk::VertexID v1 = fitter->startVertex (asVec (tracks1),
597 std::vector<double> {100*MeV, 150*MeV, 200*MeV},
598 *state,
599 930*MeV);
600
601 xAODTPUVec_t tracks2 = makexAODTP (makePerigees3());
602
603 fitter->nextVertex (asVec (tracks2),
604 std::vector<double> {130*MeV, 160*MeV},
605 std::vector<Trk::VertexID> {v1},
606 *state,
607 2000*MeV);
608
609 std::unique_ptr<Trk::VxCascadeInfo> info1 (fitter->fitCascade(*state));
610 info1->setSVOwnership (true);
611
612#if 0
613 std::cout << info1->fitChi2() << " " << info1->nDoF() << "\n";
614 for (const std::vector<TLorentzVector>& vv : info1->getParticleMoms()) {
615 std::cout << "===\n";
616 for (const TLorentzVector& vvv : vv) {
617 std::cout << vvv.X() << " " << vvv.Y() << " " << vvv.Z() << " " << vvv.E() << "\n";
618 }
619 }
620 std::cout << "=== vertices\n";
621 for (const xAOD::Vertex* v : info1->vertices()) {
622 dumpVertex (*v);
623 }
624#endif
625
626 // Some of the comparison thresholds here have to be quite large,
627 // because the fit is unstable against small changes in the rounding
628 // of, eg, trig functions. The results we get can vary depending
629 // on the libc version used as well as on the exact hardware used.
630
631 assert (Athena_test::isEqual (info1->fitChi2(), 8.69008, 1e-5));
632 assert (info1->nDoF() == 8);
633
634
635 const double exp_moms0[][4] =
636 {
637 {65.8357, -2.03326, -1.46405, 119.752},
638 {755.228, 239.515, 134.648, 817.537},
639 {900.997, -348.825, -292.857, 1029.19},
640 {1013.68, 681.319, 331.188, 1272.13},
641 {522.571, -222.398, -113.273, 600.81},
642 {1719.34, -112.854, -155.908, 1964.27},
643 };
644 const size_t nmoms0 = std::distance (std::begin(exp_moms0), std::end(exp_moms0));
645 size_t imoms0 = 0;
646 for (const std::vector<TLorentzVector>& vv : info1->getParticleMoms()) {
647 for (const TLorentzVector& vvv : vv) {
648 assert (imoms0 < nmoms0);
649 assert( Athena_test::isEqual (vvv.X(), exp_moms0[imoms0][0], 0.1) );
650 assert( Athena_test::isEqual (vvv.Y(), exp_moms0[imoms0][1], 0.1) );
651 assert( Athena_test::isEqual (vvv.Z(), exp_moms0[imoms0][2], 0.1) );
652 assert( Athena_test::isEqual (vvv.E(), exp_moms0[imoms0][3], 0.1) );
653 ++imoms0;
654 }
655 }
656 assert (imoms0 == nmoms0);
657
658 assert (info1->vertices().size() == 2);
659
660 xAOD::Vertex exp_v0;
661 exp_v0.makePrivateStore();
662 exp_v0.setPosition({ 7.89827, 0.0514449, -4.04121 });
663 exp_v0.setFitQuality(5.34877, 8);
664 exp_v0.setCovariance(std::vector<float>{
665 0.218298, -0.00769266, 0.0194589, -0.0118989, 0.0107223, 0.208922 });
666 setRefittedPerigee(
667 exp_v0,
668 0,
669 1,
670 exp_mom(exp_moms0, 0),
671 { 0.209404, -4.58753, -0.00519457, 0.00377293, 0.00105397,
672 -4.58753, 154483, 32.603, -0.117209, -35.6007,
673 -0.00519457, 32.603, 0.0113951, -0.000116443, -0.00751125,
674 0.00377293, -0.117209, -0.000116443, 0.009643, 2.37152e-05,
675 0.00105397, -35.6007, -0.00751125, 2.37152e-05, 0.0082042 });
676 setFitQuality(exp_v0, 0, 0.926, 2);
677 setRefittedPerigee(
678 exp_v0,
679 1,
680 -1,
681 exp_mom(exp_moms0, 1),
682 { 0.185428, 0.807536, -0.00324979, -0.000237823, 1.99968e-05,
683 0.807536, 154490, 6.26553, -0.238515, 0.168369,
684 -0.00324979, 6.26553, 0.00856011, -0.00036866, -2.23097e-05,
685 -0.000237823, -0.238515, -0.00036866, 0.00933191, 7.51824e-06,
686 1.99968e-05, 0.168369, -2.23097e-05, 7.51824e-06, 3.74483e-07 });
687 setFitQuality(exp_v0, 1, 4.142, 2);
688 setRefittedPerigee(
689 exp_v0,
690 2,
691 -1,
692 exp_mom(exp_moms0, 2),
693 { 0.191446, -9.49834, -0.00495436, -0.00130953, -4.72358e-05,
694 -9.49834, 154476, 5.42258, -0.231539, 0.236084,
695 -0.00495436, 5.42258, 0.00860893, -0.000425575, 3.61158e-05,
696 -0.00130953, -0.231539, -0.000425575, 0.00920703, -5.93187e-06,
697 -4.72358e-05, 0.236084, 3.61158e-05, -5.93187e-06, 4.8944e-07 });
698 setFitQuality(exp_v0, 2, 0.281, 2);
699
700 compareVertex(*info1->vertices()[0], exp_v0, 0.1);
701
702 xAOD::Vertex exp_v1;
703 exp_v1.makePrivateStore();
704 exp_v1.setPosition({ 5.31046, 0.22012, -3.80093 });
705 exp_v1.setFitQuality(3.34131, 8);
706 exp_v1.setCovariance(std::vector<float>{
707 0.0239352, 0.000977903, 0.00708136, 4.16975e-05, 0.00295894, 0.2431 });
708 setRefittedPerigee(
709 exp_v1,
710 0,
711 1,
712 exp_mom(exp_moms0, 3),
713 { 0.166917, -16.9685, -0.000309914, -0.000819924, 1.31935e-05,
714 -16.9685, 6.35682e+08, -139.016, 9.70413, -495.474,
715 -0.000309914, -139.016, 0.0100214, -7.71225e-06, 0.000103046,
716 -0.000819924, 9.70413, -7.71225e-06, 0.00998731, -5.42066e-06,
717 1.31935e-05, -495.474, 0.000103046, -5.42066e-06, 0.000386195 });
718 setFitQuality(exp_v1, 0, 1.986, 2);
719 setRefittedPerigee(
720 exp_v1,
721 1,
722 -1,
723 exp_mom(exp_moms0, 4),
724 { 0.20904, -15.3143, 0.00086181, -0.000463146, -2.83922e-05,
725 -15.3143, 6.35682e+08, 306.365, -3.09595, -2470.81,
726 0.00086181, 306.365, 0.0101467, -2.3178e-06, -0.00116433,
727 -0.000463146, -3.09595, -2.3178e-06, 0.00999678, 8.90989e-07,
728 -2.83922e-05, -2470.81, -0.00116433, 8.90989e-07, 0.00960596 });
729 setFitQuality(exp_v1, 1, 1.356, 2);
730
731 compareVertex (*info1->vertices()[1], exp_v1, 0.1);
732
733 return StatusCode::SUCCESS;
734}
static const double MeV
bool isEqual(double x1, double x2, double thresh=1e-6)
Definition FLOATassert.h:26
const ShapeFitter * fitter
@ v
Definition ParamDefs.h:78
#define unlikely(x)

◆ updateVHKA()

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

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fitter

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

Definition at line 45 of file TrkVKalVrtFitterTestAlg.h.

46{ this, "Tool", "Trk::TrkVKalVertexFitter", "Tool to test." };

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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