test
CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
SpecificationBuilder_cfi.Specification Class Reference
Inheritance diagram for SpecificationBuilder_cfi.Specification:

Public Member Functions

def __deepcopy__
 
def __init__
 
def custom
 
def groupBy
 
def pythonTypeName
 
def reduce
 
def save
 
def saveAll
 

Public Attributes

 conf
 
 spec
 

Private Attributes

 _activeColumns
 
 _lastColumns
 
 _lastMode
 
 _state
 
 _x
 
 _y
 
 _z
 

Detailed Description

Definition at line 57 of file SpecificationBuilder_cfi.py.

Constructor & Destructor Documentation

def SpecificationBuilder_cfi.Specification.__init__ (   self,
  conf = DefaultConf 
)

Member Function Documentation

def SpecificationBuilder_cfi.Specification.__deepcopy__ (   self,
  memo 
)

Definition at line 65 of file SpecificationBuilder_cfi.py.

References CondFormats_MFObjects::dictionary.conf, SpecificationBuilder_cfi.Specification.conf, and SpecificationBuilder_cfi.Specification.spec.

65 
66  def __deepcopy__(self, memo):
67  # override deepcopy to not copy .conf: it should remain a reference
68  # w/o this it is not cleanly possible to build a per-module switch.
69  t = Specification(self.conf)
70  t.spec = deepcopy(self.spec, memo)
71  return t
def SpecificationBuilder_cfi.Specification.custom (   self,
  arg = "" 
)

Definition at line 213 of file SpecificationBuilder_cfi.py.

References SpecificationBuilder_cfi.Specification._state, and hcaldqm::flag::Flag._state.

214  def custom(self, arg = ""):
215  if self._state != STAGE2:
216  raise Exception("Custom processing exists only in Harvesting.")
217  self.spec.append(cms.PSet(
218  type = CUSTOM,
219  stage = self._state,
220  columns = cms.vstring(),
221  arg = cms.string(arg)
222  ))
223  return self
224 
def SpecificationBuilder_cfi.Specification.groupBy (   self,
  cols,
  mode = "SUM" 
)

Definition at line 72 of file SpecificationBuilder_cfi.py.

References SpecificationBuilder_cfi.Specification._activeColumns, SpecificationBuilder_cfi.Specification._lastColumns, SpecificationBuilder_cfi.Specification._state, hcaldqm::flag::Flag._state, list(), SpecificationBuilder_cfi.Specification.spec, split, and SpecificationBuilder_cfi.val().

Referenced by SpecificationBuilder_cfi.Specification.saveAll().

72 
73  def groupBy(self, cols, mode = "SUM"):
74  cnames = val(cols).split("/")
75  newstate = self._state
76 
77  if self._state == FIRST:
78  cname = cnames
79  if mode != "SUM":
80  raise Exception("First grouping must be SUM")
81  if "Event" in cnames:
82  cnames.remove("Event"); # per-Event grouping is done automatically
83  t = COUNT
84  mode = "COUNT"
85  newstate = FIRST
86  else:
87  t = GROUPBY
88  newstate = STAGE1
89 
90  if self._state == STAGE1:
91  cname = self._activeColumns.difference(cnames)
92  if len(cname) != 1:
93  raise Exception("EXTEND must drop exactly one column.")
94 
95  if mode == "EXTEND_X":
96  self._x.type = EXTEND_X
97  self._x.columns = cms.vstring(cname)
98  elif mode == "EXTEND_Y":
99  self._y.type = EXTEND_Y
100  self._y.columns = cms.vstring(cname)
101  else:
102  raise Exception("Only EXTEND_X or EXTEND_Y allowed here, not " + mode)
103 
104  # remove the column in earlier steps, we always re-extract in step1.
105  c = list(cname)[0]
106  for s in self.spec:
107  if s.stage == FIRST and c in s.columns:
108  s.columns.remove(c)
109  if c in self._activeColumns:
110  self._activeColumns.remove(c)
111  if c in self._lastColumns:
112  self._lastColumns.remove(c)
113 
114  return self # done here, no new step to add
115 
116  if self._state == STAGE2:
117  cname = cnames
118  if self._activeColumns.issubset(cname):
119  raise Exception("Harvesting GROUPBY must drop some columns")
120  if mode == "EXTEND_X":
121  t = EXTEND_X
122  elif mode == "SUM":
123  t = GROUPBY
124  else:
125  raise Exception("Currently only EXTEND_X and SUM supported in harvesting, not " + mode)
126 
127  self._activeColumns = set(cnames)
128  self._lastColumns = cnames
129  self._lastMode = mode
130 
131  self.spec.append(cms.PSet(
132  type = t,
133  stage = self._state,
134  columns = cms.vstring(cname),
135  arg = cms.string(mode)
136  ))
137 
138  if newstate == STAGE1 and self._state == FIRST:
139  # emit standard column assignments, will be changed later
140  self._x = cms.PSet(
141  type = USE_X, stage = STAGE1,
142  columns = cms.vstring(),
143  arg = cms.string("")
144  )
145  self.spec.append(self._x)
146  self._y = cms.PSet(
147  type = USE_Y, stage = STAGE1,
148  columns = cms.vstring(),
149  arg = cms.string("")
150  )
151  self.spec.append(self._y)
152  self._z = cms.PSet(
153  type = USE_Z, stage = STAGE1,
154  columns = cms.vstring(),
155  arg = cms.string("")
156  )
157  self.spec.append(self._z)
158 
159  self._state = newstate
160 
161  return self
double split
Definition: MVATrainer.cc:139
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def SpecificationBuilder_cfi.Specification.pythonTypeName (   self)

Definition at line 235 of file SpecificationBuilder_cfi.py.

