1 from array
import array
3 from copy
import deepcopy
4 import FWCore.ParameterSet.Config
as cms
5 import FWCore.PythonUtilities.LumiList
as LumiList
9 return thePSet.parameters_()
12 setattr(thePSet,name,val)
19 outVPSet.append(inPSet)
23 if hasattr(ps1,
"record")
and hasattr(ps2,
"record"):
31 resvpset=overrideVPSet.copy()
32 for iop
in inVPSet.value():
34 if matchrule
is not None:
35 for cps
in overrideVPSet.value():
36 if matchrule(cps,iop):
47 return theString[0].
upper()==
'T' 69 if self.rawopt.lower()!=
"noopts":
75 if self.
flag==
"mbvertex":
78 elif self.
flag==
"zmumu":
79 self.
trkcoll=
"ALCARECOTkAlZMuMu" 81 elif self.
flag==
"ymumu":
82 self.
trkcoll=
"ALCARECOTkAlUpsilonMuMu" 84 elif self.
flag==
"jpsimumu":
85 self.
trkcoll=
"ALCARECOTkAlJpsiMuMu" 87 elif self.
flag==
"cosmics":
88 self.
trkcoll=
"ALCARECOTkAlCosmicsCTF0T" 90 elif self.
flag==
"cdcs":
91 self.
trkcoll=
"ALCARECOTkAlCosmicsInCollisions" 94 raise RuntimeError(
"Flag {} is unimplemented.".
format(self.
flag))
100 optlist=self.rawopt.split(delimiter)
102 olist=sopt.split(optdelimiter)
104 theKey=olist[0].lower()
108 raise RuntimeError(
"Option {} has an invalid number of delimiters {}".
format(sopt,optdelimiter))
113 for key,val
in self.optdict.iteritems():
116 autofind=val.find(
"auto")
118 val=val[0:autofind+4]+
":"+val[autofind+4:]
122 vallist=val.split(
';')
123 for varset
in vallist:
125 specs = varset.split(
'|')
127 namespec=spec.split(
'=')
130 frontierfind=tmpspec.find(
"frontier")
131 sqlitefind=tmpspec.find(
"sqlite_file")
132 if frontierfind>-1
and sqlitefind>-1:
133 raise RuntimeError(
"Inconsistent setting: Cannot specify frontier and sqlite_file at the same time!")
134 elif frontierfind>-1:
135 tmpspec=tmpspec[0:frontierfind+8]+
":"+tmpspec[frontierfind+8:]
137 tmpspec=tmpspec[0:sqlitefind+11]+
":"+tmpspec[sqlitefind+11:]
138 elif namespec[0]==
"connect":
139 if tmpspec.endswith(
".db"):
140 tmpspec =
str(
"sqlite_file:")+tmpspec
141 elif tmpspec.find(
"//")>-1:
142 tmpspec =
str(
"frontier:")+tmpspec
144 tmpspec =
str(
"frontier://")+tmpspec
145 cmsstrspec = cms.string(tmpspec)
148 raise RuntimeError(
"GT specification {} does not have size==2".
format(namespec))
149 gttogetpsets.append(apset)
151 elif (key==
"type" or key==
"datatype" or key==
"datagroup"):
156 print "Data type is not an integer" 158 elif key==
"lumilist":
161 elif key==
"cpe" or key==
"cpetype":
165 elif key==
"trackcollection":
168 elif key==
"overallweight":
173 print "Overall weight is not a float" 175 elif key==
"uniformetaformula":
179 elif (key==
"twobodytrackselection" or key==
"twobodydecayselection" or key==
"tbdselection"):
181 if (val==
"zsel" or val==
"y1sel"):
184 raise ValueError(
"TBD selection can only be Zsel or Y1sel at this time.")
187 elif (key==
"twobodytrackconstraint" or key==
"twobodydecayconstraint" or key==
"tbdconstraint"):
189 if (
"momconstr" in val
or "fullconstr" in val):
192 raise ValueError(
"TBD constraint can only be momconstr... or fullconstr...")
197 if (val==
"peak" or val==
"deco"):
200 raise ValueError(
"APV mode can only be peak or deco in cosmics")
204 if (val==
"0t" or val==
"zerotesla" or val==
"3.8t"):
207 raise ValueError(
"B field can only be 0T, ZEROTESLA or 3.8T")
208 elif key==
"usetracksplitting":
211 raise RuntimeError(
"Option {} is not implemented.".
format(key))
213 if len(gttogetpsets)>0:
215 for ps
in gttogetpsets:
220 for oc
in optstocheck:
221 if not hasattr(self,oc):
222 raise RuntimeError(
"Option {} needs to specified in {}.".
format(oc, self.
flag))
227 checkcosmics=(self.
flag==
"cosmics" or self.
flag==
"cdcs")
228 checkymumuconstr=(self.
flag==
"ymumu" and hasattr(self,
"TBDconstraint"))
233 "useTrkSplittingInCosmics" def getTrackDefaults(self)
def insertPSetToPSet(inPSet, outPSet)
def matchPSetsByRecord(ps1, ps2)
TBDconstraint
Get options common in min.
def mergeVPSets(inVPSet, overrideVPSet, matchrule=None)
def insertPSetToVPSet(inPSet, outVPSet)
def insertValToPSet(name, val, thePSet)
def doCheckOptions(self, optstocheck)
def interpretOptions(self)
def parseBoolString(theString)
def __init__(self, strflag, stropt)
APVmode
Options for cosmics Get APV mode.