ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::VertexSeedFinderTestAlg Class Reference

#include <VertexSeedFinderTestAlg.h>

Inheritance diagram for Trk::VertexSeedFinderTestAlg:
Collaboration diagram for Trk::VertexSeedFinderTestAlg:

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 makeMcEventCollection (const EventContext &ctx) const
 Make a test McEventCollection. More...
 
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

Gaudi::Property< std::vector< double > > m_priVert { this, "PriVert", {}, "Primary vertex 2D position" }
 
Gaudi::Property< std::vector< double > > m_expected1 { this, "Expected1", {}, "First expected result" }
 
Gaudi::Property< std::vector< double > > m_expected2 { this, "Expected2", {}, "Second expected result" }
 
Gaudi::Property< std::vector< double > > m_expected3 { this, "Expected3", {}, "Third expected result" }
 
Gaudi::Property< std::vector< float > > m_expected1PhiModes { this, "Expected1PhiModes", {}, "" }
 
Gaudi::Property< std::vector< float > > m_expected1RModes { this, "Expected1RModes", {}, "" }
 
Gaudi::Property< std::vector< float > > m_expected1ZModes { this, "Expected1ZModes", {}, "" }
 
Gaudi::Property< std::vector< float > > m_expected1Weights { this, "Expected1Weights", {}, "" }
 
Gaudi::Property< std::vector< int > > m_expected1Indices { this, "Expected1Indices", {}, "" }
 
Gaudi::Property< std::vector< double > > m_expected1CorrDist { this, "Expected1CorrDist", {}, "" }
 
Gaudi::Property< unsigned int > m_npart3 { this, "NPart3", 1000, "Number of test particles." }
 
SG::WriteHandleKey< McEventCollectionm_mcEventCollectionKey { this, "McEventCollectionKey", "", "Test MC Collecton" }
 
