diff --git a/CMakeLists.txt b/CMakeLists.txt index da6e7f5621fba8007615ff8e29da7e22f0ca9fa7..60e26872c2cf5f423886dc037b844e0d42bb832f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,14 +19,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) find_package (ROOT REQUIRED) include(${ROOT_USE_FILE}) -#---------------------------------------------------------------------------- -# Find CADMesh -find_package(cadmesh) -include_directories(${CADMESH_INCLUDE_DIRS}) -if(CADMESH_INCLUDE_DIRS) - add_definitions(-DCADMESH) -endif() - #---------------------------------------------------------------------------- # Setup Geant4 include directories and compile definitions # @@ -44,7 +36,7 @@ file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) # Add the executable, and link it to the Geant4 libraries # add_executable(lightGuide lightGuide.cc ${sources} ${headers}) -target_link_libraries(lightGuide ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} cadmesh ) +target_link_libraries(lightGuide ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ) add_executable(plotHisto ${DEPENDENCIES} Analysis/plotHisto.cc) TARGET_LINK_LIBRARIES(plotHisto ${ROOT_LIBRARIES}) diff --git a/include/DetectorConstruction.hh b/include/DetectorConstruction.hh index 935c319e905922546e05792acb6a9cf791c01846..b2787d5f4acacd87e25877368e72908723557d8c 100644 --- a/include/DetectorConstruction.hh +++ b/include/DetectorConstruction.hh @@ -40,10 +40,6 @@ #include "G4GDMLParser.hh" #include "G4RunManager.hh" -#ifdef CADMESH -#include "CADMesh.hh" -#endif - #include "Materials.hh" #include "DetectorMessenger.hh" @@ -80,10 +76,6 @@ class DetectorConstruction : public G4VUserDetectorConstruction G4LogicalVolume* m_logicHalfWorld; G4VPhysicalVolume* m_physHalfWorld; - #ifdef CADMESH - CADMesh* m_mesh; - #endif - G4LogicalVolume* m_logicLightGuide; G4VPhysicalVolume* m_physLightGuide; diff --git a/src/DetectorConstruction.cc b/src/DetectorConstruction.cc index 3e82d4f79e6b45c90ddf01d5c0b005797289f852..97bbbaf9c5f1b4a68bb8126a33a745288653f70d 100644 --- a/src/DetectorConstruction.cc +++ b/src/DetectorConstruction.cc @@ -74,10 +74,6 @@ DetectorConstruction::DetectorConstruction() m_filler = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR"); m_GasMPT = new G4MaterialPropertiesTable(); m_filler->SetMaterialPropertiesTable(m_GasMPT); - - #ifdef CADMESH - m_mesh = 0; - #endif } @@ -282,27 +278,17 @@ void DetectorConstruction::UseCADModel(G4String fileName){ if(m_logicLightGuide) delete m_logicLightGuide; if(m_physLightGuide) delete m_physLightGuide; - G4String fileType = fileName.substr( fileName.last('.') + 1, fileName.size() - fileName.last('.')); - - #ifdef CADMESH - if(fileType == "stl"){ - if(m_mesh != 0) delete m_mesh; - m_mesh = new CADMesh((char*) fileName.c_str()); - m_mesh->SetScale(mm); - m_mesh->SetOffset( G4ThreeVector(-20*cm, 0, 0) ); - m_mesh->SetReverse(false); - - m_logicLightGuide = - new G4LogicalVolume(m_mesh->TessellatedMesh(), //solid - materials->Al, //material - "LightGuide"); //name + G4String fileType; + if(fileName.last('.') != std::string::npos){ + fileType = fileName.substr( fileName.last('.') + 1, fileName.size() - fileName.last('.')); + }else{ + fileType = "geom"; } - #endif if(fileType == "gdml"){ m_Parser.Read(fileName); } - if(fileType == "step"){ + if(fileType == "geom"){ m_logicLightGuide = m_Parser.ParseST(fileName,materials->Air,materials->Al); }