ATLAS Offline Software
Loading...
Searching...
No Matches
SimTestToolBase Class Reference

#include <SimTestToolBase.h>

Inherits SimTestHisto, and extends< AthAlgTool, ISimTestTool >.

Inherited by ALFA_SimHitsTestTool, CaloCalibrationHitsTestTool, LArHitsTestTool, LayerTestTool, LucidHitsTestTool, MuonHitTestToolBase, SiHitsTestTool, TileHitsTestTool, TrtHitsTestTool, TruthTestTool, and ZDCHitsTestTool.

Collaboration diagram for SimTestToolBase:

Protected Attributes

std::string m_path {"/truth/"}
ServiceHandle< ITHistSvc > m_histSvc {"THistSvc", "SimTestHisto"}

structors and AlgTool implementation

std::string m_key
 The MC truth key.
 SimTestToolBase (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize ()
HepMC::ConstGenParticlePtr getPrimary ()

Detailed Description

Definition at line 20 of file SimTestToolBase.h.

Constructor & Destructor Documentation

◆ SimTestToolBase()

SimTestToolBase::SimTestToolBase ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 11 of file SimTestToolBase.cxx.

13 :
14 base_class(type, name, parent)
15{
16 declareProperty("HistPath", m_path="/truth/");
17 declareProperty("McEventKey", m_key="TruthEvent");
18}
std::string m_path
std::string m_key
The MC truth key.

Member Function Documentation

◆ getPrimary()

HepMC::ConstGenParticlePtr SimTestToolBase::getPrimary ( )
protected

Definition at line 20 of file SimTestToolBase.cxx.

21{
22 const McEventCollection* mcCollection;
23 if (evtStore()->retrieve(mcCollection,m_key).isSuccess()) {
25 for (e=mcCollection->begin();e!=mcCollection->end(); ++e) {
26 for (auto p : (**e)) {
28 return p;
29 }
30 }
31 }
32 }
33 return 0;
34}
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ initialize()

Member Data Documentation

◆ m_histSvc

ServiceHandle<ITHistSvc> SimTestHisto::m_histSvc {"THistSvc", "SimTestHisto"}
protectedinherited

Definition at line 35 of file SimTestHisto.h.

35{"THistSvc", "SimTestHisto"};

◆ m_key

std::string SimTestToolBase::m_key
protected

The MC truth key.

Definition at line 34 of file SimTestToolBase.h.

◆ m_path

std::string SimTestHisto::m_path {"/truth/"}
protectedinherited

Definition at line 34 of file SimTestHisto.h.

34{"/truth/"};

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