DD4hep
1.28.0
Detector Description Toolkit for High Energy Physics
|
Geometry converter from dd4hep to Geant 4 in Detector format. More...
#include <DetectorChecksum.h>
Classes | |
struct | entry_t |
class | GeometryInfo |
Data structure of the geometry converter from dd4hep to Geant 4 in Detector format. More... | |
Public Types | |
using | hash_t = uint64_t |
using | ElementMap = std::map< Atom, entry_t > |
using | MaterialMap = std::map< Material, entry_t > |
using | LimitMap = std::map< LimitSet, entry_t > |
using | PlacementMap = std::map< PlacedVolume, entry_t > |
using | RegionMap = std::map< Region, entry_t > |
using | SensDetMap = std::map< SensitiveDetector, entry_t > |
using | VolumeMap = std::map< Volume, entry_t > |
using | IdSpecMap = std::map< IDDescriptor, entry_t > |
using | SegmentationMap = std::map< Segmentation, entry_t > |
using | VisMap = std::map< VisAttr, entry_t > |
using | AlignmentMap = std::map< Alignment, entry_t > |
using | SolidMap = std::map< Solid, entry_t > |
using | FieldMap = std::map< OverlayedField, entry_t > |
using | TrafoMap = std::map< const TGeoMatrix *, entry_t > |
using | MapOfDetElements = std::map< DetElement, entry_t > |
typedef std::vector< hash_t > | hashes_t |
Public Member Functions | |
GeometryInfo & | data () const |
void | configure () |
void | hash_debug (const std::string &prefix, const entry_t &str, int flag=0) const |
entry_t | make_entry (std::stringstream &log) const |
std::stringstream | logger () const |
DetectorChecksum (Detector &description) | |
Initializing Constructor. More... | |
virtual | ~DetectorChecksum () |
Standard destructor. More... | |
template<typename T > | |
std::string | refName (T handle) const |
template<typename T > | |
std::string | attr_name (T handle) const |
void | collect_det_elements (DetElement top) const |
void | analyzeDetector (DetElement top) |
Create geometry conversion in Detector format. More... | |
void | checksumPlacement (PlacedVolume pv, hashes_t &hashes, bool recursive) const |
void | checksumDetElement (int level, DetElement det, hashes_t &hashes, bool recursive) const |
virtual const entry_t & | handleHeader () const |
Add header information in Detector format. More... | |
virtual const entry_t & | handleMaterial (Material medium) const |
Convert the geometry type material into the corresponding gdml string. More... | |
virtual const entry_t & | handleElement (Atom element) const |
Convert the geometry type element into the corresponding gdml string. More... | |
virtual const entry_t & | handleSolid (Solid solid) const |
Convert the geometry type solid into the corresponding gdml string. More... | |
virtual const entry_t & | handleVolume (Volume volume) const |
Convert the geometry type logical volume into the corresponding gdml string. More... | |
virtual void | collectVolume (Volume volume) const |
Dump logical volume in GDML format to output stream. More... | |
virtual const entry_t & | handlePlacement (PlacedVolume node) const |
Convert the geometry type volume placement into the corresponding gdml string. More... | |
const entry_t & | handleAlignment (Alignment alignment) const |
Convert alignment entry into the corresponding gdml string. More... | |
virtual const entry_t & | handleRegion (Region region) const |
Convert the geometry type region into the corresponding gdml string. More... | |
virtual const entry_t & | handleVis (VisAttr vis) const |
Convert the geometry visualisation attributes to the corresponding gdml string. More... | |
virtual const entry_t & | handleIdSpec (IDDescriptor idspec) const |
Convert the geometry id dictionary entry to the corresponding gdml string. More... | |
virtual const entry_t & | handleLimitSet (LimitSet limitset) const |
Convert the geometry type LimitSet into the corresponding gdml string. More... | |
virtual const entry_t & | handleDetElement (DetElement det) const |
virtual const entry_t & | handleSensitive (SensitiveDetector sens_det) const |
Convert the geometry type SensitiveDetector into the corresponding gdml string. More... | |
virtual const entry_t & | handleSegmentation (Segmentation seg) const |
Convert the segmentation of a SensitiveDetector into the corresponding Detector object. More... | |
virtual const entry_t & | handlePosition (const TGeoMatrix *trafo) const |
Convert the Position into the corresponding gdml string. More... | |
virtual const entry_t & | handleRotation (const TGeoMatrix *trafo) const |
Convert the Rotation into the corresponding gdml string. More... | |
virtual const entry_t & | handleField (OverlayedField field) const |
Convert the electric or magnetic fields into the corresponding gdml string. More... | |
const entry_t & | handleProperties (Detector::Properties &prp) const |
Handle the geant 4 specific properties. More... | |
void | dump_elements () const |
Dump elements used in this apparatus. More... | |
void | dump_materials () const |
Dump materials used in this apparatus. More... | |
void | dump_solids () const |
Dump solids used in this apparatus. More... | |
void | dump_volumes () const |
Dump volumes used in this apparatus. More... | |
void | dump_positions () const |
Dump positions used in this apparatus. More... | |
void | dump_rotations () const |
Dump rotations used in this apparatus. More... | |
void | dump_placements () const |
Dump placements used in this apparatus. More... | |
void | dump_detelements () const |
Dump detelements used in this apparatus. More... | |
void | dump_iddescriptors () const |
Dump iddescriptors used in this apparatus. More... | |
void | dump_segmentations () const |
Dump segmentations used in this apparatus. More... | |
void | dump_sensitives () const |
Dump sensitives used in this apparatus. More... | |
template<> | |
std::string | refName (Segmentation handle) const |
Public Member Functions inherited from dd4hep::detail::GeoHandler | |
GeoHandler () | |
Default constructor. More... | |
GeoHandler (std::map< int, std::set< const TGeoNode * > > *ptr) | |
Initializing constructor. More... | |
virtual | ~GeoHandler () |
Default destructor. More... | |
bool | setPropagateRegions (bool value) |
Propagate regions. Returns the previous value. More... | |
GeoHandler & | collect (DetElement top) |
Collect geometry information from traversal. More... | |
GeoHandler & | collect (DetElement top, GeometryInfo &info) |
Collect geometry information from traversal with aggregated information. More... | |
std::map< int, std::set< const TGeoNode * > > * | release () |
Access to collected node list. More... | |
Public Attributes | |
Detector & | m_detDesc |
Reference to detector description. More... | |
GeometryInfo * | m_dataPtr |
std::stringstream | debug_hash |
std::string | m_len_unit_nam = "mm" |
std::string | m_ang_unit_nam = "deg" |
std::string | m_ene_unit_nam = "GeV" |
std::string | m_densunit_nam = "g/cm3" |
std::string | m_atomunit_nam = "g/mole" |
double | m_len_unit = dd4hep::mm |
double | m_ang_unit = dd4hep::deg |
double | m_ene_unit = dd4hep::GeV |
double | m_densunit = dd4hep::g/dd4hep::cm3 |
double | m_atomunit = dd4hep::g/dd4hep::mole |
double | m_len__def = dd4hep::mm |
double | m_ang__def = dd4hep::deg |
double | m_ene__def = dd4hep::GeV |
double | m_dens_def = dd4hep::g/dd4hep::cm3 |
double | m_atom_def = dd4hep::g/dd4hep::mole |
entry_t | empty_entry { 0UL, "" } |
std::string | newline = "" |
int | precision { 6 } |
Property: precision of hashed printouts. More... | |
int | hash_meshes { 0 } |
Property: Include meshed solids in detector hash. More... | |
int | hash_readout { 0 } |
Property: Include readout property in detector hash. More... | |
int | max_level { 1 } |
Property: maximum depth level for printouts. More... | |
int | have_hash_strings { 0 } |
Property: Keep hash-strings, not only hash values (debugging) More... | |
int | debug { 4 } |
Property: debug level. More... | |
int | reorder { 1 } |
int | write_files { 1 } |
Additional Inherited Members | |
Protected Member Functions inherited from dd4hep::detail::GeoHandler | |
GeoHandler & | i_collect (const TGeoNode *parent, const TGeoNode *node, int level, Region rg, LimitSet ls) |
Internal helper to collect geometry information from traversal. More... | |
Protected Attributes inherited from dd4hep::detail::GeoHandler | |
bool | m_propagateRegions |
std::map< int, std::set< const TGeoNode * > > * | m_data |
Geometry converter from dd4hep to Geant 4 in Detector format.
Definition at line 38 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::AlignmentMap = std::map<Alignment, entry_t> |
Definition at line 55 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::ElementMap = std::map<Atom, entry_t> |
Definition at line 45 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::FieldMap = std::map<OverlayedField, entry_t> |
Definition at line 57 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::hash_t = uint64_t |
Definition at line 40 of file DetectorChecksum.h.
typedef std::vector<hash_t> dd4hep::detail::DetectorChecksum::hashes_t |
Definition at line 150 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::IdSpecMap = std::map<IDDescriptor, entry_t> |
Definition at line 52 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::LimitMap = std::map<LimitSet, entry_t> |
Definition at line 47 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::MapOfDetElements = std::map<DetElement, entry_t> |
Definition at line 59 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::MaterialMap = std::map<Material, entry_t> |
Definition at line 46 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::PlacementMap = std::map<PlacedVolume, entry_t> |
Definition at line 48 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::RegionMap = std::map<Region, entry_t> |
Definition at line 49 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::SegmentationMap = std::map<Segmentation, entry_t> |
Definition at line 53 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::SensDetMap = std::map<SensitiveDetector, entry_t> |
Definition at line 50 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::SolidMap = std::map<Solid, entry_t> |
Definition at line 56 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::TrafoMap = std::map<const TGeoMatrix*, entry_t> |
Definition at line 58 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::VisMap = std::map<VisAttr, entry_t> |
Definition at line 54 of file DetectorChecksum.h.
using dd4hep::detail::DetectorChecksum::VolumeMap = std::map<Volume, entry_t> |
Definition at line 51 of file DetectorChecksum.h.
DetectorChecksum::DetectorChecksum | ( | Detector & | description | ) |
Initializing Constructor.
Definition at line 128 of file DetectorChecksum.cpp.
|
virtual |
Standard destructor.
Definition at line 132 of file DetectorChecksum.cpp.
void DetectorChecksum::analyzeDetector | ( | DetElement | top | ) |
Create geometry conversion in Detector format.
Create geometry conversion.
Definition at line 1079 of file DetectorChecksum.cpp.
std::string DetectorChecksum::attr_name | ( | T | handle | ) | const |
Definition at line 148 of file DetectorChecksum.cpp.
void DetectorChecksum::checksumDetElement | ( | int | level, |
DetElement | det, | ||
hashes_t & | hashes, | ||
bool | recursive | ||
) | const |
Hash DetElement and placement
Hash all daughters with a DetElement child (but excluding the child) Note: We only take into account the placements to the next DetElement (if any) On the fly we remember all placements already taken into account!
Now hash all daughter volumes, which are not linked to a DetElement in the structural hierarchy.
Finally: Hash recursively the structural children
All done: Some debugging printout
Definition at line 1129 of file DetectorChecksum.cpp.
void DetectorChecksum::checksumPlacement | ( | PlacedVolume | pv, |
hashes_t & | hashes, | ||
bool | recursive | ||
) | const |
Definition at line 1256 of file DetectorChecksum.cpp.
void DetectorChecksum::collect_det_elements | ( | DetElement | top | ) | const |
Definition at line 1066 of file DetectorChecksum.cpp.
|
virtual |
Dump logical volume in GDML format to output stream.
Definition at line 791 of file DetectorChecksum.cpp.
void DetectorChecksum::configure | ( | ) |
Definition at line 168 of file DetectorChecksum.cpp.
|
inline |
Definition at line 130 of file DetectorChecksum.h.
void DetectorChecksum::dump_detelements | ( | ) | const |
Dump detelements used in this apparatus.
Definition at line 1340 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_elements | ( | ) | const |
Dump elements used in this apparatus.
Definition at line 1290 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_iddescriptors | ( | ) | const |
Dump iddescriptors used in this apparatus.
Definition at line 1325 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_materials | ( | ) | const |
Dump materials used in this apparatus.
Definition at line 1295 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_placements | ( | ) | const |
Dump placements used in this apparatus.
Definition at line 1320 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_positions | ( | ) | const |
Dump positions used in this apparatus.
Definition at line 1305 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_rotations | ( | ) | const |
Dump rotations used in this apparatus.
Definition at line 1310 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_segmentations | ( | ) | const |
Dump segmentations used in this apparatus.
Definition at line 1330 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_sensitives | ( | ) | const |
Dump sensitives used in this apparatus.
Definition at line 1335 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_solids | ( | ) | const |
Dump solids used in this apparatus.
Definition at line 1300 of file DetectorChecksum.cpp.
void DetectorChecksum::dump_volumes | ( | ) | const |
Dump volumes used in this apparatus.
Definition at line 1315 of file DetectorChecksum.cpp.
const DetectorChecksum::entry_t & DetectorChecksum::handleAlignment | ( | Alignment | alignment | ) | const |
Convert alignment entry into the corresponding gdml string.
Definition at line 760 of file DetectorChecksum.cpp.
|
virtual |
Definition at line 910 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type element into the corresponding gdml string.
Dump element in GDML format to output stream.
Definition at line 185 of file DetectorChecksum.cpp.
|
virtual |
Convert the electric or magnetic fields into the corresponding gdml string.
Convert the electric or magnetic fields into the corresponding Xml object(s).
Definition at line 1021 of file DetectorChecksum.cpp.
|
virtual |
Add header information in Detector format.
Definition at line 1049 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry id dictionary entry to the corresponding gdml string.
Convert the geometry id dictionary entry to the corresponding Xml object(s).
Definition at line 997 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type LimitSet into the corresponding gdml string.
Convert the geometry type LimitSet into the corresponding Detector object(s)
Definition at line 740 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type material into the corresponding gdml string.
Dump material in GDML format to output stream.
Definition at line 208 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type volume placement into the corresponding gdml string.
Dump volume placement in GDML format to output stream.
Definition at line 876 of file DetectorChecksum.cpp.
|
virtual |
Convert the Position into the corresponding gdml string.
Convert the Position into the corresponding Xml object(s).
Definition at line 653 of file DetectorChecksum.cpp.
const entry_t& dd4hep::detail::DetectorChecksum::handleProperties | ( | Detector::Properties & | prp | ) | const |
Handle the geant 4 specific properties.
|
virtual |
Convert the geometry type region into the corresponding gdml string.
Convert the geometry type region into the corresponding Detector object(s).
Convert the geometry type field into the corresponding gdml string virtual const entry_t& handleField(Ref_t field) const;
Definition at line 723 of file DetectorChecksum.cpp.
|
virtual |
Convert the Rotation into the corresponding gdml string.
Convert the Rotation into the corresponding Xml object(s).
Definition at line 671 of file DetectorChecksum.cpp.
|
virtual |
Convert the segmentation of a SensitiveDetector into the corresponding Detector object.
Definition at line 962 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type SensitiveDetector into the corresponding gdml string.
Convert the geometry type SensitiveDetector into the corresponding Detector object(s).
Definition at line 933 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type solid into the corresponding gdml string.
Dump solid in GDML format to output stream.
Definition at line 240 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry visualisation attributes to the corresponding gdml string.
Convert the geometry visualisation attributes to the corresponding Detector object(s).
Definition at line 689 of file DetectorChecksum.cpp.
|
virtual |
Convert the geometry type logical volume into the corresponding gdml string.
Dump logical volume in GDML format to output stream.
Definition at line 809 of file DetectorChecksum.cpp.
void DetectorChecksum::hash_debug | ( | const std::string & | prefix, |
const entry_t & | str, | ||
int | flag = 0 |
||
) | const |
Definition at line 1116 of file DetectorChecksum.cpp.
std::stringstream DetectorChecksum::logger | ( | ) | const |
Definition at line 153 of file DetectorChecksum.cpp.
DetectorChecksum::entry_t DetectorChecksum::make_entry | ( | std::stringstream & | log | ) | const |
Definition at line 160 of file DetectorChecksum.cpp.
std::string dd4hep::detail::DetectorChecksum::refName | ( | Segmentation | handle | ) | const |
Definition at line 143 of file DetectorChecksum.cpp.
std::string DetectorChecksum::refName | ( | T | handle | ) | const |
Definition at line 138 of file DetectorChecksum.cpp.
int dd4hep::detail::DetectorChecksum::debug { 4 } |
Property: debug level.
Definition at line 126 of file DetectorChecksum.h.
|
mutable |
Definition at line 93 of file DetectorChecksum.h.
entry_t dd4hep::detail::DetectorChecksum::empty_entry { 0UL, "" } |
Definition at line 112 of file DetectorChecksum.h.
int dd4hep::detail::DetectorChecksum::hash_meshes { 0 } |
Property: Include meshed solids in detector hash.
Definition at line 118 of file DetectorChecksum.h.
int dd4hep::detail::DetectorChecksum::hash_readout { 0 } |
Property: Include readout property in detector hash.
Definition at line 120 of file DetectorChecksum.h.
int dd4hep::detail::DetectorChecksum::have_hash_strings { 0 } |
Property: Keep hash-strings, not only hash values (debugging)
Definition at line 124 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_ang__def = dd4hep::deg |
Definition at line 107 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_ang_unit = dd4hep::deg |
Definition at line 101 of file DetectorChecksum.h.
std::string dd4hep::detail::DetectorChecksum::m_ang_unit_nam = "deg" |
Definition at line 96 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_atom_def = dd4hep::g/dd4hep::mole |
Definition at line 110 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_atomunit = dd4hep::g/dd4hep::mole |
Definition at line 104 of file DetectorChecksum.h.
std::string dd4hep::detail::DetectorChecksum::m_atomunit_nam = "g/mole" |
Definition at line 99 of file DetectorChecksum.h.
GeometryInfo* dd4hep::detail::DetectorChecksum::m_dataPtr |
Definition at line 92 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_dens_def = dd4hep::g/dd4hep::cm3 |
Definition at line 109 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_densunit = dd4hep::g/dd4hep::cm3 |
Definition at line 103 of file DetectorChecksum.h.
std::string dd4hep::detail::DetectorChecksum::m_densunit_nam = "g/cm3" |
Definition at line 98 of file DetectorChecksum.h.
Detector& dd4hep::detail::DetectorChecksum::m_detDesc |
Reference to detector description.
Definition at line 91 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_ene__def = dd4hep::GeV |
Definition at line 108 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_ene_unit = dd4hep::GeV |
Definition at line 102 of file DetectorChecksum.h.
std::string dd4hep::detail::DetectorChecksum::m_ene_unit_nam = "GeV" |
Definition at line 97 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_len__def = dd4hep::mm |
Definition at line 106 of file DetectorChecksum.h.
double dd4hep::detail::DetectorChecksum::m_len_unit = dd4hep::mm |
Definition at line 100 of file DetectorChecksum.h.
std::string dd4hep::detail::DetectorChecksum::m_len_unit_nam = "mm" |
Definition at line 95 of file DetectorChecksum.h.
int dd4hep::detail::DetectorChecksum::max_level { 1 } |
Property: maximum depth level for printouts.
Definition at line 122 of file DetectorChecksum.h.
std::string dd4hep::detail::DetectorChecksum::newline = "" |
Definition at line 113 of file DetectorChecksum.h.
|
mutable |
Property: precision of hashed printouts.
Definition at line 116 of file DetectorChecksum.h.
int dd4hep::detail::DetectorChecksum::reorder { 1 } |
Definition at line 127 of file DetectorChecksum.h.
int dd4hep::detail::DetectorChecksum::write_files { 1 } |
Definition at line 128 of file DetectorChecksum.h.