CMS 3D CMS Logo

overlapValidation.py
Go to the documentation of this file.
1 from __future__ import absolute_import
2 
3 import os
4 
5 from . import configTemplates
6 from .genericValidation import GenericValidationData_CTSR, ParallelValidation, ValidationWithPlots
7 from .helperFunctions import replaceByMap
8 from .presentation import SubsectionFromList, SubsectionOnePage
9 from .TkAlExceptions import AllInOneError
10 
11 
13  configBaseName = "TkAlOverlapValidation"
14  scriptBaseName = "TkAlOverlapValidation"
15  crabCfgBaseName = "TkAlOverlapValidation"
16  resultBaseName = "OverlapValidation"
17  outputBaseName = "OverlapValidation"
18  mandatories = {"trackcollection"}
19  valType = "overlap"
20 
21  @property
22  def ValidationTemplate(self):
23  return configTemplates.overlapTemplate
24 
25  @property
26  def ValidationSequence(self):
27  return configTemplates.overlapValidationSequence
28 
29  @property
30  def ProcessName(self):
31  return "overlap"
32 
33  def getRepMap( self, alignment = None ):
34  repMap = super(OverlapValidation, self).getRepMap(alignment)
35  repMap.update({
36  "nEvents": self.general["maxevents"],
37  "TrackCollection": self.general["trackcollection"],
38  })
39  return repMap
40 
41  def appendToPlots(self):
42  """
43  if no argument or "" is passed a string with an instantiation is
44  returned, else the validation is appended to the list
45  """
46  return '("{file}", "{title}", {color}, {style}),'.format(file=self.getCompareStrings(plain=True)["DEFAULT"], **self.getRepMap())
47 
48  def appendToMerge(self):
49  repMap = self.getRepMap()
50 
51  parameters = " ".join(os.path.join("root://eoscms//eos/cms", file.lstrip("/")) for file in repMap["resultFiles"])
52 
53  mergedoutputfile = os.path.join("root://eoscms//eos/cms", repMap["finalResultFile"].lstrip("/"))
54  return "hadd -f %s %s" % (mergedoutputfile, parameters)
55 
56  @classmethod
58  return "TkAlOverlapValidation.py"
59 
60  @classmethod
62  return configTemplates.overlapPlottingTemplate
63 
64  @classmethod
65  def plotsdirname(cls):
66  return "OverlapValidationPlots"
67 
68  @classmethod
69  def runPlots(cls, validations):
70  return ("rfcp .oO[plottingscriptpath]Oo. .\n"
71  "python .oO[plottingscriptname]Oo.")
72 
def getRepMap(self, alignment=None)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRepMap(self, alignment=None)
def getCompareStrings(self, requestId=None, plain=False)