|
[Rivet-svn] r2433 - trunk/binblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon May 3 11:27:43 BST 2010
Author: buckley Date: Mon May 3 13:54:02 2010 New Revision: 2433 Log: Add directories containing AIDA files to the plot parser path Modified: trunk/bin/aida2flat Modified: trunk/bin/aida2flat ============================================================================== --- trunk/bin/aida2flat Sat May 1 13:21:50 2010 (r2432) +++ trunk/bin/aida2flat Mon May 3 13:54:02 2010 (r2433) @@ -32,14 +32,16 @@ except: sys.stderr.write("Can't load the ElementTree XML parser: please install it!\n") sys.exit(1) + + ########################################################## if __name__ == "__main__": - rivet_data_dir=os.popen('rivet-config --datadir',"r").readline().strip() + rivet_data_dir = os.popen('rivet-config --datadir',"r").readline().strip() if not rivet_data_dir: - rivet_data_dir="" + rivet_data_dir = "" ## Parse command line options from optparse import OptionParser, OptionGroup @@ -92,8 +94,16 @@ sys.stderr.write("Must specify at least one AIDA histogram file\n") sys.exit(1) - plotparser = lighthisto.PlotParser(filter(lambda s: len(s) > 0, opts.PLOTINFODIR)) + ## Add AIDA file directories to the plotinfo path + for aidafile in args: + aidadir = os.path.dirname(aidafile) + if aidadir not in opts.PLOTINFODIR: + opts.PLOTINFODIR.append(aidadir) + ## Remove empty path entries + opts.PLOTINFODIR = filter(lambda s: len(s) > 0, opts.PLOTINFODIR) + ## Create plot file parser + plotparser = lighthisto.PlotParser(opts.PLOTINFODIR) ## Run over the files, make histos and write out those that match the patterns import re
More information about the Rivet-svn mailing list |