diff --git a/DDParsersStandAlone/CMakeLists.txt b/DDParsersStandAlone/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..679a774b46fff48208b2f786f7a51227a1d6524b --- /dev/null +++ b/DDParsersStandAlone/CMakeLists.txt @@ -0,0 +1,76 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/../cmake ) +# +include ( DD4hepBuild ) +# + +#------------- set the default installation directory to be the source directory + +IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + SET( CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE PATH + "install prefix path - overwrite with -D CMAKE_INSTALL_PREFIX = ..." + FORCE ) + MESSAGE(STATUS "CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX} - overwrite with -D CMAKE_INSTALL_PREFIX" ) +ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +# +#---Options------------------------------------------------------------------------- +option(DD4HEP_USE_CXX14 "Build DD4hep using c++14" OFF) +option(CMAKE_MACOSX_RPATH "Build with rpath on macos" ON) +# +#----------------------------------------------------------------------------------------------------- +# +# project version (Major,minor,patch) +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !! Use the same version numbers in DDSegmentation/CMakeLists.txt !! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# +# project version +SET( DD4hep_VERSION_MAJOR 0 ) +SET( DD4hep_VERSION_MINOR 24 ) +SET( DD4hep_VERSION_PATCH 0 ) + +dd4hep_set_version(DD4hep + MAJOR ${DD4hep_VERSION_MAJOR} + MINOR ${DD4hep_VERSION_MINOR} + PATCH ${DD4hep_VERSION_PATCH} ) + +dd4hep_configure_output( OUTPUT "${PROJECT_BINARY_DIR}" INSTALL "${CMAKE_INSTALL_PREFIX}" ) +# +# Include ROOT +# +find_package ( ROOT REQUIRED COMPONENTS Geom GenVector) +find_package ( ROOT REQUIRED) +include(${ROOT_USE_FILE}) +message ( STATUS "ROOT_VERSION: ${ROOT_VERSION}" ) + +#--------------------------------------------------------------------------------------------------- +dd4hep_set_compiler_flags() +# +include(DD4hep) +include(DD4hepMacros) +#---Packages------------------------------------------------------------------------ +add_subdirectory(DDParsers) +# +#---Configuration------------------------------------------------------------------- +# ----for APPLE scripts have to set the DYLD_LIBRARY_PATH +if( APPLE ) + set( USE_DYLD 1) + set(CMAKE_MACOSX_RPATH 1) +endif() +#----------------------------------------------------------------------------------- +display_std_variables() + +############################################################################## +# generate and install following configuration files +#dd4hep_generate_package_configuration_files( DD4hepConfig.cmake ) +if(APPLE) + SET ( ENV{DD4HEP_LIBRARY_PATH} $ENV{DYLD_LIBRARY_PATH} ) +else() + SET ( ENV{DD4HEP_LIBRARY_PATH} ${LD_LIBRARY_PATH} ) + SET ( DD4HEP_LIBRARY_PATH ${LD_LIBRARY_PATH} ) +endif() + +if(APPLE) + fill_dd4hep_library_path() + message(STATUS "DD4HEP_LIBRARY_PATH= $ENV{DD4HEP_LIBRARY_PATH}") +endif() diff --git a/DDParsersStandAlone/DDParsers b/DDParsersStandAlone/DDParsers new file mode 120000 index 0000000000000000000000000000000000000000..a5371ef31d258da4c9f8fdb82a91e494fe4e3a02 --- /dev/null +++ b/DDParsersStandAlone/DDParsers @@ -0,0 +1 @@ +../DDParsers \ No newline at end of file diff --git a/examples/ClientTests/src/MaterialTester_geo.cpp b/examples/ClientTests/src/MaterialTester_geo.cpp index cbf4135535e39bf76422ec2252747dfa4be742f0..53b32c25fe4532b24c8cf5636334ec457755cdd0 100644 --- a/examples/ClientTests/src/MaterialTester_geo.cpp +++ b/examples/ClientTests/src/MaterialTester_geo.cpp @@ -1,11 +1,16 @@ -// $Id: ILDExVXD_geo.cpp 673 2013-08-05 10:01:33Z gaede $ -//==================================================================== +//========================================================================== // AIDA Detector description implementation -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== + // Framework include files #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" @@ -26,26 +31,28 @@ static Ref_t create_element(Detector& description, xml_h xml_det, SensitiveDetec for(xml_coll_t k(x_det,_Unicode(test)); k; ++k) { xml_comp_t c = k; Material mat = description.material(c.nameStr()); - TGeoMaterial* m = mat->GetMaterial(); + TGeoMaterial* material = mat->GetMaterial(); printout(INFO,det_name,"+++ Material:%s [%p, %p] Z=%6.2f A=%6.2f D=%9.4f [g/cm3]", - m->GetName(), mat.ptr(), m, m->GetZ(), m->GetA(), m->GetDensity()); + material->GetName(), mat.ptr(), m, material->GetZ(), + material->GetA(), material->GetDensity()); printout(INFO,det_name,"+++ Radiation Length:%9.4f Interaction length:%9.4f Mixture:%s", - m->GetRadLen(), m->GetIntLen(), yes_no(m->IsMixture())); + material->GetRadLen(), material->GetIntLen(), + yes_no(material->IsMixture())); printout(INFO,det_name,"+++ Elements:%d Index:%d", - m->GetNelements(), m->GetIndex()); - for(Int_t i=0, n=m->GetNelements(); i<n; ++i) { - TGeoElement* e = m->GetElement(i); + material->GetNelements(), material->GetIndex()); + for(Int_t i=0, n=material->GetNelements(); i<n; ++i) { + TGeoElement* e = material->GetElement(i); Double_t a=0., z=0., w=0.; - m->GetElementProp(a,z,w,i); + material->GetElementProp(a,z,w,i); printout(INFO,det_name,"+++ ELT[%02d]: %s Z=%3d N=%3d N_eff=%7.2f A=%6.2f Weight=%9.4f ", - i, e->GetName(), e->Z(), e->N(), e->Neff(), e->A(), w); - if ( m->IsMixture() ) { - TGeoMixture* mix = (TGeoMixture*)m; - Int_t* nmix = mix->GetNmixt(); - Double_t* wmix = mix->GetWmixt(); - printout(INFO,det_name,"+++ Zmix:%7.3f Nmix:%3d Amix:%7.3f Wmix:%7.3f", - mix->GetZmixt()[i],nmix ? nmix[i] : -1, - mix->GetAmixt()[i],wmix ? wmix[i] : -1e0); + i, e->GetName(), e->Z(), e->N(), e->Neff(), e->A(), w); + if ( material->IsMixture() ) { + TGeoMixture* mix = (TGeoMixture*)m; + Int_t* nmix = mix->GetNmixt(); + Double_t* wmix = mix->GetWmixt(); + printout(INFO,det_name,"+++ Zmix:%7.3f Nmix:%3d Amix:%7.3f Wmix:%7.3f", + mix->GetZmixt()[i],nmix ? nmix[i] : -1, + mix->GetAmixt()[i],wmix ? wmix[i] : -1e0); } } } diff --git a/examples/ClientTests/src/MiniTel.cpp b/examples/ClientTests/src/MiniTel.cpp index ccdabbd8426eaf6dccfe2aced53498eb7c6e60d7..366afe2d105fabd1753579c4acd68800fbb4953a 100644 --- a/examples/ClientTests/src/MiniTel.cpp +++ b/examples/ClientTests/src/MiniTel.cpp @@ -1,3 +1,16 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +// Author : M.Frank/M.Clemencic +// +//========================================================================== + // Include files #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" diff --git a/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp b/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp index 5af5d2443ed748821465378a5c39aa964ad103b5..b8d12d118df00f692b99e35e5a7c646edc8bd0e3 100644 --- a/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp +++ b/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp @@ -1,11 +1,16 @@ -// $Id: PolyhedraBarrelCalorimeter2_geo.cpp 784 2013-09-19 20:05:24Z markus.frank@cern.ch $ -//==================================================================== +//========================================================================== // AIDA Detector description implementation -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== + #include "DD4hep/DetFactoryHelper.h" #include "XML/Layering.h" #include <limits>