ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
TruthStrategyManager Class Reference

Singleton class for creating truth incidents. More...

#include <TruthStrategyManager.h>

Collaboration diagram for TruthStrategyManager:

Public Member Functions

bool CreateTruthIncident (const G4Step *, int subDetVolLevel) const
 Returns true if any of the truth strategies return true. More...
 
void SetISFTruthSvc (ISF::ITruthSvc *truthSvc)
 Define which ISF TruthService to use. More...
 
void SetISFGeoIDSvc (ISF::IGeoIDSvc *geoIDSvc)
 Define which ISF GeoIDSvc to use. More...
 

Static Public Member Functions

static const TruthStrategyManagerGetStrategyManager ()
 Retrieve the (const) singleton instance. More...
 
static TruthStrategyManager &GetStrategyManager_nc ATLAS_NOT_THREAD_SAFE ()
 Retrieve the (non-const) singleton instance. More...
 

Private Member Functions

 TruthStrategyManager ()
 
 TruthStrategyManager (const TruthStrategyManager &)=delete
 
TruthStrategyManageroperator= (const TruthStrategyManager &)=delete
 

Private Attributes

ISF::ITruthSvcm_truthSvc
 ISF Services the TruthStrategyManager talks to. More...
 
ISF::IGeoIDSvcm_geoIDSvc
 

Detailed Description

Singleton class for creating truth incidents.

This class is gradually being refactored out of existence.

Definition at line 22 of file TruthStrategyManager.h.

Constructor & Destructor Documentation

◆ TruthStrategyManager() [1/2]

TruthStrategyManager::TruthStrategyManager ( )
private

Definition at line 36 of file TruthStrategyManager.cxx.

37  : m_truthSvc(nullptr)
38  , m_geoIDSvc(nullptr)
39 {
40 }

◆ TruthStrategyManager() [2/2]

TruthStrategyManager::TruthStrategyManager ( const TruthStrategyManager )
privatedelete

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

static TruthStrategyManager& GetStrategyManager_nc TruthStrategyManager::ATLAS_NOT_THREAD_SAFE ( )
static

Retrieve the (non-const) singleton instance.

◆ CreateTruthIncident()

bool TruthStrategyManager::CreateTruthIncident ( const G4Step *  aStep,
int  subDetVolLevel 
) const

Returns true if any of the truth strategies return true.

Definition at line 64 of file TruthStrategyManager.cxx.

65 {
67 
68  auto* atlasG4EvtUserInfo = static_cast<AtlasG4EventUserInfo*> (G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
69 
70  // This is pretty ugly and but necessary because the Geant4TruthIncident
71  // requires an ISFParticle at this point.
72  // TODO: cleanup Geant4TruthIncident to not require an ISFParticle instance any longer
73  const Amg::Vector3D myPos(0,0,0);
74  const Amg::Vector3D myMom(0,0,0);
75  const double myMass = 0.0;
76  const double myCharge = 0.0;
77  const int myPdgCode = 0;
78  const int mystatus = 3333;
79  const double myTime =0.;
80  const int myID = HepMC::UNDEFINED_ID;
81  const ISF::DetRegionSvcIDPair origin(geoID, ISF::fUndefinedSimID);
82  ISF::ISFParticle myISFParticle(myPos, myMom, myMass, myCharge, myPdgCode, mystatus, myTime, origin, myID);
83 
84  iGeant4::Geant4TruthIncident truth(aStep, myISFParticle, geoID, atlasG4EvtUserInfo);
85 
87  return false;
88 }

◆ GetStrategyManager()

const TruthStrategyManager & TruthStrategyManager::GetStrategyManager ( )
static

Retrieve the (const) singleton instance.

Definition at line 42 of file TruthStrategyManager.cxx.

43 {
44  static const TruthStrategyManager theMgr;
45  return theMgr;
46 }

◆ operator=()

TruthStrategyManager& TruthStrategyManager::operator= ( const TruthStrategyManager )
privatedelete

◆ SetISFGeoIDSvc()

void TruthStrategyManager::SetISFGeoIDSvc ( ISF::IGeoIDSvc geoIDSvc)

Define which ISF GeoIDSvc to use.

Definition at line 59 of file TruthStrategyManager.cxx.

60 {
61  m_geoIDSvc = geoIDSvc;
62 }

◆ SetISFTruthSvc()

void TruthStrategyManager::SetISFTruthSvc ( ISF::ITruthSvc truthSvc)

Define which ISF TruthService to use.

Definition at line 53 of file TruthStrategyManager.cxx.

54 {
55  m_truthSvc = truthSvc;
56 }

Member Data Documentation

◆ m_geoIDSvc

ISF::IGeoIDSvc* TruthStrategyManager::m_geoIDSvc
private

Definition at line 49 of file TruthStrategyManager.h.

◆ m_truthSvc

ISF::ITruthSvc* TruthStrategyManager::m_truthSvc
private

ISF Services the TruthStrategyManager talks to.

Definition at line 48 of file TruthStrategyManager.h.


The documentation for this class was generated from the following files:
ISF::DetRegionSvcIDPair
std::pair< AtlasDetDescr::AtlasRegion, ISF::SimSvcID > DetRegionSvcIDPair
the datatype to be used to store each individual particle hop
Definition: ISFParticle.h:30
AtlasG4EventUserInfo
This class is attached to G4Event objects as UserInformation. It holds a pointer to the HepMC::GenEve...
Definition: AtlasG4EventUserInfo.h:21
ISF::ITruthSvc::registerTruthIncident
virtual void registerTruthIncident(ITruthIncident &truthincident, bool saveAllChildren=false) const =0
Register a truth incident.
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::ISFParticle
Definition: ISFParticle.h:42
iGeant4::ISFG4GeoHelper::nextGeoId
static AtlasDetDescr::AtlasRegion nextGeoId(const G4Step *aStep, int truthVolLevel, ISF::IGeoIDSvc *geoIDSvc)
Definition: ISFG4GeoHelper.cxx:20
iGeant4::Geant4TruthIncident
Definition: Geant4TruthIncident.h:44
TruthStrategyManager::m_geoIDSvc
ISF::IGeoIDSvc * m_geoIDSvc
Definition: TruthStrategyManager.h:49
TruthStrategyManager
Singleton class for creating truth incidents.
Definition: TruthStrategyManager.h:23
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:56
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TruthStrategyManager::m_truthSvc
ISF::ITruthSvc * m_truthSvc
ISF Services the TruthStrategyManager talks to.
Definition: TruthStrategyManager.h:48
ISF::fUndefinedSimID
@ fUndefinedSimID
Definition: SimSvcID.h:32