""" A module to control processing when inputting neut file. Eventually this should be running neut but for now it just takes an input file and renames it. """ import os.path import shutil import re import random import cometModule class neut(cometModule.cometModule): """ A class to control processing when inputting neut file. Eventually this should be running neut but for now it just takes an input file and renames it. """ ################################################################### def getModuleName(self): """Return module name""" return "neut" ################################################################### def getShortModuleName(self): """Return module name""" return "numc" ################################################################### def getOutputFilename(self): """Get the output filename""" # Need to get the extension from the input file. (path,ext) = os.path.splitext(self.config.options.get("neutrino","neutfile")) # Use the standard cometModule method. name = self.createFileName(ext[1:len(ext)]) # Add the extension. self.outname = name return self.outname ################################################################### def checkModuleConfig(self): """Checks the configuration""" # Does the specified kin file exist. if self.config.options.has_option("neutrino","neutfile"): neutfile = self.config.options.get("neutrino","neutfile") if os.path.exists(neutfile): return True self.config.log.warn("Cannot find specified neut file") return False ################################################################### def process(self): """Run an SimG4 job""" outname = self.getOutputFilename() neutfile = self.config.options.get("neutrino","neutfile") shutil.copy(neutfile,outname) # We're OK, set the return code self.rtc = 0