diff --git a/compact/far_forward/B0_tracker.xml b/compact/far_forward/B0_tracker.xml index 3d44537cb3..06a64fc3da 100644 --- a/compact/far_forward/B0_tracker.xml +++ b/compact/far_forward/B0_tracker.xml @@ -111,9 +111,8 @@ - + @@ -124,9 +123,8 @@ - + @@ -137,9 +135,8 @@ - + @@ -150,9 +147,8 @@ - + diff --git a/compact/tracking/central_tracker_hybrid_v2.xml b/compact/tracking/central_tracker_hybrid_v2.xml index 925192edfe..a4aa68a661 100644 --- a/compact/tracking/central_tracker_hybrid_v2.xml +++ b/compact/tracking/central_tracker_hybrid_v2.xml @@ -156,8 +156,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + Place asymmetrically in the layer (module sits near the bottom). @@ -238,7 +238,7 @@ total X0 0.24% per disk layer (4 sectors per disk): Global Si endcap variables - + @@ -259,11 +259,11 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + - - + + @@ -565,8 +565,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + @@ -576,8 +576,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + The tracker endcap ends at the same place as the outer tracker barrel that sits around it @@ -762,8 +762,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + @@ -772,8 +772,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + @@ -782,8 +782,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + The Si tracker endcap ends at position of the last disk @@ -800,8 +800,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + @@ -810,8 +810,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + The Si tracker endcap ends at position of the last disk @@ -973,7 +973,7 @@ total X0 0.24% per disk layer (4 sectors per disk): - + Parameters for the "ring" GEMS around the silicon tracker, which are all identical @@ -993,8 +993,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + z position of the "ring" GEMS, note that some are offset slightly @@ -1031,8 +1031,8 @@ total X0 0.24% per disk layer (4 sectors per disk): - - + + diff --git a/compact/tracking/silicon_barrel.xml b/compact/tracking/silicon_barrel.xml index 4fbce770b5..b71747560c 100644 --- a/compact/tracking/silicon_barrel.xml +++ b/compact/tracking/silicon_barrel.xml @@ -31,9 +31,9 @@ 84cm=2*42cm is the engineer max - - - + + + diff --git a/compact/tracking/silicon_disks.xml b/compact/tracking/silicon_disks.xml index 36f5b9e3e7..bd50f6c5ea 100644 --- a/compact/tracking/silicon_disks.xml +++ b/compact/tracking/silicon_disks.xml @@ -28,7 +28,7 @@ Global Si endcap variables - + @@ -42,8 +42,8 @@ - - + + @@ -52,8 +52,8 @@ - - + + @@ -130,8 +130,8 @@ - - + + @@ -139,8 +139,8 @@ - - + + @@ -148,8 +148,8 @@ - - + + @@ -157,8 +157,8 @@ - - + + @@ -167,8 +167,8 @@ - - + + @@ -176,8 +176,8 @@ - - + + @@ -185,8 +185,8 @@ - - + + symmetric N and P disks (5 each) @@ -195,8 +195,8 @@ - - + + diff --git a/compact/tracking/tof_endcap.xml b/compact/tracking/tof_endcap.xml index 7ee623b249..0988b0fabb 100644 --- a/compact/tracking/tof_endcap.xml +++ b/compact/tracking/tof_endcap.xml @@ -107,8 +107,8 @@ - - + + diff --git a/compact/tracking/vertex_barrel.xml b/compact/tracking/vertex_barrel.xml index f2fc4ad20b..9c7395c0ff 100644 --- a/compact/tracking/vertex_barrel.xml +++ b/compact/tracking/vertex_barrel.xml @@ -27,7 +27,7 @@ - + diff --git a/configurations/craterlake_material_map.yml b/configurations/craterlake_material_map.yml index 6bfebb53f2..e2ec921824 100644 --- a/configurations/craterlake_material_map.yml +++ b/configurations/craterlake_material_map.yml @@ -15,13 +15,20 @@ features: silicon_disks: tof_barrel: tof_endcap: - ecal: - bic_layer1_only: + #ecal: + # FIXME: disabled due to: + # Error in : + # Wrong bounding box for volume envelope26 + #bic_layer1_only: pid: dirc: pfrich: drich: - far_forward: - default: + #far_forward: + # FIXME: disabled due to: + # 16:39:13 StraightLine VERBOSE Step with size 10000 performed. We are now at -131706 -162867 -9.98943e+06 with direction -0.0131817 -0.0163004 -0.99978 + # 16:39:13 StraightLine VERBOSE PathLimit aborter | Target stepSize (path limit) updated to ( +∞, +∞, +∞, 10000) + # 16:39:13 StraightLine ERROR Propagation reached the step count limit of 1000 (did 1000 steps) + #default: far_backward: default: diff --git a/scripts/material_map/epic.py b/scripts/material_map/epic.py index 4e8fc28583..cc02cef72d 100644 --- a/scripts/material_map/epic.py +++ b/scripts/material_map/epic.py @@ -35,15 +35,11 @@ def getDetector( level=customLogLevel(maxLevel=acts.logging.INFO), ) - dd4hepConfig = acts.examples.dd4hep.DD4hepGeometryService.Config( + dd4hepConfig = acts.examples.dd4hep.DD4hepDetector.Config( xmlFileNames=[xmlFile], logLevel=logLevel, dd4hepLogLevel=customLogLevel(), ) - detector = acts.examples.dd4hep.DD4hepDetector() + detector = acts.examples.dd4hep.DD4hepDetector(dd4hepConfig) - config = acts.MaterialMapJsonConverter.Config() - - trackingGeometry, deco = detector.finalize(dd4hepConfig, matDeco) - - return detector, trackingGeometry, deco + return detector diff --git a/scripts/material_map/geometry_epic.py b/scripts/material_map/geometry_epic.py index 08d231a335..80aa3b996c 100644 --- a/scripts/material_map/geometry_epic.py +++ b/scripts/material_map/geometry_epic.py @@ -27,7 +27,9 @@ ) args = p.parse_args() - detector, trackingGeometry, decorators = epic.getDetector(args.xmlFile) + detector = epic.getDetector(args.xmlFile) + trackingGeometry = detector.trackingGeometry() + decorators = detector.contextDecorators() runGeometry( trackingGeometry, diff --git a/scripts/material_map/material_mapping_epic.py b/scripts/material_map/material_mapping_epic.py index d99a458e1c..d5eb645d33 100644 --- a/scripts/material_map/material_mapping_epic.py +++ b/scripts/material_map/material_mapping_epic.py @@ -44,9 +44,10 @@ print('ERROR(material_mapping_epic.py): please provide a material map file in .json or .cbor format') exit() - detector, trackingGeometry, decorators = epic.getDetector( + detector = epic.getDetector( args.xmlFile, args.geoFile) - + trackingGeometry = detector.trackingGeometry() + decorators = detector.contextDecorators() runMaterialMapping( trackingGeometry, diff --git a/scripts/material_map/material_recording_epic.py b/scripts/material_map/material_recording_epic.py index 85290e9552..925cbedd35 100644 --- a/scripts/material_map/material_recording_epic.py +++ b/scripts/material_map/material_recording_epic.py @@ -18,7 +18,6 @@ import acts.examples.dd4hep import acts.examples.geant4 -import acts.examples.geant4.dd4hep import epic from material_recording import runMaterialRecording @@ -57,15 +56,11 @@ def main(): ) args = p.parse_args() - detector, trackingGeometry, decorators = epic.getDetector( + detector = epic.getDetector( args.xmlFile) - detectorConstructionFactory = ( - acts.examples.geant4.dd4hep.DDG4DetectorConstructionFactory(detector) - ) - runMaterialRecording( - detectorConstructionFactory=detectorConstructionFactory, + detector=detector, tracksPerEvent=args.tracks, outputDir=os.getcwd(), etaRange=(args.eta_min, args.eta_max), diff --git a/scripts/material_map/material_validation_epic.py b/scripts/material_map/material_validation_epic.py index fc636abe49..fce15c993d 100644 --- a/scripts/material_map/material_validation_epic.py +++ b/scripts/material_map/material_validation_epic.py @@ -50,7 +50,9 @@ args = p.parse_args() - detector, trackingGeometry, decorators = epic.getDetector(args.xmlFile, args.matFile) + detector = epic.getDetector(args.xmlFile, args.matFile) + trackingGeometry = detector.trackingGeometry() + decorators = detector.contextDecorators() field = acts.ConstantBField(acts.Vector3(0, 0, 0)) diff --git a/scripts/material_map/run_material_map_validation.sh b/scripts/material_map/run_material_map_validation.sh index bdfaed9bca..581620b223 100755 --- a/scripts/material_map/run_material_map_validation.sh +++ b/scripts/material_map/run_material_map_validation.sh @@ -11,7 +11,7 @@ if [[ -z ${DETECTOR_PATH} ]] ; then fi # Download required Acts files -ACTS_VERSION="v36.3.2" +ACTS_VERSION="v39.2.0" ACTS_URL="https://github.com/acts-project/acts/raw/" ACTS_FILES=( "Examples/Scripts/Python/geometry.py" @@ -42,7 +42,7 @@ diff -aru a/Examples/Scripts/MaterialMapping/Mat_map.C b/Examples/Scripts/Materi // 2D map for Validation input TCanvas *VM = new TCanvas("VM","Validation Map") ; -- Val_file->Draw("mat_y:mat_z","fabs(mat_x)<1"); +- Val_file->Draw("mat_y:mat_z","std::abs(mat_x)<1"); + Val_file->Draw("sqrt(mat_x**2+mat_y**2):mat_z>>mat_map1","(mat_z>-5000)&(mat_z<8000)"); + VM->SetGrid(); @@ -71,6 +71,18 @@ export ACTS_SEQUENCER_DISABLE_FPEMON=1 # Default arguments nevents=1000 nparticles=5000 + +function print_the_help { + echo "USAGE: [--nevents ] [--nparticles ]" + echo "OPTIONAL ARGUMENTS:" + echo " --nevents Number of events (default: $nevents)" + echo " --nparticles Number of particles per event (default: $nparticles)" + echo " -h,--help Print this message" + echo "" + echo " Run material map validation." + exit +} + while [[ $# -gt 1 ]] do key="$1" @@ -104,6 +116,7 @@ propFile=propagation_material echo "::group::----GEANTINO SCAN------" # output geant4_material_tracks.root # The result of the geantino scan will be a root file containing material tracks. Those contain the direction and production vertex of the geantino, the total material accumulated and all the interaction points in the detector. +sed -i 's/seed=228/seed=1306/' Examples/Scripts/Python/material_recording.py python material_recording_epic.py -i ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml -n ${nevents} -t ${nparticles} -o ${recordingFile} echo "::endgroup::" @@ -127,11 +140,24 @@ mkdir -p plots python Examples/Scripts/MaterialMapping/GeometryVisualisationAndMaterialHandling.py --geometry ${geoFile} echo "::endgroup::" +echo "::group::----MAPPING Debugging-----" +echo "Volumes by name:" +jq -r '.Volumes.entries[] | "vol=\(.volume): \(.value.NAME)"' geometry-map.json +echo "Volume surfaces:" +jq -r '.Surfaces.entries[] | select(.boundary != null) | "vol=\(.volume)|bnd=\(.boundary): \(.value.type) \(.value.bounds.type) \(.value.bounds.values) rot=\(.value.transform.rotation) pos=\(.value.transform.translation)"' geometry-map.json +echo "Layer surfaces:" +jq -r '.Surfaces.entries[] | select(.volume < 40 and .layer != null) | "vol=\(.volume)|lay=\(.layer): \(.value.type) \(.value.bounds.type) \(.value.bounds.values) rot=\(.value.transform.rotation) pos=\(.value.transform.translation)"' geometry-map.json +echo "::endgroup::" + echo "::group::----MAPPING------------" # input: geant4_material_tracks.root, geometry-map.json # output: material-maps.json or cbor. This is the material map that you want to provide to EICrecon, i.e. -Pacts:MaterialMap=XXX .Please --matFile to specify the name and type # material-maps_tracks.root(recorded steps from geantino, for validation purpose) -python material_mapping_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --geoFile ${geoFile} --matFile ${matFile} +sed -i 's/acts\.logging\.INFO/acts.logging.VERBOSE/g' Examples/Scripts/Python/material_mapping.py +sed -i 's/navigator = Navigator($/&level=acts.logging.VERBOSE,/' Examples/Scripts/Python/material_mapping.py +sed -i 's/propagator = Propagator(stepper, navigator)$/propagator = Propagator(stepper, navigator, loglevel=acts.logging.VERBOSE)/' Examples/Scripts/Python/material_mapping.py +set -o pipefail +python material_mapping_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --geoFile ${geoFile} --matFile ${matFile} | tail -n 5000 echo "::endgroup::" echo "::group::----Prepare validation rootfile--------" diff --git a/src/B0Tracker_geo.cpp b/src/B0Tracker_geo.cpp index ac6a3dc9d3..9c3a9245ad 100644 --- a/src/B0Tracker_geo.cpp +++ b/src/B0Tracker_geo.cpp @@ -163,17 +163,12 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector xml_comp_t l_env = x_layer.child(_U(envelope)); string layer_name = det_name + std::string("_layer") + std::to_string(l_id); - std::string layer_vis = l_env.attr(_Unicode(vis)); - double layer_rmin_tolerance = l_env.attr(_Unicode(rmin_tolerance)); - double layer_rmax_tolerance = l_env.attr(_Unicode(rmax_tolerance)); - double layer_zmin_tolerance = l_env.attr(_Unicode(zmin_tolerance)); - double layer_zmax_tolerance = l_env.attr(_Unicode(zmax_tolerance)); - double layer_length = l_env.attr(_Unicode(length)); - double layer_zstart = l_env.attr(_Unicode(zstart)); - double layer_center_z = layer_zstart + layer_length / 2.0; - // printout(INFO,"ROOTGDMLParse","+++ Read geometry from GDML file file:%s",input.c_str()); - // std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << - // layer_length/dd4hep::mm << " mm thick )\n"; + std::string layer_vis = l_env.attr(_Unicode(vis)); + double envelope_r_min = l_env.attr(_Unicode(rmin)); + double envelope_r_max = l_env.attr(_Unicode(rmax)); + double envelope_z_min = l_env.attr(_Unicode(zmin)); + double envelope_z_max = l_env.attr(_Unicode(zmax)); + double layer_center_z = (envelope_z_min + envelope_z_max) / 2.0; Assembly layer_vol(layer_name); PlacedVolume layer_pv; @@ -226,10 +221,10 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector } } layer_vol->GetShape()->ComputeBBox(); - layerParams.set("envelope_r_min", layer_rmin_tolerance / dd4hep::mm); - layerParams.set("envelope_r_max", layer_rmax_tolerance / dd4hep::mm); - layerParams.set("envelope_z_min", layer_zmin_tolerance / dd4hep::mm); - layerParams.set("envelope_z_max", layer_zmax_tolerance / dd4hep::mm); + layerParams.set("envelope_r_min", envelope_r_min); + layerParams.set("envelope_r_max", envelope_r_max); + layerParams.set("envelope_z_min", envelope_z_min); + layerParams.set("envelope_z_max", envelope_z_max); for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) { xml_comp_t x_layer_material = lmat;