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
iniparser.ConfigData Class Reference

Public Member Functions

def __init__
 
def parseConfig
 
def parseParameter
 

Public Attributes

 defpeak
 
 firsttree
 
 jobDataPath
 
 jobNumber
 
 jobTime
 
 latexfile
 
 limit
 
 message
 
 mpspath
 
 numberofbins
 
 outputList
 
 outputPath
 
 rangedistM
 
 rangemode
 
 rangemodeHL
 
 rangerotHL
 
 rangerotM
 
 rangexyzHL
 
 rangexyzM
 
 samerange
 
 samerangeHL
 
 showadditional
 
 showbeamer
 
 showdump
 
 showhighlevel
 
 showhtml
 
 showmodule
 
 showmonitor
 
 showsubmodule
 
 showtex
 
 showtime
 
 statboxsize
 
 widthstddev
 

Detailed Description

stores the config data of the ini files or the console parameters

Definition at line 15 of file iniparser.py.

Constructor & Destructor Documentation

def iniparser.ConfigData.__init__ (   self)

Definition at line 19 of file iniparser.py.

19 
20  def __init__(self):
21  # get path to modules, defaut ini and templates
22  self.mpspath = os.path.join(os.path.dirname(__file__))
23 
24  # General
25  # jobmX dir
26  self.jobNumber = -1
27  # MillePedeUser_X time
28  self.jobTime = -1
29  # ./jobData/jobmX path
30  self.jobDataPath = ""
31  # base outputpath
32  self.outputPath = ""
33  # latex file name
34  self.latexfile = ""
35  # identification in every plot (e.g. mp1885)
36  self.message = ""
37  # limits for warning dict with keys xyz, rot, dist
38  # arguments must be given in this order
39  self.limit = {}
40  # statboxsize
41  self.statboxsize = -1
42 
43  # what should be created
44  self.showmonitor = -1
45  self.showadditional = -1
46  self.showdump = -1
47  self.showtime = -1
48  self.showhighlevel = -1
49  self.showmodule = -1
50  self.showsubmodule = -1
51  self.showtex = -1
52  self.showbeamer = -1
53  self.showhtml = -1
54 
55  # MODULEPLOTS
56  # number of bins after shrinking
57  self.numberofbins = -1
58  # definition of sharp peak; max_outlier / StdDev > X
59  self.defpeak = -1
60  # new histogram width in units of StdDev
61  self.widthstddev = -1
62  # every parameter (e.g. xyz) with same range
63  self.samerange = -1
64  # rangemode "stddev" = multiple of StdDev, "all" = show all, "given" =
65  # use given ranges
66  self.rangemode = -1
67  # ranges
68  self.rangexyzM = []
69  self.rangerotM = []
70  self.rangedistM = []
71 
72  # HIGHLEVELPLOTS
73  # given ranges
74  self.rangexyzHL = []
75  self.rangerotHL = []
76  # every parameter (e.g. xyz) with same range
77  self.samerangeHL = -1
78  # rangemode "all" = show all, "given" = use given ranges
79  self.rangemodeHL = -1
80 
81  # Time dependent
82  self.firsttree = -1
83 
84  # list with the plots for the output
85  self.outputList = []

Member Function Documentation

def iniparser.ConfigData.parseConfig (   self,
  path 
)

Definition at line 86 of file iniparser.py.

References iniparser.ConfigData.defpeak, cmsPerfStripChart.dict, iniparser.ConfigData.firsttree, iniparser.ConfigData.jobDataPath, iniparser.ConfigData.jobNumber, iniparser.ConfigData.jobTime, iniparser.ConfigData.latexfile, iniparser.ConfigData.limit, iniparser.ConfigData.numberofbins, iniparser.ConfigData.outputPath, iniparser.ConfigData.rangedistM, iniparser.ConfigData.rangemode, iniparser.ConfigData.rangemodeHL, iniparser.ConfigData.rangerotHL, iniparser.ConfigData.rangerotM, iniparser.ConfigData.rangexyzHL, iniparser.ConfigData.rangexyzM, iniparser.ConfigData.samerange, iniparser.ConfigData.samerangeHL, iniparser.ConfigData.showadditional, iniparser.ConfigData.showbeamer, iniparser.ConfigData.showdump, iniparser.ConfigData.showhighlevel, iniparser.ConfigData.showhtml, iniparser.ConfigData.showmodule, iniparser.ConfigData.showmonitor, iniparser.ConfigData.showsubmodule, iniparser.ConfigData.showtex, iniparser.ConfigData.showtime, split, iniparser.ConfigData.statboxsize, iniparser.ConfigData.widthstddev, and ComparisonHelper.zip().

