CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDDWorld.cc
Go to the documentation of this file.
3 
6 
7 #include "G4RunManagerKernel.hh"
8 #include "G4PVPlacement.hh"
9 #include "G4TransportationManager.hh"
10 
11 using namespace edm;
12 
16  bool check) {
17 
18  std::auto_ptr<DDG4Builder> theBuilder(new DDG4Builder(cpv, check));
19 
20  DDGeometryReturnType ret = theBuilder->BuildGeometry();
21  G4LogicalVolume * world = ret.logicalVolume();
22 
23  m_world = new G4PVPlacement(0,G4ThreeVector(),world,"DDDWorld",0,false,0);
24  SetAsWorld(m_world);
25  map = ret.lvToDDLPMap();
26  catalog = ret.sdCatalog();
27 }
28 
30 
31 void DDDWorld::SetAsWorld(G4VPhysicalVolume * pv) {
32  G4RunManagerKernel * kernel = G4RunManagerKernel::GetRunManagerKernel();
33  if(kernel) kernel->DefineWorldVolume(pv);
34  else edm::LogError("SimG4CoreGeometry") << "No G4RunManagerKernel?";
35  edm::LogInfo("SimG4CoreGeometry") << " World volume defined ";
36 }
37 
38 void DDDWorld::WorkerSetAsWorld(G4VPhysicalVolume * pv) {
39  G4RunManagerKernel * kernel = G4RunManagerKernel::GetRunManagerKernel();
40  if(kernel) {
41  kernel->WorkerDefineWorldVolume(pv);
42  // The following does not get done in WorkerDefineWorldVolume()
43  // because we don't use G4MTRunManager
44  G4TransportationManager* transM = G4TransportationManager::GetTransportationManager();
45  transM->SetWorldForTracking(pv);
46  }
47  else edm::LogError("SimG4CoreGeometry") << "No G4RunManagerKernel?";
48  edm::LogInfo("SimG4CoreGeometry") << " World volume defined (for worker) ";
49 }
50 
tuple ret
prodAgent to be discontinued
static void SetAsWorld(G4VPhysicalVolume *pv)
Definition: DDDWorld.cc:31
type of data representation of DDCompactView
Definition: DDCompactView.h:90
G4LogicalVolume * logicalVolume() const
~DDDWorld()
Definition: DDDWorld.cc:29
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:38
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts)