From e577cf444c79f0191a9e4454333d72d5c716211e Mon Sep 17 00:00:00 2001 From: Whitney Armstrong <warmstrong@anl.gov> Date: Tue, 17 Aug 2021 07:19:00 +0000 Subject: [PATCH] Fix view20 - Added NModules constants to "Hybrid" calorimeter. --- compact/subsystem_views/calorimeters.xml | 1 + scripts/view20/.DAWN_1.history | 6 ++--- scripts/view20/generate_eps | 13 +++++++---- src/HybridCalorimeter_geo.cpp | 5 ++++- views/generate_prim_files.yml | 28 ++++++++++++++++++++++++ views/view20.yml | 12 +++++----- 6 files changed, 51 insertions(+), 14 deletions(-) diff --git a/compact/subsystem_views/calorimeters.xml b/compact/subsystem_views/calorimeters.xml index 57df8740..49799815 100644 --- a/compact/subsystem_views/calorimeters.xml +++ b/compact/subsystem_views/calorimeters.xml @@ -87,6 +87,7 @@ Beamline elements ----------------- </comment> + <include ref="ip6/beampipe.xml" /> <documentation level="5"> ## Main magnet diff --git a/scripts/view20/.DAWN_1.history b/scripts/view20/.DAWN_1.history index cc3ead27..f4980ff8 100644 --- a/scripts/view20/.DAWN_1.history +++ b/scripts/view20/.DAWN_1.history @@ -1,12 +1,12 @@ 1.34392e+07 -0 +90 180 0 0 0 0 -5 -3 +1 +1 0.001 0 1 diff --git a/scripts/view20/generate_eps b/scripts/view20/generate_eps index 87001448..8a5365d4 100755 --- a/scripts/view20/generate_eps +++ b/scripts/view20/generate_eps @@ -68,13 +68,18 @@ pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox -thinlinemode sol #npdet_info print EcalEndcapN_z0 --value-only ../../athena.xml #180.5 cm -NMOD1=`npdet_info print EcalEndcapN_NModules_Sector1 ${DETECTOR_PATH}/calorimeters.xml | tail -1` -NMOD2=`npdet_info print EcalEndcapN_NModules_Sector2 ${DETECTOR_PATH}/calorimeters.xml | tail -1` +zcut=$(npdet_info print EcalEndcapN_z0 --value-only ${DETECTOR_PATH}/athena.xml ) +NMOD1=$(npdet_info print EcalEndcapN_NModules_Sector1 --value-only ${DETECTOR_PATH}/calorimeters.xml ) +NMOD2=$(npdet_info print EcalEndcapN_NModules_Sector2 --value-only ${DETECTOR_PATH}/calorimeters.xml ) + +echo "NMOD1 = ${NMOD1}" +echo "NMOD2 = ${NMOD2}" +echo "zcut = ${zcut}" # Top view with a thin slice down the middle dawncut 0 0 1 -1800 ${INPUT_FILE} ${FILE_TAG}_endcapN_temp0.prim -dawncut 0 0 -1 1805 ${FILE_TAG}_endcapN_temp0.prim ${FILE_TAG}_endcapN.prim -../../bin/dawn_tweak --mag 5 --draw 1 --theta 180 --phi 0 --draw 3 +dawncut 0 0 -1 2200 ${FILE_TAG}_endcapN_temp0.prim ${FILE_TAG}_endcapN.prim +../../bin/dawn_tweak --mag 5 --draw 3 --theta 180 --phi 0 dawn -d ${FILE_TAG}_endcapN.prim ps2pdf ${FILE_TAG}_endcapN.eps ${FILE_TAG}_endcapN_full.pdf gs -o ${FILE_TAG}_endcapN.pdf -sDEVICE=pdfwrite \ diff --git a/src/HybridCalorimeter_geo.cpp b/src/HybridCalorimeter_geo.cpp index e0a86b7e..20f4a38c 100644 --- a/src/HybridCalorimeter_geo.cpp +++ b/src/HybridCalorimeter_geo.cpp @@ -215,10 +215,13 @@ static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDete // fmt::print(" {:<5} {:<6} {:<3} {:<3} {:>10.4f} {:>10.4f} {}\n", towerIndex, code, colIndex, rowIndex, x / cm, y / cm, name); - glass_module_index++; + //glass_module_index++; } } } + + desc.add(Constant("EcalEndcapN_NModules_Sector1", std::to_string(cryst_module_index))); + desc.add(Constant("EcalEndcapN_NModules_Sector2", std::to_string(glass_module_index))); // fmt::print("Total Glass modules: {}\n", towerIndex); // fmt::print("CE EMCAL GLASS END\n\n"); diff --git a/views/generate_prim_files.yml b/views/generate_prim_files.yml index e511aa23..69c25d3f 100644 --- a/views/generate_prim_files.yml +++ b/views/generate_prim_files.yml @@ -36,3 +36,31 @@ view_prim:ev004: - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - ./bin/generate_prim_file -o ${LOCAL_DATA_PATH} -t view_ev004 -s 4 + + +view_prim:calorimeters: + extends: .views + stage: test + script: + - cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/." + - ./bin/generate_prim_file -c ${DETECTOR_PATH}/calorimeters.xml -o ${LOCAL_DATA_PATH} -D -t calorimeters_view + - ls -lrth && ls -lrth ${LOCAL_DATA_PATH} + +view_prim:calorimeters_ev001: + extends: .views + stage: test + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + script: + - cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/." + - ./bin/generate_prim_file -c ${DETECTOR_PATH}/calorimeters.xml -o ${LOCAL_DATA_PATH} -t calorimeters_view_ev001 -s 1 + +view_prim:calorimeters_ev002: + extends: .views + stage: test + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + script: + - cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/." + - ./bin/generate_prim_file -c ${DETECTOR_PATH}/calorimeters.xml -o ${LOCAL_DATA_PATH} -t calorimeters_view_ev002 -s 2 + diff --git a/views/view20.yml b/views/view20.yml index be4107e9..ba01b249 100644 --- a/views/view20.yml +++ b/views/view20.yml @@ -1,31 +1,31 @@ dawn_view_20:detector: extends: .views needs: - - job: view_prim:detector_only + - job: view_prim:calorimeters optional: false script: - cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/." - - ./bin/make_dawn_views -c ${DETECTOR_PATH}/calorimeters.xml -i ${LOCAL_DATA_PATH}/detector_view.prim -t calorimeters_view20 -d scripts/view20 -D + - ./bin/make_dawn_views -c ${DETECTOR_PATH}/calorimeters.xml -i ${LOCAL_DATA_PATH}/calorimeters_view.prim -t view20 -d scripts/view20 -D dawn_view_20:ev001: extends: .views needs: - - job: view_prim:ev001 + - job: view_prim:calorimeters_ev001 optional: true rules: - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - - ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view20_ev001 -d scripts/view20 -s 1 + - ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/calorimeters_view_ev001.prim -t view20_ev001 -d scripts/view20 -s 1 dawn_view_20:ev002: extends: .views needs: - - job: view_prim:ev002 + - job: view_prim:calorimeters_ev002 optional: true rules: - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - - ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view20_ev002 -d scripts/view20 -s 2 + - ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/calorimeters_view_ev002.prim -t view20_ev002 -d scripts/view20 -s 2 view_20: stage: collect -- GitLab