86 
87  def parseConfig(self, path):
88  logger = logging.getLogger("mpsvalidate")
89 
90  # create ConfigParser object
91  parser = ConfigParser.ConfigParser()
92 
93  # read ini file
94  if (parser.read(path) == []):
95  logger.error("Could not open ini-file: {0}".format(path))
96 
97  # buffer object
98  configBuffer = ConfigData()
99 
100  # collect data and process it
101  try:
102  configBuffer.jobNumber = int(parser.get("GENERAL", "job"))
103  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
104  pass
105 
106  try:
107  configBuffer.jobDataPath = parser.get("GENERAL", "jobdatapath")
108  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
109  pass
110 
111  # set jobDataPath if job number is given and if path is not given
112  if (configBuffer.jobNumber != -1 and configBuffer.jobDataPath == ""):
113  self.jobNumber = configBuffer.jobNumber
114  if (self.jobNumber == 0):
115  self.jobDataPath = "jobData/jobm"
116  else:
117  self.jobDataPath = "jobData/jobm{0}".format(self.jobNumber)
118  self.outputPath = os.path.join(self.jobDataPath, "validation_output")
119 
120  # if jobData path is given
121  if (configBuffer.jobDataPath != ""):
122  self.jobDataPath = configBuffer.jobDataPath
123  self.outputPath = "validation_output"
124 
125  # set outputpath
126  try:
127  if (parser.get("GENERAL", "outputpath")):
128  self.outputPath = parser.get("GENERAL", "outputpath")
129  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
130  pass
131 
132 
133  # data which could be stored directly
134  try:
135  self.jobTime = int(parser.get("GENERAL", "time"))
136  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
137  pass
138 
139  try:
140  self.latexfile = parser.get("GENERAL", "latexfile")
141  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
142  pass
143 
144  try:
145  self.limit = parser.get("GENERAL", "limit")
146  self.limit = map(float, self.limit.replace(" ", "").split(","))
147  # make a dict to lookup by mode
148  self.limit = dict(zip(["xyz", "rot", "dist"], self.limit))
149  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
150  pass
151 
152  try:
153  self.statboxsize = float(parser.get("GENERAL", "statboxsize"))
154  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
155  pass
156 
157  # MODULEPLOTS
158 
159  try:
160  self.numberofbins = int(parser.get("MODULEPLOTS", "numberofbins"))
161  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
162  pass
163 
164  try:
165  self.defpeak = int(parser.get("MODULEPLOTS", "defpeak"))
166  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
167  pass
168 
169  try:
170  self.widthstddev = int(parser.get("MODULEPLOTS", "widthstddev"))
171  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
172  pass
173 
174  try:
175  self.samerange = int(parser.get("MODULEPLOTS", "samerange"))
176  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
177  pass
178 
179  try:
180  self.rangemode = parser.get("MODULEPLOTS", "rangemode")
181  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
182  pass
183 
184  try:
185  self.rangexyzM = parser.get("MODULEPLOTS", "rangexyz")
186  self.rangexyzM = sorted(
187  map(float, self.rangexyzM.replace(" ", "").split(",")))
188  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
189  pass
190 
191  try:
192  self.rangerotM = parser.get("MODULEPLOTS", "rangerot")
193  self.rangerotM = sorted(
194  map(float, self.rangerotM.replace(" ", "").split(",")))
195  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
196  pass
197 
198  try:
199  self.rangedistM = parser.get("MODULEPLOTS", "rangedist")
200  self.rangedistM = sorted(
201  map(float, self.rangedistM.replace(" ", "").split(",")))
202  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
203  pass
204 
205  # HIGHLEVELPLOTS
206 
207  try:
208  self.rangexyzHL = parser.get("HIGHLEVELPLOTS", "rangexyz")
209  self.rangexyzHL = sorted(
210  map(float, self.rangexyzHL.replace(" ", "").split(",")))
211  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
212  pass
213 
214  try:
215  self.rangerotHL = parser.get("HIGHLEVELPLOTS", "rangerot")
216  self.rangerotHL = sorted(
217  map(float, self.rangerotHL.replace(" ", "").split(",")))
218  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
219  pass
220 
221  try:
222  self.samerangeHL = int(parser.get("HIGHLEVELPLOTS", "samerange"))
223  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
224  pass
225 
226  try:
227  self.rangemodeHL = parser.get("HIGHLEVELPLOTS", "rangemode")
228  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
229  pass
230 
231  # TIMEPLOTS
232 
233  try:
234  self.firsttree = int(parser.get("TIMEPLOTS", "firsttree"))
235  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
236  pass
237 
238  # SHOW
239 
240  try:
241  self.showmonitor = int(parser.get("SHOW", "showmonitor"))
242  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
243  pass
244 
245  try:
246  self.showadditional = int(parser.get("SHOW", "showadditional"))
247  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
248  pass
249 
250  try:
251  self.showdump = int(parser.get("SHOW", "showdump"))
252  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
253  pass
254 
255  try:
256  self.showtime = int(parser.get("SHOW", "showtime"))
257  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
258  pass
259 
260  try:
261  self.showhighlevel = int(parser.get("SHOW", "showhighlevel"))
262  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
263  pass
264 
265  try:
266  self.showmodule = int(parser.get("SHOW", "showmodule"))
267  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
268  pass
269 
270  try:
271  self.showsubmodule = int(parser.get("SHOW", "showsubmodule"))
272  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
273  pass
274 
275  try:
276  self.showtex = int(parser.get("SHOW", "showtex"))
277  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
278  pass
279 
280  try:
281  self.showbeamer = int(parser.get("SHOW", "showbeamer"))
282  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
283  pass
284 
285  try:
286  self.showhtml = int(parser.get("SHOW", "showhtml"))
287  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
288  pass
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
double split
Definition: MVATrainer.cc:139
def iniparser.ConfigData.parseParameter (   self,
  args 
)

