CMS 3D CMS Logo

DDDWorld.cc
Go to the documentation of this file.
3 
6 
7 #include "G4PVPlacement.hh"
8 #include "G4RunManagerKernel.hh"
9 #include "G4TransportationManager.hh"
10 
11 using namespace edm;
12 
16  bool check) {
17  std::unique_ptr<DDG4Builder> theBuilder(new DDG4Builder(cpv, check));
18 
19  DDGeometryReturnType ret = theBuilder->BuildGeometry();
20  G4LogicalVolume *world = ret.logicalVolume();
21 
22  m_world = new G4PVPlacement(nullptr, G4ThreeVector(), world, "DDDWorld", nullptr, false, 0);
23  SetAsWorld(m_world);
24  map = ret.lvToDDLPMap();
25  catalog = ret.sdCatalog();
26 }
27 
29 
30 void DDDWorld::SetAsWorld(G4VPhysicalVolume *pv) {
31  G4RunManagerKernel *kernel = G4RunManagerKernel::GetRunManagerKernel();
32  if (kernel)
33  kernel->DefineWorldVolume(pv);
34  else
35  edm::LogError("SimG4CoreGeometry") << "No G4RunManagerKernel?";
36  edm::LogInfo("SimG4CoreGeometry") << " World volume defined ";
37 }
38 
39 void DDDWorld::WorkerSetAsWorld(G4VPhysicalVolume *pv) {
40  G4RunManagerKernel *kernel = G4RunManagerKernel::GetRunManagerKernel();
41  if (kernel) {
42  kernel->WorkerDefineWorldVolume(pv);
43  // The following does not get done in WorkerDefineWorldVolume()
44  // because we don't use G4MTRunManager
45  G4TransportationManager *transM = G4TransportationManager::GetTransportationManager();
46  transM->SetWorldForTracking(pv);
47  } else
48  edm::LogError("SimG4CoreGeometry") << "No G4RunManagerKernel?";
49  edm::LogInfo("SimG4CoreGeometry") << " World volume defined (for worker) ";
50 }
static void SetAsWorld(G4VPhysicalVolume *pv)
Definition: DDDWorld.cc:30
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
G4LogicalVolume * logicalVolume() const
~DDDWorld()
Definition: DDDWorld.cc:28
def pv(vc)
Definition: MetAnalyzer.py:7
DDDWorld(const DDCompactView *, G4LogicalVolumeToDDLogicalPartMap &, SensitiveDetectorCatalog &, bool check=false)
Definition: DDDWorld.cc:13
SensitiveDetectorCatalog sdCatalog() const
G4LogicalVolumeToDDLogicalPartMap lvToDDLPMap() const
static void WorkerSetAsWorld(G4VPhysicalVolume *pv)
Definition: DDDWorld.cc:39
HLT enums.
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts)