CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
plottingOptions.PlottingOptionsTrackSplitting Class Reference
Inheritance diagram for plottingOptions.PlottingOptionsTrackSplitting:
plottingOptions.BasePlottingOptions

Public Member Functions

def __init__
 
def validsubdets
 
- Public Member Functions inherited from plottingOptions.BasePlottingOptions
def __init__
 
def getRepMap
 

Additional Inherited Members

- Public Attributes inherited from plottingOptions.BasePlottingOptions
 cmssw
 
 cmsswreleasebase
 
 config
 
 general
 
 randomWorkdirPart
 
 scramarch
 
 type
 

Detailed Description

Definition at line 110 of file plottingOptions.py.

Constructor & Destructor Documentation

def plottingOptions.PlottingOptionsTrackSplitting.__init__ (   self,
  config,
  addDefaults = {},
  addMandatories = [],
  addneedpackages = [] 
)

Definition at line 111 of file plottingOptions.py.

References plottingOptions.BasePlottingOptions.general, genericValidation.GenericValidation.general, join(), and plottingOptions.PlottingOptionsTrackSplitting.validsubdets().

112  def __init__(self, config, addDefaults = {}, addMandatories=[], addneedpackages=[]):
113  defaults = {
114  "outliercut": "-1.0",
115  "subdetector": "none",
116  }
117  defaults.update(addDefaults)
118  mandatories = []
119  mandatories += addMandatories
120  needpackages = ["Alignment/CommonAlignmentProducer"]
121  needpackages += addneedpackages
122  BasePlottingOptions.__init__(self, config, "split", defaults, mandatories, needpackages)
123  validsubdets = self.validsubdets()
124  if self.general["subdetector"] not in validsubdets:
125  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 plottingOptions.PlottingOptionsTrackSplitting.validsubdets (   self)

Definition at line 126 of file plottingOptions.py.

References monteCarloValidation.MonteCarloValidation.getRepMap(), geometryComparison.GeometryComparison.getRepMap(), offlineValidation.OfflineValidation.getRepMap(), plottingOptions.BasePlottingOptions.getRepMap(), genericValidation.GenericValidation.getRepMap(), alignment.Alignment.getRepMap(), offlineValidation.OfflineValidationDQM.getRepMap(), genericValidation.GenericValidationData.getRepMap(), python.rootplot.root2matplotlib.replace(), helperFunctions.replaceByMap(), and split.

Referenced by plottingOptions.PlottingOptionsTrackSplitting.__init__().

127  def validsubdets(self):
128  filename = replaceByMap(".oO[Alignment/CommonAlignmentProducer]Oo./python/AlignmentTrackSelector_cfi.py", self.getRepMap())
129  with open(filename) as f:
130  trackselector = f.read()
131 
132  minhitspersubdet = trackselector.split("minHitsPerSubDet")[1].split("(",1)[1]
133 
134  parenthesesdepth = 0
135  i = 0
136  for character in minhitspersubdet:
137  if character == "(":
138  parenthesesdepth += 1
139  if character == ")":
140  parenthesesdepth -= 1
141  if parenthesesdepth < 0:
142  break
143  i += 1
144  minhitspersubdet = minhitspersubdet[0:i]
145 
146  results = minhitspersubdet.split(",")
147  empty = []
148  for i in range(len(results)):
149  results[i] = results[i].split("=")[0].strip().replace("in", "", 1)
150 
151  results.append("none")
152 
153  return [a for a in results if a]
def replaceByMap
— Helpers —############################
double split
Definition: MVATrainer.cc:139