ATLAS Offline Software
VolumeDebugger.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4DEBUGGINGTOOLS_VolumeDebugger_H
6 #define G4DEBUGGINGTOOLS_VolumeDebugger_H
7 
8 #include <string>
9 #include <mutex>
10 
11 #include "G4UserRunAction.hh"
13 
14 class G4LogicalVolume;
15 class G4VPhysicalVolume;
16 
17 namespace G4UA
18 {
19 
36  class VolumeDebugger : public AthMessaging, public G4UserRunAction
37  {
38 
39  public:
40 
41  struct Config
42  {
43  std::string path{"./test_volume.gdml"};
44  std::string targetVolume{""}; // By default targetVolume is empty => dump the whole Atlas::Atlas geometry
45  int res{1000000};
46  bool verbose{true};
47  float tol{0.000001};
48  bool volumeCheck{false};
49  double targetMaxCopiesToCheck{1.e6};
50  bool dumpGDML{true};
51  bool dumpPhysicsRegions{false};
52  bool printGeo{false};
53  };
54 
57  virtual void BeginOfRunAction(const G4Run*) override;
58 
59  private:
60 
64  void DumpGeometry() const;
66  void PullVolumes( G4LogicalVolume* v ) const;
68  bool recursiveCheck(G4VPhysicalVolume *pv) const;
69 
70  std::string printVolume(const G4VPhysicalVolume *pv, const std::string& delim = "") const;
71 
72  }; // class VolumeDebugger
73 
74 } // namespace G4UA
75 
76 #endif //G4DEBUGGINGTOOLS_VolumeDebugger_H
G4UA::VolumeDebugger::Config
Definition: VolumeDebugger.h:42
G4UA::VolumeDebugger
a user action to debug G4 geometries
Definition: VolumeDebugger.h:37
G4UA::VolumeDebugger::Config::dumpGDML
bool dumpGDML
Definition: VolumeDebugger.h:50
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::VolumeDebugger::printVolume
std::string printVolume(const G4VPhysicalVolume *pv, const std::string &delim="") const
Definition: VolumeDebugger.cxx:190
G4UA::VolumeDebugger::recursiveCheck
bool recursiveCheck(G4VPhysicalVolume *pv) const
Returns true if there were overlaps.
Definition: VolumeDebugger.cxx:138
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
G4UA::VolumeDebugger::Config::tol
float tol
Definition: VolumeDebugger.h:47
G4UA::VolumeDebugger::BeginOfRunAction
virtual void BeginOfRunAction(const G4Run *) override
hook for G4 UA functionality
Definition: VolumeDebugger.cxx:132
G4UA::VolumeDebugger::Config::printGeo
bool printGeo
Definition: VolumeDebugger.h:52
G4UA::VolumeDebugger::Config::dumpPhysicsRegions
bool dumpPhysicsRegions
Definition: VolumeDebugger.h:51
G4UA::VolumeDebugger::Config::volumeCheck
bool volumeCheck
Definition: VolumeDebugger.h:48
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
G4UA::VolumeDebugger::VolumeDebugger
VolumeDebugger(const Config &config)
Definition: VolumeDebugger.cxx:34
G4UA::VolumeDebugger::Config::targetVolume
std::string targetVolume
Definition: VolumeDebugger.h:44
G4UA::VolumeDebugger::m_config
Config m_config
configuration data
Definition: VolumeDebugger.h:62
G4UA::VolumeDebugger::PullVolumes
void PullVolumes(G4LogicalVolume *v) const
volume filter
Definition: VolumeDebugger.cxx:41
Config
Definition: dumpNPs.cxx:47
python.PyAthena.v
v
Definition: PyAthena.py:157
AthMessaging.h
G4UA::VolumeDebugger::Config::targetMaxCopiesToCheck
double targetMaxCopiesToCheck
Definition: VolumeDebugger.h:49
python.changerun.pv
pv
Definition: changerun.py:81
G4UA::VolumeDebugger::Config::path
std::string path
Definition: VolumeDebugger.h:43
G4UA::VolumeDebugger::DumpGeometry
void DumpGeometry() const
wrapper function for the gdml dump
Definition: VolumeDebugger.cxx:63
G4UA::VolumeDebugger::Config::verbose
bool verbose
Definition: VolumeDebugger.h:46