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 | Private Member Functions
validateAlignments.Alignment Class Reference

Public Member Functions

def __init__
 
def createValidations
 
def getLoadTemplate
 
def getRepMap
 
def restrictTo
 

Public Attributes

 color
 
 compareTo
 
 dbpath
 
 errordbpath
 
 errortag
 
 mode
 
 name
 
 style
 
 tag
 

Private Member Functions

def __testDbExist
 

Detailed Description

Definition at line 73 of file validateAlignments.py.

Constructor & Destructor Documentation

def validateAlignments.Alignment.__init__ (   self,
  name,
  config 
)

Definition at line 74 of file validateAlignments.py.

74 
75  def __init__(self, name, config):
76  section = "alignment:%s"%name
77  self.name = name
78  if not config.has_section( section ):
79  raise StandardError, "section %s not found. Please define the alignment!"%section
80  self.mode = config.get(section, "mode").split()
81  self.dbpath = config.get(section, "dbpath")
82  self.__testDbExist( self.dbpath )
83 
84  self.errordbpath = "frontier://FrontierProd/CMS_COND_21X_ALIGNMENT"
85  self.errortag = "TrackerIdealGeometryErrors210_mc"
86  if config.has_option(section,"errordbpath") and config.has_option(section,"errortag"):
87  self.errordbpath = config.get(section, "errordbpath")
88  self.__testDbExist( self.errordbpath )
89  self.errortag = config.get(section,"errortag")
90  else:
91  if config.has_option(section,"errordbpath") or config.has_option(section,"errortag"):
92  raise StandardError, "in alignment:%s you have to provide either both errordbpath _and_ errortag or none of both."%name
93  self.tag = config.get(section,"tag")
94 
95  self.color = config.get(section,"color")
96  self.style = config.get(section,"style")
97  self.compareTo = {}
98  for option in config.options( section ):
99  if option.startswith("compare|"):
100  alignmentName = option.split("compare|")[1]
101  comparisonList = config.get( section, option ).split()
102  if len(comparisonList) == 0:
103  raise StandardError, "empty comaprison list '%s' given for %s"%(config.get( section, option ), alignmentName )
104  self.compareTo[ alignmentName ] = comparisonList
105  if self.compareTo == {}:
106  self.compareTo = {
107  "IDEAL":["Tracker","SubDets"]
108  }
double split
Definition: MVATrainer.cc:139

Member Function Documentation

def validateAlignments.Alignment.__testDbExist (   self,
  dbpath 
)
private

Definition at line 109 of file validateAlignments.py.

110  def __testDbExist(self, dbpath):
111  #FIXME delete return to end train debuging
112  return
113  if not dbpath.startswith("sqlite_file:"):
114  print "WARNING: could not check existence for",dbpath
115  else:
116  if not os.path.exists( dbpath.split("sqlite_file:")[1] ):
117  raise "could not find file: '%s'"%dbpath.split("sqlite_file:")[1]
def validateAlignments.Alignment.createValidations (   self,
  config,
  options,
  allAlignments = [] 
)
config is the overall configuration
options are the options as paresed from command line
allAlignemts is a list of Alignment objects the is used to generate Alignment_vs_Alignemnt jobs

Definition at line 142 of file validateAlignments.py.

References validateAlignments.Alignment.compareTo, validateAlignments.Alignment.mode, and svgfig.Poly.mode.

