ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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. More...
 
virtual StatusCode execute () override
 Execute the algorithm. More...
 
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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 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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode test1 ()
 
StatusCode test2 ()
 
StatusCode test3 ()
 
StatusCode test4 ()
 
StatusCode test5 ()
 
StatusCode test6 ()
 
StatusCode test7 ()
 
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...
 

Private Attributes

ToolHandle< Trk::IVertexFitterm_fitter { this, "Tool", "Trk::TrkVKalVertexFitter", "Tool to test." }
 
DataObjIDColl m_extendedExtraObjects
 
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
 

Detailed Description

Definition at line 25 of file TrkVKalVrtFitterTestAlg.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

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 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode Trk::TrkVKalVrtFitterTestAlg::execute ( )
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() );
372  ATH_CHECK( test2() );
373  ATH_CHECK( test3() );
374 
375  return StatusCode::SUCCESS;
376 }

◆ 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::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 }

◆ 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() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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, PyAthena::Alg, and AthHistogramAlgorithm.

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 }

◆ 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::TrkVKalVrtFitterTestAlg::test1 ( )
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 (std::vector<const Trk::TrackParameters*>(),
399  asVec (neutrals)));
400  compareVertex (*v1, exp_v0);
401 
402  return StatusCode::SUCCESS;
403 }

◆ test2()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test2 ( )
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 (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 (std::vector<const xAOD::TrackParticle*>(),
450  asVec (xaodnp),
451  pnt1));
452  compareVertex (*v2, exp_v1);
453 
454  return StatusCode::SUCCESS;
455 }

◆ test3()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test3 ( )
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 (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 (std::vector<const xAOD::TrackParticle*>(),
509  asVec (xaodnp),
510  pnt2));
511  compareVertex (*v2, exp_v1);
512 
513  return StatusCode::SUCCESS;
514 }

◆ test4()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test4 ( )
private

Definition at line 585 of file TrkVKalVrtFitterTestAlg.cxx.

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

◆ test5()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test5 ( )
private

◆ test6()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test6 ( )
private

◆ test7()

StatusCode Trk::TrkVKalVrtFitterTestAlg::test7 ( )
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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

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::TrkVKalVrtFitterTestAlg::m_fitter { this, "Tool", "Trk::TrkVKalVertexFitter", "Tool to test." }
private

Definition at line 49 of file TrkVKalVrtFitterTestAlg.h.

◆ 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:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
xAOD::Vertex_v1::setPosition
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
xAOD::Vertex_v1::setFitQuality
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Definition: Vertex_v1.cxx:150
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Trk::VertexID
int VertexID
Definition: IVertexCascadeFitter.h:23
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::Vertex_v1::setCovariance
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::IVertexCascadeFitter
Definition: IVertexCascadeFitter.h:30
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
Athena_test::isEqual
bool isEqual(double x1, double x2, double thresh=1e-6)
Definition: FLOATassert.h:26
Trk::TrkVKalVrtFitterTestAlg::m_fitter
ToolHandle< Trk::IVertexFitter > m_fitter
Definition: TrkVKalVrtFitterTestAlg.h:50
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::TrkVKalVrtFitterTestAlg::test1
StatusCode test1()
Definition: TrkVKalVrtFitterTestAlg.cxx:382
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::TrkVKalVrtFitterTestAlg::test2
StatusCode test2()
Definition: TrkVKalVrtFitterTestAlg.cxx:408
MuonValidation_CreateResolutionProfiles.fit
def fit(h, emin, emax)
Definition: MuonValidation_CreateResolutionProfiles.py:69
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
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:192
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrkVKalVrtFitterTestAlg::test3
StatusCode test3()
Definition: TrkVKalVrtFitterTestAlg.cxx:459
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
PlotCalibFromCool.vv
vv
Definition: PlotCalibFromCool.py:716
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::v
@ v
Definition: ParamDefs.h:78
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >