Skip to content

Commit

Permalink
SND: allow disabling, disable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
olantwin committed Sep 17, 2024
1 parent 396b36e commit f956373
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
4 changes: 3 additions & 1 deletion geometry/geometry_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 25 additions & 13 deletions macro/run_simScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion python/shipDet_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f956373

Please sign in to comment.