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

Class to allow for not-standard material construction. More...

#include "G4AtlasTools/VoxelDensityTool.h"

Inheritance diagram for VoxelDensityTool:
Collaboration diagram for VoxelDensityTool:

Public Member Functions

 VoxelDensityTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual ~VoxelDensityTool ()=default
 Destructor.
virtual StatusCode preGeometryConfigure () const override final
 Configure method.
virtual StatusCode postGeometryConfigure () const override final
virtual StatusCode initialize () override
 Initialize method.

Private Attributes

Gaudi::Property< std::map< std::string, double > > m_volumeVoxelDensityLevel {this, "VolumeVoxellDensityLevel", {}, "Allow setting of indivial volumes' voxel density level"}

Detailed Description

Class to allow for not-standard material construction.

Author
Andrea Dell'Acqua
Date
2016-08-16

Definition at line 20 of file VoxelDensityTool.h.

Constructor & Destructor Documentation

◆ VoxelDensityTool()

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

Standard constructor.

Definition at line 15 of file VoxelDensityTool.cxx.

18 : GeometryConfigurationToolBase(type, name, parent)
19{
20}
GeometryConfigurationToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.

◆ ~VoxelDensityTool()

virtual VoxelDensityTool::~VoxelDensityTool ( )
virtualdefault

Destructor.

Member Function Documentation

◆ initialize()

StatusCode GeometryConfigurationToolBase::initialize ( )
overridevirtualinherited

Initialize method.

Definition at line 29 of file GeometryConfigurationToolBase.cxx.

30{
31 ATH_MSG_DEBUG("GeometryyConfigurationToolBase::initialize()");
32
33 return StatusCode::SUCCESS;
34}
#define ATH_MSG_DEBUG(x)

◆ postGeometryConfigure()

StatusCode VoxelDensityTool::postGeometryConfigure ( ) const
finaloverridevirtual

Reimplemented from GeometryConfigurationToolBase.

Definition at line 29 of file VoxelDensityTool.cxx.

30{
31 ATH_MSG_INFO("VoxelDensityTool::postGeometryConfigure()");
32 // Set VoxelDensity
33 G4LogicalVolumeStore *logicalVolumeStore = G4LogicalVolumeStore::GetInstance();
34 if (logicalVolumeStore->size() == 0) {
35 ATH_MSG_ERROR( "G4 logical volume store is empty." );
36 }
37 const G4String muonSys("Muon::MuonSys");
38 const G4String embSTAC("LArMgr::LAr::EMB::STAC");
39 bool ilvMuonSys = false, ilvEmbSTAC = false;
40 for (auto* ilv : *logicalVolumeStore ) {
41 if ( ilv->GetName() == muonSys ) {
42 ilv->SetSmartless( 0.1 );
43 ATH_MSG_INFO( "Set VoxelDensity for Muon::MuonSys to 0.1" );
44 ilvMuonSys = true;
45 }
46 else if ( ilv->GetName() == embSTAC ) {
47 ilv->SetSmartless( 0.5 );
48 ATH_MSG_INFO( "Set VoxelDensity for LArMgr::LAr::EMB::STAC to 0.5" );
49 ilvEmbSTAC = true;
50 }
51
52 //Now for any volumes set via job property std::pair<volume name, value>...
53 for (auto& volToSet:m_volumeVoxelDensityLevel) {
54#if G4VERSION_NUMBER < 1100
55 if (ilv->GetName().contains(volToSet.first)) {
56#else
57 if (G4StrUtil::contains(ilv->GetName(), std::string_view(volToSet.first))) {
58#endif
59 ilv->SetSmartless(volToSet.second);
60 ATH_MSG_INFO("Set VoxelDensity for "<<ilv->GetName()<<" to "<<volToSet.second);
61 }
62 }
63
64 }
65 if (ilvMuonSys == false) {
66 ATH_MSG_INFO( "Muon::MuonSys not in G4 logical volume store. VoxelDensity not set." );
67 }
68 if (ilvEmbSTAC == false) {
69 ATH_MSG_INFO( "LArMgr::LAr::EMB::STAC not in G4 logical volume store. VoxelDensity not set." );
70 }
71
72 return StatusCode::SUCCESS;
73}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
Gaudi::Property< std::map< std::string, double > > m_volumeVoxelDensityLevel

◆ preGeometryConfigure()

StatusCode VoxelDensityTool::preGeometryConfigure ( ) const
finaloverridevirtual

Configure method.

Reimplemented from GeometryConfigurationToolBase.

Definition at line 22 of file VoxelDensityTool.cxx.

23{
24 ATH_MSG_DEBUG("VoxelDensityTool::preGeometryConfigure()");
25
26 return StatusCode::SUCCESS;
27}

Member Data Documentation

◆ m_volumeVoxelDensityLevel

Gaudi::Property<std::map<std::string,double> > VoxelDensityTool::m_volumeVoxelDensityLevel {this, "VolumeVoxellDensityLevel", {}, "Allow setting of indivial volumes' voxel density level"}
private

Definition at line 36 of file VoxelDensityTool.h.

36{this, "VolumeVoxellDensityLevel", {}, "Allow setting of indivial volumes' voxel density level"};

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