CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def __iter__
 
def __next__
 
def createJob
 
def getValidation
 
def needsproxy
 
def runJob
 
- Public Member Functions inherited from validateAlignments.ValidationBase
def __init__
 
def createJob
 
def getValidation
 
def needsproxy
 
def runJob
 

Public Attributes

 end
 
 JobId
 
 scripts
 
 start
 
 validation
 
- Public Attributes inherited from validateAlignments.ValidationBase
 alignments
 
 commandLineOptions
 
 config
 
 preexisting
 
 valName
 
 valSection
 
 valType
 

Static Public Attributes

dictionary condorConf = {}
 
int interactCount = 0
 
int jobCount = 0
 

Private Member Functions

def __createJob
 
def __getValidation
 

Detailed Description

Definition at line 118 of file validateAlignments.py.

Constructor & Destructor Documentation

def validateAlignments.ValidationJob.__init__ (   self,
  validation,
  config,
  options,
  args,
  kwargs 
)

Member Function Documentation

def validateAlignments.ValidationJob.__createJob (   self,
  jobMode,
  outpath 
)
private
This private method creates the needed files for the validation job.

Definition at line 207 of file validateAlignments.py.

References validateAlignments.ValidationBase.preexisting.

Referenced by validateAlignments.ValidationJob.createJob().

208  def __createJob( self, jobMode, outpath ):
209  """This private method creates the needed files for the validation job.
210  """
211  self.validation.createConfiguration( outpath )
212  if self.preexisting:
213  return
214  self.scripts = sum([addIndex(script, self.validation.NJobs) for script in self.validation.createScript( outpath )], [])
215  return None
def validateAlignments.ValidationJob.__getValidation (   self,
  valType,
  name,
  alignments,
  config,
  options 
)
private

Definition at line 135 of file validateAlignments.py.

References submitPVValidationJobs.split(), and digitizers_cfi.strip.

136  def __getValidation( self, valType, name, alignments, config, options ):
137  if valType == "compare":
138  alignmentsList = alignments.split( "," )
139  firstAlignList = alignmentsList[0].split()
140  firstAlignName = firstAlignList[0].strip()
141  if firstAlignName == "IDEAL":
142  raise AllInOneError("'IDEAL' has to be the second (reference)"
143  " alignment in 'compare <val_name>: "
144  "<alignment> <reference>'.")
145  if len( firstAlignList ) > 1:
146  firstRun = firstAlignList[1]
147  elif config.has_section("IOV"):
148  firstRun = config.get("IOV", "iov")
149  else:
150  raise AllInOneError("Have to provide a run number for geometry comparison")
151  firstAlign = Alignment( firstAlignName, config, firstRun )
152  firstAlignName = firstAlign.name
153  secondAlignList = alignmentsList[1].split()
154  secondAlignName = secondAlignList[0].strip()
155  if secondAlignName == "IDEAL":
156  secondAlign = secondAlignName
157  else:
158  if len( secondAlignList ) > 1:
159  secondRun = secondAlignList[1]
160  elif config.has_section("IOV"):
161  secondRun = config.get("IOV", "iov")
162  else:
163  raise AllInOneError("Have to provide a run number for geometry comparison")
164  secondAlign = Alignment( secondAlignName, config,
165  secondRun )
166  secondAlignName = secondAlign.name
167 
168  validation = GeometryComparison( name, firstAlign, secondAlign,
169  config,
170  self.commandLineOptions.getImages)
171  elif valType == "offline":
172  validation = OfflineValidation( name,
173  Alignment( alignments.strip(), config ), config )
174  elif valType == "preexistingoffline":
175  validation = PreexistingOfflineValidation(name, config)
176  elif valType == "offlineDQM":
177  validation = OfflineValidationDQM( name,
178  Alignment( alignments.strip(), config ), config )
179  elif valType == "mcValidate":
180  validation = MonteCarloValidation( name,
181  Alignment( alignments.strip(), config ), config )
182  elif valType == "preexistingmcValidate":
183  validation = PreexistingMonteCarloValidation(name, config)
184  elif valType == "split":
185  validation = TrackSplittingValidation( name,
186  Alignment( alignments.strip(), config ), config )
187  elif valType == "preexistingsplit":
188  validation = PreexistingTrackSplittingValidation(name, config)
189  elif valType == "zmumu":
190  validation = ZMuMuValidation( name,
191  Alignment( alignments.strip(), config ), config )
192  elif valType == "primaryvertex":
193  validation = PrimaryVertexValidation( name,
194  Alignment( alignments.strip(), config ), config )
195  elif valType == "pvresolution":
196  validation = PrimaryVertexResolution( name,
197  Alignment( alignments.strip(), config ), config )
198  elif valType == "preexistingprimaryvertex":
199  validation = PreexistingPrimaryVertexValidation(name, self.__config)
200  elif valType == "overlap":
201  validation = OverlapValidation( name,
202  Alignment( alignments.strip(), self.__config ), self.__config )
203  else:
204  raise AllInOneError("Unknown validation mode '%s'"%valType)
205 
206  return validation
def validateAlignments.ValidationJob.__iter__ (   self)

Definition at line 283 of file validateAlignments.py.

284  def __iter__(self):
285  yield self
def validateAlignments.ValidationJob.__next__ (   self)

Definition at line 286 of file validateAlignments.py.

References validateAlignments.ValidationJob.end, svgfig.LineAxis.end, validateAlignments.ValidationJob.start, and svgfig.LineAxis.start.

287  def __next__(self):
288  if self.start >= len(self.end):
289  raise StopIteration
290  else:
291  self.start += 1
292  return self.end[self.start-1]
293 
def validateAlignments.ValidationJob.createJob (   self)
This is the method called to create the job files.

