diff --git a/IcedustControl/modules/SimG4.py b/IcedustControl/modules/SimG4.py index afb5f14..7ec24fd 100644 --- a/IcedustControl/modules/SimG4.py +++ b/IcedustControl/modules/SimG4.py @@ -18,7 +18,7 @@ class SimG4(cometModule.cometModule): """ ####################################################################### - def getModuleName(self): + def getModuleName(self): """ Returns the module name """ @@ -26,11 +26,16 @@ class SimG4(cometModule.cometModule): ####################################################################### - def getShortModuleName(self): + def getShortModuleName(self): """ Returns the short module name. Used in file naming. """ - return "SG4" + black_holes_entry=self.getOption("black_holes_entry") + black_holes_exit=self.getOption("black_holes_exit") + if black_holes_entry or black_holes_exit: + return "SG4BH" + else: + return "SG4" ####################################################################### @@ -373,27 +378,32 @@ class SimG4(cometModule.cometModule): """ Setup the controls for black hole monitors """ - contents="\n# Black holes:\n" - name = self.createFileName("rootracker").tmp - self.monitorsfilename = name - contents+="/db/blackHoleFile "+name+"\n" - + # Check for black holes black_holes_entry=self.getOption("black_holes_entry") - if black_holes_entry: - for volume in black_holes_entry.split(): - volume=volume.split(":") - component = volume[0] - if len(volume)>1: volume="".join(volume[1:])+":" - else: volume="" - str(component) - contents+="/comet/"+component+"/Readout "+volume+"Readout = black-hole\n" black_holes_exit=self.getOption("black_holes_exit") - if black_holes_exit: - for volume in black_holes_exit.split(): - volume=volume.split(":") - component = volume[0] - if len(volume)>1: volume="".join(volume[1:])+":" - else: volume="" - str(component) - contents+="/comet/"+component+"/Readout "+volume+"Readout = black-hole-onExit\n" + # Title the section in the macro + contents="\n# Black holes:\n" + # Check for black hole entries or exits + if black_holes_entry or black_holes_exit: + name = self.createFileName("rootracker").tmp + self.monitorsfilename = name + contents+="/db/blackHoleFile "+name+"\n" + # Check for entries + if black_holes_entry: + for volume in black_holes_entry.split(): + volume=volume.split(":") + component = volume[0] + if len(volume)>1: volume="".join(volume[1:])+":" + else: volume="" + str(component) + contents+="/comet/"+component+"/Readout "+volume+"Readout = black-hole\n" + # Check for exits + if black_holes_exit: + for volume in black_holes_exit.split(): + volume=volume.split(":") + component = volume[0] + if len(volume)>1: volume="".join(volume[1:])+":" + else: volume="" + str(component) + contents+="/comet/"+component+"/Readout "+volume+"Readout = black-hole-onExit\n" return contents