Definition at line 289 of file iniparser.py.

References iniparser.ConfigData.jobDataPath, iniparser.ConfigData.jobNumber, iniparser.ConfigData.jobTime, iniparser.ConfigData.message, and iniparser.ConfigData.outputPath.

290  def parseParameter(self, args):
291  logger = logging.getLogger("mpsvalidate")
292 
293  # check if parameter is given and override the config data
294  if (args.time != -1):
295  self.jobTime = args.time
296 
297  if (args.job != -1):
298  self.jobNumber = args.job
299 
300  # set jobDataPath
301  if (self.jobNumber == 0):
302  self.jobDataPath = "jobData/jobm"
303  else:
304  self.jobDataPath = "jobData/jobm{0}".format(self.jobNumber)
305  self.outputPath = os.path.join(self.jobDataPath, "validation_output")
306 
307  if (args.jobdatapath != ""):
308  self.jobDataPath = args.jobdatapath
309 
310  if (args.message != ""):
311  self.message = args.message
312 
313  # if path is given put the output in the current directory
314  if (args.jobdatapath):
315  self.outputPath = "validation_output"
316 
317  if (args.outputpath):
318  self.outputPath = args.outputpath
319 

Member Data Documentation

iniparser.ConfigData.defpeak

Definition at line 58 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.firsttree

Definition at line 81 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.jobDataPath

Definition at line 29 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig(), and iniparser.ConfigData.parseParameter().

iniparser.ConfigData.jobNumber

Definition at line 25 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig(), and iniparser.ConfigData.parseParameter().

iniparser.ConfigData.jobTime

Definition at line 27 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig(), and iniparser.ConfigData.parseParameter().

iniparser.ConfigData.latexfile

Definition at line 33 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.limit

Definition at line 38 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.message

Definition at line 35 of file iniparser.py.

Referenced by util.rrapi.RRApiError.__str__(), rrapi.RRApiError.__str__(), argparse.ArgumentError.__str__(), python.rootplot.argparse.ArgumentError.__str__(), and iniparser.ConfigData.parseParameter().

iniparser.ConfigData.mpspath

Definition at line 21 of file iniparser.py.

iniparser.ConfigData.numberofbins

Definition at line 56 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.outputList

Definition at line 84 of file iniparser.py.

iniparser.ConfigData.outputPath

Definition at line 31 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig(), and iniparser.ConfigData.parseParameter().

iniparser.ConfigData.rangedistM

Definition at line 69 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.rangemode

Definition at line 65 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.rangemodeHL

Definition at line 78 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.rangerotHL

Definition at line 74 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.rangerotM

Definition at line 68 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.rangexyzHL

Definition at line 73 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.rangexyzM

Definition at line 67 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.samerange

Definition at line 62 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.samerangeHL

Definition at line 76 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showadditional

Definition at line 44 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showbeamer

Definition at line 51 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showdump

Definition at line 45 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showhighlevel

Definition at line 47 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showhtml

Definition at line 52 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showmodule

Definition at line 48 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showmonitor

Definition at line 43 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showsubmodule

Definition at line 49 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showtex

Definition at line 50 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.showtime

Definition at line 46 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.statboxsize

Definition at line 40 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().

iniparser.ConfigData.widthstddev

Definition at line 60 of file iniparser.py.

Referenced by iniparser.ConfigData.parseConfig().