Skip to content

Commit

Permalink
Add IDEA_o2 CMake test and reorder G4GenericTrap
Browse files Browse the repository at this point in the history
Adding a CMake test for IDEA_o2_v01. ctest -R t_test_IDEA_o2_v01 takes
about 211 s on lxplus9 machines. This test spotted one "Error" keyword
due to anticlockwise ordering of G4GenericTrap constructor edges (they
were internally reordered by root). To fix it I reordered them
clockwise.
  • Loading branch information
lopezzot committed Nov 25, 2024
1 parent 1a16035 commit ed41d51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,23 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
double vertices[16];
vertices[0] = static_cast<double>(-DistancetoSolenoid * tan(0.5 * phi_unit));
vertices[1] = static_cast<double>(DistancetoSolenoid);
vertices[2] = static_cast<double>(DistancetoSolenoid * tan(0.5 * phi_unit));
vertices[3] = static_cast<double>(DistancetoSolenoid);
vertices[2] = static_cast<double>(-innerR * tan(0.5 * phi_unit));
vertices[3] = static_cast<double>(innerR);
vertices[4] = static_cast<double>(innerR * tan(0.5 * phi_unit));
vertices[5] = static_cast<double>(innerR);
vertices[6] = static_cast<double>(-innerR * tan(0.5 * phi_unit));
vertices[7] = static_cast<double>(innerR);
vertices[6] = static_cast<double>(DistancetoSolenoid * tan(0.5 * phi_unit));
vertices[7] = static_cast<double>(DistancetoSolenoid);
// The first two points of the outer face are at the same distance to the z-axis
// as in the inner face
// The second two poits of the outer face are same as before with innerR+tower_height
vertices[8] = static_cast<double>(-DistancetoSolenoid * tan(0.5 * phi_unit));
vertices[9] = static_cast<double>(DistancetoSolenoid);
vertices[10] = static_cast<double>(DistancetoSolenoid * tan(0.5 * phi_unit));
vertices[11] = static_cast<double>(DistancetoSolenoid);
vertices[10] = static_cast<double>(-(innerR + tower_height) * tan(0.5 * phi_unit));
vertices[11] = static_cast<double>(innerR + tower_height);
vertices[12] = static_cast<double>((innerR + tower_height) * tan(0.5 * phi_unit));
vertices[13] = static_cast<double>(innerR + tower_height);
vertices[14] = static_cast<double>(-(innerR + tower_height) * tan(0.5 * phi_unit));
vertices[15] = static_cast<double>(innerR + tower_height);
vertices[14] = static_cast<double>(DistancetoSolenoid * tan(0.5 * phi_unit));
vertices[15] = static_cast<double>(DistancetoSolenoid);
// Equivalent of Geant4 GenericTrap shape constructor
EightPointSolid phiER("phiER", tower_height / 2., vertices);
Volume phiERLog("phiER", phiER, description.material(x_stave.attr<std::string>(_U(material))));
Expand Down
8 changes: 8 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh
SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION " Exception; EXCEPTION;ERROR;Error" TIMEOUT 600)
endif()

#--------------------------------------------------
# test for IDEA o2 v01
if(DCH_INFO_H_EXIST)
SET( test_name "test_IDEA_o2_v01" )
ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh"
ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml -N 1 -G --gun.distribution uniform --random.seed 1988301045 --outputFile=testIDEA_o2_v01.root )
SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION " Exception; EXCEPTION;ERROR;Error" TIMEOUT 600)
endif()

#--------------------------------------------------
# test for ALLEGRO o1 v02
Expand Down

0 comments on commit ed41d51

Please sign in to comment.