Referenced by Mixins._ParameterTypeBase.dumpPython(), Mixins._ValidatingParameterListBase.dumpPython(), and Types.PSet.dumpPython().

236  def pythonTypeName(self):
237  return 'cms.PSet';
def SpecificationBuilder_cfi.Specification.reduce (   self,
  sort 
)

Definition at line 162 of file SpecificationBuilder_cfi.py.

References SpecificationBuilder_cfi.Specification._state, hcaldqm::flag::Flag._state, and SpecificationBuilder_cfi.Specification.spec.

163  def reduce(self, sort):
164  if self._state == FIRST:
165  if sort != "COUNT":
166  raise Exception("First statement must be groupBy.")
167  self.spec[0].type = COUNT # this is actually a noop
168  # groupBy already saw the "Event" column and set up counting.
169 
170  return self
171 
172  if self._state == STAGE1:
173  if sort == "MEAN":
174  self.spec.append(cms.PSet(
175  type = PROFILE, stage = STAGE1,
176  columns = cms.vstring(), arg = cms.string("")
177  ))
178  return self
179 
180  if sort != "MEAN":
181  raise Exception("Harvesting allows only reduce(MEAN) at the moment, not " + sort)
182 
183  self.spec.append(cms.PSet(
184  type = REDUCE,
185  stage = self._state,
186  columns = cms.vstring(),
187  arg = cms.string(sort)
188  ))
189  return self
def SpecificationBuilder_cfi.Specification.save (   self)

Definition at line 190 of file SpecificationBuilder_cfi.py.

References SpecificationBuilder_cfi.Specification._state, and hcaldqm::flag::Flag._state.

Referenced by Vispa.Main.TabController.TabController.allowClose(), Vispa.Main.TabController.TabController.checkModificationTimestamp(), and SpecificationBuilder_cfi.Specification.saveAll().

191  def save(self):
192  if self._state == FIRST:
193  raise Exception("First statement must be groupBy.")
194 
195  if self._state == STAGE1:
196  # end of STAGE1, fix the parameter assignments
197  n = 1
198  if self._x.type == USE_X: self._x.arg = cms.string(str(n)); n = n+1
199  if self._y.type == USE_Y: self._y.arg = cms.string(str(n)); n = n+1
200  if self._z.type == USE_Z: self._z.arg = cms.string(str(n)); n = n+1
201  # we don't know how many parameters the user wants to pass here, but the
202  # HistogramManager knows. So we just add 3.
203 
204  # SAVE is implicit in step1 and ignored in harvesting, so not really needed.
205  #self.spec.append(cms.PSet(
206  # type = SAVE,
207  # stage = self._state,
208  # columns = cms.vstring(),
209  # arg = cms.string("")
210  #))
211  self._state = STAGE2
212  return self
def SpecificationBuilder_cfi.Specification.saveAll (   self)

Definition at line 225 of file SpecificationBuilder_cfi.py.

References SpecificationBuilder_cfi.Specification._lastColumns, SpecificationBuilder_cfi.Specification._lastMode, SpecificationBuilder_cfi.Specification.groupBy(), cond::persistency::Query< Types >.groupBy(), join(), l1t::WriterProxy.save(), l1t::WriterProxyT< Record, Type >.save(), PiecewiseScalingPolynomial.save(), HcalIndexLookup.save(), HBHENegativeEFilter.save(), HBHEChannelGroups.save(), TrackerMap.save(), OOTPileupCorrData.save(), SpecificationBuilder_cfi.Specification.save(), and svgfig.SVG.save().

226  def saveAll(self):
227  self.save()
228  columns = self._lastColumns
229  for i in range(len(columns)-1, 0, -1):
230  cols = columns[0:i]
231  self.groupBy("/".join(cols), self._lastMode)
232  self.save()
233  return self
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Data Documentation

SpecificationBuilder_cfi.Specification._activeColumns
private

Definition at line 62 of file SpecificationBuilder_cfi.py.

Referenced by SpecificationBuilder_cfi.Specification.groupBy().

SpecificationBuilder_cfi.Specification._lastColumns
private

Definition at line 127 of file SpecificationBuilder_cfi.py.

Referenced by SpecificationBuilder_cfi.Specification.groupBy(), and SpecificationBuilder_cfi.Specification.saveAll().

SpecificationBuilder_cfi.Specification._lastMode
private

Definition at line 128 of file SpecificationBuilder_cfi.py.

Referenced by SpecificationBuilder_cfi.Specification.saveAll().

SpecificationBuilder_cfi.Specification._state
private

Definition at line 63 of file SpecificationBuilder_cfi.py.

Referenced by SpecificationBuilder_cfi.Specification.custom(), SpecificationBuilder_cfi.Specification.groupBy(), SpecificationBuilder_cfi.Specification.reduce(), and SpecificationBuilder_cfi.Specification.save().

SpecificationBuilder_cfi.Specification._x
private

Definition at line 139 of file SpecificationBuilder_cfi.py.

Referenced by plotting.PlotText.Draw().

SpecificationBuilder_cfi.Specification._y
private

Definition at line 145 of file SpecificationBuilder_cfi.py.

Referenced by plotting.PlotText.Draw().

SpecificationBuilder_cfi.Specification._z
private

Definition at line 151 of file SpecificationBuilder_cfi.py.

SpecificationBuilder_cfi.Specification.conf

Definition at line 61 of file SpecificationBuilder_cfi.py.

Referenced by SpecificationBuilder_cfi.Specification.__deepcopy__().

SpecificationBuilder_cfi.Specification.spec

Definition at line 60 of file SpecificationBuilder_cfi.py.

Referenced by SpecificationBuilder_cfi.Specification.__deepcopy__(), SpecificationBuilder_cfi.Specification.groupBy(), and SpecificationBuilder_cfi.Specification.reduce().