ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
9
#include "
ACTFW/Plugins/Geant4/MMDetectorConstruction.hpp
"
10
11
#include "
G4GDMLParser.hh
"
12
#include "TGeoManager.h"
13
14
FW::Geant4::MMDetectorConstruction::MMDetectorConstruction
()
15
:
G4VUserDetectorConstruction
(), m_tgeoNode(nullptr), m_gdmlFile(nullptr) {}
16
17
G4VPhysicalVolume
*
FW::Geant4::MMDetectorConstruction::Construct
() {
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) {
32
G4GDMLParser
parser
;
33
parser.
Read
(*m_gdmlFile);
34
return
parser.
GetWorldVolume
();
35
}
else
36
return
nullptr
;
// and error Message
37
}
38
39
void
FW::Geant4::MMDetectorConstruction::setTGeoGeometry
(TGeoNode* tgeoNode) {
40
m_tgeoNode = tgeoNode;
41
}
42
43
void
FW::Geant4::MMDetectorConstruction::setGdmlInput
(std::string gdmlFile) {
44
m_gdmlFile =
new
std::string(gdmlFile);
45
}
acts
blob
master
Examples
Algorithms
Geant4
src
MMDetectorConstruction.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration