42 for (index,item)
in enumerate(items):
43 for (opt,value)
in threeValued:
44 if (str(item)
in opt)
and (index==len(items)-1
or items[index+1].startswith(
'-')):
45 items.insert(index+1,value)
47 (options,args) = parser.parse_args(items)
49 if not options.conditions
or options.conditions==
"help":
50 from Configuration.AlCa
import autoCond
52 for k
in autoCond.autoCond:
53 possible+=
"\nauto:"+k+
" -> "+autoCond.autoCond[k]
54 raise Exception(
"the --conditions option is mandatory. Possibilities are: "+possible)
62 if options.triggerResultsProcess ==
None and "ALCAOUTPUT" in options.step:
63 print "ERROR: If ALCA splitting is requested, the name of the process in which the alca producers ran needs to be specified. E.g. via --triggerResultsProcess RECO"
66 if not options.evt_type:
67 options.evt_type=sys.argv[1]
72 if options.dirin!=
'' and (
not options.dirin.endswith(
'/')): options.dirin+=
'/'
73 if options.dirout!=
'' and (
not options.dirout.endswith(
'/')): options.dirout+=
'/'
78 prec_step = {
"NONE":
"",
95 "RAW2DIGI":
"DIGI2RAW",
96 "RAW2RECO":
"DIGI2RAW",
100 "ALCAHARVEST":
"RECO"}
102 trimmedEvtType=options.evt_type.split(
'/')[-1]
105 options.trimmedStep=[]
106 for s
in options.step.split(
','):
108 options.trimmedStep.append(step)
109 first_step=options.trimmedStep[0]
115 'ALL':
'GEN,SIM,DIGI,L1,DIGI2RAW,HLT:GRun,RAW2DIGI,RECO,POSTRECO,VALIDATION,DQM',
116 'DATA_CHAIN':
'RAW2DIGI,RECO,POSTRECO,DQM'
118 if options.step
in stepsAliases:
119 options.step=stepsAliases[options.step]
121 options.step = options.step.replace(
"SIM_CHAIN",
"GEN,SIM,DIGI,L1,DIGI2RAW")
125 if (
"FASTSIM" in options.step
and not "VALIDATION" in options.step)
or "HARVESTING" in options.step
or "ALCAHARVEST" in options.step
or "ALCAOUTPUT" in options.step
or options.step ==
"":
127 if (
"SKIM" in options.step
and not "RECO" in options.step):
129 if (
"ENDJOB" in options.step):
131 if (
'DQMROOT' in options.datatier):
134 options.step=options.step+
',ENDJOB'
138 if options.filetype==defaultOptions.filetype:
139 if options.filein.lower().endswith(
".lhe")
or options.filein.lower().endswith(
".lhef")
or options.filein.startswith(
"lhe:"):
140 options.filetype=
"LHE"
141 elif options.filein.startswith(
"mcdb:"):
142 print "This is a deprecated way of selecting lhe files from article number. Please use lhe:article argument to --filein"
143 options.filein=options.filein.replace(
'mcdb:',
'lhe:')
144 options.filetype=
"LHE"
146 options.filetype=
"EDM"
148 filesuffix = {
"LHE":
"lhe",
"EDM":
"root",
"MCDB":
"",
"DQM":
"root"}[options.filetype]
150 if options.filein==
"" and not (first_step
in (
"ALL",
"GEN",
"LHE",
"SIM_CHAIN")):
151 options.dirin=
"file:"+options.dirin.replace(
'file:',
'')
152 options.filein=trimmedEvtType+
"_"+prec_step[first_step]+
"."+filesuffix
157 standardFileName =
""
158 standardFileName = trimmedEvtType+
"_"+
"_".
join(options.trimmedStep)
159 standardFileName = standardFileName.replace(
",",
"_").
replace(
".",
"_")
160 if options.pileup !=
"NoPileUp":
161 standardFileName +=
"_PU"
165 if options.fileout==
"" and not first_step
in (
"HARVESTING",
"ALCAHARVEST"):
166 options.fileout = standardFileName+
".root"
169 if not options.python_filename:
170 options.python_filename = standardFileName+
'.py'
178 if 'reSIM' in options.trimmedStep:
179 options.name =
'RESIM'
180 elif 'reDIGI' in options.trimmedStep:
181 options.name =
'REDIGI'
182 elif 'HLT' in options.trimmedStep:
184 elif 'RECO' in options.trimmedStep:
185 options.name =
'RECO'
186 elif options.trimmedStep == [
'NONE']
and options.filetype
in (
'LHE',
'MCDB'):
188 elif len(options.trimmedStep)==0:
189 options.name =
'PROCESS'
191 options.name = options.trimmedStep[-1]
197 if "HARVESTING" in options.trimmedStep
and len(options.trimmedStep) > 1:
198 raise Exception(
"The Harvesting step must be run alone")
201 if not options.isData
and not options.isMC:
202 if 'SIM' in options.trimmedStep:
204 if 'CFWRITER' in options.trimmedStep:
206 if 'DIGI' in options.trimmedStep:
208 if (
not (options.eventcontent ==
None))
and 'SIM' in options.eventcontent:
210 if 'SIM' in options.datatier:
213 print 'We have determined that this is simulation (if not, rerun cmsDriver.py with --data)'
215 print 'We have determined that this is real data (if not, rerun cmsDriver.py with --mc)'
218 if options.profile
and options.prefix:
219 raise Exception(
"--profile and --prefix are incompatible")
221 profileOpts = options.profile.split(
':')
223 profilerType = profileOpts[0].
replace(
"=",
" ")
225 if profilerType ==
"pp":
226 options.profileTypeLabel =
"performance"
227 elif profilerType ==
"mp":
228 options.profileTypeLabel =
"memory"
229 elif profilerType.startswith(
"fp "):
230 options.profileTypeLabel = profilerType.replace(
"fp ",
"")
232 raise Exception(
"Not a valid profiler type %s. Alternatives are pp, mp, fp=<function>."%(profilerType))
234 options.prefix =
"igprof -t cmsRun -%s" % profilerType
static std::string join(char **cmd)