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 
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
overlapValidation.OverlapValidation.appendToMerge
def appendToMerge(self)
Definition: overlapValidation.py:48
overlapValidation.OverlapValidation.ValidationSequence
def ValidationSequence(self)
Definition: overlapValidation.py:26
genericValidation.GenericValidationData_CTSR
Definition: genericValidation.py:509
overlapValidation.OverlapValidation.appendToPlots
def appendToPlots(self)
Definition: overlapValidation.py:41
overlapValidation.OverlapValidation.ProcessName
def ProcessName(self)
Definition: overlapValidation.py:30
overlapValidation.OverlapValidation
Definition: overlapValidation.py:12
genericValidation.GenericValidation.general
general
Definition: genericValidation.py:57
genericValidation.ValidationWithPlots
Definition: genericValidation.py:598
overlapValidation.OverlapValidation.runPlots
def runPlots(cls, validations)
Definition: overlapValidation.py:69
genericValidation.ParallelValidation
Definition: genericValidation.py:571
overlapValidation.OverlapValidation.plottingscripttemplate
def plottingscripttemplate(cls)
Definition: overlapValidation.py:61
genericValidation.GenericValidation.getRepMap
def getRepMap(self, alignment=None)
Definition: genericValidation.py:136
overlapValidation.OverlapValidation.plottingscriptname
def plottingscriptname(cls)
Definition: overlapValidation.py:57
overlapValidation.OverlapValidation.ValidationTemplate
def ValidationTemplate(self)
Definition: overlapValidation.py:22
format
overlapValidation.OverlapValidation.plotsdirname
def plotsdirname(cls)
Definition: overlapValidation.py:65
overlapValidation.OverlapValidation.getRepMap
def getRepMap(self, alignment=None)
Definition: overlapValidation.py:33
genericValidation.GenericValidation.getCompareStrings
def getCompareStrings(self, requestId=None, plain=False)
Definition: genericValidation.py:168