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

Redo the segmentation after the simulation has ended. More...

#include <RedoSegmentation.h>

Inheritance diagram for RedoSegmentation:
Collaboration diagram for RedoSegmentation:

Public Member Functions

 RedoSegmentation (const std::string &, ISvcLocator *)
 
virtual ~RedoSegmentation ()
 
virtual StatusCode initialize () final
 Initialize.
 
virtual StatusCode execute (const EventContext &) const final
 Execute.
 
virtual StatusCode finalize () final
 Finalize.
 

Private Member Functions

uint64_t volumeID (uint64_t aCellId) const
 Get ID of the volume that contains the cell.
 

Private Attributes

ServiceHandle< IGeoSvc > m_geoSvc
 Pointer to the geometry service.
 
DataHandle< edm4hep::CalorimeterHitCollection > m_inHits
 Handle for the EDM positioned hits to be read.
 
DataHandle< edm4hep::SimCalorimeterHitCollection > m_outHits
 Handle for the EDM hits to be written.
 
MetaDataHandle< std::string > m_outHitsCellIDEncoding
 Handle for the output hits cell id encoding.
 
dd4hep::DDSegmentation::Segmentation * m_segmentation
 New segmentation.
 
int m_segmentationType
 
Gaudi::Property< std::string > m_oldReadoutName
 Name of the detector readout used in simulation.
 
dd4hep::DDSegmentation::Segmentation * m_oldSegmentation
 Old segmentation.
 
int m_oldSegmentationType
 
Gaudi::Property< std::string > m_newReadoutName {this, "newReadoutName", "", "Name of the new detector readout"}
 Name of the new detector readout.
 
dd4hep::DDSegmentation::BitFieldCoder * m_oldDecoder
 Old bitfield decoder.
 
Gaudi::Property< std::vector< std::string > > m_oldIdentifiers
 Segmentation fields that are going to be replaced by the new segmentation.
 
std::vector< std::string > m_detectorIdentifiers
 Detector fields that are going to be rewritten.
 
Gaudi::Property< uint > m_debugPrint {this, "debugPrint", 10, "Limit of debug printing"}
 Limit of debug printing.
 

Detailed Description

Redo the segmentation after the simulation has ended.

True positions of the hits are required! New readout (with new segmentation) has to be added to <readouts> tag in the detector description xml. Cell IDs are rewritten from the old readout (\b oldReadoutName) to the new readout (\b newReadoutName). Names of the old segmentation fields need to be passed as a vector 'oldSegmentationIds'. Those fields are replaced by the new segmentation.

For an example see Detector/DetComponents/tests/options/redoSegmentationXYZ.py and Detector/DetComponents/tests/options/redoSegmentationRPhi.py.

Author
Anna Zaborowska

Constructor & Destructor Documentation

◆ RedoSegmentation()

RedoSegmentation::RedoSegmentation ( const std::string & aName,
ISvcLocator * aSvcLoc )
explicit

◆ ~RedoSegmentation()

RedoSegmentation::~RedoSegmentation ( )
virtual

Member Function Documentation

◆ execute()

StatusCode RedoSegmentation::execute ( const EventContext & ) const
finalvirtual

Execute.

Returns
status code

◆ finalize()

StatusCode RedoSegmentation::finalize ( )
finalvirtual

Finalize.

Returns
status code

◆ initialize()

StatusCode RedoSegmentation::initialize ( )
finalvirtual

Initialize.

Returns
status code

◆ volumeID()

uint64_t RedoSegmentation::volumeID ( uint64_t aCellId) const
private

Get ID of the volume that contains the cell.

Parameters
[in]aCellIdID of the cell.
Returns
ID of the volume.

Member Data Documentation

◆ m_debugPrint

Gaudi::Property<uint> RedoSegmentation::m_debugPrint {this, "debugPrint", 10, "Limit of debug printing"}
private

Limit of debug printing.

◆ m_detectorIdentifiers

std::vector<std::string> RedoSegmentation::m_detectorIdentifiers
private

Detector fields that are going to be rewritten.

◆ m_geoSvc

ServiceHandle<IGeoSvc> RedoSegmentation::m_geoSvc
private

Pointer to the geometry service.

◆ m_inHits

DataHandle<edm4hep::CalorimeterHitCollection> RedoSegmentation::m_inHits
mutableprivate
Initial value:
{
"hits/caloInHits", Gaudi::DataHandle::Reader, this}

Handle for the EDM positioned hits to be read.

◆ m_newReadoutName

Gaudi::Property<std::string> RedoSegmentation::m_newReadoutName {this, "newReadoutName", "", "Name of the new detector readout"}
private

Name of the new detector readout.

◆ m_oldDecoder

dd4hep::DDSegmentation::BitFieldCoder* RedoSegmentation::m_oldDecoder
private

Old bitfield decoder.

◆ m_oldIdentifiers

Gaudi::Property<std::vector<std::string> > RedoSegmentation::m_oldIdentifiers
private
Initial value:
{
this, "oldSegmentationIds", {}, "Segmentation fields that are going to be replaced by the new segmentation"}

Segmentation fields that are going to be replaced by the new segmentation.

◆ m_oldReadoutName

Gaudi::Property<std::string> RedoSegmentation::m_oldReadoutName
private
Initial value:
{this, "oldReadoutName", "",
"Name of the detector readout used in simulation"}

Name of the detector readout used in simulation.

◆ m_oldSegmentation

dd4hep::DDSegmentation::Segmentation* RedoSegmentation::m_oldSegmentation
private

Old segmentation.

◆ m_oldSegmentationType

int RedoSegmentation::m_oldSegmentationType
private

◆ m_outHits

DataHandle<edm4hep::SimCalorimeterHitCollection> RedoSegmentation::m_outHits
mutableprivate
Initial value:
{
"hits/caloOutHits", Gaudi::DataHandle::Writer, this}

Handle for the EDM hits to be written.

◆ m_outHitsCellIDEncoding

MetaDataHandle<std::string> RedoSegmentation::m_outHitsCellIDEncoding
private
Initial value:
{
m_outHits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer}
DataHandle< edm4hep::SimCalorimeterHitCollection > m_outHits
Handle for the EDM hits to be written.
Definition RedoSegmentation.h:66

Handle for the output hits cell id encoding.

◆ m_segmentation

dd4hep::DDSegmentation::Segmentation* RedoSegmentation::m_segmentation
private

New segmentation.

◆ m_segmentationType

int RedoSegmentation::m_segmentationType
private

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