diff --git a/DDExamples/ILDExSimu/CMakeLists.txt b/DDExamples/ILDExSimu/CMakeLists.txt index f5fc20735c4116af961c03f960d842fec382cfb4..faad5ea7613223b99750763488fdac95ba615b6e 100644 --- a/DDExamples/ILDExSimu/CMakeLists.txt +++ b/DDExamples/ILDExSimu/CMakeLists.txt @@ -1,12 +1,14 @@ cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR) -find_package(Geant4 REQUIRED) +find_package(Geant4 REQUIRED ui_all vis_all) ##---Handle the case CLHEP is not included in Geant4------------------------------ #if(NOT Geant4_clhep_FOUND) # find_package(CLHEP REQUIRED) # set(Geant4_INCLUDE_DIRS ${Geant4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}) # set(Geant4_LIBRARIES ${Geant4_LIBRARIES} ${CLHEP_LIBRARIES}) #endif() +INCLUDE(${Geant4_USE_FILE}) # this also takes care of geant 4 definitions and include dirs + find_package(LCIO REQUIRED) diff --git a/DDExamples/ILDExSimu/ILDExSimu.cpp b/DDExamples/ILDExSimu/ILDExSimu.cpp index 34b4ae80b70becd4b322038d924085e6d1c08d32..e3c3f458d9fdaf67b09223abd3ce6a95c53e5b51 100644 --- a/DDExamples/ILDExSimu/ILDExSimu.cpp +++ b/DDExamples/ILDExSimu/ILDExSimu.cpp @@ -108,21 +108,25 @@ int main(int argc,char** argv) G4UImanager* UImanager = G4UImanager::GetUIpointer(); - if ( argc!=1) { // batch mode + // if ( argc > 3 ) { // batch mode - G4String command = "/control/execute "; - G4String fileName = argv[argc-1]; - UImanager->ApplyCommand(command+fileName); + // G4String command = "/control/execute "; + // G4String fileName = argv[argc-1]; + // UImanager->ApplyCommand(command+fileName); - } else { // interactive mode : define UI session + // } else { // interactive mode : define UI session - G4UIsession *ui = new G4UIterminal(new G4UItcsh()); - // G4UIsession* ui = new G4UIQt(argc, argv); + //G4UIsession *ui = new G4UIterminal(new G4UItcsh()); + //G4UIsession* ui = new G4UIQt(argc, argv); + G4UIExecutive* ui = new G4UIExecutive(argc, argv); + + + ui->SessionStart(); // end ... delete ui; - } + //} // Job termination // Free the store: user actions, physics_list and detector_description are diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt index ed0fe8dd2b44c1a35458a12b78c836cb0c27b2b8..d8f198ef2b07929755fb6992cf9c1a9ce7d95e40 100644 --- a/DDG4/CMakeLists.txt +++ b/DDG4/CMakeLists.txt @@ -1,6 +1,6 @@ #---Find Geant4------------------------------------------------------------------- -find_package(Geant4 REQUIRED) +find_package(Geant4 REQUIRED gdml ui_all vis_all) #if(NOT Geant4_clhep_FOUND) # find_package(CLHEP REQUIRED) # set(Geant4_INCLUDE_DIRS ${Geant4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}) @@ -42,4 +42,4 @@ install(TARGETS DD4hepG4 LIBRARY DESTINATION lib ) # to do: add corresponding uninstall... -#------------------------------------------------------- \ No newline at end of file +#------------------------------------------------------- diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index c0b285c1648f416a7a8819dfedd5e5845ff827e6..5c4aab8af1bbd68d9f9eadbdde8877282c537f07 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -81,6 +81,7 @@ using namespace DD4hep::Geometry; using namespace DD4hep; using namespace std; + namespace { static TGeoNode* s_topPtr; static string indent = ""; @@ -381,6 +382,18 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume } if ( vis.isValid() ) { vis_attr = (G4VisAttributes*)handleVis(vis.name(),vis.ptr()); + + if( std::string(vis.name()) == "WorldVis" ){ + + printout(INFO,"Geant4Converter","************** vis.name() == \"WorldVis\" " ) ; + vis_attr->SetVisibility(true) ; + } + + printout(INFO,"Geant4Converter","************** (G4VisAttributes*)handleVis( %s , 0x%x ) = %d ", vis.name() , + vis.ptr(), vis_attr->IsVisible() ) ; + + + } Region reg = _v.region(); G4Region* region = 0;