3 from optparse
import OptionParser
5 from PlotCalibrationGains
import L1CaloGeometryConvertor
8 print (
"Starting prepareForcedList")
10 parser = OptionParser()
12 parser.add_option(
"-f",
"--InputFile",action=
"store",type=
"string",dest=
"input_file_name",help=
"Name of input file")
13 parser.add_option(
"-o",
"--OutputFile",action=
"store",type=
"string",dest=
"output_file_name",help=
"Name of input file")
14 parser.add_option(
"-s",
"--StrategyString",action=
"store",type=
"string",dest=
"strategy",default=
None,help=
"Strategy string")
16 (options, args) = parser.parse_args()
18 file_input =
open(options.input_file_name)
19 file_output =
open(options.output_file_name,
'w')
22 geometry_convertor.LoadReceiverPPMMap()
24 if options.strategy
is None:
25 print (
"taking default strategy string")
26 strategy =
"GainOneOvEmecFcalLowEta"
29 strategy=options.strategy
31 print (
"Using strategy string %s, check it makes sense!!!" % strategy)
33 for line
in file_input.readlines():
35 parts = line2.split(
' ')
36 parts_stripped = [iii
for iii
in parts
if not iii==
'']
38 file_output.write(
"%s %.3f # %s %s %s %s \n" % (geometry_convertor.getReceiverfromPPM(parts_stripped[2],strategy),
39 float(parts_stripped[3]),
40 parts_stripped[0],parts_stripped[1],parts_stripped[2],parts_stripped[3]))