ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MMDetectorConstruction.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MMDetectorConstruction.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
11 #include "G4GDMLParser.hh"
12 #include "TGeoManager.h"
13 
15  : G4VUserDetectorConstruction(), m_tgeoNode(nullptr), m_gdmlFile(nullptr) {}
16 
18  if (m_tgeoNode) {
19  // Import geometry from Root to VGM
20  /* RootGM::Factory rtFactory;
21  rtFactory.SetDebug(1);
22  rtFactory.Import(m_tgeoNode);
23 
24  // Export VGM geometry to Geant4
25  Geant4GM::Factory g4Factory;
26  g4Factory.SetDebug(1);
27  rtFactory.Export(&g4Factory);
28  G4VPhysicalVolume* world = g4Factory.World();
29  return world;*/
30  return nullptr;
31  } else if (m_gdmlFile) {
33  parser.Read(*m_gdmlFile);
34  return parser.GetWorldVolume();
35  } else
36  return nullptr; // and error Message
37 }
38 
40  m_tgeoNode = tgeoNode;
41 }
42 
44  m_gdmlFile = new std::string(gdmlFile);
45 }