From 378a99d224c410a54fcf0ef80c4b4a0908ff03dd Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Thu, 24 Sep 2020 11:57:40 +0200 Subject: [PATCH 1/4] adding unit test for HGCal material budget plots --- Validation/Geometry/test/BuildFile.xml | 1 + Validation/Geometry/test/genHGCalPlots.sh | 34 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 Validation/Geometry/test/genHGCalPlots.sh diff --git a/Validation/Geometry/test/BuildFile.xml b/Validation/Geometry/test/BuildFile.xml index 5896242c49359..0915fee7a115b 100644 --- a/Validation/Geometry/test/BuildFile.xml +++ b/Validation/Geometry/test/BuildFile.xml @@ -1,2 +1,3 @@ + diff --git a/Validation/Geometry/test/genHGCalPlots.sh b/Validation/Geometry/test/genHGCalPlots.sh new file mode 100755 index 0000000000000..815f2dc92d506 --- /dev/null +++ b/Validation/Geometry/test/genHGCalPlots.sh @@ -0,0 +1,34 @@ +#!/bin/bash -ex + +VGEO_DIR=$CMSSW_BASE/src/Validation/Geometry +TEST_DIR=${VGEO_DIR}/test/materialBudgetHGCalPlots + +if [ -d $TEST_DIR ] ; then rm -rf $TEST_DIR ; fi +mkdir $TEST_DIR && cd $TEST_DIR + +cmsRun ${VGEO_DIR}/test/single_neutrino_cfg.py nEvents=100 >$TEST_DIR/single_neutrino_cfg.log 2>&1 + +for geom in {'Extended2026D49','Extended2026D62'}; do + python ${VGEO_DIR}/test/runP_HGCal_cfg.py geom=$geom label=HGCal >$TEST_DIR/runP_HGCal_cfg_$geom.log 2>&1 + python ${VGEO_DIR}/test/MaterialBudgetHGCal.py -s -d HGCal + mv ${TEST_DIR}/Images/HGCal_x_vs_eta.png ${TEST_DIR}/Images/HGCal_x_vs_eta_$geom.png + mv ${TEST_DIR}/Images/HGCal_l_vs_eta.png ${TEST_DIR}/Images/HGCal_l_vs_eta_$geom.png + mv ${TEST_DIR}/Images/HGCal_x_vs_phi.png ${TEST_DIR}/Images/HGCal_x_vs_phi_$geom.png + mv ${TEST_DIR}/Images/HGCal_l_vs_phi.png ${TEST_DIR}/Images/HGCal_l_vs_phi_$geom.png + mv ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rsum.png ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rsum_$geom.png + mv ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rsum.png ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rsum_$geom.png + mv ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloc.png ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloc_$geom.png + mv ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloc.png ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloc_$geom.png + mv ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloccos.png ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloccos_$geom.png + mv ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloccos.png ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloccos_$geom.png +done + + +echo ' Reference Tracker Material Budget

Reference Plots

Please check any diferences in the plots compared with the given reference. Reference plots have a green border followed by the output of the PR which features a red border

Geometry: Extended2026D49






















Geometry: Extended2026D62























' > ${TEST_DIR}/index.html + +if [[ ! -z ${JENKINS_UPLOAD_DIR} ]] ; then + mkdir ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots + cp ${TEST_DIR}/Images/*.png ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots/ + cp ${TEST_DIR}/index.html ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots/ + cp ${TEST_DIR}/*.log ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots/ +fi From c897c97bbe16f09a332bb8d352a164bb7a0ea337 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Thu, 24 Sep 2020 12:03:23 +0200 Subject: [PATCH 2/4] run the same amount of events as with the Tracker --- Validation/Geometry/test/genHGCalPlots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/Geometry/test/genHGCalPlots.sh b/Validation/Geometry/test/genHGCalPlots.sh index 815f2dc92d506..3a2e1606090db 100755 --- a/Validation/Geometry/test/genHGCalPlots.sh +++ b/Validation/Geometry/test/genHGCalPlots.sh @@ -6,7 +6,7 @@ TEST_DIR=${VGEO_DIR}/test/materialBudgetHGCalPlots if [ -d $TEST_DIR ] ; then rm -rf $TEST_DIR ; fi mkdir $TEST_DIR && cd $TEST_DIR -cmsRun ${VGEO_DIR}/test/single_neutrino_cfg.py nEvents=100 >$TEST_DIR/single_neutrino_cfg.log 2>&1 +cmsRun ${VGEO_DIR}/test/single_neutrino_cfg.py nEvents=1000 >$TEST_DIR/single_neutrino_cfg.log 2>&1 for geom in {'Extended2026D49','Extended2026D62'}; do python ${VGEO_DIR}/test/runP_HGCal_cfg.py geom=$geom label=HGCal >$TEST_DIR/runP_HGCal_cfg_$geom.log 2>&1 From 568b8862f5995c2337c0fcb416a9bfdd0db4a0c3 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Thu, 24 Sep 2020 12:05:33 +0200 Subject: [PATCH 3/4] some tweaks in the html page --- Validation/Geometry/test/genHGCalPlots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/Geometry/test/genHGCalPlots.sh b/Validation/Geometry/test/genHGCalPlots.sh index 3a2e1606090db..0c484ed0a8a32 100755 --- a/Validation/Geometry/test/genHGCalPlots.sh +++ b/Validation/Geometry/test/genHGCalPlots.sh @@ -24,7 +24,7 @@ for geom in {'Extended2026D49','Extended2026D62'}; do done -echo ' Reference Tracker Material Budget

