CMS 3D CMS Logo

List of all members | Public Member Functions
plottingOptions.PlottingOptionsTrackSplitting Class Reference
Inheritance diagram for plottingOptions.PlottingOptionsTrackSplitting:
plottingOptions.BasePlottingOptions

Public Member Functions

def __init__ (self, config, addDefaults={}, addMandatories=[], addneedpackages=[])
 
def validsubdets (self)
 
- Public Member Functions inherited from plottingOptions.BasePlottingOptions
def __init__ (self, config, valType, addDefaults={}, addMandatories=[], addneedpackages=[])
 
def getRepMap (self)
 

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().

111  def __init__(self, config, addDefaults = {}, addMandatories=[], addneedpackages=[]):
112  defaults = {
113  "outliercut": "-1.0",
114  "subdetector": "none",
115  }
116  defaults.update(addDefaults)
117  mandatories = []
118  mandatories += addMandatories
119  needpackages = ["Alignment/CommonAlignmentProducer"]
120  needpackages += addneedpackages
121  BasePlottingOptions.__init__(self, config, "split", defaults, mandatories, needpackages)
122  validsubdets = self.validsubdets()
123  if self.general["subdetector"] not in validsubdets:
124  raise AllInOneError("'%s' is not a valid subdetector!\n" % self.general["subdetector"] + "The options are: " + ", ".join(validsubdets))
125 
def __init__(self, config, addDefaults={}, addMandatories=[], addneedpackages=[])
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(), split, and digi_MixPreMix_cfi.strip.

Referenced by plottingOptions.PlottingOptionsTrackSplitting.__init__().

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