k4SimGeant4
Loading...
Searching...
No Matches
SimG4SaveTrackerHits Class Reference

Save tracker hits tool. More...

#include <SimG4SaveTrackerHits.h>

Inheritance diagram for SimG4SaveTrackerHits:
Collaboration diagram for SimG4SaveTrackerHits:

Public Member Functions

 SimG4SaveTrackerHits (const std::string &aType, const std::string &aName, const IInterface *aParent)
 
virtual ~SimG4SaveTrackerHits ()
 
virtual StatusCode initialize ()
 Initialize.
 
virtual StatusCode finalize ()
 Finalize.
 
virtual StatusCode saveOutput (const G4Event &aEvent) final
 Save the data output.
 
- Public Member Functions inherited from ISimG4SaveOutputTool
 DeclareInterfaceID (ISimG4SaveOutputTool, 1, 0)
 

Private Attributes

ServiceHandle< IGeoSvc > m_geoSvc
 Pointer to the geometry service.
 
DataHandle< edm4hep::SimTrackerHitCollection > m_trackHits
 Handle for output tracker hits.
 
MetaDataHandle< std::string > m_cellIDEncoding
 Output handle for cell ID encoding string.
 
Gaudi::Property< std::vector< std::string > > m_readoutNames
 Names of the readouts (hits collections) to save, deprecated.
 
Gaudi::Property< std::string > m_readoutName
 Name of the readout (hits collection) to save.
 

Detailed Description

Save tracker hits tool.

The tool expects one readout name and will produce one collection.

Readout name is defined in DD4hep compact file as the attribute readout of a detector tag.

If readout name which does not correspond to any Geant4 hit collection is provided, the tool will fail at initialization.

If both readoutName and deprecated readoutNames are provided, the tool will fail at initialization.

If the more than one readout names is provided through the deprecated readoutNames parameter, the tool will fail at initialization.

For more information please see.

Author
Anna Zaborowska
Valentin Volkl (extended with Digi Info)
Juraj Smiesko (deprecated readoutNames)

Constructor & Destructor Documentation

◆ SimG4SaveTrackerHits()

SimG4SaveTrackerHits::SimG4SaveTrackerHits ( const std::string & aType,
const std::string & aName,
const IInterface * aParent )
explicit

◆ ~SimG4SaveTrackerHits()

SimG4SaveTrackerHits::~SimG4SaveTrackerHits ( )
virtual

Member Function Documentation

◆ finalize()

StatusCode SimG4SaveTrackerHits::finalize ( )
virtual

Finalize.

Returns
status code

◆ initialize()

StatusCode SimG4SaveTrackerHits::initialize ( )
virtual

Initialize.

Returns
status code

◆ saveOutput()

StatusCode SimG4SaveTrackerHits::saveOutput ( const G4Event & aEvent)
finalvirtual

Save the data output.

Saves the tracker hits from the collections as specified in the job options in 'readoutNames'.

Parameters
[in]aEventEvent with data to save.
Returns
status code

workaround, store trackid in an unrelated field

Implements ISimG4SaveOutputTool.

Member Data Documentation

◆ m_cellIDEncoding

MetaDataHandle<std::string> SimG4SaveTrackerHits::m_cellIDEncoding
private
Initial value:
{
m_trackHits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer}
DataHandle< edm4hep::SimTrackerHitCollection > m_trackHits
Handle for output tracker hits.
Definition SimG4SaveTrackerHits.h:69

Output handle for cell ID encoding string.

◆ m_geoSvc

ServiceHandle<IGeoSvc> SimG4SaveTrackerHits::m_geoSvc
private

Pointer to the geometry service.

◆ m_readoutName

Gaudi::Property<std::string> SimG4SaveTrackerHits::m_readoutName
private
Initial value:
{
this, "readoutName", {}, "Name of the readout (hit collection) to save"}

Name of the readout (hits collection) to save.

◆ m_readoutNames

Gaudi::Property<std::vector<std::string> > SimG4SaveTrackerHits::m_readoutNames
private
Initial value:
{
this, "readoutNames", {}, "[Deprecated] Name of the readouts (hits collections) to save"}

Names of the readouts (hits collections) to save, deprecated.

◆ m_trackHits

DataHandle<edm4hep::SimTrackerHitCollection> SimG4SaveTrackerHits::m_trackHits
mutableprivate
Initial value:
{
"TrackerHits", Gaudi::DataHandle::Writer, this}

Handle for output tracker hits.


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