CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
trackSplittingValidation.TrackSplittingValidation Class Reference
Inheritance diagram for trackSplittingValidation.TrackSplittingValidation:
genericValidation.GenericValidationData genericValidation.GenericValidation

Public Member Functions

def __init__ (self, valName, alignment, config, configBaseName="TkAlTrackSplitting", scriptBaseName="TkAlTrackSplitting", crabCfgBaseName="TkAlTrackSplitting", resultBaseName="TrackSplitting", outputBaseName="TrackSplitting")
 
def appendToExtendedValidation (self, validationsSoFar="")
 
def appendToMerge (self, validationsSoFar="")
 
def createConfiguration (self, path)
 
def createCrabCfg (self, path)
 
def createScript (self, path)
 
def getRepMap (self, alignment=None)
 
def validsubdets (self)
 
- Public Member Functions inherited from genericValidation.GenericValidationData
def __init__ (self, valName, alignment, config, valType, addDefaults={}, addMandatories=[], addneedpackages=[])
 
def createCrabCfg (self, path, crabCfgBaseName)
 
def createScript (self, path, template=configTemplates.scriptTemplate, downloadFiles=[], repMap=None, repMaps=None)
 
def getRepMap (self, alignment=None)
 
- Public Member Functions inherited from genericValidation.GenericValidation
def __init__ (self, valName, alignment, config, valType, addDefaults={}, addMandatories=[], addneedpackages=[])
 
def createConfiguration (self, fileContents, path, schedule=None, repMap=None, repMaps=None)
 
def createCrabCfg (self, fileContents, path)
 
def createFiles (self, fileContents, path, repMap=None, repMaps=None)
 
def createScript (self, fileContents, path, downloadFiles=[], repMap=None, repMaps=None)
 
def getCompareStrings (self, requestId=None, plain=False)
 
def getRepMap (self, alignment=None)
 

Public Attributes

 configBaseName
 
 crabCfgBaseName
 
 needParentFiles
 
 outputBaseName
 
 resultBaseName
 
 scriptBaseName
 
- Public Attributes inherited from genericValidation.GenericValidationData
 crabWorkingDir
 
 dataset
 
- Public Attributes inherited from genericValidation.GenericValidation
 alignmentToValidate
 
 AutoAlternates
 
 cmssw
 
 cmsswreleasebase
 
 config
 
 configFiles
 
 crabConfigFiles
 
 filesToCompare
 
 general
 
 jobid
 
 jobmode
 
 name
 
 NJobs
 
 packages
 
 randomWorkdirPart
 
 scramarch
 
 scriptFiles
 
 valType
 

Additional Inherited Members

- Static Public Attributes inherited from genericValidation.GenericValidation
string defaultReferenceName = "DEFAULT"
 

Detailed Description

Definition at line 8 of file trackSplittingValidation.py.

Constructor & Destructor Documentation

def trackSplittingValidation.TrackSplittingValidation.__init__ (   self,
  valName,
  alignment,
  config,
  configBaseName = "TkAlTrackSplitting",
  scriptBaseName = "TkAlTrackSplitting",
  crabCfgBaseName = "TkAlTrackSplitting",
  resultBaseName = "TrackSplitting",
  outputBaseName = "TrackSplitting" 
)

Definition at line 11 of file trackSplittingValidation.py.

11  resultBaseName = "TrackSplitting", outputBaseName = "TrackSplitting"):
12  mandatories = ["trackcollection"]
13  defaults = {}
14  self.configBaseName = configBaseName
15  self.scriptBaseName = scriptBaseName
16  self.crabCfgBaseName = crabCfgBaseName
17  self.resultBaseName = resultBaseName
18  self.outputBaseName = outputBaseName
19  self.needParentFiles = False
20  GenericValidationData.__init__(self, valName, alignment, config,
21  "split", addMandatories = mandatories, addDefaults = defaults)
22 

Member Function Documentation

def trackSplittingValidation.TrackSplittingValidation.appendToExtendedValidation (   self,
  validationsSoFar = "" 
)
if no argument or "" is passed a string with an instantiation is
returned, else the validation is appended to the list

Definition at line 55 of file trackSplittingValidation.py.

References genericValidation.GenericValidation.getCompareStrings(), genericValidation.GenericValidation.getRepMap(), and alignment.Alignment.getRepMap().

55  def appendToExtendedValidation( self, validationsSoFar = "" ):
56  """
57  if no argument or "" is passed a string with an instantiation is
58  returned, else the validation is appended to the list
59  """
60  repMap = self.getRepMap()
61  comparestring = self.getCompareStrings("TrackSplittingValidation")
62  if validationsSoFar != "":
63  validationsSoFar += ',"\n "'
64  validationsSoFar += comparestring
65  return validationsSoFar
66 
def getRepMap(self, alignment=None)
def getCompareStrings(self, requestId=None, plain=False)
def trackSplittingValidation.TrackSplittingValidation.appendToMerge (   self,
  validationsSoFar = "" 
)
if no argument or "" is passed a string with an instantiation is returned,
else the validation is appended to the list

Definition at line 67 of file trackSplittingValidation.py.

