from RingerCore import Logger, LoggingLevel, save, load, ArgumentParser, emptyArgumentsPrintHelp from TuningTools import fixPPCol import numpy as np import sys, os mainParser = ArgumentParser() mainParser.add_argument('-i','--input', action='store', required = True, help = "The input files [.mat] that will be used to generate a extract the preproc proj matrix.\ Your matlab file must be inside: projCollection = [[[]]], nEtaBin = int, nEtBin = int, \ nSort = int") mainParser.add_argument('-o','--output', action='store', required = False, default = 'ppCol', help = "The output file") emptyArgumentsPrintHelp( mainParser ) mainLogger = Logger.getModuleLogger( __name__, LoggingLevel.INFO ) args=mainParser.parse_args() import scipy.io mainLogger.info(('Loading matlab file: %s')%(args.input)) rawData = scipy.io.loadmat(args.input) collections = rawData['projCollection'] nEta = rawData['nEtaBin'][0][0] nEt = rawData['nEtBin'][0][0] nSort= rawData['nSort'][0][0] #initialize ppcol as none matrix ppCol = [[[None for i in range(nSort)] for j in range(nEta)] for k in range(nEt)]
'--refFileDS', metavar='REF_FILE', required=False, default=None, action='store', help="""Input dataset to loop upon files to retrieve configuration. There will be one job for each file on this container.""") parser = ArgumentParser( description= 'Retrieve performance information from the Cross-Validation method on the GRID.', parents=[crossValStatsJobParser, parentParser, ioGridParser, loggerParser], conflict_handler='resolve') parser.make_adjustments() emptyArgumentsPrintHelp(parser) # Retrieve parser args: args = parser.parse_args(namespace=TuningToolGridNamespace('prun')) args.setBExec( 'source ./buildthis.sh --grid --with-scipy --no-color || source ./buildthis.sh --grid --with-scipy --no-color' ) mainLogger = Logger.getModuleLogger(__name__, args.output_level) printArgs(args, mainLogger.debug) # Set primary dataset number of files: try: # The input files can be send via a text file to avoid very large command lines? mainLogger.info(("Retrieving files on the data container to separate " "the jobs accordingly to each tunned bin reagion.")) from rucio.client import DIDClient
action='store', default='HLT/Egamma/Expert', help="the basepath to the ntuple") mainFilterParser.add_argument('-o', '--output', action='store', default='NTUPLE.*.root', help="output file name.") mainFilterParser.add_argument('--treename', action='store', default='trigger', help="The ntuple name") emptyArgumentsPrintHelp(mainFilterParser) mainLogger = Logger.getModuleLogger(__name__, LoggingLevel.INFO) mainLogger.info('Start ntuple extraction...') # retrieve args args = mainFilterParser.parse_args() # Treat special arguments if len(args.inputFiles) == 1: args.inputFiles = csvStr2List(args.inputFiles[0]) args.inputFiles = expandFolders(args.inputFiles) mainLogger.verbose("All input files are:") pprint(args.inputFiles) if '*' in args.output: