Back to home page

EIC code displayed by LXR

 
 

    


Warning, /DD4hep/examples/DDDB/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #==========================================================================
0002 #  AIDA Detector description implementation 
0003 #--------------------------------------------------------------------------
0004 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 # All rights reserved.
0006 #
0007 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 #
0010 #==========================================================================
0011 #
0012 # DDDB is a detector description convention developed by the LHCb experiment.
0013 # For further information concerning the DTD, please see:
0014 # http://lhcb-comp.web.cern.ch/lhcb-comp/Frameworks/DetDesc/Documents/lhcbDtd.pdf
0015 #
0016 # The usage of Xerces-C is mandatory due to the entity resolution mechanism
0017 #
0018 #==========================================================================
0019 cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
0020 
0021 IF(NOT TARGET DD4hep::DDCore)
0022   find_package ( DD4hep REQUIRED )
0023   include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
0024   include ( ${DD4hep_DIR}/cmake/DD4hepBuild.cmake )
0025   dd4hep_configure_output()
0026 ENDIF()
0027 
0028 dd4hep_set_compiler_flags()
0029 #==========================================================================
0030 # XercesC dependent stuff
0031 if(DD4HEP_USE_XERCESC)
0032   dd4hep_print("|++> XercesC PRESENT. Building DDDB examples.")
0033 else()
0034   dd4hep_print("|++> XercesC is not present. NOT building DDDB examples.")
0035   return()
0036 endif()
0037 
0038 #---DDDB library --------------------------------------------------------------
0039 FILE(GLOB DDDB_SOURCES src/*.cpp src/Detector/*.cpp)
0040 add_library(DDDB SHARED ${DDDB_SOURCES})
0041 target_link_libraries(DDDB
0042   DD4hep::DDCore
0043   DD4hep::DDCond
0044   ROOT::Core ROOT::Geom ROOT::GenVector
0045   )
0046 
0047 target_include_directories(DDDB
0048   PUBLIC include
0049   )
0050 
0051 #---DDDB plugin library -------------------------------------------------------
0052 dd4hep_add_plugin(DDDBPlugins SOURCES src/plugins/*.cpp USES DDDB)
0053 install(TARGETS DDDB DDDBPlugins LIBRARY DESTINATION lib)
0054 set(DDDB_BIN  ${CMAKE_INSTALL_PREFIX}/bin)
0055 set(DDDB_DATA ${CMAKE_INSTALL_PREFIX}/examples/DDDB)
0056 
0057 #---Package installation procedure(s) -----------------------------------------
0058 install ( PROGRAMS scripts/run_dddb.sh DESTINATION bin)
0059 install ( PROGRAMS scripts/display_dddb.sh DESTINATION bin)
0060 install ( PROGRAMS scripts/extract_dddb.sh DESTINATION bin)
0061 install ( FILES    data/DDDB.tar.gz    DESTINATION examples/DDDB)
0062 install ( FILES    data/materials.xml  DESTINATION examples/DDDB)
0063 #---Testing--------------------------------------------------------------------
0064 dd4hep_configure_scripts ( DDDB DEFAULT_SETUP WITH_TESTS )
0065 #
0066 #---Testing: Extract DDDB data from zip archive -------------------------------
0067 dd4hep_add_test_reg( DDDB_extract_LONGTEST
0068   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0069   EXEC_ARGS  ${DDDB_BIN}/extract_dddb.sh
0070   REGEX_PASS "DDDB Database successfully installed."
0071   )
0072 #
0073 #---Testing: Load the geometry from archive -----------------------------------
0074 dd4hep_add_test_reg( DDDB_load_LONGTEST
0075   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0076   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0077   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0078   -config DD4hep_ConditionsManagerInstaller
0079   DEPENDS    DDDB_extract_LONGTEST
0080   REGEX_PASS "\\+ Converted    12852 placements"
0081   REGEX_FAIL "EXCEPTION;Exception"
0082   )
0083 #
0084 #---Testing: Load the geometry + conditions from archive ----------------------
0085 dd4hep_add_test_reg( DDDB_conditions_LONGTEST
0086   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0087   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0088   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0089   -config    DD4hep_ConditionsManagerInstaller
0090   DEPENDS    DDDB_extract_LONGTEST
0091   REGEX_PASS "\\+ Converted     9353 conditions" 
0092   REGEX_FAIL "EXCEPTION;Exception"
0093   )
0094 #
0095 #---Testing: Load the geometry + conditions dump as view from DetElement ------
0096 dd4hep_add_test_reg( DDDB_conditions_dump_simple_LONGTEST
0097   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0098   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0099   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0100   -config    DD4hep_ConditionsManagerInstaller
0101   -exec      DDDB_ConditionsSummary
0102   DEPENDS    DDDB_extract_LONGTEST
0103   REGEX_PASS "\\+ DDDB Total Number of parameters:    13642  " 
0104   REGEX_FAIL "EXCEPTION;Exception"
0105   )
0106 #
0107 #---Testing: Load the geometry + dump detector elemets ------------------------
0108 dd4hep_add_test_reg( DDDB_det_elements_LONGTEST
0109   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0110   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0111   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0112   -config    DD4hep_ConditionsManagerInstaller  -end-plugin
0113   -plugin    DDDB_DetectorDump -print DEBUG   -end-plugin
0114   DEPENDS    DDDB_extract_LONGTEST
0115   REGEX_PASS "\\+ DDDB: Number of DetElements in the geometry:     6261" 
0116   REGEX_FAIL "EXCEPTION;Exception"
0117   )
0118 #
0119 #---Testing: Load the geometry + dump volumes ---------------------------------
0120 dd4hep_add_test_reg( DDDB_det_volumes_LONGTEST
0121   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0122   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0123   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0124   -config    DD4hep_ConditionsManagerInstaller
0125   -plugin    DDDB_DetectorVolumeDump -print DEBUG
0126   DEPENDS    DDDB_extract_LONGTEST
0127   REGEX_PASS "\\+ DDDB: Number of DetElement placements:           6253" 
0128   REGEX_FAIL "EXCEPTION;Exception"
0129   )
0130 #
0131 #---Testing: Load the geometry + dump condition keys --------------------------
0132 dd4hep_add_test_reg( DDDB_det_conditions_keys_LONGTEST
0133   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0134   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0135   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0136   -config    DD4hep_ConditionsManagerInstaller
0137   -plugin    DDDB_DetectorConditionKeysDump -print DEBUG
0138   DEPENDS    DDDB_extract_LONGTEST
0139   REGEX_PASS "\\+ DDDB: Number of DetElement condition keys:       9043"
0140   REGEX_FAIL "EXCEPTION;Exception"
0141   )
0142 #
0143 #---Testing: Load the geometry + dump condition keys --------------------------
0144 dd4hep_add_test_reg( DDDB_det_catalog_data_LONGTEST
0145   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0146   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0147   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0148   -config    DD4hep_ConditionsManagerInstaller
0149   -plugin    DDDB_DetectorConditionDump -print DEBUG
0150   DEPENDS    DDDB_extract_LONGTEST
0151   REGEX_PASS "\\+ DDDBConditions Total Number of parameters:   346312 "
0152   REGEX_FAIL "EXCEPTION;Exception"
0153   )
0154 #
0155 #---Testing: Load the geometry + dump condition keys --------------------------
0156 dd4hep_add_test_reg( DDDB_det_catalog_align_LONGTEST
0157   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0158   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0159   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0160   -config    DD4hep_ConditionsManagerInstaller
0161   -plugin    DDDB_DetectorAlignmentDump -print DEBUG
0162   DEPENDS    DDDB_extract_LONGTEST
0163   REGEX_PASS "\\+ DDDB: Number of attached alignments:             5408"
0164   REGEX_FAIL "EXCEPTION;Exception"
0165   )
0166 #
0167 #---Testing: Load the geometry + conditions dump as view from DetElement ------
0168 dd4hep_add_test_reg( DDDB_detelement_conditions_dump_LONGTEST
0169   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0170   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0171   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0172   -config    DD4hep_ConditionsManagerInstaller
0173   -plugin    DDDB_DetElementConditionDump -print DEBUG
0174   DEPENDS    DDDB_extract_LONGTEST
0175   REGEX_PASS "\\+ DDDB: Total number of DetElement parameters:    13136"
0176   )
0177 #
0178 #---Testing: Load the geometry + conditions + conditions derives
0179 dd4hep_add_test_reg( DDDB_derived_conditions_LONGTEST
0180   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0181   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0182   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0183   -config    DD4hep_ConditionsManagerInstaller
0184   -plugin    DDDB_DerivedCondTest -print DEBUG
0185   DEPENDS    DDDB_extract_LONGTEST
0186   REGEX_PASS "\\+ DDDB: Total Number of callbacks:    16221"
0187   REGEX_FAIL "EXCEPTION;Exception"
0188   )
0189 #
0190 #---Testing: Load the geometry + conditions + run basic derived alignments test
0191 dd4hep_add_test_reg( DDDB_alignment_derived_LONGTEST
0192   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0193   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0194   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0195   -config    DD4hep_ConditionsManagerInstaller
0196   -plugin    DDDB_DerivedAlignmentsTest -print DEBUG -turns 1 -access 3
0197   DEPENDS    DDDB_extract_LONGTEST
0198   REGEX_PASS "\\+ DDDB: AlignmentManager:    9352 conditions \\(S:9352,L:0,C:0,M:0\\) alignments: \\(A:6200,M:0\\) for IOV:epoch\\(0\\)"
0199   REGEX_FAIL "EXCEPTION;Exception"
0200   )
0201 #
0202 #---Testing: Load the geometry + conditions + access derived alignments from DetElement structures
0203 dd4hep_add_test_reg( DDDB_alignment_access_LONGTEST
0204   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0205   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0206   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0207   -config    DD4hep_ConditionsManagerInstaller
0208   -plugin    DDDB_AlignmentsAccessTest -print DEBUG
0209   DEPENDS    DDDB_extract_LONGTEST
0210   REGEX_PASS "\\+ DDDB: Accessed 5407 alignments from 5407 DetElement objects" 
0211   REGEX_FAIL "EXCEPTION;Exception"
0212   )
0213 #
0214 #---Testing: Load the geometry + conditions + create DeVelo detector elements
0215 dd4hep_add_test_reg( DDDB_DeVelo_LONGTEST
0216   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0217   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0218   -iov_start 31-12-2000-00:00:00 -iov_end 31-12-2019-00:00:00
0219   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0220   -config DD4hep_ConditionsManagerInstaller
0221   -plugin DDDB_DeVeloTest -print DEBUG
0222   DEPENDS    DDDB_extract_LONGTEST
0223   REGEX_PASS "TestSummary              Total 9110 conditions load summary \\(S:2286,L:4020,C:2804,M:0\\)" 
0224   REGEX_FAIL "EXCEPTION"
0225   )
0226 #
0227 #---Testing: As above, but access conditions using Gaudi-like service
0228 dd4hep_add_test_reg( DDDB_DeVelo_Gaudi_LONGTEST
0229   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0230   EXEC_ARGS  ${DDDB_BIN}/run_dddb.sh
0231   -iov_start 31-12-2000-00:00:00 -iov_end 31-12-2019-00:00:00
0232   -config DD4hep_XMLLoader -arg ${DDDB_DATA}/materials.xml 
0233   -config DD4hep_ConditionsManagerInstaller
0234   -plugin DDDB_DeVeloServiceTest -print DEBUG
0235   DEPENDS    DDDB_extract_LONGTEST
0236   REGEX_PASS "TestSummary              Total 10 slices created and accessed during the test." 
0237   REGEX_FAIL "EXCEPTION"
0238   )
0239 #
0240 #---Testing: Extract DDDB data from zip archive -------------------------------
0241 dd4hep_add_test_reg( DDDB_clean_LONGTEST
0242   COMMAND    "${DDDB_BIN}/run_test_DDDB.sh"
0243   EXEC_ARGS  ${DDDB_BIN}/extract_dddb.sh -clean
0244   DEPENDS    DDDB_extract_LONGTEST
0245   DDDB_alignment_access_LONGTEST
0246   DDDB_alignment_derived_LONGTEST
0247   DDDB_derived_conditions_LONGTEST
0248   DDDB_detelement_conditions_dump_LONGTEST
0249   DDDB_det_catalog_align_LONGTEST
0250   DDDB_det_catalog_data_LONGTEST
0251   DDDB_det_conditions_keys_LONGTEST
0252   DDDB_det_volumes_LONGTEST
0253   DDDB_det_elements_LONGTEST
0254   DDDB_conditions_dump_simple_LONGTEST
0255   DDDB_conditions_LONGTEST
0256   DDDB_load_LONGTEST
0257   DDDB_DeVelo_Gaudi_LONGTEST
0258   DDDB_DeVelo_LONGTEST
0259   REGEX_PASS "DDDB Database successfully removed"
0260   )
0261