References genericValidation.GenericValidation.getRepMap(), alignment.Alignment.getRepMap(), and join().

67  def appendToMerge( self, validationsSoFar = "" ):
68  """
69  if no argument or "" is passed a string with an instantiation is returned,
70  else the validation is appended to the list
71  """
72  repMap = self.getRepMap()
73 
74  parameters = " ".join(os.path.join("root://eoscms//eos/cms", file.lstrip("/")) for file in repMap["resultFiles"])
75 
76  mergedoutputfile = os.path.join("root://eoscms//eos/cms", repMap["finalResultFile"].lstrip("/"))
77  validationsSoFar += "hadd -f %s %s\n" % (mergedoutputfile, parameters)
78  return validationsSoFar
79 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRepMap(self, alignment=None)
def trackSplittingValidation.TrackSplittingValidation.createConfiguration (   self,
  path 
)

Definition at line 23 of file trackSplittingValidation.py.

References monteCarloValidation.MonteCarloValidation.configBaseName, trackSplittingValidation.TrackSplittingValidation.configBaseName, primaryVertexValidation.PrimaryVertexValidation.configBaseName, offlineValidation.OfflineValidation.configBaseName, genericValidation.GenericValidation.filesToCompare, genericValidation.GenericValidation.getRepMap(), alignment.Alignment.getRepMap(), AlignableObjectId::entry.name, genericValidation.GenericValidation.name, alignment.Alignment.name, TrackerSectorStruct.name, classes.MonitorData.name, MuonGeometrySanityCheckPoint.name, classes.OutputData.name, geometry.Structure.name, and plotscripts.SawTeethFunction.name.

23  def createConfiguration(self, path ):
24  cfgName = "%s.%s.%s_cfg.py"%(self.configBaseName, self.name,
25  self.alignmentToValidate.name)
26  repMap = self.getRepMap()
27  cfgs = {cfgName: configTemplates.TrackSplittingTemplate}
28  self.filesToCompare[GenericValidationData.defaultReferenceName] = \
29  repMap["finalResultFile"]
30  GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
31 
def getRepMap(self, alignment=None)
def trackSplittingValidation.TrackSplittingValidation.createCrabCfg (   self,
  path 
)
def trackSplittingValidation.TrackSplittingValidation.createScript (   self,
  path 
)

Definition at line 32 of file trackSplittingValidation.py.

32  def createScript(self, path):
33  return GenericValidationData.createScript(self, path)
34 
def trackSplittingValidation.TrackSplittingValidation.getRepMap (   self,
  alignment = None 
)

Definition at line 38 of file trackSplittingValidation.py.

References genericValidation.GenericValidation.general.

38  def getRepMap( self, alignment = None ):
39  repMap = GenericValidationData.getRepMap(self)
40  if repMap["subdetector"] == "none":
41  subdetselection = ""
42  else:
43  subdetselection = "process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2"
44  repMap.update({
45  "nEvents": self.general["maxevents"],
46  "TrackCollection": self.general["trackcollection"],
47  "subdetselection": subdetselection,
48  })
49  # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
50  # if self.jobmode.split( ',' )[0] == "crab":
51  # repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
52  return repMap
53 
54 
def trackSplittingValidation.TrackSplittingValidation.validsubdets (   self)

Definition at line 80 of file trackSplittingValidation.py.

References genericValidation.GenericValidation.cmssw, genericValidation.GenericValidation.cmsswreleasebase, python.rootplot.root2matplotlib.replace(), split, and digi_MixPreMix_cfi.strip.

80  def validsubdets(self):
81  filename = os.path.join(self.cmssw, "src/Alignment/CommonAlignmentProducer/python/AlignmentTrackSelector_cfi.py")
82  if not os.path.isfile(filename):
83  filename = os.path.join(self.cmsswreleasebase, "src/Alignment/CommonAlignmentProducer/python/AlignmentTrackSelector_cfi.py")
84  with open(filename) as f:
85  trackselector = f.read()
86 
87  minhitspersubdet = trackselector.split("minHitsPerSubDet")[1].split("(",1)[1]
88 
89  parenthesesdepth = 0
90  i = 0
91  for character in minhitspersubdet:
92  if character == "(":
93  parenthesesdepth += 1
94  if character == ")":
95  parenthesesdepth -= 1
96  if parenthesesdepth < 0:
97  break
98  i += 1
99  minhitspersubdet = minhitspersubdet[0:i]
100 
101  results = minhitspersubdet.split(",")
102  empty = []
103  for i in range(len(results)):
104  results[i] = results[i].split("=")[0].strip().replace("in", "", 1)
105 
106  results.append("none")
107 
108  return [a for a in results if a]

Member Data Documentation

trackSplittingValidation.TrackSplittingValidation.configBaseName
trackSplittingValidation.TrackSplittingValidation.crabCfgBaseName
trackSplittingValidation.TrackSplittingValidation.needParentFiles

Definition at line 19 of file trackSplittingValidation.py.

trackSplittingValidation.TrackSplittingValidation.outputBaseName
trackSplittingValidation.TrackSplittingValidation.resultBaseName
trackSplittingValidation.TrackSplittingValidation.scriptBaseName