Reference Plots

Please check any diferences in the plots compared with the given reference. Reference plots have a green border followed by the output of the PR which features a red border

Geometry: Extended2026D49






















Geometry: Extended2026D62























' > ${TEST_DIR}/index.html +echo ' Reference HGCAL Material Budget

Reference Plots

Please check any diferences in the plots compared with the given reference. Reference plots have a green border followed by the output of the PR which features a red border

Geometry: Extended2026D49






















Geometry: Extended2026D62























' > ${TEST_DIR}/index.html if [[ ! -z ${JENKINS_UPLOAD_DIR} ]] ; then mkdir ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots From 846bb2a737d8e0d375e041be04b3e56af3515f13 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas Date: Mon, 28 Sep 2020 11:21:16 +0200 Subject: [PATCH 4/4] most basic test --- Validation/Geometry/test/genHGCalPlots.sh | 28 ++++------------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/Validation/Geometry/test/genHGCalPlots.sh b/Validation/Geometry/test/genHGCalPlots.sh index 0c484ed0a8a32..a9dce20735a08 100755 --- a/Validation/Geometry/test/genHGCalPlots.sh +++ b/Validation/Geometry/test/genHGCalPlots.sh @@ -1,34 +1,14 @@ #!/bin/bash -ex +geom=Extended2026D62 VGEO_DIR=$CMSSW_BASE/src/Validation/Geometry TEST_DIR=${VGEO_DIR}/test/materialBudgetHGCalPlots if [ -d $TEST_DIR ] ; then rm -rf $TEST_DIR ; fi mkdir $TEST_DIR && cd $TEST_DIR -cmsRun ${VGEO_DIR}/test/single_neutrino_cfg.py nEvents=1000 >$TEST_DIR/single_neutrino_cfg.log 2>&1 +cmsRun ${VGEO_DIR}/test/single_neutrino_cfg.py nEvents=1 >$TEST_DIR/single_neutrino_cfg.log 2>&1 -for geom in {'Extended2026D49','Extended2026D62'}; do - python ${VGEO_DIR}/test/runP_HGCal_cfg.py geom=$geom label=HGCal >$TEST_DIR/runP_HGCal_cfg_$geom.log 2>&1 - python ${VGEO_DIR}/test/MaterialBudgetHGCal.py -s -d HGCal - mv ${TEST_DIR}/Images/HGCal_x_vs_eta.png ${TEST_DIR}/Images/HGCal_x_vs_eta_$geom.png - mv ${TEST_DIR}/Images/HGCal_l_vs_eta.png ${TEST_DIR}/Images/HGCal_l_vs_eta_$geom.png - mv ${TEST_DIR}/Images/HGCal_x_vs_phi.png ${TEST_DIR}/Images/HGCal_x_vs_phi_$geom.png - mv ${TEST_DIR}/Images/HGCal_l_vs_phi.png ${TEST_DIR}/Images/HGCal_l_vs_phi_$geom.png - mv ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rsum.png ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rsum_$geom.png - mv ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rsum.png ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rsum_$geom.png - mv ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloc.png ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloc_$geom.png - mv ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloc.png ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloc_$geom.png - mv ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloccos.png ${TEST_DIR}/Images/HGCal_x_vs_z_vs_Rloccos_$geom.png - mv ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloccos.png ${TEST_DIR}/Images/HGCal_l_vs_z_vs_Rloccos_$geom.png -done +python ${VGEO_DIR}/test/runP_HGCal_cfg.py geom=${geom} label=HGCal >$TEST_DIR/runP_HGCal_cfg_${geom}.log 2>&1 +python ${VGEO_DIR}/test/MaterialBudgetHGCal.py -s -d HGCal - -echo ' Reference HGCAL Material Budget

Reference Plots

Please check any diferences in the plots compared with the given reference. Reference plots have a green border followed by the output of the PR which features a red border

Geometry: Extended2026D49






















Geometry: Extended2026D62























' > ${TEST_DIR}/index.html - -if [[ ! -z ${JENKINS_UPLOAD_DIR} ]] ; then - mkdir ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots - cp ${TEST_DIR}/Images/*.png ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots/ - cp ${TEST_DIR}/index.html ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots/ - cp ${TEST_DIR}/*.log ${JENKINS_UPLOAD_DIR}/materialBudgetHGCalPlots/ -fi