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
trackSplittingValidation.TrackSplittingValidation Class Reference
Inheritance diagram for trackSplittingValidation.TrackSplittingValidation:
genericValidation.GenericValidationData genericValidation.GenericValidation

Public Member Functions

def __init__
 
def appendToExtendedValidation
 
def appendToMerge
 
def createConfiguration
 
def createCrabCfg
 
def createScript
 
def getRepMap
 
def validsubdets
 
- Public Member Functions inherited from genericValidation.GenericValidationData
def __init__
 
def createCrabCfg
 
def createScript
 
def getRepMap
 
- Public Member Functions inherited from genericValidation.GenericValidation
def __init__
 
def createConfiguration
 
def createCrabCfg
 
def createFiles
 
def createScript
 
def getCompareStrings
 
def getRepMap
 

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
 
 jobmode
 
 name
 
 NJobs
 
 randomWorkdirPart
 
 scramarch
 
 scriptFiles
 

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 
12  resultBaseName = "TrackSplitting", outputBaseName = "TrackSplitting"):
13  mandatories = ["trackcollection"]
14  defaults = {"subdetector": "BPIX"}
15  self.configBaseName = configBaseName
16  self.scriptBaseName = scriptBaseName
17  self.crabCfgBaseName = crabCfgBaseName
18  self.resultBaseName = resultBaseName
19  self.outputBaseName = outputBaseName
20  self.needParentFiles = False
21  GenericValidationData.__init__(self, valName, alignment, config,
22  "split", addMandatories = mandatories, addDefaults = defaults)
23  validsubdets = self.validsubdets()
24  if self.general["subdetector"] not in validsubdets:
25  raise AllInOneError("'%s' is not a valid subdetector!\n" % self.general["subdetector"] + "The options are: " + ", ".join(validsubdets))
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

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 59 of file trackSplittingValidation.py.

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

59 
60  def appendToExtendedValidation( self, validationsSoFar = "" ):
61  """
62  if no argument or "" is passed a string with an instantiation is
63  returned, else the validation is appended to the list
64  """
65  repMap = self.getRepMap()
66  comparestring = self.getCompareStrings("TrackSplittingValidation")
67  if validationsSoFar != "":
68  validationsSoFar += ',"\n "'
69  validationsSoFar += comparestring
70  return validationsSoFar
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 71 of file trackSplittingValidation.py.

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

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

Definition at line 26 of file trackSplittingValidation.py.

References monteCarloValidation.MonteCarloValidation.configBaseName, trackSplittingValidation.TrackSplittingValidation.configBaseName, offlineValidation.OfflineValidation.configBaseName, genericValidation.GenericValidation.filesToCompare, genericValidation.GenericValidation.getRepMap(), alignment.Alignment.getRepMap(), entry.name, genericValidation.GenericValidation.name, alignment.Alignment.name, TrackerSectorStruct.name, MuonGeometrySanityCheckPoint.name, and plotscripts.SawTeethFunction.name.

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

Definition at line 38 of file trackSplittingValidation.py.

References monteCarloValidation.MonteCarloValidation.crabCfgBaseName, trackSplittingValidation.TrackSplittingValidation.crabCfgBaseName, and offlineValidation.OfflineValidation.crabCfgBaseName.

38 
39  def createCrabCfg(self, path):
40  return GenericValidationData.createCrabCfg(self, path, self.crabCfgBaseName)
def trackSplittingValidation.TrackSplittingValidation.createScript (   self,
  path 
)

Definition at line 35 of file trackSplittingValidation.py.

35 
36  def createScript(self, path):
37  return GenericValidationData.createScript(self, path)
def trackSplittingValidation.TrackSplittingValidation.getRepMap (   self,
  alignment = None 
)

Definition at line 41 of file trackSplittingValidation.py.

References genericValidation.GenericValidation.general.

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

Definition at line 84 of file trackSplittingValidation.py.

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

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

Member Data Documentation

trackSplittingValidation.TrackSplittingValidation.configBaseName

Definition at line 14 of file trackSplittingValidation.py.

Referenced by trackSplittingValidation.TrackSplittingValidation.createConfiguration(), and zMuMuValidation.ZMuMuValidation.createConfiguration().

trackSplittingValidation.TrackSplittingValidation.crabCfgBaseName

Definition at line 16 of file trackSplittingValidation.py.

Referenced by trackSplittingValidation.TrackSplittingValidation.createCrabCfg(), and zMuMuValidation.ZMuMuValidation.createCrabCfg().

trackSplittingValidation.TrackSplittingValidation.needParentFiles

Definition at line 19 of file trackSplittingValidation.py.

trackSplittingValidation.TrackSplittingValidation.outputBaseName

Definition at line 18 of file trackSplittingValidation.py.

Referenced by zMuMuValidation.ZMuMuValidation.getRepMap(), and genericValidation.GenericValidationData.getRepMap().

trackSplittingValidation.TrackSplittingValidation.resultBaseName

Definition at line 17 of file trackSplittingValidation.py.

Referenced by genericValidation.GenericValidationData.getRepMap().

trackSplittingValidation.TrackSplittingValidation.scriptBaseName

Definition at line 15 of file trackSplittingValidation.py.

Referenced by genericValidation.GenericValidationData.createScript().