143  def createValidations(self, config, options, allAlignments=[]):
144  """
145 config is the overall configuration
146 options are the options as paresed from command line
147 allAlignemts is a list of Alignment objects the is used to generate Alignment_vs_Alignemnt jobs
148 """
149  result = []
150  for validationName in self.mode:
151  if validationName == "compare":
152  randomWorkdirPart = None #use only one ranom numberr for all geom. comparisions for one alignment
153  #test if all needed alignments are defined
154  for alignmentName in self.compareTo:
155  referenceAlignment = 'IDEAL'
156  if not alignmentName == "IDEAL":
157  foundAlignment = False
158  for alignment in allAlignments:
159  if alignment.name == alignmentName:
160  referenceAlignment = alignment
161  foundAlignment = True
162  if not foundAlignment:
163  raise StandardError, " could not find alignment called '%s'"%alignmentName
164  result.append( GeometryComparision( self, referenceAlignment, config, options.getImages, randomWorkdirPart ) )
165  if randomWorkdirPart == None:
166  randomWorkdirPart = result[-1].randomWorkdirPart
167  elif validationName == "offline":
168  result.append( OfflineValidation( self, config ) )
169  elif validationName == "offlineDQM":
170  result.append( OfflineValidationDQM( self, config ) )
171  elif validationName == "mcValidate":
172  result.append( MonteCarloValidation( self, config ) )
173  elif validationName == "split":
174  result.append( TrackSplittingValidation( self, config ) )
175  else:
176  raise StandardError, "unknown validation mode '%s'"%validationName
177  return result
def validateAlignments.Alignment.getLoadTemplate (   self)

Definition at line 139 of file validateAlignments.py.

References validateAlignments.Alignment.getRepMap(), and validateAlignments.replaceByMap().

140  def getLoadTemplate(self):
141  return replaceByMap( configTemplates.dbLoadTemplate, self.getRepMap() )
def replaceByMap
— Helpers —############################ replaces .oO[id]Oo.
def validateAlignments.Alignment.getRepMap (   self)

Definition at line 126 of file validateAlignments.py.

References validateAlignments.Alignment.color, validateAlignments.Alignment.dbpath, validateAlignments.Alignment.errordbpath, validateAlignments.Alignment.errortag, validateAlignments.Alignment.name, MuonGeometrySanityCheckPoint.name, plotscripts.SawTeethFunction.name, validateAlignments.Alignment.style, and validateAlignments.Alignment.tag.

Referenced by validateAlignments.OfflineValidation.appendToExtendedValidation(), validateAlignments.GeometryComparision.createConfiguration(), validateAlignments.OfflineValidation.createConfiguration(), validateAlignments.GeometryComparision.createScript(), and validateAlignments.Alignment.getLoadTemplate().

127  def getRepMap( self ):
128  result = {
129  "name": self.name,
130  "dbpath": self.dbpath,
131  "errordbpath": self.errordbpath,
132  "tag": self.tag,
133  "errortag": self.errortag,
134  "color": self.color,
135  "style": self.style
136 
137  }
138  return result
def validateAlignments.Alignment.restrictTo (   self,
  restriction 
)

Definition at line 118 of file validateAlignments.py.

References validateAlignments.Alignment.mode, and svgfig.Poly.mode.

119  def restrictTo( self, restriction ):
120  result = []
121  if not restriction == None:
122  for mode in self.mode:
123  if mode in restriction:
124  result.append( mode )
125  self.mode = result

Member Data Documentation

validateAlignments.Alignment.color

Definition at line 94 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.getRepMap().

validateAlignments.Alignment.compareTo

Definition at line 96 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.createValidations().

validateAlignments.Alignment.dbpath

Definition at line 80 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.getRepMap().

validateAlignments.Alignment.errordbpath

Definition at line 83 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.getRepMap().

validateAlignments.Alignment.errortag

Definition at line 84 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.getRepMap().

validateAlignments.Alignment.mode

Definition at line 79 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.createValidations(), and validateAlignments.Alignment.restrictTo().

validateAlignments.Alignment.name

Definition at line 76 of file validateAlignments.py.

Referenced by TreeCrawler.Package.dump(), validateAlignments.Alignment.getRepMap(), python.rootplot.utilities.Hist.TGraph(), python.rootplot.utilities.Hist.TH1F(), and python.Vispa.Views.PropertyView.Property.valueChanged().

validateAlignments.Alignment.style

Definition at line 95 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.getRepMap(), and cmsCodeRules.Formatter.SimpleHTMLFormatter.headers().

validateAlignments.Alignment.tag

Definition at line 92 of file validateAlignments.py.

Referenced by validateAlignments.Alignment.getRepMap().