DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geant4GeometryInfo.h
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 #ifndef DD4HEP_DDG4_GEANT4GEOMETRYINFO_H
16 #define DD4HEP_DDG4_GEANT4GEOMETRYINFO_H
17 
18 // Framework include files
19 #include "DD4hep/Objects.h"
20 #include "DD4hep/GeoHandler.h"
21 #include "DDG4/Geant4Primitives.h"
22 
23 // C/C++ include files
24 #include <map>
25 #include <vector>
26 
27 // Forward declarations (TGeo)
28 class TGeoElement;
29 class TGeoMedium;
30 class TGeoVolume;
31 class TGeoShape;
32 class TGeoNode;
33 // Forward declarations (Geant4)
34 class G4Element;
35 class G4Material;
36 class G4VSolid;
37 class G4LogicalVolume;
38 class G4Region;
39 class G4UserLimits;
40 class G4VisAttributes;
41 class G4VPhysicalVolume;
42 class G4AssemblyVolume;
44 
46 namespace DD4hep {
47 
49  namespace Simulation {
50 
51  // Forward declarations
52  class Geant4Mapping;
53  class Geant4AssemblyVolume;
54 
56 
61  namespace Geant4GeometryMaps {
62  using Geometry::Atom;
63  using Geometry::Material;
64  using Geometry::VisAttr;
65  using Geometry::Volume;
67  using Geometry::Region;
68  using Geometry::LimitSet;
70 
71  typedef std::vector<const G4VPhysicalVolume*> Geant4PlacementPath;
72  typedef std::map<Atom, G4Element*> ElementMap;
73  typedef std::map<Material, G4Material*> MaterialMap;
74  typedef std::map<LimitSet, G4UserLimits*> LimitMap;
75  typedef std::map<PlacedVolume, G4VPhysicalVolume*> PlacementMap;
76  typedef std::map<Region, G4Region*> RegionMap;
77  typedef std::map<Volume, G4LogicalVolume*> VolumeMap;
78  typedef std::map<PlacedVolume, Geant4AssemblyVolume*> AssemblyMap;
79 
80  typedef std::vector<const TGeoNode*> VolumeChain;
81  typedef std::pair<VolumeChain,const G4VPhysicalVolume*> ImprintEntry;
82  typedef std::vector<ImprintEntry> Imprints;
83  typedef std::map<Volume,Imprints> VolumeImprintMap;
84  typedef std::map<const TGeoShape*, G4VSolid*> SolidMap;
85  typedef std::map<VisAttr, G4VisAttributes*> VisMap;
86  typedef std::map<Geant4PlacementPath, VolumeID> Geant4PathMap;
87 
92  std::string placementPath(const Geant4PlacementPath& path, bool reverse=true);
93  }
94 
96 
102  public:
117  G4VPhysicalVolume* m_world;
118  bool valid;
119  private:
120  friend class Geant4Mapping;
124  virtual ~Geant4GeometryInfo();
125  public:
127  G4VPhysicalVolume* world() const;
129  void setWorld(const TGeoNode* node);
130  };
131 
132  } // End namespace Simulation
133 } // End namespace DD4hep
134 
135 #endif // DD4HEP_DDG4_GEANT4GEOMETRYINFO_H
Geant4GeometryMaps::LimitMap g4Limits
std::map< Region, G4Region * > RegionMap
void setWorld(const TGeoNode *node)
Set the world volume.
std::vector< const TGeoNode * > VolumeChain
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:135
std::map< VisAttr, G4VisAttributes * > VisMap
Handle class describing a material.
Definition: Objects.h:300
Handle class describing an element in the periodic table.
Definition: Objects.h:267
std::map< Geant4PlacementPath, VolumeID > Geant4PathMap
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
Definition: Geant4Classes.h:48
Geant4GeometryMaps::AssemblyMap g4AssemblyVolumes
std::vector< const G4VPhysicalVolume * > Geant4PlacementPath
std::vector< ImprintEntry > Imprints
Geometry::GeoHandlerTypes::SensitiveVolumes SensitiveVolumes
std::map< Region, ConstVolumeSet > RegionVolumes
Definition: GeoHandler.h:59
Geant4GeometryMaps::RegionVolumes regions
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:237
std::map< PlacedVolume, G4VPhysicalVolume * > PlacementMap
virtual ~Geant4GeometryInfo()
Default destructor.
std::map< const TGeoShape *, G4VSolid * > SolidMap
std::map< Material, G4Material * > MaterialMap
std::map< Volume, G4LogicalVolume * > VolumeMap
std::map< Volume, Imprints > VolumeImprintMap
std::map< SensitiveDetector, ConstVolumeSet > SensitiveVolumes
Definition: GeoHandler.h:58
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:34
Geant4GeometryMaps::VolumeMap g4Volumes
Geant4GeometryMaps::MaterialMap g4Materials
Geant4GeometryMaps::VolumeImprintMap g4VolumeImprints
std::map< LimitSet, ConstVolumeSet > LimitVolumes
Definition: GeoHandler.h:60
DD4hep::Geometry::SensitiveDetector SensitiveDetector
Geant4GeometryMaps::LimitVolumes limits
std::map< PlacedVolume, Geant4AssemblyVolume * > AssemblyMap
Geant4GeometryMaps::SensitiveVolumes sensitives
Geant4GeometryMaps::RegionMap g4Regions
Handle class describing visualization attributes.
Definition: Objects.h:341
G4VPhysicalVolume * world() const
The world placement.
Geometry::GeoHandlerTypes::LimitVolumes LimitVolumes
Geant4GeometryMaps::ElementMap g4Elements
Geant4GeometryMaps::PlacementMap g4Placements
Geometry::GeoHandlerTypes::RegionVolumes RegionVolumes
Handle class describing a set of limits as they are used for simulation.
Definition: Objects.h:475
Handle class describing a region as used in simulation.
Definition: Objects.h:516
Concreate class holding the relation information between geant4 objects and dd4hep objects...
Geometry mapping from DD4hep to Geant 4.
Definition: Geant4Mapping.h:36
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
Definition: Geant4Classes.h:4
Geant4GeometryMaps::SolidMap g4Solids
std::map< Atom, G4Element * > ElementMap
std::map< LimitSet, G4UserLimits * > LimitMap
Geant4GeometryMaps::Geant4PathMap g4Paths
std::pair< VolumeChain, const G4VPhysicalVolume * > ImprintEntry
std::string placementPath(const Geant4PlacementPath &path, bool reverse=true)
Assemble Geant4 volume path.