ToolHandle< Trk::IVertexSeedFinderm_finder { this, "VertexSeedFinderTool", "", "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 27 of file VertexSeedFinderTestAlg.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::VertexSeedFinderTestAlg::execute ( )
overridevirtual

Execute the algorithm.

Standard Gaudi execute method.

Definition at line 136 of file VertexSeedFinderTestAlg.cxx.

137 {
138  ATH_MSG_INFO ("execute");
139  const EventContext& ctx = Gaudi::Hive::currentContext();
140 
141  double vx = 0;
142  double vy = 0;
143  if (!m_priVert.empty()) {
144  if (m_priVert.size() != 2) std::abort();
145  vx = m_priVert[0];
146  vy = m_priVert[1];
147  }
148 
149  Amg::Vector3D pos0 { 0, 0, 0 };
150 
151  Amg::Vector3D pos1a { 2*mm, 1*mm, -10*mm };
152  Amg::Vector3D mom1a { 400*MeV, 600*MeV, 200*MeV };
153  Amg::Vector3D pos1b { 1*mm, 2*mm, -3*mm };
154  Amg::Vector3D mom1b { 600*MeV, 400*MeV, -200*MeV };
155  Amg::Vector3D pos1c { 1.2*mm, 1.3*mm, -7*mm };
156  Amg::Vector3D mom1c { 300*MeV, 1000*MeV, 100*MeV };
157 
158  auto p1a = std::make_unique<Trk::Perigee>(pos1a, mom1a, 1, pos0, cov5());
159  auto p1b = std::make_unique<Trk::Perigee>(pos1b, mom1b, -1, pos0, cov5());
160  auto p1c = std::make_unique<Trk::Perigee>(pos1c, mom1c, -1, pos0, cov5());
161 
162  std::vector<const Trk::TrackParameters*> v1a { p1a.get(), p1b.get(), p1c.get() };
163  std::vector<const Trk::TrackParameters*> v1b { p1c.get(), p1a.get(), p1b.get() };
164 
165  if (!m_expected1.empty()) {
166  ATH_MSG_INFO ("testing 1");
167  Amg::Vector3D p = m_finder->findSeed (vx, vy, v1a);
168  assertVec3D ("1a", p, m_expected1);
169 
170  std::unique_ptr<Trk::IMode3dInfo> info;
171  p = m_finder->findSeed (vx, vy, info, v1b);
172  assertVec3D ("1b", p, m_expected1);
173 
174  if (!m_expected1PhiModes.empty()) {
175  std::vector<float> phi;
176  std::vector<float> r;
177  std::vector<float> z;
178  std::vector<float> w;
179  size_t sz = info->Modes1d (phi, r, z, w);
180  assert (sz == phi.size());
181  assert (sz == r.size());
182  assert (sz == z.size());
183  assert (sz == w.size());
184  assertVector ("phiModes", phi, m_expected1PhiModes);
185  assertVector ("rModes", r, m_expected1RModes);
186  assertVector ("zModes", z, m_expected1ZModes);
187  assertVector ("weights", w, m_expected1Weights);
188  }
189 
190  if (!m_expected1Indices.empty()) {
191  std::vector<const Trk::TrackParameters*> p;
192  size_t sz = info->perigeesAtSeed (p, v1a);
193  assert (sz == p.size());
194  std::vector<int> ndx;
195  for (const Trk::TrackParameters* pp : p) {
196  auto it = std::find (v1a.begin(), v1a.end(), pp);
197  assert (it != v1a.end());
198  ndx.push_back (it - v1a.begin());
199  }
200  assert (ndx == m_expected1Indices);
201  }
202 
203  if (!m_expected1CorrDist.empty()) {
204  double cXY = 0;
205  double cZ = 0;
206  info->getCorrelationDistance (cXY, cZ);
207  assert (Athena_test::isEqual (cXY, m_expected1CorrDist[0], 1e-5));
208  assert (Athena_test::isEqual (cZ, m_expected1CorrDist[1], 1e-5));
209  }
210  }
211 
212  xAOD::Vertex vert1;
213  initVertex (vert1);
214 
215  if (!m_expected2.empty()) {
216  ATH_MSG_INFO ("testing 2");
217  Amg::Vector3D p = m_finder->findSeed (vx, vy, v1a, &vert1);
218  assertVec3D ("2a", p, m_expected2);
219 
220  p = m_finder->findSeed (vx, vy, v1b, &vert1);
221  assertVec3D ("2b", p, m_expected2);
222  }
223 
224  std::vector<std::unique_ptr<Trk::Perigee> > perigees;
225  std::vector<const Trk::TrackParameters*> pvec;
234  for (unsigned int i=0; i < m_npart3; i++) {
235  double x = xdist(rng);
236  double y = ydist(rng);
237  double z;
238  if ((i%3) == 0) {
239  z = z2dist(rng);
240  }
241  else {
242  z = z1dist(rng);
243  }
244 
245  Amg::Vector3D pos { x, y, z };
246  double pt = ptdist(rng);
247  double phi = phidist(rng);
248  double eta = etadist(rng);
249  Amg::Vector3D mom { pt*cos(phi), pt*sin(phi), pt*sinh(eta) };
250  double charge = etadist(rng) > 0 ? 1 : -1;
251  perigees.emplace_back (std::make_unique<Trk::Perigee> (pos, mom, charge, pos0,
252  cov5()));
253  pvec.push_back (perigees.back().get());
254  }
255 
256  if (!m_mcEventCollectionKey.empty()) {
258  }
259 
260  if (!m_expected3.empty()) {
261  ATH_MSG_INFO ("testing 3");
262  if (m_expected3.size() == 3) {
263  Amg::Vector3D p = m_finder->findSeed (vx, vy, pvec);
264  assertVec3D ("3a", p, m_expected3);
265  }
266  else {
267  std::vector<Amg::Vector3D> seeds = m_finder->findMultiSeeds (pvec);
268  if (seeds.size() != m_expected3.size()/3) {
269  std::cerr << "VertexSeedFinderTestAlg size mismatch 3b "
270  << seeds.size() << " / " << m_expected3.size()/3 << "\n";
271  std::abort();
272  }
273  int i = 0;
274  for (const auto& seed : seeds) {
275  assertVec3D ("3b", seed, m_expected3, i);
276  i += 3;
277  }
278  }
279  }
280 
281  return StatusCode::SUCCESS;
282 }

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

Standard Gaudi initialize method.

Definition at line 125 of file VertexSeedFinderTestAlg.cxx.

126 {
127  ATH_CHECK( m_finder.retrieve() );
129  return StatusCode::SUCCESS;
130 }

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

◆ makeMcEventCollection()

StatusCode Trk::VertexSeedFinderTestAlg::makeMcEventCollection ( const EventContext &  ctx) const
private

Make a test McEventCollection.

Definition at line 289 of file VertexSeedFinderTestAlg.cxx.

290 {
291  auto *evt1 = new HepMC::GenEvent();
292  auto *evt2 = new HepMC::GenEvent();
293  auto *evt3 = new HepMC::GenEvent();
294  auto v1 = HepMC::newGenVertexPtr(HepMC::FourVector{1*mm, 2*mm, 12*mm,0.0});
295  auto v2 = HepMC::newGenVertexPtr(HepMC::FourVector{0.3*mm,-0.7*mm,-3*mm,0.0});
296  auto v3 = HepMC::newGenVertexPtr(HepMC::FourVector{0.6*mm, 0.2*mm, 7*mm,0.0});
300 
304  Athena_test::URNG rng (123);
305  for (unsigned int i = 0; i < 1000; i++) {
306  double pt = ptdist(rng);
307  double phi = phidist(rng);
308  double eta = etadist(rng);
309  double e = pt*sinh(eta);
310  double charge = etadist(rng) > 0 ? 1 : -1;
311  HepMC::FourVector mom {pt*cos(phi), pt*sin(phi), e, e };
312  auto p = HepMC::newGenParticlePtr ( mom, charge * 11, 1 );
313 
314  double vrand = etadist(rng);
315  if (vrand < 0) {
316  HepMC::signal_process_vertex(evt1)->add_particle_out (p);
317  }
318  else if (vrand < 3) {
319  HepMC::signal_process_vertex(evt2)->add_particle_out (p);
320  }
321  else {
322  HepMC::signal_process_vertex(evt3)->add_particle_out (p);
323  }
324  }
325 
326  auto evtcoll = std::make_unique<McEventCollection>();
330  evtcoll->push_back (evt1);
331  evtcoll->push_back (evt2);
332  evtcoll->push_back (evt3);
333 
335  ATH_CHECK( h.record (std::move (evtcoll)) );
336  return StatusCode::SUCCESS;
337 }

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

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

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected1 { this, "Expected1", {}, "First expected result" }
private

Definition at line 47 of file VertexSeedFinderTestAlg.h.

◆ m_expected1CorrDist

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected1CorrDist { this, "Expected1CorrDist", {}, "" }
private

Definition at line 64 of file VertexSeedFinderTestAlg.h.

◆ m_expected1Indices

Gaudi::Property<std::vector<int> > Trk::VertexSeedFinderTestAlg::m_expected1Indices { this, "Expected1Indices", {}, "" }
private

Definition at line 62 of file VertexSeedFinderTestAlg.h.

◆ m_expected1PhiModes

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1PhiModes { this, "Expected1PhiModes", {}, "" }
private

Definition at line 54 of file VertexSeedFinderTestAlg.h.

◆ m_expected1RModes

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1RModes { this, "Expected1RModes", {}, "" }
private

Definition at line 56 of file VertexSeedFinderTestAlg.h.

◆ m_expected1Weights

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1Weights { this, "Expected1Weights", {}, "" }
private

Definition at line 60 of file VertexSeedFinderTestAlg.h.

◆ m_expected1ZModes

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1ZModes { this, "Expected1ZModes", {}, "" }
private

Definition at line 58 of file VertexSeedFinderTestAlg.h.

◆ m_expected2

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected2 { this, "Expected2", {}, "Second expected result" }
private

Definition at line 49 of file VertexSeedFinderTestAlg.h.

◆ m_expected3

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected3 { this, "Expected3", {}, "Third expected result" }
private

Definition at line 51 of file VertexSeedFinderTestAlg.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_finder

ToolHandle<Trk::IVertexSeedFinder> Trk::VertexSeedFinderTestAlg::m_finder { this, "VertexSeedFinderTool", "", "Tool to test." }
private

Definition at line 73 of file VertexSeedFinderTestAlg.h.

◆ m_mcEventCollectionKey

SG::WriteHandleKey<McEventCollection> Trk::VertexSeedFinderTestAlg::m_mcEventCollectionKey { this, "McEventCollectionKey", "", "Test MC Collecton" }
private

Definition at line 70 of file VertexSeedFinderTestAlg.h.

◆ m_npart3

Gaudi::Property<unsigned int> Trk::VertexSeedFinderTestAlg::m_npart3 { this, "NPart3", 1000, "Number of test particles." }
private

Definition at line 67 of file VertexSeedFinderTestAlg.h.

◆ m_priVert

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_priVert { this, "PriVert", {}, "Primary vertex 2D position" }
private

Definition at line 45 of file VertexSeedFinderTestAlg.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:
grepfile.info
info
Definition: grepfile.py:38
Trk::VertexSeedFinderTestAlg::m_expected1Indices
Gaudi::Property< std::vector< int > > m_expected1Indices
Definition: VertexSeedFinderTestAlg.h:63
Trk::y
@ y
Definition: ParamDefs.h:62
beamspotman.r
def r
Definition: beamspotman.py:676
fitman.sz
sz
Definition: fitman.py:527
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:63
Trk::VertexSeedFinderTestAlg::m_npart3
Gaudi::Property< unsigned int > m_npart3
Definition: VertexSeedFinderTestAlg.h:68
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Trk::VertexSeedFinderTestAlg::m_mcEventCollectionKey
SG::WriteHandleKey< McEventCollection > m_mcEventCollectionKey
Definition: VertexSeedFinderTestAlg.h:71
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
Trk::VertexSeedFinderTestAlg::m_expected1Weights
Gaudi::Property< std::vector< float > > m_expected1Weights
Definition: VertexSeedFinderTestAlg.h:61
skel.it
it
Definition: skel.GENtoEVGEN.py:423
test_pyathena.pt
pt
Definition: test_pyathena.py:11
Trk::VertexSeedFinderTestAlg::m_expected1RModes
Gaudi::Property< std::vector< float > > m_expected1RModes
Definition: VertexSeedFinderTestAlg.h:57
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
D3PDTest::rng
uint32_t rng()
Definition: FillerAlg.cxx:40
Trk::VertexSeedFinderTestAlg::m_expected2
Gaudi::Property< std::vector< double > > m_expected2
Definition: VertexSeedFinderTestAlg.h:50
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *)
Definition: GenEvent.h:504
Athena_test::normal_distribution
Definition: random.h:102
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::VertexSeedFinderTestAlg::m_expected1PhiModes
Gaudi::Property< std::vector< float > > m_expected1PhiModes
Definition: VertexSeedFinderTestAlg.h:55
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::VertexSeedFinderTestAlg::m_expected3
Gaudi::Property< std::vector< double > > m_expected3
Definition: VertexSeedFinderTestAlg.h:52
Trk::VertexSeedFinderTestAlg::m_expected1CorrDist
Gaudi::Property< std::vector< double > > m_expected1CorrDist
Definition: VertexSeedFinderTestAlg.h:65
Trk::VertexSeedFinderTestAlg::m_finder
ToolHandle< Trk::IVertexSeedFinder > m_finder
Definition: VertexSeedFinderTestAlg.h:74
HepMC::set_signal_process_vertex
void set_signal_process_vertex(GenEvent *e, T v)
Definition: GenEvent.h:528
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
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.
HepMC::newGenVertexPtr
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
Definition: GenVertex.h:64
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
Athena_test::isEqual
bool isEqual(double x1, double x2, double thresh=1e-6)
Definition: FLOATassert.h:26
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::VertexSeedFinderTestAlg::makeMcEventCollection
StatusCode makeMcEventCollection(const EventContext &ctx) const
Make a test McEventCollection.
Definition: VertexSeedFinderTestAlg.cxx:289
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::VertexSeedFinderTestAlg::m_expected1ZModes
Gaudi::Property< std::vector< float > > m_expected1ZModes
Definition: VertexSeedFinderTestAlg.h:59
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Trk::VertexSeedFinderTestAlg::m_priVert
Gaudi::Property< std::vector< double > > m_priVert
Definition: VertexSeedFinderTestAlg.h:46
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
charge
double charge(const T &p)
Definition: AtlasPID.h:494
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
SG::WriteHandle< McEventCollection >
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
HepMC::newGenParticlePtr
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition: GenParticle.h:39
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
Athena_test::URNG
Generator compatible with the C++11 STL UniformRandomNumberGenerator.
Definition: random.h:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Athena_test::uniform_real_distribution
Definition: random.h:133
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
pvec
std::array< fp_t, 2 > pvec
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:9
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::VertexSeedFinderTestAlg::m_expected1
Gaudi::Property< std::vector< double > > m_expected1
Definition: VertexSeedFinderTestAlg.h:48
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
Trk::x
@ x
Definition: ParamDefs.h:61
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
HepMC::signal_process_vertex
GenVertex * signal_process_vertex(const GenEvent *e)
Definition: GenEvent.h:503