Definition at line 216 of file validateAlignments.py.

References validateAlignments.ValidationJob.__createJob().

217  def createJob(self):
218  """This is the method called to create the job files."""
219  self.__createJob( self.validation.jobmode,
220  os.path.abspath( self.commandLineOptions.Name) )
def validateAlignments.ValidationJob.getValidation (   self)

Definition at line 277 of file validateAlignments.py.

References validateAlignments.ValidationJob.validation.

278  def getValidation( self ):
279  return self.validation
def validateAlignments.ValidationJob.needsproxy (   self)

Definition at line 280 of file validateAlignments.py.

References validateAlignments.ValidationBase.preexisting.

281  def needsproxy(self):
282  return self.validation.needsproxy and not self.preexisting and not self.commandLineOptions.dryRun
def validateAlignments.ValidationJob.runJob (   self)

Definition at line 221 of file validateAlignments.py.

References bitset_utilities.append(), helperFunctions.getCommandOutput2(), validateAlignments.ValidationBase.preexisting, print(), validateAlignments.ValidationJob.scripts, validateAlignments.ValidationBase.valName, trackSplittingValidation.TrackSplittingValidation.valType, monteCarloValidation.MonteCarloValidation.valType, overlapValidation.OverlapValidation.valType, primaryVertexValidation.PrimaryVertexValidation.valType, primaryVertexResolution.PrimaryVertexResolution.valType, offlineValidation.OfflineValidation.valType, zMuMuValidation.ZMuMuValidation.valType, geometryComparison.GeometryComparison.valType, and validateAlignments.ValidationBase.valType.

222  def runJob( self ):
223 
224  general = self.config.getGeneral()
225  log = ""
226 
227  if self.preexisting:
228  if self.validation.config.has_section("IOV"):
229  iov = self.validation.config.get("IOV", "iov")
230  else:
231  iov = "singleIOV"
232  preexistingValType = self.valType
233  originalValType = preexistingValType.replace('preexisting', '')
234  key = (originalValType, self.validation.originalValName, iov)
235  if key in ValidationJob.condorConf:
236  ValidationJob.condorConf[key].append(("preexisting", "", general["logdir"]))
237  else:
238  ValidationJob.condorConf[key] = [("preexisting", "", general["logdir"])]
239  log = "> " + self.validation.name + " is already validated."
240  return log
241 
242  for script in self.scripts:
243  name = os.path.splitext( os.path.basename( script) )[0]
244  ValidationJob.jobCount += 1
245  if self.commandLineOptions.dryRun:
246  print("%s would run: %s"%( name, os.path.basename( script) ))
247  continue
248  log = "> Validating "+name
249  print("> Validating "+name)
250  if self.validation.jobmode == "interactive":
251  log += getCommandOutput2( script )
252  ValidationJob.interactCount += 1
253  elif self.validation.jobmode.split( "," )[0] == "condor":
254  if self.validation.config.has_section("IOV"):
255  iov = self.validation.config.get("IOV", "iov")
256  else:
257  iov = "singleIOV"
258  scriptPaths = script.split("/")
259  scriptName = scriptPaths[-1]
260  scriptName = scriptName.split(".")
261  jobName = "%s"%scriptName[0] + "_%s"%scriptName[1]+"_%s"%scriptName[2]
262  key = (self.valType, self.valName, iov)
263  if key in ValidationJob.condorConf:
264  ValidationJob.condorConf[key].append((jobName, script, general["logdir"]))
265  else:
266  ValidationJob.condorConf[key] = [(jobName, script, general["logdir"])]
267  else:
268  raise AllInOneError("Unknown 'jobmode'!\n"
269  "Please change this parameter either in "
270  "the [general] or in the ["
271  + self.valType + ":" + self.valName
272  + "] section to one of the following "
273  "values:\n"
274  "\tinteractive\n\tcondor, -q <queue>\n")
275 
276  return log
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

Member Data Documentation

dictionary validateAlignments.ValidationJob.condorConf = {}
static

Definition at line 123 of file validateAlignments.py.

validateAlignments.ValidationJob.end

Definition at line 128 of file validateAlignments.py.

Referenced by OrderedSet.OrderedSet.__iter__(), validateAlignments.ValidationJob.__next__(), validateAlignments.ValidationJobMultiIOV.__next__(), OrderedSet.OrderedSet.__reversed__(), OrderedSet.OrderedSet.add(), Types.LuminosityBlockRange.cppID(), Types.EventRange.cppID(), o2olib.O2ORunMgr.endJob(), and OrderedSet.OrderedSet.pop().

int validateAlignments.ValidationJob.interactCount = 0
static

Definition at line 121 of file validateAlignments.py.

int validateAlignments.ValidationJob.jobCount = 0
static

Definition at line 122 of file validateAlignments.py.

validateAlignments.ValidationJob.JobId

Definition at line 129 of file validateAlignments.py.

validateAlignments.ValidationJob.scripts

Definition at line 213 of file validateAlignments.py.

Referenced by validateAlignments.ValidationJob.runJob().

validateAlignments.ValidationJob.start

Definition at line 127 of file validateAlignments.py.

Referenced by progressbar.ProgressBar.__next__(), validateAlignments.ValidationJob.__next__(), validateAlignments.ValidationJobMultiIOV.__next__(), Types.LuminosityBlockRange.cppID(), Types.EventRange.cppID(), and o2olib.O2ORunMgr.endJob().

validateAlignments.ValidationJob.validation

Definition at line 131 of file validateAlignments.py.

Referenced by validateAlignments.ValidationJob.getValidation().