CMS 3D CMS Logo

DDDWorld.cc
Go to the documentation of this file.
5 
10 #include "DDG4/Geant4Converter.h"
11 #include "DDG4/Geant4GeometryInfo.h"
12 #include "DDG4/Geant4Mapping.h"
13 #include "DD4hep/Detector.h"
14 #include "DD4hep/Printout.h"
16 
17 #include "G4PVPlacement.hh"
18 
19 using namespace edm;
20 using namespace dd4hep;
21 using namespace dd4hep::sim;
22 
24  const cms::DDCompactView *pDD4hep,
26  int verb,
27  bool cuts,
28  bool pcut) {
29  LogVerbatim("SimG4CoreApplication") << "+++ DDDWorld: initialisation of Geant4 geometry";
30  if (pDD4hep) {
31  // DD4Hep
32  const cms::DDDetector *det = pDD4hep->detector();
33  dd4hep::sim::Geant4GeometryMaps::VolumeMap lvMap;
34 
35  cms::DDG4Builder theBuilder(pDD4hep, lvMap, false);
36  m_world = theBuilder.BuildGeometry(catalog);
37  LogVerbatim("SimG4CoreApplication") << "DDDWorld: worldLV: " << m_world->GetName();
38  if (cuts) {
39  DDG4ProductionCuts pcuts(&det->specpars(), &lvMap, verb, pcut);
40  }
41  catalog.printMe();
42  } else {
43  // old DD code
45 
46  DDG4Builder theBuilder(pDD, lvMap, false);
47  G4LogicalVolume *world = theBuilder.BuildGeometry(catalog);
48  LogVerbatim("SimG4CoreApplication") << "DDDWorld: worldLV: " << world->GetName();
49  m_world = new G4PVPlacement(nullptr, G4ThreeVector(), world, "DDDWorld", nullptr, false, 0);
50  if (cuts) {
51  DDG4ProductionCuts pcuts(&lvMap, verb, pcut);
52  }
53  }
54  LogVerbatim("SimG4CoreApplication") << "DDDWorld: initialisation of Geant4 geometry is done.";
55 }
56 
60  bool check) {
61  LogVerbatim("SimG4CoreApplication") << "DDDWorld: initialization of Geant4 geometry";
62  DDG4Builder theBuilder(cpv, lvmap, check);
63 
64  G4LogicalVolume *world = theBuilder.BuildGeometry(catalog);
65 
66  m_world = new G4PVPlacement(nullptr, G4ThreeVector(), world, "DDDWorld", nullptr, false, 0);
67  LogVerbatim("SimG4CoreApplication") << "DDDWorld: initialization of Geant4 geometry is done.";
68 }
69 
cms::DDDetector::specpars
dd4hep::SpecParRegistry const & specpars() const
Definition: DDDetector.h:21
MessageLogger.h
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
DDMapper< G4LogicalVolume *, DDLogicalPart >
edm
HLT enums.
Definition: AlignableModifier.h:19
G4LogicalVolumeToDDLogicalPartMap.h
DDDetector.h
DDCompactView.h
DDDWorld.h
cms::DDG4Builder::BuildGeometry
G4VPhysicalVolume * BuildGeometry(SensitiveDetectorCatalog &)
Definition: DD4hep_DDG4Builder.cc:29
DDG4Builder::BuildGeometry
G4LogicalVolume * BuildGeometry(SensitiveDetectorCatalog &)
Definition: DDG4Builder.cc:97
DDG4ProductionCuts.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
DDCompactView.h
particleFlowSimParticle_cfi.sim
sim
Definition: particleFlowSimParticle_cfi.py:21
DD4hep_DDG4Builder.h
DDDWorld::DDDWorld
DDDWorld(const DDCompactView *pDD, const cms::DDCompactView *pDD4hep, SensitiveDetectorCatalog &, int verb, bool cuts, bool pcut)
Definition: DDDWorld.cc:23
DDG4ProductionCuts
Definition: DDG4ProductionCuts.h:15
cms::DDG4Builder
Definition: DD4hep_DDG4Builder.h:23
edm::check
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts)
Definition: GetProductCheckerOutputModule.cc:80
DDG4Builder
Definition: DDG4Builder.h:23
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dd4hep
Definition: DDPlugins.h:8
cms::DDDetector
Definition: DDDetector.h:12
cms::DDCompactView
Definition: DDCompactView.h:31
DDDWorld::~DDDWorld
~DDDWorld()
Definition: DDDWorld.cc:70
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
DDG4Builder.h
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:34