From 88eab58da48d2671ee7e0796b0d1e6140d2ec1ea Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 13:15:03 -0500 Subject: [PATCH 01/20] Removed default kryptonite materials per #198 Removed /remoll/kryptonite/set to trigger errors on old macros --- include/remollDetectorConstruction.hh | 1 - src/remollDetectorConstruction.cc | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/include/remollDetectorConstruction.hh b/include/remollDetectorConstruction.hh index 5f266cafe..713c83470 100644 --- a/include/remollDetectorConstruction.hh +++ b/include/remollDetectorConstruction.hh @@ -89,7 +89,6 @@ class remollDetectorConstruction : public G4VUserDetectorConstruction public: void SetKryptoniteVerbose(G4int verbose) { fKryptoniteVerbose = verbose; } - void SetKryptoniteEnable(G4String flag); void EnableKryptonite(); void DisableKryptonite(); void AddKryptoniteCandidate(G4String name); diff --git a/src/remollDetectorConstruction.cc b/src/remollDetectorConstruction.cc index c124acfa1..13b0556b1 100644 --- a/src/remollDetectorConstruction.cc +++ b/src/remollDetectorConstruction.cc @@ -68,14 +68,6 @@ remollDetectorConstruction::remollDetectorConstruction(const G4String& name, con // Create GDML parser fGDMLParser = new G4GDMLParser(); - // Starter set of kryptonite materials - AddKryptoniteCandidate("VacuumKryptonite"); - AddKryptoniteCandidate("Tungsten"); - AddKryptoniteCandidate("CW95"); - AddKryptoniteCandidate("Copper"); - AddKryptoniteCandidate("Lead"); - InitKryptoniteMaterials(); - // Create generic messenger fMessenger = new G4GenericMessenger(this,"/remoll/","Remoll properties"); fMessenger->DeclareMethod( @@ -191,10 +183,6 @@ remollDetectorConstruction::remollDetectorConstruction(const G4String& name, con "verbose", &remollDetectorConstruction::SetKryptoniteVerbose, "Set verbose level"); - fKryptoniteMessenger->DeclareMethod( - "set", - &remollDetectorConstruction::SetKryptoniteEnable, - "Treat materials as kryptonite"); fKryptoniteMessenger->DeclareMethod( "enable", &remollDetectorConstruction::EnableKryptonite, @@ -213,14 +201,6 @@ remollDetectorConstruction::remollDetectorConstruction(const G4String& name, con "List kryptonite candidate materials"); } -void remollDetectorConstruction::SetKryptoniteEnable(G4String flag) -{ - if (flag.compareTo("true", G4String::ignoreCase) == 0) - EnableKryptonite(); - else - DisableKryptonite(); -} - void remollDetectorConstruction::EnableKryptonite() { if (fKryptoniteVerbose > 0) From d06c8b3c5a929432b855744fc5aff7089eac08ac Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 13:29:23 -0500 Subject: [PATCH 02/20] Replaced former default kryptonite configuration with macro If you used to have `/remoll/kryptonite/set true` or `/remoll/kryptonite/enable` then you will want to replace that line by `/control/execute macros/kryptonite.mac` --- macros/kryptonite.mac | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 macros/kryptonite.mac diff --git a/macros/kryptonite.mac b/macros/kryptonite.mac new file mode 100644 index 000000000..5b07311f2 --- /dev/null +++ b/macros/kryptonite.mac @@ -0,0 +1,12 @@ +# Enable kryptonite +/remoll/kryptonite/enable + +# Set some default materials +/remoll/kryptonite/add VacuumKryptonite +/remoll/kryptonite/add Tungsten +/remoll/kryptonite/add Copper +/remoll/kryptonite/add Lead +/remoll/kryptonite/add CW95 + +# List materials +/remoll/kryptonite/list From 8f5603cbbb74dba2fcb431e0ae0fc17e9ee3ca8e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 14:40:11 -0500 Subject: [PATCH 03/20] Fix the unit test that crashes in #199 (but that doesn't fix the reported bug) --- macros/tests/unit/test_kryptonite.mac | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/macros/tests/unit/test_kryptonite.mac b/macros/tests/unit/test_kryptonite.mac index 0d2491d6b..e71ca2a58 100644 --- a/macros/tests/unit/test_kryptonite.mac +++ b/macros/tests/unit/test_kryptonite.mac @@ -1,11 +1,10 @@ /run/initialize /remoll/filename test_kryptonite.root -/remoll/kryptonite/del Lead /remoll/kryptonite/add G4_Pb /remoll/kryptonite/list -/remoll/kryptonite/set true +/remoll/kryptonite/enable /run/beamOn 100 -/remoll/kryptonite/set false +/remoll/kryptonite/disable /run/beamOn 100 From 4bd7fdc13b288f61e0fc885530c28566b761871f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 14:48:20 -0500 Subject: [PATCH 04/20] Replaced /remoll/kryptonite/enable and /remoll/kryptonite/set true --- analysis/pruneTreeEnvelope/runexample_epelastic_envelope.mac | 2 +- analysis/pruneTreeEnvelope/runexample_limit_envelope.mac | 2 +- analysis/pruneTreeEnvelope/runexample_moller_envelope.mac | 2 +- macros/envelope_data.mac | 2 +- macros/hepmc/ee_ee_hepmc.mac | 2 +- macros/hepmc/ee_ee_moller.mac | 2 +- macros/hepmc/ep_ep.mac | 2 +- macros/hepmc/ep_ep_elastic.mac | 2 +- macros/hepmc/ep_ep_hepmc.mac | 2 +- macros/initializeTF1Generator.mac | 2 +- macros/mainz.mac | 2 +- macros/optical.mac | 2 +- macros/optics_test.mac | 2 +- macros/pion/pion_optical_response.in | 2 +- macros/pion/pion_optical_response.mac | 2 +- macros/remoll_test.in | 2 +- macros/runTF1.mac | 2 +- macros/runexample.mac | 2 +- macros/runexample_envelope.mac | 2 +- macros/runexample_epelastic_envelope.mac | 2 +- macros/runexample_limit_envelope.mac | 2 +- macros/runexample_moller_envelope.mac | 2 +- macros/showermax_piondetector_optical_response_moller.in | 2 +- macros/showermax_piondetector_optical_response_pion.in | 2 +- macros/sim_dump_backscatter.in | 2 +- macros/sim_dump_backscatter.mac | 2 +- macros/tests/commit/test_beam.mac | 2 +- macros/tests/commit/test_elastic.mac | 2 +- macros/tests/commit/test_elasticAl.mac | 2 +- macros/tests/commit/test_elasticAl_DS.mac | 2 +- macros/tests/commit/test_elasticAl_US.mac | 2 +- macros/tests/commit/test_inelastic.mac | 2 +- macros/tests/commit/test_inelasticAl.mac | 2 +- macros/tests/commit/test_moller.mac | 2 +- macros/tests/commit/test_pion.mac | 2 +- macros/tests/commit/test_raster.mac | 2 +- macros/tests/release/test_moller.mac | 2 +- macros/tests/valgrind/test_moller.mac | 2 +- 38 files changed, 38 insertions(+), 38 deletions(-) diff --git a/analysis/pruneTreeEnvelope/runexample_epelastic_envelope.mac b/analysis/pruneTreeEnvelope/runexample_epelastic_envelope.mac index fd3691b1b..78f40ecbf 100644 --- a/analysis/pruneTreeEnvelope/runexample_epelastic_envelope.mac +++ b/analysis/pruneTreeEnvelope/runexample_epelastic_envelope.mac @@ -23,7 +23,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/analysis/pruneTreeEnvelope/runexample_limit_envelope.mac b/analysis/pruneTreeEnvelope/runexample_limit_envelope.mac index 02d3f575c..78b8b11fb 100644 --- a/analysis/pruneTreeEnvelope/runexample_limit_envelope.mac +++ b/analysis/pruneTreeEnvelope/runexample_limit_envelope.mac @@ -23,7 +23,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/analysis/pruneTreeEnvelope/runexample_moller_envelope.mac b/analysis/pruneTreeEnvelope/runexample_moller_envelope.mac index 5327db51c..c63d8e518 100644 --- a/analysis/pruneTreeEnvelope/runexample_moller_envelope.mac +++ b/analysis/pruneTreeEnvelope/runexample_moller_envelope.mac @@ -23,7 +23,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/macros/envelope_data.mac b/macros/envelope_data.mac index d9a5933ee..b1c5a725e 100644 --- a/macros/envelope_data.mac +++ b/macros/envelope_data.mac @@ -44,7 +44,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -#/remoll/kryptonite/set true +#/control/execute macros/kryptonite.mac #create moller output file diff --git a/macros/hepmc/ee_ee_hepmc.mac b/macros/hepmc/ee_ee_hepmc.mac index 6381a2073..92525579c 100644 --- a/macros/hepmc/ee_ee_hepmc.mac +++ b/macros/hepmc/ee_ee_hepmc.mac @@ -8,7 +8,7 @@ /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt -/remoll/kryptonite/enable +/control/execute macros/kryptonite.mac /remoll/SD/disable_range 7000 10000 diff --git a/macros/hepmc/ee_ee_moller.mac b/macros/hepmc/ee_ee_moller.mac index e95ef7b14..1340acea3 100644 --- a/macros/hepmc/ee_ee_moller.mac +++ b/macros/hepmc/ee_ee_moller.mac @@ -8,7 +8,7 @@ /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt -/remoll/kryptonite/enable +/control/execute macros/kryptonite.mac /remoll/SD/disable_range 7000 10000 diff --git a/macros/hepmc/ep_ep.mac b/macros/hepmc/ep_ep.mac index 3b35ca036..f4c61d2ff 100644 --- a/macros/hepmc/ep_ep.mac +++ b/macros/hepmc/ep_ep.mac @@ -8,7 +8,7 @@ /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/evgen/set hepmcAscii diff --git a/macros/hepmc/ep_ep_elastic.mac b/macros/hepmc/ep_ep_elastic.mac index dfdc31f74..d14d9e5bd 100644 --- a/macros/hepmc/ep_ep_elastic.mac +++ b/macros/hepmc/ep_ep_elastic.mac @@ -8,7 +8,7 @@ /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt -/remoll/kryptonite/enable +/control/execute macros/kryptonite.mac /remoll/SD/disable_range 7000 10000 diff --git a/macros/hepmc/ep_ep_hepmc.mac b/macros/hepmc/ep_ep_hepmc.mac index a9fe93f17..86d6b434d 100644 --- a/macros/hepmc/ep_ep_hepmc.mac +++ b/macros/hepmc/ep_ep_hepmc.mac @@ -8,7 +8,7 @@ /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt -/remoll/kryptonite/enable +/control/execute macros/kryptonite.mac /remoll/SD/disable_range 7000 10000 diff --git a/macros/initializeTF1Generator.mac b/macros/initializeTF1Generator.mac index 46a1ef88b..4ab005b3b 100644 --- a/macros/initializeTF1Generator.mac +++ b/macros/initializeTF1Generator.mac @@ -53,7 +53,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list diff --git a/macros/mainz.mac b/macros/mainz.mac index f0dd9092f..a26afb745 100644 --- a/macros/mainz.mac +++ b/macros/mainz.mac @@ -25,7 +25,7 @@ #---------------------------------------- # Kill tracks on interactions with W, Cu, and Pb -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list diff --git a/macros/optical.mac b/macros/optical.mac index 25464dd3f..9730f3d1b 100644 --- a/macros/optical.mac +++ b/macros/optical.mac @@ -24,7 +24,7 @@ /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt -/remoll/kryptonite/set false +/remoll/kryptonite/disable /remoll/filename remollout.root diff --git a/macros/optics_test.mac b/macros/optics_test.mac index 18d84fd1c..b1e3f366d 100644 --- a/macros/optics_test.mac +++ b/macros/optics_test.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list diff --git a/macros/pion/pion_optical_response.in b/macros/pion/pion_optical_response.in index 00a200a43..c894923b3 100644 --- a/macros/pion/pion_optical_response.in +++ b/macros/pion/pion_optical_response.in @@ -14,7 +14,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set false +/remoll/kryptonite/disable # Only read detectors 28 and 30 /remoll/SD/disable_all diff --git a/macros/pion/pion_optical_response.mac b/macros/pion/pion_optical_response.mac index aa4e7e29a..e49d58b31 100644 --- a/macros/pion/pion_optical_response.mac +++ b/macros/pion/pion_optical_response.mac @@ -15,7 +15,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set false +/remoll/kryptonite/disable # Only read detectors 28 and 30 /remoll/SD/disable_all diff --git a/macros/remoll_test.in b/macros/remoll_test.in index a16461693..16c32da5b 100644 --- a/macros/remoll_test.in +++ b/macros/remoll_test.in @@ -61,7 +61,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list diff --git a/macros/runTF1.mac b/macros/runTF1.mac index 7697627bd..65b70ccee 100644 --- a/macros/runTF1.mac +++ b/macros/runTF1.mac @@ -35,7 +35,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list diff --git a/macros/runexample.mac b/macros/runexample.mac index 7f77c68fa..00a7d5e36 100644 --- a/macros/runexample.mac +++ b/macros/runexample.mac @@ -83,7 +83,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list diff --git a/macros/runexample_envelope.mac b/macros/runexample_envelope.mac index 330b460e8..b4a781db1 100644 --- a/macros/runexample_envelope.mac +++ b/macros/runexample_envelope.mac @@ -16,7 +16,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/macros/runexample_epelastic_envelope.mac b/macros/runexample_epelastic_envelope.mac index fd3691b1b..78f40ecbf 100644 --- a/macros/runexample_epelastic_envelope.mac +++ b/macros/runexample_epelastic_envelope.mac @@ -23,7 +23,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/macros/runexample_limit_envelope.mac b/macros/runexample_limit_envelope.mac index 02d3f575c..78b8b11fb 100644 --- a/macros/runexample_limit_envelope.mac +++ b/macros/runexample_limit_envelope.mac @@ -23,7 +23,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/macros/runexample_moller_envelope.mac b/macros/runexample_moller_envelope.mac index 5327db51c..c63d8e518 100644 --- a/macros/runexample_moller_envelope.mac +++ b/macros/runexample_moller_envelope.mac @@ -23,7 +23,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /process/list # Specify random number seed - DO NOT USE THE SAME SEED OVER AND OVER AGAIN #/remoll/seed 123456 diff --git a/macros/showermax_piondetector_optical_response_moller.in b/macros/showermax_piondetector_optical_response_moller.in index a8ca2f6e7..7d2d65303 100644 --- a/macros/showermax_piondetector_optical_response_moller.in +++ b/macros/showermax_piondetector_optical_response_moller.in @@ -14,7 +14,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set false +/remoll/kryptonite/disable # Only read detectors 28 and 30 /remoll/SD/disable_all diff --git a/macros/showermax_piondetector_optical_response_pion.in b/macros/showermax_piondetector_optical_response_pion.in index 65d2ad3de..758550f8b 100644 --- a/macros/showermax_piondetector_optical_response_pion.in +++ b/macros/showermax_piondetector_optical_response_pion.in @@ -14,7 +14,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set false +/remoll/kryptonite/disable # Only read detectors 28 and 30 /remoll/SD/disable_all diff --git a/macros/sim_dump_backscatter.in b/macros/sim_dump_backscatter.in index 112999af7..3ab030cb6 100644 --- a/macros/sim_dump_backscatter.in +++ b/macros/sim_dump_backscatter.in @@ -30,7 +30,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set false +/remoll/kryptonite/disable # Disable all but useful detectors /remoll/SD/disable_all diff --git a/macros/sim_dump_backscatter.mac b/macros/sim_dump_backscatter.mac index a7e3bcd85..c0d754737 100644 --- a/macros/sim_dump_backscatter.mac +++ b/macros/sim_dump_backscatter.mac @@ -30,7 +30,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set false +/remoll/kryptonite/disable /remoll/SD/disable_all /remoll/SD/enable 28 diff --git a/macros/tests/commit/test_beam.mac b/macros/tests/commit/test_beam.mac index e37f2ea52..a7fc35b73 100644 --- a/macros/tests/commit/test_beam.mac +++ b/macros/tests/commit/test_beam.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_elastic.mac b/macros/tests/commit/test_elastic.mac index 8676253fb..c3c8b74f8 100644 --- a/macros/tests/commit/test_elastic.mac +++ b/macros/tests/commit/test_elastic.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_elasticAl.mac b/macros/tests/commit/test_elasticAl.mac index aa2567046..c9938ca78 100644 --- a/macros/tests/commit/test_elasticAl.mac +++ b/macros/tests/commit/test_elasticAl.mac @@ -30,7 +30,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_elasticAl_DS.mac b/macros/tests/commit/test_elasticAl_DS.mac index 7b80cb80d..96f6e2d18 100644 --- a/macros/tests/commit/test_elasticAl_DS.mac +++ b/macros/tests/commit/test_elasticAl_DS.mac @@ -34,7 +34,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_elasticAl_US.mac b/macros/tests/commit/test_elasticAl_US.mac index 77eaf0ea4..9c40c1089 100644 --- a/macros/tests/commit/test_elasticAl_US.mac +++ b/macros/tests/commit/test_elasticAl_US.mac @@ -34,7 +34,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_inelastic.mac b/macros/tests/commit/test_inelastic.mac index 3b0b681e6..29207ced6 100644 --- a/macros/tests/commit/test_inelastic.mac +++ b/macros/tests/commit/test_inelastic.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_inelasticAl.mac b/macros/tests/commit/test_inelasticAl.mac index 117ff20cc..c2328bea2 100644 --- a/macros/tests/commit/test_inelasticAl.mac +++ b/macros/tests/commit/test_inelasticAl.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_moller.mac b/macros/tests/commit/test_moller.mac index afecc47f7..2db6c5368 100644 --- a/macros/tests/commit/test_moller.mac +++ b/macros/tests/commit/test_moller.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_pion.mac b/macros/tests/commit/test_pion.mac index d054ee97a..0b32ac07c 100644 --- a/macros/tests/commit/test_pion.mac +++ b/macros/tests/commit/test_pion.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/commit/test_raster.mac b/macros/tests/commit/test_raster.mac index c535f0cc8..414bed77a 100644 --- a/macros/tests/commit/test_raster.mac +++ b/macros/tests/commit/test_raster.mac @@ -57,7 +57,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/release/test_moller.mac b/macros/tests/release/test_moller.mac index 9311942ce..184c8c07b 100644 --- a/macros/tests/release/test_moller.mac +++ b/macros/tests/release/test_moller.mac @@ -41,7 +41,7 @@ # Make interactions with W, Cu, and Pb # realistic rather than pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 diff --git a/macros/tests/valgrind/test_moller.mac b/macros/tests/valgrind/test_moller.mac index afe7cd0e5..15c1fa490 100644 --- a/macros/tests/valgrind/test_moller.mac +++ b/macros/tests/valgrind/test_moller.mac @@ -40,7 +40,7 @@ /remoll/beamcurr 85 microampere # Make interactions with W, Cu, and Pb pure absorbers -/remoll/kryptonite/set true +/control/execute macros/kryptonite.mac /remoll/seed 123456 From 84570956e5c9f8c5ef1a3f8e14f6aacfce7064f9 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 16:03:18 -0500 Subject: [PATCH 05/20] Enable kryptonite in step limiter example due to tracking verbose --- macros/tests/unit/test_physlist_steplimiter.mac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macros/tests/unit/test_physlist_steplimiter.mac b/macros/tests/unit/test_physlist_steplimiter.mac index caeac4b4e..0917c0c78 100644 --- a/macros/tests/unit/test_physlist_steplimiter.mac +++ b/macros/tests/unit/test_physlist_steplimiter.mac @@ -1,12 +1,17 @@ # Enable step limiter physics /remoll/physlist/steplimiter/enable +# Enable kryptonite +/control/execute macros/kryptonite.mac + # Initialize and run /run/initialize +# Set step limit /remoll/geometry/userlimits/usermaxallowedstep h2Targ 5*mm # Run +/remoll/seed 123456 /event/verbose 1 /tracking/verbose 1 /run/beamOn 1 From 794593ef1bff18a546af74527f9436be75ef2d9d Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 18:36:25 -0500 Subject: [PATCH 06/20] Time the test macros. --- scripts/tests/test_macros.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_macros.sh b/scripts/tests/test_macros.sh index cc940157c..22f8574ef 100755 --- a/scripts/tests/test_macros.sh +++ b/scripts/tests/test_macros.sh @@ -66,7 +66,7 @@ for macro in ${macros}/${macroglob} ; do # Run remoll macro mkdir -p ${logfiles} - $prefix build/remoll ${macro} 2>&1 | tee ${logfiles}/${name}.log + time $prefix build/remoll ${macro} 2>&1 | tee ${logfiles}/${name}.log # Unit tests do not have output if [ "$suite" == "unit" ] ; then @@ -89,7 +89,7 @@ for macro in ${macros}/${macroglob} ; do echo "Starting analysis..." | tee ${logfiles}/analysis/${name}.log for rootmacro in ${analysis1}/${analysisglob} ${analysis2}/${analysisglob} ; do echo "Running analysis macro `basename ${rootmacro} .C`..." - root -q -b -l "${rootmacro}+(\"${rootfiles}\",\"${name}\")" 2>&1 | tee -a ${logfiles}/analysis/${name}.log + time root -q -b -l "${rootmacro}+(\"${rootfiles}\",\"${name}\")" 2>&1 | tee -a ${logfiles}/analysis/${name}.log done done From ceaf3372d8e299d037a6d5ce331b960184964ce5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 Feb 2019 18:36:37 -0500 Subject: [PATCH 07/20] Use kryptonite in these unit tests (some are at the 2 minute mark). --- macros/tests/unit/test_beam_energy.mac | 2 ++ macros/tests/unit/test_det_enable.mac | 2 ++ macros/tests/unit/test_gen_external.mac | 2 ++ macros/tests/unit/test_interval.mac | 1 + macros/tests/unit/test_polarization.mac | 2 ++ macros/tests/unit/test_seed.mac | 2 ++ macros/tests/unit/test_tracking_flag.mac | 2 ++ 7 files changed, 13 insertions(+) diff --git a/macros/tests/unit/test_beam_energy.mac b/macros/tests/unit/test_beam_energy.mac index f58100fd8..5714f596e 100644 --- a/macros/tests/unit/test_beam_energy.mac +++ b/macros/tests/unit/test_beam_energy.mac @@ -1,5 +1,7 @@ # This will produce four files test_moller_$E.root, $E = 8,9,10,11 GeV. +/control/execute macros/kryptonite.mac + /run/initialize /remoll/filename test_moller_8.root diff --git a/macros/tests/unit/test_det_enable.mac b/macros/tests/unit/test_det_enable.mac index 451611be3..9cceae6c8 100644 --- a/macros/tests/unit/test_det_enable.mac +++ b/macros/tests/unit/test_det_enable.mac @@ -1,5 +1,7 @@ /run/initialize +/control/execute macros/kryptonite.mac + # Print all detectors /remoll/SD/print_all diff --git a/macros/tests/unit/test_gen_external.mac b/macros/tests/unit/test_gen_external.mac index 55e853a04..9198940f1 100644 --- a/macros/tests/unit/test_gen_external.mac +++ b/macros/tests/unit/test_gen_external.mac @@ -3,6 +3,8 @@ /remoll/parallel/setfile geometry/mollerParallel.gdml /remoll/physlist/parallel/enable +/control/execute macros/kryptonite.mac + /run/initialize /remoll/evgen/set moller diff --git a/macros/tests/unit/test_interval.mac b/macros/tests/unit/test_interval.mac index 97c055cf8..36c3b1dc4 100644 --- a/macros/tests/unit/test_interval.mac +++ b/macros/tests/unit/test_interval.mac @@ -1,3 +1,4 @@ +/control/execute macros/kryptonite.mac /run/initialize /remoll/evgen/set moller /remoll/interval 5 diff --git a/macros/tests/unit/test_polarization.mac b/macros/tests/unit/test_polarization.mac index 7e663173c..329a0bda3 100644 --- a/macros/tests/unit/test_polarization.mac +++ b/macros/tests/unit/test_polarization.mac @@ -1,5 +1,7 @@ /run/initialize +/control/execute macros/kryptonite.mac + /remoll/addfield map_directory/blockyHybrid_rm_3.0.txt /remoll/addfield map_directory/blockyUpstream_rm_1.1.txt diff --git a/macros/tests/unit/test_seed.mac b/macros/tests/unit/test_seed.mac index 52af1c2af..035bd595c 100644 --- a/macros/tests/unit/test_seed.mac +++ b/macros/tests/unit/test_seed.mac @@ -6,6 +6,8 @@ /run/initialize +/control/execute macros/kryptonite.mac + /remoll/filename test_seed_0.root /run/beamOn 100 diff --git a/macros/tests/unit/test_tracking_flag.mac b/macros/tests/unit/test_tracking_flag.mac index 585d16c49..8f1a8d074 100644 --- a/macros/tests/unit/test_tracking_flag.mac +++ b/macros/tests/unit/test_tracking_flag.mac @@ -1,5 +1,7 @@ /run/initialize +/control/execute macros/kryptonite.mac + /remoll/tracking/set 0 /remoll/filename test_tracking_flag_0.root /run/beamOn 100 From 5e16bd9acbc22fba5202b7bf8a329e656f45f958 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 5 May 2019 14:17:43 -0400 Subject: [PATCH 08/20] Shift all positions.xml to 0 == hall pivot ref frame --- geometry/positions.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/geometry/positions.xml b/geometry/positions.xml index 233d22934..f44f73a17 100644 --- a/geometry/positions.xml +++ b/geometry/positions.xml @@ -7,34 +7,34 @@ --> - + - + - + - + - + - + - + - + - + - + From 246e77e6d51e8e0c01870a10a3824839c8e81bf2 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 5 May 2019 14:18:10 -0400 Subject: [PATCH 09/20] Shift beam generator raster reference to 0 == hall pivot ref frame --- src/remollGenBeam.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remollGenBeam.cc b/src/remollGenBeam.cc index d16b16499..d6f6065b4 100644 --- a/src/remollGenBeam.cc +++ b/src/remollGenBeam.cc @@ -21,7 +21,7 @@ remollGenBeam::remollGenBeam() : remollVEventGen("beam"), - fOriginMean(0.0*m,0.0*m,-6.7*m), + fOriginMean(0.0*m,0.0*m,-12.787*m), fOriginSpread(0.0,0.0,0.0), fOriginModelX(kOriginModelFlat), fOriginModelY(kOriginModelFlat), @@ -30,7 +30,7 @@ remollGenBeam::remollGenBeam() fCorrelation(0.149*mrad/mm,0.149*mrad/mm,0.0), fPolarization(0.0,0.0,0.0), fRaster(5*mm,5*mm,0.0), - fRasterRefZ(0.5*m), + fRasterRefZ(-5.587*m), fParticleName("e-") { fSampType = kNoTargetVolume; From f3e2ad13686d7c1f07888209e7b7cf086a954bbe Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 5 May 2019 14:19:28 -0400 Subject: [PATCH 10/20] Removed unused old position definitions --- geometry/mollerMother_5open.gdml | 2 +- geometry/mollerMother_black.gdml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/geometry/mollerMother_5open.gdml b/geometry/mollerMother_5open.gdml index 8a4bda0cf..62160917f 100644 --- a/geometry/mollerMother_5open.gdml +++ b/geometry/mollerMother_5open.gdml @@ -26,7 +26,7 @@ - + diff --git a/geometry/mollerMother_black.gdml b/geometry/mollerMother_black.gdml index e1f637a6a..aa023b7b7 100644 --- a/geometry/mollerMother_black.gdml +++ b/geometry/mollerMother_black.gdml @@ -8,11 +8,8 @@ - - - - + From 966ed16b99f81d6d3e704b1b040746684a7c0d44 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 7 May 2019 10:48:18 -0400 Subject: [PATCH 11/20] Move target back to center of scattering chamber volumes stack --- geometry/target/subTargetRegion.gdml | 2 +- geometry/target/target12C.gdml | 2 +- geometry/target/targetDaughter.gdml | 2 +- geometry/target/targetDaughter_Clamshell_Optimized.gdml | 2 +- geometry/target/targetDaughter_acceptanceDefinition.gdml | 2 +- geometry/target/targetDaughter_merged.gdml | 2 +- geometry/target/targetDaughter_noShlds.gdml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/geometry/target/subTargetRegion.gdml b/geometry/target/subTargetRegion.gdml index 291f8e88a..a1024061a 100644 --- a/geometry/target/subTargetRegion.gdml +++ b/geometry/target/subTargetRegion.gdml @@ -10,7 +10,7 @@ &matrices; - + diff --git a/geometry/target/target12C.gdml b/geometry/target/target12C.gdml index a95e459dd..f4a59284b 100644 --- a/geometry/target/target12C.gdml +++ b/geometry/target/target12C.gdml @@ -2,7 +2,7 @@ - + diff --git a/geometry/target/targetDaughter.gdml b/geometry/target/targetDaughter.gdml index 9b357b38a..aee078d2a 100644 --- a/geometry/target/targetDaughter.gdml +++ b/geometry/target/targetDaughter.gdml @@ -2,7 +2,7 @@ - + diff --git a/geometry/target/targetDaughter_Clamshell_Optimized.gdml b/geometry/target/targetDaughter_Clamshell_Optimized.gdml index dbc37effe..f8e399d25 100644 --- a/geometry/target/targetDaughter_Clamshell_Optimized.gdml +++ b/geometry/target/targetDaughter_Clamshell_Optimized.gdml @@ -13,7 +13,7 @@ - + diff --git a/geometry/target/targetDaughter_acceptanceDefinition.gdml b/geometry/target/targetDaughter_acceptanceDefinition.gdml index dbc37effe..f8e399d25 100644 --- a/geometry/target/targetDaughter_acceptanceDefinition.gdml +++ b/geometry/target/targetDaughter_acceptanceDefinition.gdml @@ -13,7 +13,7 @@ - + diff --git a/geometry/target/targetDaughter_merged.gdml b/geometry/target/targetDaughter_merged.gdml index 1b5539ba7..e350e2afe 100644 --- a/geometry/target/targetDaughter_merged.gdml +++ b/geometry/target/targetDaughter_merged.gdml @@ -10,7 +10,7 @@ &matrices; - + diff --git a/geometry/target/targetDaughter_noShlds.gdml b/geometry/target/targetDaughter_noShlds.gdml index 45de62c0c..0d0504d0d 100644 --- a/geometry/target/targetDaughter_noShlds.gdml +++ b/geometry/target/targetDaughter_noShlds.gdml @@ -10,7 +10,7 @@ &matrices; - + From f70102e5a4493100e26f01ade24c9d115a4ae7eb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 7 May 2019 10:49:09 -0400 Subject: [PATCH 12/20] Move target, US and hybrid, and detectors 1. target goes 1.5 m downstream and is shortened to 1.25 m 2. upstream and hybrid both moved 1 m downstream 3. detectors move 0.5 m upstream Distance between center of target and detector plane is 26.5 m. --- geometry/positions.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/geometry/positions.xml b/geometry/positions.xml index f44f73a17..9f7aed024 100644 --- a/geometry/positions.xml +++ b/geometry/positions.xml @@ -10,31 +10,31 @@ - + - + - + - + - + - + - + - + - + From ae9546b064bacb8a1913a81113fd6a147094526d Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 7 May 2019 10:50:08 -0400 Subject: [PATCH 13/20] Move beam generator raster reference to center of target Also, for now, moved raster origin (i.e. effective magnet focus position) downstream by 1 m so the angle-position correlations are unchanged. --- src/remollGenBeam.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remollGenBeam.cc b/src/remollGenBeam.cc index d6f6065b4..ce120b43f 100644 --- a/src/remollGenBeam.cc +++ b/src/remollGenBeam.cc @@ -21,7 +21,7 @@ remollGenBeam::remollGenBeam() : remollVEventGen("beam"), - fOriginMean(0.0*m,0.0*m,-12.787*m), + fOriginMean(0.0*m,0.0*m,-11.787*m), fOriginSpread(0.0,0.0,0.0), fOriginModelX(kOriginModelFlat), fOriginModelY(kOriginModelFlat), @@ -30,7 +30,7 @@ remollGenBeam::remollGenBeam() fCorrelation(0.149*mrad/mm,0.149*mrad/mm,0.0), fPolarization(0.0,0.0,0.0), fRaster(5*mm,5*mm,0.0), - fRasterRefZ(-5.587*m), + fRasterRefZ(-4.587*m), fParticleName("e-") { fSampType = kNoTargetVolume; From ae4b71d5804fa09006f40f83e4a64364568502dd Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 17 May 2019 13:53:47 -0400 Subject: [PATCH 14/20] Also shift the virtual tracking detector upstream by 1 meter here, see 59468ee03cdbf8558c1cd53283b54735baf6a9a8. Probably invalidates merge of #262 due to conflict. Ah well... --- geometry/positions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geometry/positions.xml b/geometry/positions.xml index 9f7aed024..126b6962e 100644 --- a/geometry/positions.xml +++ b/geometry/positions.xml @@ -21,7 +21,7 @@ - + From 39bf6b6ce0c55bc15c36d8e7043ed6ea1e3dcf49 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 20 Jun 2019 11:52:23 -0400 Subject: [PATCH 15/20] Add separate front and back poly shield thickness for upstream --- geometry/upstream/upstreamDaughter_merged.gdml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/geometry/upstream/upstreamDaughter_merged.gdml b/geometry/upstream/upstreamDaughter_merged.gdml index 40ce19d2b..fe29d7d89 100644 --- a/geometry/upstream/upstreamDaughter_merged.gdml +++ b/geometry/upstream/upstreamDaughter_merged.gdml @@ -152,18 +152,21 @@ + + - + - + + - + @@ -718,7 +721,7 @@ - + From 72e7764506751612faebc9169b573fa4329b4bfc Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 20 Jun 2019 11:53:58 -0400 Subject: [PATCH 16/20] Avoid overlap with 6 mm less poly at back end --- geometry/upstream/upstreamDaughter_merged.gdml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geometry/upstream/upstreamDaughter_merged.gdml b/geometry/upstream/upstreamDaughter_merged.gdml index fe29d7d89..628de7b26 100644 --- a/geometry/upstream/upstreamDaughter_merged.gdml +++ b/geometry/upstream/upstreamDaughter_merged.gdml @@ -153,7 +153,7 @@ - + From 1806cc8238e7aa6da431ee6e341da54a9fceecc2 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 20 Jun 2019 11:56:21 -0400 Subject: [PATCH 17/20] Avoid overlap with 75% less poly at front end, remove padding The main goal here is to get this merged in. The concrete shielding of the target region is overlapping with the upstream spectrometer poly shielding by about 75 cm. This commit fixes the overlap in an adhoc way. Rather than removing concrete DS shielding on the target, I've chosen to remove US shielding on the upstream spectrometer in the hope that this will have less impact. A proper study is obviously needed. --- geometry/upstream/upstreamDaughter_merged.gdml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geometry/upstream/upstreamDaughter_merged.gdml b/geometry/upstream/upstreamDaughter_merged.gdml index 628de7b26..9ed849ab7 100644 --- a/geometry/upstream/upstreamDaughter_merged.gdml +++ b/geometry/upstream/upstreamDaughter_merged.gdml @@ -132,7 +132,7 @@ - + @@ -152,7 +152,7 @@ - + From f9055a8d881e34a22b8a549d9472218a8a3154fd Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 20 Jun 2019 11:56:33 -0400 Subject: [PATCH 18/20] Add merged geometry to geometry menu. --- macros/gui.mac | 1 + 1 file changed, 1 insertion(+) diff --git a/macros/gui.mac b/macros/gui.mac index ac012f19a..fbfc2cfe3 100644 --- a/macros/gui.mac +++ b/macros/gui.mac @@ -25,6 +25,7 @@ /gui/addButton geom geometry/mollerMother.gdml "/remoll/geometry/setfile geometry/mollerMother.gdml" /gui/addButton geom geometry/mollerMother_dump.gdml "/remoll/geometry/setfile geometry/mollerMother_dump.gdml" /gui/addButton geom geometry/mollerMother_empty.gdml "/remoll/geometry/setfile geometry/mollerMother_empty.gdml" +/gui/addButton geom geometry/mollerMother_merged.gdml "/remoll/geometry/setfile geometry/mollerMother_merged.gdml" /gui/addButton geom geometry/mollerMother_trackingOnly.gdml "/remoll/geometry/setfile geometry/mollerMother_trackingOnly.gdml" /gui/addButton geom geometry/mollerMother_showerMaxOnly.gdml "/remoll/geometry/setfile geometry/mollerMother_showerMaxOnly.gdml" /gui/addButton geom geometry/pionDetectorLucite.gdml "/remoll/geometry/setfile geometry/pionDetectorLucite.gdml" From bd9ac66c7c04bb608f999dde02f0a131a982e498 Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Mon, 5 Aug 2019 11:49:25 -0400 Subject: [PATCH 19/20] A plotting tool useful for envelope studies --- analysis/rootScripts/plotDetPlaneCuts.C | 146 ++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 analysis/rootScripts/plotDetPlaneCuts.C diff --git a/analysis/rootScripts/plotDetPlaneCuts.C b/analysis/rootScripts/plotDetPlaneCuts.C new file mode 100644 index 000000000..8c9b75d84 --- /dev/null +++ b/analysis/rootScripts/plotDetPlaneCuts.C @@ -0,0 +1,146 @@ +#include +#include +#include +#include "TCut.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void plotDetPlaneCuts(Double_t r_outer_cut=0, Int_t n_steps = 15, Double_t r_step = 10.0, Double_t z_cut = 27000.0, Int_t detector = 28, TString type = "moller", Int_t radialCut = 1, TString fname = "NULL"){ + /* I want to take a given ROOT output file and plot a specific detector's + * hit.x/y/r/theta, etc. distributions (weighted by rate) + * and using cuts that are set at the z_cut position, cutting out all part.tjr + * (calculated radii) tracks that are > r_outer_cut + * + * I would also like to have this loop over r_outer_cut from some initial + * to final in fine steps and make a plot of the number of cut out/in epelastic/moller + * particles (weighted by rate) vs. that cut radius + * + * I would also like to do a similar scan in z maybe... or at least compare at multiple + * z cut places */ + + if (r_outer_cut==0) { + std::cout<<"Usage: Load Data Root File to gDirectory, root> .x plotDetPlaneCuts(r_outer_cut=0, n_steps = 15, r_step = 10.0, z_cut = 27000.0, detector = 28, type = \"moller\")\n\n"<Get("T"); + } + else { + T->Add(fname); + } + FILE *fp; + fp = fopen(Form("Output_cuts.txt"),"a"); + + Int_t n_events = 100000; + Int_t start_event_n = 1; + Double_t z_cut_space = 1.0; // mm + + const Int_t n_canvases = 100; + const Int_t n_plots = 1; + Double_t norm_rate_weight_all[n_canvases*n_plots]; + Double_t norm_rate_weight_in[n_canvases*n_plots]; + Double_t norm_rate_weight_out[n_canvases*n_plots]; + TCanvas *canvas[n_canvases]; + TH1F *totalRate[n_canvases*n_plots]; + TH1F *r_inside[n_canvases*n_plots]; + TH1F *r_outside[n_canvases*n_plots]; + TH2F *xy_inside[n_canvases*n_plots]; + TH2F *xy_outside[n_canvases*n_plots]; + + for (Int_t n_canvas = 0; n_canvas < n_steps; n_canvas++) { + r_outer_cut = r_outer_cut - r_step; + canvas[n_canvas] = new TCanvas(Form("Plot of %s in detector %d hits for z plane %f, r > %f",type.Data(),detector,z_cut,r_outer_cut),Form("Plot of %s in detector %d hits for z plane %f, r > %f",type.Data(),detector,z_cut,r_outer_cut)); + canvas[n_canvas]->Divide(n_plots*2,2); + for (Int_t n_plot = 0; n_plotcd(n_plot+1); + T->Draw(Form("hit.r[0]>>h_totalRate_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f)",detector,z_cut,z_cut_space,z_cut,z_cut_space),"",n_events,start_event_n); + totalRate[n_canvas*n_plots + n_plot] = (TH1F*)gROOT->FindObject(Form("h_totalRate_%d",n_canvas*n_plots + n_plot)); + norm_rate_weight_all[n_canvas*n_plots + n_plot] = totalRate[n_canvas*n_plots + n_plot]->Integral(); + Printf("Normalization total rate weight = %f",norm_rate_weight_all[n_canvas*n_plots + n_plot]); + + // Radial + if (radialCut == 1){ + T->Draw(Form("hit.r[0]>>h_r_inside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && sqrt((part.tjx*part.tjx)+(part.tjy*part.tjy)) < %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + else { + // X cut + T->Draw(Form("hit.r[0]>>h_r_inside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && part.tjx < %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + r_inside[n_canvas*n_plots + n_plot] = (TH1F*)gROOT->FindObject(Form("h_r_inside_%d",n_canvas*n_plots + n_plot)); + norm_rate_weight_in[n_canvas*n_plots + n_plot] = r_inside[n_canvas*n_plots + n_plot]->Integral(); + + canvas[n_canvas]->cd(n_plot+2); + // Radial + if (radialCut == 1){ + T->Draw(Form("hit.r[0]>>h_r_outside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && sqrt((part.tjx*part.tjx)+(part.tjy*part.tjy)) > %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + // X cut + } + else { + T->Draw(Form("hit.r[0]>>h_r_outside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && part.tjx > %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + r_outside[n_canvas*n_plots + n_plot] = (TH1F*)gROOT->FindObject(Form("h_r_outside_%d",n_canvas*n_plots + n_plot)); + norm_rate_weight_out[n_canvas*n_plots + n_plot] = r_outside[n_canvas*n_plots + n_plot]->Integral(); + + canvas[n_canvas]->cd(n_plot+3); + // Radial + if (radialCut == 1){ + T->Draw(Form("hit.y[0]:hit.x[0]>>h_xy_inside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && sqrt((part.tjx*part.tjx)+(part.tjy*part.tjy)) < %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + else { + // X cut + T->Draw(Form("hit.y[0]:hit.x[0]>>h_xy_inside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && part.tjx < %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + xy_inside[n_canvas*n_plots + n_plot] = (TH2F*)gROOT->FindObject(Form("h_xy_inside_%d",n_canvas*n_plots + n_plot)); + + canvas[n_canvas]->cd(n_plot+4); + // Radial + if (radialCut == 1){ + T->Draw(Form("hit.y[0]:hit.x[0]>>h_xy_outside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && sqrt((part.tjx*part.tjx)+(part.tjy*part.tjy)) > %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + // X cut + else { + T->Draw(Form("hit.y[0]:hit.x[0]>>h_xy_outside_%d",n_canvas*n_plots + n_plot),Form("rate*(hit.det[0] == %d && part.tjz > %f-%f && part.tjz < %f+%f && part.tjx > %f)",detector,z_cut,z_cut_space,z_cut,z_cut_space,r_outer_cut),"",n_events,start_event_n); + } + xy_outside[n_canvas*n_plots + n_plot] = (TH2F*)gROOT->FindObject(Form("h_xy_outside_%d",n_canvas*n_plots + n_plot)); + + // CAMGUIN feature: writeFile_h takes the name of the variable, the value to set it to, the "run number" which is a unique identifier, the split number (which is another unique identifier), and the number of runs (another one) + //writeFile_h("r_outer_cut", r_outer_cut, r_outer_cut, z_cut, detector*1.0); + //writeFile_h("z_cut", z_cut, r_outer_cut, z_cut, detector*1.0); + //writeFile_h("detector", detector*1.0, r_outer_cut, z_cut, detector*1.0); + //writeFile_h(Form("%s_norm_rate_weight_all",type.Data()), norm_rate_weight_all[n_canvas*n_plots + n_plot], r_outer_cut, z_cut, detector*1.0); + //writeFile_h(Form("%s_norm_rate_weight_in",type.Data()), norm_rate_weight_in[n_canvas*n_plots + n_plot], r_outer_cut, z_cut, detector*1.0); + //writeFile_h(Form("%s_norm_rate_weight_out",type.Data()), norm_rate_weight_out[n_canvas*n_plots + n_plot], r_outer_cut, z_cut, detector*1.0); + + if(fp!=NULL){ + fprintf(fp,"r_outer_cut = %f, z_cut = %f, detector = %d, %s_norm_rate_weight_all = %f, %s_norm_rate_weight_in = %f, %s_norm_rate_weight_out = %f\n",r_outer_cut,z_cut,detector,type.Data(),norm_rate_weight_all[n_canvas*n_plots + n_plot],type.Data(),norm_rate_weight_in[n_canvas*n_plots + n_plot],type.Data(),norm_rate_weight_out[n_canvas*n_plots + n_plot]); + } + } + if (n_canvas == 0 && n_steps != 1){ + canvas[n_canvas]->SaveAs(Form("%s_norm_rate_weight.pdf(",type.Data())); + } + else if (n_canvas < n_steps || n_steps==1) { + canvas[n_canvas]->SaveAs(Form("%s_norm_rate_weight.pdf",type.Data())); + } + else { + canvas[n_canvas]->SaveAs(Form("%s_norm_rate_weight.pdf)",type.Data())); + } + } + + fclose(fp); +} From 415fe4d0df74f8c6bf03e502c822f56c2a1d440e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 5 Sep 2019 10:43:11 -0500 Subject: [PATCH 20/20] Add branch name to test dirs --- scripts/tests/targz_macros.sh | 13 ++++++++----- scripts/tests/test_geometries.sh | 5 ++++- scripts/tests/test_macros.sh | 7 +++++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/tests/targz_macros.sh b/scripts/tests/targz_macros.sh index 4063ae298..d8b6be2d6 100755 --- a/scripts/tests/targz_macros.sh +++ b/scripts/tests/targz_macros.sh @@ -12,10 +12,13 @@ dir=`readlink -f ${dir}` # The test suite can be specified as first argument, default is "commit" suite="${1:-commit}" +# The branch name is used to avoid clobbering comparative output +branch=`git rev-parse --abbrev-ref HEAD` + # Pack log files -tar -czvf remolltest.${suite}.log.tar.gz --transform 's|logfiles/tests/||g' logfiles/tests/${suite}/*.log -tar -czvf remolltest.${suite}.analysis.log.tar.gz --transform 's|logfiles/tests/||g' logfiles/tests/${suite}/analysis/*.log +tar -czvf remolltest.${suite}.log.tar.gz --transform 's|logfiles/tests/||g' logfiles/tests/${suite}/${branch}/*.log +tar -czvf remolltest.${suite}.analysis.log.tar.gz --transform 's|logfiles/tests/||g' logfiles/tests/${suite}/${branch}/analysis/*.log # Pack analysis products -tar -czvf remolltest.${suite}.root.tar.gz --transform 's|rootfiles/tests/||g' rootfiles/tests/${suite}/*.root -tar -czvf remolltest.${suite}.analysis.pdf.tar.gz --transform 's|rootfiles/tests/||g' rootfiles/tests/${suite}/analysis/*.pdf -tar -czvf remolltest.${suite}.analysis.root.tar.gz --transform 's|rootfiles/tests/||g' rootfiles/tests/${suite}/analysis/*.root +tar -czvf remolltest.${suite}.root.tar.gz --transform 's|rootfiles/tests/||g' rootfiles/tests/${suite}/${branch}/*.root +tar -czvf remolltest.${suite}.analysis.pdf.tar.gz --transform 's|rootfiles/tests/||g' rootfiles/tests/${suite}/${branch}/analysis/*.pdf +tar -czvf remolltest.${suite}.analysis.root.tar.gz --transform 's|rootfiles/tests/||g' rootfiles/tests/${suite}/${branch}/analysis/*.root diff --git a/scripts/tests/test_geometries.sh b/scripts/tests/test_geometries.sh index 264bb6d52..6d278966a 100755 --- a/scripts/tests/test_geometries.sh +++ b/scripts/tests/test_geometries.sh @@ -14,11 +14,14 @@ suite="${1:-load}" shopt -s nullglob geomglob="${2:-mollerMother*.gdml}" +# The branch name is used to avoid clobbering comparative output +branch=`git rev-parse --abbrev-ref HEAD` + # Set test suite input directories geom=${dir}/geometry # Set test suite output directories -logfiles=${dir}/logfiles/tests/geometry/${suite} +logfiles=${dir}/logfiles/tests/geometry/${suite}/${branch} mkdir -p ${logfiles} # Usage information diff --git a/scripts/tests/test_macros.sh b/scripts/tests/test_macros.sh index 79904f9c9..9feecbefe 100755 --- a/scripts/tests/test_macros.sh +++ b/scripts/tests/test_macros.sh @@ -18,14 +18,17 @@ macroglob="${2:-*.mac}" shopt -s nullglob analysisglob="${3:-*.C}" +# The branch name is used to avoid clobbering comparative output +branch=`git rev-parse --abbrev-ref HEAD` + # Set test suite input directories macros=${dir}/macros/tests/${suite} analysis1=${dir}/analysis/tests analysis2=${dir}/analysis/tests/${suite} # Set test suite output directories -rootfiles=${dir}/rootfiles/tests/${suite} -logfiles=${dir}/logfiles/tests/${suite} +rootfiles=${dir}/rootfiles/tests/${suite}/${branch} +logfiles=${dir}/logfiles/tests/${suite}/${branch} mkdir -p ${logfiles} ${rootfiles} ${rootfiles}/analysis