From f9563737be2fa302d7d8d1f6b42c576d529efa6f Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Tue, 10 Sep 2024 15:43:20 +0200 Subject: [PATCH] SND: allow disabling, disable by default --- CHANGELOG.md | 2 ++ geometry/geometry_config.py | 4 +++- macro/run_simScript.py | 38 ++++++++++++++++++++++++------------- python/shipDet_conf.py | 4 +++- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c1611a1c..989521fd58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ it in future. * Automatically built documentation using Doxygen * Add CODEOWNERS file to automatically trigger reviews by the relevant experts * Add different configuration files for vacuum /helium for the Decay Vessel +* Add option to enable/disable SND ### Fixed @@ -44,3 +45,4 @@ it in future. * Remove uses of future and past modules #473 * Remove Geant3 dependency * Remove unimplemented event display functions (see #497) +* Disable SND by default diff --git a/geometry/geometry_config.py b/geometry/geometry_config.py index 2833107e61..a22e481df1 100644 --- a/geometry/geometry_config.py +++ b/geometry/geometry_config.py @@ -61,11 +61,13 @@ scName = None if "DecayVolumeMedium" not in globals(): DecayVolumeMedium = "vacuums" - +if "SND" not in globals(): + SND = True with ConfigRegistry.register_config("basic") as c: c.DecayVolumeMedium = DecayVolumeMedium + c.SND = SND c.SC_mag = SC_mag c.scName = scName diff --git a/macro/run_simScript.py b/macro/run_simScript.py index b273ab91ef..615df8b3c3 100755 --- a/macro/run_simScript.py +++ b/macro/run_simScript.py @@ -125,7 +125,7 @@ parser.add_argument("--Muflux", dest="muflux", help="Muflux fixed target setup", required=False, action="store_true") parser.add_argument("--charm", dest="charm", help="!=0 create charm detector instead of SHiP", required=False, default=0) parser.add_argument("--CharmdetSetup", dest="CharmdetSetup", help="1 charm cross section setup, 0 muon flux setup", required=False, default=0, type=int) -parser.add_argument("--CharmTarget", dest="CharmTarget", help="six different configurations used in July 2018 exposure for charm", required=False, default=3, type=int) +parser.add_argument("--CharmTarget", dest="CharmTarget", help="six different configurations used in July 2018 exposure for charm", default=3, type=int, choices=[1, 2, 3, 4, 5, 6, 16]) parser.add_argument("-F", dest="deepCopy", help="default = False: copy only stable particles to stack, except for HNL events", required=False, action="store_true") parser.add_argument("-t", "--test", dest="testFlag", help="quick test", required=False,action="store_true") parser.add_argument("--dry-run", dest="dryrun", help="stop after initialize", required=False,action="store_true") @@ -143,6 +143,8 @@ const="helium", default="vacuums" ) +parser.add_argument("--SND", dest="SND", help="Activate SND.", action='store_true') +parser.add_argument("--noSND", dest="SND", help="Deactivate SND. NOOP, as it currently defaults to off.", action='store_false') options = parser.parse_args() @@ -215,19 +217,29 @@ # - muShieldDesign = 7 # 7 = short design+magnetized hadron absorber # - targetOpt = 5 # 0=solid >0 sliced, 5: 5 pieces of tungsten, 4 H20 slits, 17: Mo + W +H2O (default) # nuTauTargetDesign = 0 # 0 = TP, 1 = NEW with magnet, 2 = NEW without magnet, 3 = 2018 design -if options.charm == 0: ship_geo = ConfigRegistry.loadpy("$FAIRSHIP/geometry/geometry_config.py", Yheight = options.dy, tankDesign = options.dv, \ - muShieldDesign = options.ds, nuTauTargetDesign=options.nud, CaloDesign=options.caloDesign, \ - strawDesign=options.strawDesign, muShieldGeo=options.geofile, - muShieldStepGeo=options.muShieldStepGeo, muShieldWithCobaltMagnet=options.muShieldWithCobaltMagnet, - SC_mag=options.SC_mag, scName=options.scName, DecayVolumeMedium =options.helium) +if not options.charm: + ship_geo = ConfigRegistry.loadpy( + "$FAIRSHIP/geometry/geometry_config.py", + Yheight=options.dy, + tankDesign=options.dv, + muShieldDesign=options.ds, + nuTauTargetDesign=options.nud, + CaloDesign=options.caloDesign, + strawDesign=options.strawDesign, + muShieldGeo=options.geofile, + muShieldStepGeo=options.muShieldStepGeo, + muShieldWithCobaltMagnet=options.muShieldWithCobaltMagnet, + SC_mag=options.SC_mag, + scName=options.scName, + DecayVolumeMedium=options.helium, + SND=options.SND, + ) else: - ship_geo = ConfigRegistry.loadpy("$FAIRSHIP/geometry/charm-geometry_config.py", Setup = options.CharmdetSetup, cTarget = options.CharmTarget) - if options.CharmdetSetup == 0: print("Setup for muon flux measurement has been set") - else: - print("Setup for charm cross section measurement has been set") - if (((options.CharmTarget > 6) or (options.CharmTarget < 0)) and (options.CharmTarget != 16)): #check if proper option for emulsion target has been set - print("ERROR: unavailable option for CharmTarget. Currently implemented options: 1,2,3,4,5,6,16") - 1/0 + ship_geo = ConfigRegistry.loadpy("$FAIRSHIP/geometry/charm-geometry_config.py", Setup = options.CharmdetSetup, cTarget = options.CharmTarget) + if not options.CharmdetSetup: + print("Setup for muon flux measurement has been set") + else: + print("Setup for charm cross section measurement has been set") # switch off magnetic field to measure muon flux #ship_geo.muShield.Field = 0. #ship_geo.EmuMagnet.B = 0. diff --git a/python/shipDet_conf.py b/python/shipDet_conf.py index 0f6f21861c..069b4adb07 100644 --- a/python/shipDet_conf.py +++ b/python/shipDet_conf.py @@ -146,6 +146,8 @@ def configure(run, ship_geo): ship_geo.NuTauTT.design = 0 if not hasattr(ship_geo, "EcalOption"): ship_geo.EcalOption = 1 + if not hasattr(ship_geo, "SND"): + ship_geo.SND = True latestShipGeo = ConfigRegistry.loadpy( "$FAIRSHIP/geometry/geometry_config.py", Yheight=ship_geo.Yheight / u.m, @@ -312,7 +314,7 @@ def configure(run, ship_geo): fairship + "/geometry/veto_config_vacuums.yaml" ) # put conditions for the design - if hasattr(ship_geo, "tauMudet"): # don't support old designs + if hasattr(ship_geo, "tauMudet") and ship_geo.SND: # don't support old designs if ship_geo.muShieldDesign >= 7 and hasattr(ship_geo.tauMudet, "Xtot"): taumuondetector = ROOT.NuTauMudet( "NuTauMudet", ship_geo.tauMudet.zMudetC, ROOT.kTRUE