diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index 797b58d9daf566eb16be6c4ff9ebc344daf41483..f599b421b82d7c8ea19649c0e8ef117f16967368 100644 --- a/DDCore/CMakeLists.txt +++ b/DDCore/CMakeLists.txt @@ -40,5 +40,15 @@ dd4hep_add_package_library ( DDCore OPTIONAL [BOOST SOURCES src/parsers/*.cpp] ) + +if ( ${ROOT_VERSION_MAJOR} GREATER 5 ) + dd4hep_add_regular_library(DD4hepGaudiPluginMgr + SOURCES src/pluginmgr/Gaudi.cpp + INCLUDE_DIRS ${GaudiPluginService_INCLUDE_DIRS} + LINK_LIBRARIES ${GaudiPluginService_LIBRARIES} + NODEFAULTS + ) +endif() + # Generate DDCore plugins--------------------------------------------------------- dd4hep_add_plugin ( DDCorePlugins SOURCES src/plugins/*.cpp ) diff --git a/DDCore/src/Plugins.cpp b/DDCore/src/Plugins.cpp index 8f8dcf495a14fef627ab8d836a5622d7c34bec52..ce715076407cab6b2f9e652f9b2a2a80582541c6 100644 --- a/DDCore/src/Plugins.cpp +++ b/DDCore/src/Plugins.cpp @@ -68,21 +68,64 @@ void PluginService::addFactory(const std::string&, void*, const std::type_info& #else // ROOT 6 #include "DD4hep/Printout.h" -#define private public -#include "Gaudi/PluginService.h" +#include "TSystem.h" + +namespace { + struct PluginInterface { + int (*getDebug)(); + int (*setDebug)(int new_value); + void* (*create)(const char* identifier, const char* signature); + void (*add)(const char* identifier, + void* creator_stub, + const char* signature, + const char* return_type); + PluginInterface(); + static PluginInterface& instance() { + static PluginInterface s_instance; + return s_instance; + } + }; + + template <typename T> + static inline T get_func(const char* plugin, const char* entry) { + PluginService::FuncPointer<Func_t> fun(gSystem->DynFindSymbol(plugin,entry)); + PluginService::FuncPointer<T> fp(fun.fptr.ptr); + if ( 0 == fp.fptr.ptr ) { + string err = "DD4hep:PluginService: Failed to access symbol " + "\""+string(entry)+"\" in plugin library "+string(plugin); + throw runtime_error(err); + } + return fp.fptr.fcn; + } -// Do not know yet what code to really put in there.....at least it presevers the interfaces and links + PluginInterface::PluginInterface() + : getDebug(0), setDebug(0), create(0), add(0) + { + const char* plugin_name = ::getenv("DD4HEP_PLUGINMGR"); + if ( 0 == plugin_name ) { + plugin_name = "libDD4hepGaudiPluginMgr"; + } + gSystem->Load(plugin_name); + + getDebug = get_func< int(*)() >(plugin_name,"dd4hep_pluginmgr_getdebug"); + setDebug = get_func< int (*)(int)>(plugin_name,"dd4hep_pluginmgr_getdebug"); + create = get_func< void* (*)(const char*, + const char*)>(plugin_name,"dd4hep_pluginmgr_create"); + add = get_func<void (*)(const char* identifier, + void* creator_stub, + const char* signature, + const char* return_type)>(plugin_name,"dd4hep_pluginmgr_add_factory"); + } +} /// Default constructor -PluginDebug::PluginDebug(int dbg) - : m_debug(0) { - m_debug = Gaudi::PluginService::Debug(); - Gaudi::PluginService::SetDebug(dbg); +PluginDebug::PluginDebug(int dbg) : m_debug(0) { + m_debug = PluginInterface::instance().setDebug(dbg); } /// Default destructor PluginDebug::~PluginDebug() { - Gaudi::PluginService::SetDebug(m_debug); + PluginInterface::instance().setDebug(m_debug); } /// Helper to check factory existence @@ -93,19 +136,18 @@ string PluginDebug::missingFactory(const string& name) const { } void* PluginService::getCreator(const std::string& id, const std::type_info& info) { - return Gaudi::PluginService::Details::getCreator(id, info.name()); + return PluginInterface::instance().create(id.c_str(), info.name()); } void PluginService::addFactory(const std::string& id, stub_t stub, const std::type_info& signature_type, const std::type_info& return_type) { - using namespace Gaudi::PluginService::Details; if ( PluginService::debug() ) { printout(INFO,"PluginService","+++ Declared factory[%s] with signature %s type:%s.", id.c_str(),signature_type.name(),return_type.name()); } - Registry::instance().add(id,stub,signature_type.name(),return_type.name(),id); + PluginInterface::instance().add(id.c_str(),stub,signature_type.name(),return_type.name()); } #endif @@ -119,4 +161,3 @@ DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*, const Geometry::GeoHandler*, const std::map<std::string,std::string>*)) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, ()) DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(void*, (const char*)) - diff --git a/DDCore/src/VolumeManager.cpp b/DDCore/src/VolumeManager.cpp index fcfa9bc3a1c00ea51a98efad8a7e1022ecfffe54..9391b3d3df6d708c29d81f1db930570b015f79dc 100644 --- a/DDCore/src/VolumeManager.cpp +++ b/DDCore/src/VolumeManager.cpp @@ -51,14 +51,15 @@ namespace { DetElement de = (*i).second; PlacedVolume pv = de.placement(); if (pv.isValid()) { + VolIDs ids; Chain chain; SensitiveDetector sd; - VolIDs ids; m_entries.clear(); scanPhysicalVolume(de, de, pv, ids, sd, chain); continue; } - printout(WARNING, "VolumeManager", "++ Detector element %s of type %s has no placement.", de.name(), de.type().c_str()); + printout(WARNING, "VolumeManager", "++ Detector element %s of type %s has no placement.", + de.name(), de.type().c_str()); } } /// Find a detector element below with the corresponding placement @@ -79,7 +80,9 @@ namespace { return DetElement(); } /// Scan a single physical volume and look for sensitive elements below - size_t scanPhysicalVolume(DetElement& parent, DetElement e, PlacedVolume pv, VolIDs ids, SensitiveDetector& sd, Chain& chain) { + size_t scanPhysicalVolume(DetElement& parent, DetElement e, PlacedVolume pv, + VolIDs ids, SensitiveDetector& sd, Chain& chain) + { TGeoNode* node = pv.ptr(); size_t count = 0; if (node) { @@ -88,7 +91,7 @@ namespace { VolIDs pv_ids = pv.volIDs(); ids.VolIDs::Base::insert(ids.end(), pv_ids.begin(), pv_ids.end()); bool got_readout = false; - if (vol.isSensitive()) { + if ( vol.isSensitive() ) { sd = vol.sensitiveDetector(); Readout ro = sd.readout(); if ( sd.isValid() && ro.isValid() ) { @@ -109,7 +112,7 @@ namespace { size_t cnt; PlacedVolume pv_dau = Ref_t(daughter); DetElement de_dau = findElt(e, daughter); - if (de_dau.isValid()) { + if ( de_dau.isValid() ) { Chain dau_chain; cnt = scanPhysicalVolume(parent, de_dau, pv_dau, ids, sd, dau_chain); } @@ -126,12 +129,15 @@ namespace { " [Internal error -- bad detector constructor]"); } } - if ( sd.isValid() ) { + if ( count == 0 ) { + sd = SensitiveDetector(0); + } + else if ( count > 0 && sd.isValid() ) { // We recuperate volumes from lower levels by reusing the subdetector // This only works if there is exactly one sensitive detector per subdetector! // I hate this, but I could not talk Frank out of this! M.F. Readout ro = sd.readout(); - if (ro.isValid()) { + if ( ro.isValid() ) { IDDescriptor iddesc = ro.idSpec(); pair<VolumeID, VolumeID> det_encoding = encoding(iddesc,ids); printout(VERBOSE,"VolumeManager","++++ %-11s SD:%s VolID=%p Mask=%p",e.path().c_str(), @@ -144,6 +150,8 @@ namespace { } return count; } + + /// Compute the encoding for a set of VolIDs within a readout descriptor pair<VolumeID, VolumeID> encoding(const IDDescriptor iddesc, const VolIDs& ids) const { VolumeID volume_id = 0, mask = 0; for (VolIDs::const_iterator i = ids.begin(); i != ids.end(); ++i) { @@ -156,7 +164,9 @@ namespace { } return make_pair(volume_id, mask); } - void add_entry(SensitiveDetector sd, DetElement parent, DetElement e, const TGeoNode* n, const VolIDs& ids, Chain& nodes) { + void add_entry(SensitiveDetector sd, DetElement parent, DetElement e, + const TGeoNode* n, const VolIDs& ids, Chain& nodes) + { Readout ro = sd.readout(); IDDescriptor iddesc = ro.idSpec(); pair<VolumeID, VolumeID> code = encoding(iddesc, ids); @@ -202,13 +212,15 @@ namespace { //if ( !sensitive ) return; ++s_count; stringstream log; - log << s_count << ": " << parent.name() << ": " << e.name() << " ro:" << ro.ptr() << " pv:" << n->GetName() << " id:" + log << s_count << ": " << parent.name() << ": " << e.name() + << " ro:" << ro.ptr() << " pv:" << n->GetName() << " id:" << (void*) volume_id << " : "; for (VolIDs::const_iterator i = ids.begin(); i != ids.end(); ++i) { const PlacedVolume::VolID& id = (*i); IDDescriptor::Field f = ro.idSpec().field(id.first); VolumeID value = f->value(volume_id); - log << id.first << "=" << id.second << "," << value << " [" << f->offset() << "," << f->width() << "] "; + log << id.first << "=" << id.second << "," << value + << " [" << f->offset() << "," << f->width() << "] "; } log << " Sensitive:" << yes_no(sensitive); printout(DEBUG, "VolumeManager", log.str().c_str()); @@ -277,8 +289,8 @@ VolumeManager VolumeManager::addSubdetector(DetElement det, Readout ro) { VolumeManager m = (*i).second; IDDescriptor::Field field = ro.idSpec().field(id.first); if (!field) { - throw runtime_error( - "DD4hep: VolumeManager::addSubdetector: IdDescriptor of " + string(det.name()) + " has no field " + id.first); + throw runtime_error("DD4hep: VolumeManager::addSubdetector: IdDescriptor of " + + string(det.name()) + " has no field " + id.first); } Object& mo = m._data(); mo.top = o.top; @@ -308,9 +320,11 @@ VolumeManager VolumeManager::subdetector(VolumeID id) const { if (sys_id == mo.sysID) return (*j).second; } - throw runtime_error("DD4hep: VolumeManager::subdetector(VolID): Attempt to access unknown subdetector section."); + throw runtime_error("DD4hep: VolumeManager::subdetector(VolID): " + "Attempt to access unknown subdetector section."); } - throw runtime_error("DD4hep: VolumeManager::subdetector(VolID): Cannot assign ID descriptor [Invalid Manager Handle]"); + throw runtime_error("DD4hep: VolumeManager::subdetector(VolID): " + "Cannot assign ID descriptor [Invalid Manager Handle]"); } /// Access the top level detector element @@ -448,10 +462,12 @@ VolumeManager::Context* VolumeManager::lookupContext(VolumeID volume_id) const { } } stringstream err; - err << "VolumeManager::lookupContext: Failed to search Volume context [Unknown identifier]" << (void*) volume_id; + err << "VolumeManager::lookupContext: Failed to search Volume context [Unknown identifier]" + << (void*) volume_id; throw runtime_error("DD4hep: " + err.str()); } - throw runtime_error("DD4hep: VolumeManager::lookupContext: Failed to search Volume context [Invalid Manager Handle]"); + throw runtime_error("DD4hep: VolumeManager::lookupContext: " + "Failed to search Volume context [Invalid Manager Handle]"); } /// Lookup a physical (placed) volume identified by its 64 bit hit ID @@ -486,15 +502,18 @@ std::ostream& DD4hep::Geometry::operator<<(std::ostream& os, const VolumeManager //bool hasTop = (o.flags & VolumeManager::ONE) == VolumeManager::ONE; //bool isSdet = (o.flags & VolumeManager::TREE) == VolumeManager::TREE && top != &o; string prefix(isTop ? "" : "++ "); - os << prefix << (isTop ? "TOP Level " : "Secondary ") << "Volume manager:" << &o << " " << o.detector.name() << " IDD:" - << o.id.toString() << " SysID:" << (void*) o.sysID << " " << o.managers.size() << " subsections " << o.volumes.size() + os << prefix << (isTop ? "TOP Level " : "Secondary ") << "Volume manager:" + << &o << " " << o.detector.name() << " IDD:" + << o.id.toString() << " SysID:" << (void*) o.sysID << " " + << o.managers.size() << " subsections " << o.volumes.size() << " placements "; if (!(o.managers.empty() && o.volumes.empty())) os << endl; for (VolumeManager::Volumes::const_iterator i = o.volumes.begin(); i != o.volumes.end(); ++i) { const VolumeManager::Context* c = (*i).second; PlacedVolume pv = c->placement; - os << prefix << "PV:" << setw(32) << left << pv.name() << " id:" << setw(18) << left << (void*) c->identifier << " mask:" + os << prefix << "PV:" << setw(32) << left << pv.name() + << " id:" << setw(18) << left << (void*) c->identifier << " mask:" << setw(18) << left << (void*) c->mask << endl; } for (VolumeManager::Managers::const_iterator i = o.managers.begin(); i != o.managers.end(); ++i) diff --git a/DDCore/src/pluginmgr/Gaudi.cpp b/DDCore/src/pluginmgr/Gaudi.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abd8a8bc3347abd262e6eb5fc5df87cfd829ffc1 --- /dev/null +++ b/DDCore/src/pluginmgr/Gaudi.cpp @@ -0,0 +1,24 @@ +#define private public +#include "Gaudi/PluginService.h" + +extern "C" { + /// Access debug level + int dd4hep_pluginmgr_getdebug() { + return (int)Gaudi::PluginService::Debug(); + } + /// Set debug level + int dd4hep_pluginmgr_setdebug(int value) { + int debug = dd4hep_pluginmgr_getdebug(); + Gaudi::PluginService::SetDebug(value); + return debug; + } + /// Access factory by name + void* dd4hep_pluginmgr_create(const char* id, const char* sig) { + return Gaudi::PluginService::Details::getCreator(id, sig); + } + /// Add a new factory to the registry + void dd4hep_pluginmgr_add_factory(const char* id, void* stub, const char* sig, const char* ret) { + Gaudi::PluginService::Details::Registry::instance().add(id,stub,sig,ret,id); + } +} + diff --git a/UtilityApps/CMakeLists.txt b/UtilityApps/CMakeLists.txt index 461840bc45cfb09a64afc6e77ec511784fee269c..e0962680774ec92b2b55dabc02b9e9aa20618b38 100644 --- a/UtilityApps/CMakeLists.txt +++ b/UtilityApps/CMakeLists.txt @@ -29,13 +29,15 @@ dd4hep_add_executable(test_surfaces USES DDRec DDTest OPTIONAL [LCIO REQUIRED SOURCES src/test_surfaces.cpp]) #----------------------------------------------------------------------------------- -dd4hep_add_dictionary( G__teve SOURCES src/EvNavHandler.h LINKDEF src/LinkDef.h ) +dd4hep_add_dictionary( G__teve + SOURCES src/EvNavHand*.h + LINKDEF src/LinkDef.h ) #----------------------------------------------------------------------------------- -dd4hep_add_executable( teveLCIO +dd4hep_add_executable( teveDisplay USES [ROOT REQUIRED COMPONENTS TEve] DDRec - OPTIONAL [LCIO REQUIRED SOURCES src/teve_display.cpp src/next_event_lcio.cpp G__teve.cxx] ) + SOURCES src/teve_display.cpp src/next_event_dummy.cpp G__teve.cxx +) #----------------------------------------------------------------------------------- -dd4hep_add_executable( teveDisplay +dd4hep_add_executable( teveLCIO USES [ROOT REQUIRED COMPONENTS TEve] DDRec - SOURCES src/teve_display.cpp src/next_event_dummy.cpp - GENERATED G__teve.cxx ) + OPTIONAL [LCIO REQUIRED SOURCES src/teve_display.cpp src/next_event_lcio.cpp G__teve.cxx] ) diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index bede9e66a12ea2ce3afad25a8f7c23b0924fb087..398b56991d8df184684dd9b66c59e39f2c2e65b1 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -852,7 +852,7 @@ endfunction() # #--------------------------------------------------------------------------------------------------- function( dd4hep_add_library binary building ) - cmake_parse_arguments ( ARG "" "" "SOURCES;GENERATED;LINK_LIBRARIES;INCLUDE_DIRS;USES;OPTIONAL;DEFINITIONS;PRINT" ${ARGN} ) + cmake_parse_arguments ( ARG "NODEFAULTS" "" "SOURCES;GENERATED;LINK_LIBRARIES;INCLUDE_DIRS;USES;OPTIONAL;DEFINITIONS;PRINT" ${ARGN} ) dd4hep_package_properties( pkg PKG_NAME enabled ) set ( tag "Library[${pkg}] -> ${binary}" ) if ( NOT "${ARG_PRINT}" STREQUAL "" ) @@ -872,10 +872,15 @@ function( dd4hep_add_library binary building ) if ( NOT "${optional_missing}" STREQUAL "" ) dd4hep_print ( "|++> ${tag} (optional) skipped. Missing dependency: ${optional_missing}" ) else() - dd4hep_use_package( "${tag}" PACKAGE LOCAL - USES ${ARG_USES} ${optional_uses} - OPTIONAL ${ARG_OPTIONAL} ) - + if ( ${ARG_NODEFAULTS} ) + set ( LOCAL_LINK_LIBRARIES ) + set ( LOCAL_LINK_LIBRARIES ) + set ( LOCAL_DEFINITIONS ) + else() + dd4hep_use_package( "${tag}" PACKAGE LOCAL + USES ${ARG_USES} ${optional_uses} + OPTIONAL ${ARG_OPTIONAL} ) + endif() if ( NOT "${LOCAL_MISSING}" STREQUAL "" ) dd4hep_print ( "|++> ${tag} skipped. Missing dependency: ${missing}" ) endif() @@ -923,6 +928,30 @@ function( dd4hep_add_library binary building ) set ( ${building} ${building_binary} PARENT_SCOPE ) endfunction(dd4hep_add_library) +#--------------------------------------------------------------------------------------------------- +# dd4hep_add_regular_library +# +# Arguments -> See function dd4hep_add_library +# +# \author M.Frank +# \version 1.0 +# +#--------------------------------------------------------------------------------------------------- +function( dd4hep_add_regular_library library ) + dd4hep_package_properties( pkg PKG enabled ) + set ( tag "Package library[${pkg}] -> ${library}" ) + if ( "${enabled}" STREQUAL "OFF" ) + dd4hep_skipmsg ( "${tag} DISBALED -- package is not built!" ) + else() + dd4hep_add_library( ${library} building ${ARGN} PRINT ${tag} ) + if ( "${building}" STREQUAL "ON" ) + dd4hep_debug ( "add_package_library -> ${library} ${PKG}_LIBRARIES:${pkg_libs}" ) + else() + dd4hep_fatal ( "Package library[${pkg}] -> ${binary} Cannot be built! This is an ERROR condition." ) + endif() + endif() +endfunction(dd4hep_add_regular_library) + #--------------------------------------------------------------------------------------------------- # dd4hep_add_package_library # @@ -1145,8 +1174,13 @@ function( dd4hep_add_dictionary dictionary ) # add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h COMMAND ${ROOTCINT_EXECUTABLE} -cint -f ${dictionary}.cxx - -c -p ${ARG_OPTIONS} ${comp_defs} ${inc_dirs} ${headers} ${linkdefs} + -s ${CMAKE_CURRENT_BINARY_DIR}/../lib/${dictionary} -c -p ${ARG_OPTIONS} ${comp_defs} ${inc_dirs} ${headers} ${linkdefs} DEPENDS ${headers} ${linkdefs} ) + # Install the binary to the destination directory + if ( ${ROOT_VERSION_MAJOR} GREATER 5 ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/../lib/${dictionary}_rdict.pcm PROPERTIES GENERATED TRUE ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../lib/${dictionary}_rdict.pcm DESTINATION lib) + endif() set_source_files_properties( ${dictionary}.h ${dictionary}.cxx PROPERTIES GENERATED TRUE ) endif() endfunction() diff --git a/doc/release.notes b/doc/release.notes index ea5ddcfc86a36931feecb3f4a8c74eef7e256d94..a8f639f051e93afa3727d665163fe0f027220605 100644 --- a/doc/release.notes +++ b/doc/release.notes @@ -3,21 +3,11 @@ DD4hep ---- Release Notes ================================= -2015-08-19 N.Nikiforou ------------------------ - - DDRec/DetectorData.h: added new variables to LayeredCalorimeterStruct/Layer: - - inner_nRadiationLengths, inner_nInteractionLengths and inner_thickness : - Number of Radiation Lengths, number of Interaction Lengths and thickness summing - up from innermost layer face (closest to the IP) up to the center of the - sensitive element - - outer_nRadiationLengths, outer_nInteractionLengths and outer_thickness : - Similarly, summing up from center of sensitive volume up to the outermost - face of the layer - - sensitive_thickness: Thickness of sensitive element in layer - - The variables "absorberThickness" and "thickness" are now DEPRECATED - - The variable "distance" is understood to contain the distance from the IP or - the Z axis to the innermost face of the layer. - - DDRec/createGearForCLIC.cpp: Made compatible with new DDRec structure +2015-08-20 M.Frank + - DDCore: Modularize/abstract plugin manager + - VolumeManager: Fix bug propagating sensitive detectors + Showed up in the examples of nested detectors + 2015-08-12 N.Nikiforou ----------------------- diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt index 69b036d67c53dedd5f007da2d26af33f4f433178..aec504d952538a5f538579a025fdfda5fe99258b 100644 --- a/examples/ClientTests/CMakeLists.txt +++ b/examples/ClientTests/CMakeLists.txt @@ -26,7 +26,7 @@ dd4hep_install_dir( compact scripts DESTINATION ${DD4hep_DIR}/examples/ClientTes dd4hep_configure_scripts( ClientTests DEFAULT_SETUP WITH_TESTS) #*** Testing ********************************************************************* -foreach (test Assemblies BoxTrafos IronCylinder LheD_tracker MagnetFields MaterialTester MiniTel SectorBarrelCalorimeter SiliconBlock NestedDetectors ) +foreach (test Assemblies BoxTrafos IronCylinder LheD_tracker MagnetFields MaterialTester MiniTel SectorBarrelCalorimeter SiliconBlock NestedSimple NestedDetectors ) foreach( type lcdd gdml vis ) dd4hep_add_test_reg( ClientTests_converter_${type}_${test} COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" diff --git a/examples/ClientTests/compact/NestedDetectors.xml b/examples/ClientTests/compact/NestedDetectors.xml index e0d86bfe7207d29d042fa1ad6c647aad4ca13673..745335a1079622db9b9aafc6abb730cb92ea3daf 100644 --- a/examples/ClientTests/compact/NestedDetectors.xml +++ b/examples/ClientTests/compact/NestedDetectors.xml @@ -58,6 +58,7 @@ <comment>Silicon Tracker Assembly</comment> <composite name="SiTrackerBarrel"/> <composite name="SiVertexBarrel"/> + <composite name="NestedSolenoid"/> </detector> </detectors> @@ -66,4 +67,6 @@ <include ref="${SiD_dir}/SiD_VertexConfig.xml"/> <include ref="${SiD_dir}/SiD_VertexBarrel.xml"/> + <include ref="NestedSolenoid.xml"/> + </lccdd> diff --git a/examples/ClientTests/compact/NestedSimple.xml b/examples/ClientTests/compact/NestedSimple.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0d86bfe7207d29d042fa1ad6c647aad4ca13673 --- /dev/null +++ b/examples/ClientTests/compact/NestedSimple.xml @@ -0,0 +1,69 @@ +<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd"> + + <info name="Nested_Detectors_test" + title="Test for nested detector descriptions" + author="Markus Frank" + url="None" + status="development" + version="$Id: compact.xml 1374 2014-11-05 10:49:55Z markus.frank@cern.ch $"> + <comment>Test for nested detector descriptions</comment> + </info> + + <includes> + <gdmlFile ref="${DDDetectors_dir}/elements.xml"/> + <gdmlFile ref="${DDDetectors_dir}/materials.xml"/> + </includes> + + <define> + <constant name="DDDetectors_dir" value="${DD4hepINSTALL}/DDDetectors/compact" type="string"/>; + <constant name="SiD_dir" value="${DDDetectors_dir}/SiD" type="string"/>; + <constant name="world_side" value="30000*mm"/> + <constant name="world_x" value="world_side"/> + <constant name="world_y" value="world_side"/> + <constant name="world_z" value="world_side"/> + + <constant name="VertexBarrel_ID" value="1"/> + <constant name="VertexBarrel_zmax" value="10.0*cm"/> + <constant name="VertexBarrel_r1" value="2.7*cm"/> + <constant name="VertexBarrel_r2" value="3.8*cm"/> + <constant name="VertexBarrel_r3" value="5.1*cm"/> + <constant name="VertexBarrel_r4" value="6.4*cm"/> + <constant name="VertexBarrel_r5" value="7.7*cm"/> + + <constant name="SiTrackerBarrel_ID" value="3"/> + + <constant name="tracker_region_rmax" value="world_side"/> + <constant name="tracker_region_zmax" value="world_side"/> + + </define> + + <limits><limitset name="SiTrackerBarrelRegionLimitSet"/></limits> + <regions><region name="SiTrackerBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001"/></regions> + + <comment>Common Generic visualization attributes</comment> + <display> + <vis name="InvisibleNoDaughters" showDaughters="false" visible="false"/> + <vis name="InvisibleWithDaughters" showDaughters="true" visible="false"/> + <vis name="BlueVis" alpha="1" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/> + <vis name="BlueVisTrans" alpha="0.1" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/> + </display> + + <comment>Tracking detectors</comment> + <detectors> + <detector id="99" name="SiTrackers" type="DD4hep_SubdetectorAssembly" vis="BlueVisTrans"> + <shape name="SiTrackersEnv" type="Tube" rmin="0*mm" rmax="2500*mm" dz="2200*mm" material="Air"> + </shape> + <comment>Silicon Tracker Assembly</comment> + <composite name="SiTrackerBarrel"/> + <composite name="SiVertexBarrel"/> + </detector> + </detectors> + + <include ref="${SiD_dir}/SiD_TrackerConfig.xml"/> + <include ref="${SiD_dir}/SiD_TrackerBarrel.xml"/> + + <include ref="${SiD_dir}/SiD_VertexConfig.xml"/> + <include ref="${SiD_dir}/SiD_VertexBarrel.xml"/> +</lccdd> diff --git a/examples/ClientTests/compact/NestedSolenoid.xml b/examples/ClientTests/compact/NestedSolenoid.xml new file mode 100644 index 0000000000000000000000000000000000000000..d79333629d511b6291d6e6be8038ec554df87868 --- /dev/null +++ b/examples/ClientTests/compact/NestedSolenoid.xml @@ -0,0 +1,17 @@ +<lccdd> + + <display> + <vis name="VIS1" alpha="1" r="0" g="0.3" b="0.3" showDaughters="true" visible="true"/> + <vis name="VIS2" alpha="1" r="0" g="0.6" b="0.6" showDaughters="true" visible="true"/> + </display> + + <detectors> + <detector name="NestedSolenoid" type="DD4hep_MultiLayerTracker" insideTrackingVolume="false" reflect="true"> + <layer id="1" inner_r="1.8*m" outer_z="1.5*m" vis="VIS1"> + <slice material="Iron" thickness="1*cm" /> + <slice material="Iron" thickness="1*cm" /> + </layer> + </detector> + </detectors> + +</lccdd>