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

#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. More...
 
virtual ~VoxelDensityTool ()=default
 Destructor. More...
 
virtual StatusCode preGeometryConfigure () const override final
 Configure method. More...
 
virtual StatusCode postGeometryConfigure () const override final
 
virtual StatusCode initialize () override
 Initialize method. More...
 

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.

◆ ~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 }

◆ 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 }

◆ 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.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VoxelDensityTool::m_volumeVoxelDensityLevel
Gaudi::Property< std::map< std::string, double > > m_volumeVoxelDensityLevel
Definition: VoxelDensityTool.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GeometryConfigurationToolBase::GeometryConfigurationToolBase
GeometryConfigurationToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: GeometryConfigurationToolBase.cxx:18