DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4Converter.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DDG4_GEANT4CONVERTER_H
14 #define DDG4_GEANT4CONVERTER_H
15 
16 // Framework include files
17 #include <DD4hep/Printout.h>
18 #include <DDG4/Geant4Mapping.h>
19 
21 namespace dd4hep {
22 
24  namespace sim {
25 
27 
33  public:
35  bool debugMaterials = false;
37  bool debugElements = false;
39  bool debugShapes = false;
41  bool debugVolumes = false;
43  bool debugPlacements = false;
45  bool debugReflections = false;
47  bool debugRegions = false;
49  bool debugLimits = false;
51  bool debugSurfaces = false;
52 
54  bool printPlacements = false;
56  bool printSensitives = false;
57 
59  bool checkOverlaps = true;
61  PrintLevel outputLevel = INFO;
62 
64  Geant4Converter(const Detector& description);
65 
67  Geant4Converter(const Detector& description, PrintLevel level);
68 
70  virtual ~Geant4Converter();
71 
74 
76  virtual void* handleMaterialProperties(TObject* matrix) const;
77 
79  void* handleOpticalSurface(TObject* surface) const;
80 
82  void* handleSkinSurface(TObject* surface) const;
83 
85  void* handleBorderSurface(TObject* surface) const;
86 
88  virtual void* handleMaterial(const std::string& name, Material medium) const;
89 
91  virtual void* handleIsotope(const std::string& name, const TGeoIsotope* iso) const;
92 
94  virtual void* handleElement(const std::string& name, Atom element) const;
95 
97  virtual void* handleSolid(const std::string& name, const TGeoShape* volume) const;
98 
100  virtual void* handleVolume(const std::string& name, const TGeoVolume* volume) const;
101  virtual void* collectVolume(const std::string& name, const TGeoVolume* volume) const;
102 
104  virtual void* handlePlacement(const std::string& name, const TGeoNode* node) const;
105  virtual void* handleAssembly(const std::string& name, const TGeoNode* node) const;
106 
109 
111  virtual void* handleRegion(Region region, const std::set<const TGeoVolume*>& volumes) const;
112 
114  virtual void* handleVis(const std::string& name, VisAttr vis) const;
115 
117  virtual void* handleLimitSet(LimitSet limitset, const std::set<const TGeoVolume*>& volumes) const;
118 
120  void handleProperties(Detector::Properties& prp) const;
121 
123  virtual void printSensitive(SensitiveDetector sens_det, const std::set<const TGeoVolume*>& volumes) const;
124 
126  virtual void* printPlacement(const std::string& name, const TGeoNode* node) const;
127  };
128  } // End namespace sim
129 } // End namespace dd4hep
130 #endif // DDG4_GEANT4CONVERTER_H
dd4hep::sim::Geant4Converter::debugRegions
bool debugRegions
Property: Flag to debug regions during conversion mechanism.
Definition: Geant4Converter.h:47
dd4hep::sim::Geant4Converter::debugMaterials
bool debugMaterials
Property: Flag to debug materials during conversion mechanism.
Definition: Geant4Converter.h:35
dd4hep::sim::Geant4Converter::handleLimitSet
virtual void * handleLimitSet(LimitSet limitset, const std::set< const TGeoVolume * > &volumes) const
Convert the geometry type LimitSet into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:1192
dd4hep::Atom
Handle class describing an element in the periodic table.
Definition: Objects.h:242
dd4hep::sim::Geant4Converter
Geometry converter from dd4hep to Geant 4.
Definition: Geant4Converter.h:32
dd4hep::sim::Geant4Converter::Geant4Converter
Geant4Converter(const Detector &description)
Initializing Constructor.
Definition: Geant4Converter.cpp:289
Geant4Mapping.h
dd4hep::SensitiveDetector
Handle class to hold the information of a sensitive detector.
Definition: DetElement.h:44
dd4hep::sim::Geant4Converter::debugLimits
bool debugLimits
Property: Flag to debug LimitSets during conversion mechanism.
Definition: Geant4Converter.h:49
dd4hep::sim::Geant4Converter::debugElements
bool debugElements
Property: Flag to debug elements during conversion mechanism.
Definition: Geant4Converter.h:37
dd4hep::Detector::Properties
std::map< std::string, PropertyValues > Properties
Definition: Detector.h:95
dd4hep::VisAttr
Handle class describing visualization attributes.
Definition: Objects.h:324
dd4hep::sim::Geant4Converter::handleSkinSurface
void * handleSkinSurface(TObject *surface) const
Convert the skin surface to Geant4.
Definition: Geant4Converter.cpp:1557
dd4hep::sim::Geant4Converter::outputLevel
PrintLevel outputLevel
Property: Output level for debug printing.
Definition: Geant4Converter.h:61
dd4hep::sim::Geant4Converter::debugSurfaces
bool debugSurfaces
Property: Flag to debug surfaces during conversion mechanism.
Definition: Geant4Converter.h:51
dd4hep::sim::Geant4Converter::debugShapes
bool debugShapes
Property: Flag to debug shapes during conversion mechanism.
Definition: Geant4Converter.h:39
dd4hep::Material
Handle class describing a material.
Definition: Objects.h:272
dd4hep::sim::Geant4Converter::debugPlacements
bool debugPlacements
Property: Flag to debug placements during conversion mechanism.
Definition: Geant4Converter.h:43
dd4hep::sim::Geant4Converter::create
Geant4Converter & create(DetElement top)
Create geometry conversion.
Definition: Geant4Converter.cpp:1670
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::sim::Geant4Converter::handleBorderSurface
void * handleBorderSurface(TObject *surface) const
Convert the border surface to Geant4.
Definition: Geant4Converter.cpp:1575
dd4hep::detail::GeoHandler
The base class for all dd4hep geometry crawlers.
Definition: GeoHandler.h:87
dd4hep::sim::Geant4Mapping
Geometry mapping from dd4hep to Geant 4.
Definition: Geant4Mapping.h:35
dd4hep::sim::Geant4Converter::checkOverlaps
bool checkOverlaps
Property: Check geometrical overlaps for volume placements and G4 imprints.
Definition: Geant4Converter.h:59
dd4hep::sim::Geant4Converter::~Geant4Converter
virtual ~Geant4Converter()
Standard destructor.
Definition: Geant4Converter.cpp:304
dd4hep::LimitSet
Handle class describing a set of limits as they are used for simulation.
Definition: Objects.h:425
dd4hep::sim::Geant4Converter::handleMaterial
virtual void * handleMaterial(const std::string &name, Material medium) const
Convert the geometry type material into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:350
dd4hep::sim::Geant4Converter::handleProperties
void handleProperties(Detector::Properties &prp) const
Handle the geant 4 specific properties.
Definition: Geant4Converter.cpp:1260
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:462
dd4hep::sim::Geant4Converter::printSensitive
virtual void printSensitive(SensitiveDetector sens_det, const std::set< const TGeoVolume * > &volumes) const
Print the geometry type SensitiveDetector.
Definition: Geant4Converter.cpp:1594
dd4hep::sim::Geant4Converter::handleOpticalSurface
void * handleOpticalSurface(TObject *surface) const
Convert the optical surface to Geant4.
Definition: Geant4Converter.cpp:1424
dd4hep::sim::Geant4Converter::handleAssembly
virtual void * handleAssembly(const std::string &name, const TGeoNode *node) const
Dump volume placement in GDML format to output stream.
Definition: Geant4Converter.cpp:872
dd4hep::sim::Geant4Converter::handleVis
virtual void * handleVis(const std::string &name, VisAttr vis) const
Convert the geometry visualisation attributes to the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:1234
dd4hep::sim::Geant4Converter::handleVolume
virtual void * handleVolume(const std::string &name, const TGeoVolume *volume) const
Convert the geometry type logical volume into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:742
dd4hep::sim::Geant4Converter::debugVolumes
bool debugVolumes
Property: Flag to debug volumes during conversion mechanism.
Definition: Geant4Converter.h:41
dd4hep::sim::Geant4Converter::handleSolid
virtual void * handleSolid(const std::string &name, const TGeoShape *volume) const
Convert the geometry type solid into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:597
dd4hep::sim::Geant4Converter::collectVolume
virtual void * collectVolume(const std::string &name, const TGeoVolume *volume) const
Dump logical volume in GDML format to output stream.
Definition: Geant4Converter.cpp:852
dd4hep::sim::Geant4Converter::printSensitives
bool printSensitives
Property: Flag to dump all sensitives after the conversion procedure.
Definition: Geant4Converter.h:56
dd4hep::sim::Geant4Converter::handlePlacement
virtual void * handlePlacement(const std::string &name, const TGeoNode *node) const
Convert the geometry type volume placement into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:945
dd4hep::sim::Geant4Converter::handleIsotope
virtual void * handleIsotope(const std::string &name, const TGeoIsotope *iso) const
Handle the conversion of isotopes.
Definition: Geant4Converter.cpp:308
TObject
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:41
dd4hep::sim::Geant4Converter::handleMaterialProperties
virtual void * handleMaterialProperties(TObject *matrix) const
Convert the geometry type material into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:1295
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::sim::Geant4Converter::debugReflections
bool debugReflections
Property: Flag to debug reflections during conversion mechanism.
Definition: Geant4Converter.h:45
dd4hep::sim::Geant4Converter::handleRegion
virtual void * handleRegion(Region region, const std::set< const TGeoVolume * > &volumes) const
Convert the geometry type region into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:1114
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::sim::Geant4Converter::printPlacements
bool printPlacements
Property: Flag to dump all placements after the conversion procedure.
Definition: Geant4Converter.h:54
Printout.h
dd4hep::sim::Geant4Converter::handleElement
virtual void * handleElement(const std::string &name, Atom element) const
Convert the geometry type element into the corresponding Geant4 object(s).
Definition: Geant4Converter.cpp:322
dd4hep::sim::Geant4Converter::printPlacement
virtual void * printPlacement(const std::string &name, const TGeoNode *node) const
Print Geant4 placement.
Definition: Geant4Converter.cpp:1639