CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
alignmentValidation Namespace Reference

Functions

def createCanvasesList
 
def createCanvasToIDList
 
def createDirectoryStructure
 
def dirToID
 
def doCurvaturePlotsDT
 
def doFitFunctionsPlotsCSC
 
def doFitFunctionsPlotsDT
 
def doIterationPlots
 
def doMapPlotsCSC
 
def doMapPlotsDT
 
def doSegDiffPlotsCSC
 
def doSegDiffPlotsDT
 
def idsForFile
 
def isFileUnderDir
 functions definitions More...
 
def saveAs
 

Variables

string action = "store_true"
 
string allOptions = "-l "
 
tuple c1 = ROOT.TCanvas("c1","c1",800,600)
 do drawing More...
 
list CANVASES_LIST_TEMPLATE
 
string comdir = "common/"
 setup output: More...
 
string default = ''
 
string dest = "runLabel"
 
 DO_CSC = False
 
 DO_CURVATURE = False
 
 DO_DIAGNOSTIC = options.diagnostic
 
 DO_DT = False
 
 DO_FIT = False
 
 DO_MAP = False
 
 DO_MEDIAN = False
 
 DO_SEGDIFF = False
 
string fname = options.inputDir+'/'
 main script More...
 
string help = "[REQUIRED] label to use for a run"
 
 i1prefix = options.i1prefix
 
 iNprefix = options.iNprefix
 
list iter1_reports = []
 
 iter1_tfile = None
 
string iteration1 = "iter1"
 
string iterationN = "iterN"
 
list iterN_reports = []
 
 iterN_tfile = None
 
 outdir = options.outputDir
 
tuple parser = optparse.OptionParser(usage)
 
int QUICKTESTN = 10000
 
 SINGLE_ITERATION = False
 
list tfiles1_plotting = []
 
list tfilesN_plotting = []
 
string type = "string"
 
string usage = '%prog [options]\n'
 To parse commandline args. More...
 

Function Documentation

def alignmentValidation.createCanvasesList (   fname = "canvases_list.js")
Use CANVASES_LIST_TEMPLATE as a template to create a canvases list include for the browser.
   Write out only those canvases which have existing filename.png plots.

Definition at line 731 of file alignmentValidation.py.

References isFileUnderDir().

732 def createCanvasesList(fname="canvases_list.js"):
733  '''Use CANVASES_LIST_TEMPLATE as a template to create a canvases list include for the browser.
734  Write out only those canvases which have existing filename.png plots.
735  '''
736  CANVASES_LIST = []
737  for scope in CANVASES_LIST_TEMPLATE:
738  scope_entry = []
739  if len(scope)>2:
740  scope_entry = [scope[0],scope[1]]
741  for canvas_entry in scope[2:]:
742  if isFileUnderDir("./",canvas_entry[1]):
743  scope_entry.append(canvas_entry)
744  CANVASES_LIST.append(scope_entry)
745 
746  ff = open(fname,mode="w")
747  print >>ff, "var CANVASES_LIST = "
748  json.dump(CANVASES_LIST,ff)
749  ff.close()
750 
def isFileUnderDir
functions definitions
def alignmentValidation.createCanvasToIDList (   fname = "canvas2id_list.js")
Create a canvas-to-ids list include for the browser.
   Write out only those canvases which have existing filename.png plots.

Definition at line 751 of file alignmentValidation.py.

References python.multivaluedict.dict, idsForFile(), and list().

752 def createCanvasToIDList(fname="canvas2id_list.js"):
753  '''Create a canvas-to-ids list include for the browser.
754  Write out only those canvases which have existing filename.png plots.
755  '''
756  CANVAS2ID_LIST = []
757  for scope in CANVASES_LIST_TEMPLATE:
758  if len(scope)>2:
759  for canvas_entry in scope[2:]:
760  ids = idsForFile("./",canvas_entry[1])
761  # scope_entry.append(canvas_entry)
762  # uniquify:
763  set_ids = set(ids)
764  uids = list(set_ids)
765  print canvas_entry, ":", len(uids), "ids"
766  if (len(uids)>0):
767  CANVAS2ID_LIST.append( (canvas_entry[1],uids) )
768  #print CANVAS2ID_LIST
769  CANVAS2ID_LIST_DICT = dict(CANVAS2ID_LIST)
770  #print CANVAS2ID_LIST_DICT
771  ff = open(fname,mode="w")
772  print >>ff, "var CANVAS2ID_LIST = "
773  json.dump(CANVAS2ID_LIST_DICT,ff)
774  ff.close()
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def alignmentValidation.createDirectoryStructure (   iteration_name)

Definition at line 293 of file alignmentValidation.py.

294 def createDirectoryStructure(iteration_name):
295 
296  if not os.access(iteration_name,os.F_OK):
297  os.mkdir(iteration_name)
298 
299  csc_basedir = iteration_name+'/'
300  for endcap in CSC_TYPES:
301  #print csc_basedir+endcap[0]
302  shutil.rmtree(csc_basedir+endcap[0],True)
303  os.mkdir(csc_basedir+endcap[0])
304  for station in endcap[2]:
305  #print csc_basedir+endcap[0]+'/'+station[1]
306  os.mkdir(csc_basedir+endcap[0]+'/'+station[1])
307  for ring in station[2]:
308  #print csc_basedir+endcap[0]+'/'+station[1]+'/'+ring[1]
309  os.mkdir(csc_basedir+endcap[0]+'/'+station[1]+'/'+ring[1])
310  for chamber in range(1,ring[2]+1):
311  schamber = "%02d" % chamber
312  #print csc_basedir+endcap[0]+'/'+station[1]+'/'+ring[1]+'/'+schamber
313  os.mkdir(csc_basedir+endcap[0]+'/'+station[1]+'/'+ring[1]+'/'+schamber)
314 
315  dt_basedir = iteration_name+'/MB/'
316  #print dt_basedir
317  shutil.rmtree(dt_basedir,True)
318  os.mkdir(dt_basedir)
319  for wheel in DT_TYPES:
320  #print dt_basedir+wheel[0]
321  os.mkdir(dt_basedir+wheel[0])
322  for station in wheel[2]:
323  #print dt_basedir+wheel[0]+'/'+station[1]
324  os.mkdir(dt_basedir+wheel[0]+'/'+station[1])
325  for sector in range(1,station[2]+1):
326  ssector = "%02d" % sector
327  #print dt_basedir+wheel[0]+'/'+station[1]+'/'+ssector
328  os.mkdir(dt_basedir+wheel[0]+'/'+station[1]+'/'+ssector)
329 
330  print os.getcwd()
def alignmentValidation.dirToID (   d)

Definition at line 793 of file alignmentValidation.py.

Referenced by idsForFile().

794 def dirToID(d):
795  if d[-1]!='/': d += '/'
796  dtn = d.find("/MB/")
797  if dtn!=-1:
798  return d[dtn+4:-1]
799  cscn = d.find("/ME-/")
800  if cscn!=-1:
801  return 'ME-'+d[cscn+4:-1]
802  cscn = d.find("/ME+/")
803  if cscn!=-1:
804  return 'ME+'+d[cscn+4:-1]
805  return ''
806 
def alignmentValidation.doCurvaturePlotsDT (   dt_basedir,
  tfiles_plotting 
)
write DT curvature plots

"wheel%s_sector%s" % (wheel, sector)

wheel in "m2", "m1", "z", "p1", "p2"
station 1 only!
sector in "01", ..., "12"

"param" may be one of 
  "deltax" (Delta x position residuals),
  "deltadxdz" (Delta (dx/dz) angular residuals),
  "curverr" (Delta x * d(Delta q/pT)/d(Delta x) = Delta q/pT in the absence of misalignment) - not necessary

made for all (wheel,station=1,sector) combinations

Interface: could be accesses through a general DT chambers map for station=1 chambers.

Definition at line 461 of file alignmentValidation.py.

References plotscripts.curvatureplot(), and saveAs().

Referenced by doIterationPlots().

462 def doCurvaturePlotsDT(dt_basedir, tfiles_plotting):
463  """write DT curvature plots
464 
465  "wheel%s_sector%s" % (wheel, sector)
466 
467  wheel in "m2", "m1", "z", "p1", "p2"
468  station 1 only!
469  sector in "01", ..., "12"
470 
471  "param" may be one of
472  "deltax" (Delta x position residuals),
473  "deltadxdz" (Delta (dx/dz) angular residuals),
474  "curverr" (Delta x * d(Delta q/pT)/d(Delta x) = Delta q/pT in the absence of misalignment) - not necessary
475 
476  made for all (wheel,station=1,sector) combinations
477 
478  Interface: could be accesses through a general DT chambers map for station=1 chambers."""
479 
480  w_dict = {'-2':'m2', '-1':'m1', '0':'z', '1':'p1', '2':'p2'}
481  qcount = 0
482  for wheel in DT_TYPES:
483  if wheel[1]=="ALL": continue
484  #station = 1
485  station = wheel[2][0]
486  print wheel[0]+'/'+station[1]
487  for sector in range(1,station[2]+1):
488  if sector>12: break
489  if qcount>QUICKTESTN: break
490  qcount += 1
491  ssector = "%02d" % sector
492  pdir = dt_basedir+'/'+wheel[0]+'/'+station[1]+'/'+ssector+'/'
493  label = "wheel%s_sector%s" % (w_dict[wheel[1]], ssector)
494  thetitle ="Wheel %s, sector %s" % (wheel[1], ssector)
495  curvatureplot(tfiles_plotting, label, "deltax", title=thetitle, window=15., fitline=True)
496  saveAs(pdir+'dt_curvature_deltax.png')
497  curvatureplot(tfiles_plotting, label, "deltadxdz", title=thetitle, window=15., fitline=True)
498  saveAs(pdir+'dt_curvature_deltadxdz.png')
499 
def alignmentValidation.doFitFunctionsPlotsCSC (   csc_basedir,
  iter_tfile,
  iter_reports 
)
write fit functions plots for CSC

 CSC bellcurves and polynomials

set of plots of bellcurves
  rphi, drphidz, rphi vs. drphidz

set of plots of polynomials
  rphi vs. rphi pos,    rphi vs drphidz angle
  drphidz vs. rphi pos, drphidz vs drphidz angle

made for all (endcap,station,ring,chamber) combinations

Interface: could be accesses through a general CSC chambers map.

Definition at line 667 of file alignmentValidation.py.

References plotscripts.bellcurves(), plotscripts.clearDDT(), plotscripts.polynomials(), and saveAs().

Referenced by doIterationPlots().

668 def doFitFunctionsPlotsCSC(csc_basedir, iter_tfile, iter_reports):
669  """write fit functions plots for CSC
670 
671  CSC bellcurves and polynomials
672 
673  set of plots of bellcurves
674  rphi, drphidz, rphi vs. drphidz
675 
676  set of plots of polynomials
677  rphi vs. rphi pos, rphi vs drphidz angle
678  drphidz vs. rphi pos, drphidz vs drphidz angle
679 
680  made for all (endcap,station,ring,chamber) combinations
681 
682  Interface: could be accesses through a general CSC chambers map."""
683 
684  qcount = 0
685  clearDDT()
686  for endcap in CSC_TYPES:
687  for station in endcap[2]:
688  for ring in station[2]:
689  if ring[1]=="ALL": continue
690  print endcap[0]+'/'+station[1]+'/'+ring[1]
691  for chamber in range(1,ring[2]+1):
692  if qcount>QUICKTESTN: break
693  qcount += 1
694  schamber = "%02d" % chamber
695  pdir = csc_basedir+'/'+endcap[0]+'/'+station[1]+'/'+ring[1]+'/'+schamber+'/'
696  label = "ME%s%s%s_%s" % (endcap[1], station[1], ring[1], schamber)
697  bellcurves(iter_tfile, iter_reports, label, False)
698  #c1.SaveAs(pdir+'csc_bellcurves.png')
699  saveAs(pdir+'csc_bellcurves.png')
700  polynomials(iter_tfile, iter_reports, label, False)
701  #c1.SaveAs(pdir+'csc_polynomials.png')
702  saveAs(pdir+'csc_polynomials.png')
703  #printDeltaTs()
704 
705 
def alignmentValidation.doFitFunctionsPlotsDT (   dt_basedir,
  iter_tfile,
  iter_reports 
)
write fit functions plots for DT

 DT bellcurves and polynomials

set of plots of bellcurves
  x, dxdz, x vs. dxdz (for all 4 stations)
  y, dydz, x vs. dxdz (only for stations 1-3?)

set of plots of polynomials -- for stations 1-3 only??
  x vs. xpos,    x vs ypos,    x vs dxdz angle,    x vs dydz angle
  y vs. xpos,    y vs ypos,    y vs dxdz angle,    y vs dydz angle
  dxdz vs. xpos, dxdz vs ypos, dxdz vs dxdz angle, dxdz vs dydz angle
  dydz vs. xpos, dydz vs ypos, dydz vs dxdz angle, dydz vs dydz angle

set of plots of polynomials -- for station 4 only??
  x vs. xpos,    x vs dxdz angle
  dxdz vs. xpos, dxdz vs dxdz angle

made for all (wheel,station,sector) combinations

Interface: could be accesses through a general DT chambers map.

Definition at line 623 of file alignmentValidation.py.

References plotscripts.bellcurves(), plotscripts.clearDDT(), plotscripts.polynomials(), saveAs(), and plotscripts.wheelLetter().

Referenced by doIterationPlots().

624 def doFitFunctionsPlotsDT(dt_basedir, iter_tfile, iter_reports):
625  """write fit functions plots for DT
626 
627  DT bellcurves and polynomials
628 
629  set of plots of bellcurves
630  x, dxdz, x vs. dxdz (for all 4 stations)
631  y, dydz, x vs. dxdz (only for stations 1-3?)
632 
633  set of plots of polynomials -- for stations 1-3 only??
634  x vs. xpos, x vs ypos, x vs dxdz angle, x vs dydz angle
635  y vs. xpos, y vs ypos, y vs dxdz angle, y vs dydz angle
636  dxdz vs. xpos, dxdz vs ypos, dxdz vs dxdz angle, dxdz vs dydz angle
637  dydz vs. xpos, dydz vs ypos, dydz vs dxdz angle, dydz vs dydz angle
638 
639  set of plots of polynomials -- for station 4 only??
640  x vs. xpos, x vs dxdz angle
641  dxdz vs. xpos, dxdz vs dxdz angle
642 
643  made for all (wheel,station,sector) combinations
644 
645  Interface: could be accesses through a general DT chambers map."""
646 
647  qcount = 0
648  clearDDT()
649  for wheel in DT_TYPES:
650  if wheel[1]=="ALL": continue
651  for station in wheel[2]:
652  print wheel[0]+'/'+station[1]
653  for sector in range(1,station[2]+1):
654  if qcount>QUICKTESTN: break
655  qcount += 1
656  ssector = "%02d" % sector
657  pdir = dt_basedir+'/'+wheel[0]+'/'+station[1]+'/'+ssector+'/'
658  label = "MBwh%sst%ssec%s" % (wheelLetter(int(wheel[1])),station[1],ssector)
659  bellcurves(iter_tfile, iter_reports, label, False)
660  #c1.SaveAs(pdir+'dt_bellcurves.png')
661  saveAs(pdir+'dt_bellcurves.png')
662  polynomials(iter_tfile, iter_reports, label, False)
663  #c1.SaveAs(pdir+'dt_polynomials.png')
664  saveAs(pdir+'dt_polynomials.png')
665  #printDeltaTs()
666 
def wheelLetter
Definition: plotscripts.py:34
def alignmentValidation.doIterationPlots (   iteration_directory,
  tfiles_plotting,
  iter_tfile,
  iter_reports 
)

Definition at line 706 of file alignmentValidation.py.

References doCurvaturePlotsDT(), doFitFunctionsPlotsCSC(), doFitFunctionsPlotsDT(), doMapPlotsCSC(), doMapPlotsDT(), doSegDiffPlotsCSC(), and doSegDiffPlotsDT().

707 def doIterationPlots(iteration_directory, tfiles_plotting, iter_tfile, iter_reports):
708  dt_basedir = iteration_directory+'/'+'MB'
709  csc_basedir = iteration_directory+'/'
710 
711  if DO_DT and DO_MAP:
712  doMapPlotsDT(dt_basedir, tfiles_plotting)
713  if DO_CSC and DO_MAP:
714  doMapPlotsCSC(csc_basedir, tfiles_plotting)
715 
716  if DO_DT and DO_CURVATURE:
717  doCurvaturePlotsDT(dt_basedir, tfiles_plotting)
718  #if DO_CSC and DO_CURVATURE:
719  # doCurvaturePlotsCSC(csc_basedir, tfiles_plotting)
720 
721  if DO_DT and DO_SEGDIFF:
722  doSegDiffPlotsDT(dt_basedir, tfiles_plotting, iter_reports)
723  if DO_CSC and DO_SEGDIFF:
724  doSegDiffPlotsCSC(csc_basedir, tfiles_plotting, iter_reports)
725 
726  if DO_DT and DO_FIT:
727  doFitFunctionsPlotsDT(dt_basedir, iter_tfile, iter_reports)
728  if DO_CSC and DO_FIT:
729  doFitFunctionsPlotsCSC(csc_basedir, iter_tfile, iter_reports)
730 
def alignmentValidation.doMapPlotsCSC (   csc_basedir,
  tfiles_plotting 
)
write CSC map plots

 "CSCvsphi_me%s%d%d" % (endcap, station, ring)

plots "integrated" over ALL SECTORS:
of rphi, drphi/dz vs. phi
made for all (endcap,station,ring) combinations

Interface: may be arranged into two station(1 .. 4) vs. R(1 .. 4) maps for both endcaps
with R range (1 .. 4) for stations 2-4
 It could be incorporated into a general CSC chambers map (column1: endcap, column2: station,
column3: ring, columns4-40 correspond to chamber #) by making ring numbers in column 3
clickable.


 "CSCvsr_me%s%dch%02d" % (endcap, station, chamberNumber)

plots "integrated" over ALL RINGS:
of rphi, drphi/dz vs. z
made for all (endcap,station,chamber) combinations

Interface: may be arranged into two station(1 .. 4) vs. chamber(1 .. 36) maps for both endcaps
It could be incorporated into an EXTENDED general CSC chambers map (extended by adding an
identifier "ALL" in column3 for ring number).

Definition at line 403 of file alignmentValidation.py.

References plotscripts.mapplot(), and plotscripts.saveTestResultsMap().

Referenced by doIterationPlots().

404 def doMapPlotsCSC(csc_basedir, tfiles_plotting):
405  """write CSC map plots
406 
407  "CSCvsphi_me%s%d%d" % (endcap, station, ring)
408 
409  plots "integrated" over ALL SECTORS:
410  of rphi, drphi/dz vs. phi
411  made for all (endcap,station,ring) combinations
412 
413  Interface: may be arranged into two station(1 .. 4) vs. R(1 .. 4) maps for both endcaps
414  with R range (1 .. 4) for stations 2-4
415  It could be incorporated into a general CSC chambers map (column1: endcap, column2: station,
416  column3: ring, columns4-40 correspond to chamber #) by making ring numbers in column 3
417  clickable.
418 
419 
420  "CSCvsr_me%s%dch%02d" % (endcap, station, chamberNumber)
421 
422  plots "integrated" over ALL RINGS:
423  of rphi, drphi/dz vs. z
424  made for all (endcap,station,chamber) combinations
425 
426  Interface: may be arranged into two station(1 .. 4) vs. chamber(1 .. 36) maps for both endcaps
427  It could be incorporated into an EXTENDED general CSC chambers map (extended by adding an
428  identifier "ALL" in column3 for ring number)."""
429 
430  for endcap in CSC_TYPES:
431  for station in endcap[2]:
432  for ring in station[2]:
433  if ring[1]=="ALL": continue
434  pdir = csc_basedir+'/'+endcap[0]+'/'+station[1]+'/'+ring[1]+'/'
435  label = "CSCvsphi_me%s%s%s" % (endcap[1], station[1], ring[1])
436  htitle = "%s%s/%s" % (endcap[0], station[1],ring[1])
437  mapplot(tfiles_plotting, label, "x", window=15., title=htitle, fitsine=True)
438  c1.SaveAs(pdir+'map_CSCvsphi_x.png')
439  mapplot(tfiles_plotting, label, "dxdz", window=15., title=htitle)
440  c1.SaveAs(pdir+'map_CSCvsphi_dxdz.png')
441 
442  saveTestResultsMap(options.runLabel)
443 
444  qcount = 0
445  for endcap in CSC_TYPES:
446  for station in endcap[2]:
447  for ring in station[2]:
448  if ring[1]!="ALL": continue
449  for chamber in range(1,ring[2]+1):
450  if qcount>QUICKTESTN: break
451  qcount += 1
452  schamber = "%02d" % chamber
453  pdir = csc_basedir+'/'+endcap[0]+'/'+station[1]+'/'+ring[1]+'/'+schamber+'/'
454  label = "CSCvsr_me%s%sch%s" % (endcap[1], station[1], schamber)
455  htitle = "%s%s/ALL/%d" % (endcap[0], station[1],chamber)
456  mapplot(tfiles_plotting, label, "x", window=15., title=htitle)
457  c1.SaveAs(pdir+'map_CSCvsr_x.png')
458  mapplot(tfiles_plotting, label, "dxdz", window=15., title=htitle)
459  c1.SaveAs(pdir+'map_CSCvsr_dxdz.png')
460 
def saveTestResultsMap
def alignmentValidation.doMapPlotsDT (   dt_basedir,
  tfiles_plotting 
)
write DT map plots

 "DTvsphi_st%dwh%s" % (station, wheelletter):

plots "integrated" over ALL SECTORS:
of x, y, dxdz, dydz vs. phi (y and dydz only for stations 1-3)
made for all (station,wheel) combinations

Access interface may be arranged into station(1 .. 4) vs. wheel(-2 .. +2) map.
It could be incorporated into a general DT chambers map (column1: wheel, column2: station,
columns3-16 correspond to sector #) by making station numbers in column 2 clickable.


 "DTvsz_st%dsec%02d" % (station, sector)

plots "integrated" over ALL WHEELS:
of x, y, dxdz, dydz vs. z (y and dydz only for stations 1-3)
made for all (station,sector) combinations

Interface: may be arranged into station(1 .. 4) vs. sector(1 .. 14) map with sector range
(1 .. 12) for stations 1-3.
It could be incorporated into an EXTENDED general DT chambers map (extended by adding an
identifier "ALL" in column1 for wheel number).

Definition at line 333 of file alignmentValidation.py.

References plotscripts.mapplot(), plotscripts.saveTestResultsMap(), and plotscripts.wheelLetter().

Referenced by doIterationPlots().

334 def doMapPlotsDT(dt_basedir, tfiles_plotting):
335  """write DT map plots
336 
337  "DTvsphi_st%dwh%s" % (station, wheelletter):
338 
339  plots "integrated" over ALL SECTORS:
340  of x, y, dxdz, dydz vs. phi (y and dydz only for stations 1-3)
341  made for all (station,wheel) combinations
342 
343  Access interface may be arranged into station(1 .. 4) vs. wheel(-2 .. +2) map.
344  It could be incorporated into a general DT chambers map (column1: wheel, column2: station,
345  columns3-16 correspond to sector #) by making station numbers in column 2 clickable.
346 
347 
348  "DTvsz_st%dsec%02d" % (station, sector)
349 
350  plots "integrated" over ALL WHEELS:
351  of x, y, dxdz, dydz vs. z (y and dydz only for stations 1-3)
352  made for all (station,sector) combinations
353 
354  Interface: may be arranged into station(1 .. 4) vs. sector(1 .. 14) map with sector range
355  (1 .. 12) for stations 1-3.
356  It could be incorporated into an EXTENDED general DT chambers map (extended by adding an
357  identifier "ALL" in column1 for wheel number)."""
358 
359  for wheel in DT_TYPES:
360  if wheel[1]=="ALL": continue
361  for station in wheel[2]:
362  pdir = dt_basedir+'/'+wheel[0]+'/'+station[1]+'/'
363  label = "DTvsphi_st%dwh%s" % (int(station[1]), wheelLetter(int(wheel[1])))
364  htitle = "wheel %+d, station %s" % (int(wheel[1]), station[1])
365  mapplot(tfiles_plotting, label, "x", window=15., title=htitle, fitsawteeth=True,fitsine=True)
366  c1.SaveAs(pdir+'map_DTvsphi_x.png')
367  #mapplot(tfiles_plotting, label, "dxdz", window=15., title=htitle, fitsawteeth=True,fitsine=True)
368  mapplot(tfiles_plotting, label, "dxdz", window=15., title=htitle)
369  c1.SaveAs(pdir+'map_DTvsphi_dxdz.png')
370 
371  if station[1]=='4': continue
372  #mapplot(tfiles_plotting, label, "y", window=15., title=htitle, fitsawteeth=True,fitsine=True)
373  mapplot(tfiles_plotting, label, "y", window=15., title=htitle)
374  c1.SaveAs(pdir+'map_DTvsphi_y.png')
375  #mapplot(tfiles_plotting, label, "dydz", window=15., title=htitle, fitsawteeth=True,fitsine=True)
376  mapplot(tfiles_plotting, label, "dydz", window=15., title=htitle)
377  c1.SaveAs(pdir+'map_DTvsphi_dydz.png')
378 
379  qcount=0
380  for wheel in DT_TYPES:
381  if wheel[1]!="ALL": continue
382  for station in wheel[2]:
383  for sector in range(1,station[2]+1):
384  if qcount>QUICKTESTN: break
385  qcount += 1
386  ssector = "%02d" % sector
387  pdir = dt_basedir+'/'+wheel[0]+'/'+station[1]+'/'+ssector+'/'
388  label = "DTvsz_st%ssec%s" % (station[1], ssector)
389  htitle = "station %s, sector %d" % (station[1], sector)
390  mapplot(tfiles_plotting, label, "x", window=15., title=htitle)
391  c1.SaveAs(pdir+'map_DTvsz_x.png')
392  mapplot(tfiles_plotting, label, "dxdz", window=15., title=htitle)
393  c1.SaveAs(pdir+'map_DTvsz_dxdz.png')
394 
395  if station[1]=='4': continue
396  mapplot(tfiles_plotting, label, "y", window=15., title=htitle)
397  c1.SaveAs(pdir+'map_DTvsz_y.png')
398  mapplot(tfiles_plotting, label, "dydz", window=15., title=htitle)
399  c1.SaveAs(pdir+'map_DTvsz_dydz.png')
400 
401  saveTestResultsMap(options.runLabel)
402 
def wheelLetter
Definition: plotscripts.py:34
def saveTestResultsMap
def alignmentValidation.doSegDiffPlotsCSC (   csc_basedir,
  tfiles_plotting,
  iter_reports 
)
write segment-difference plots for CSC
 
 segdiff "csc_resid" and "csc_slope"

set of plots of
rphi vs qpt, rphi for positive, rphi for negative ("csc_resid")
drphidz vs qpt, drphidz for positive, drphidz for negative ("csc_slope")
done for ME1-ME2, ME2-ME3, and ME3-ME4 stations combinations with
  endcap "m" or "p" 
  ring 1 or 2
  chamber 1-18 (r1) or 1-36 (r2)
note: there's no ME3-ME4 plots for R2

Interface: could be accessed through a general CSC chambers map, but only for chambers in
stations 2-4 (e.g., station 2 would provide ME1-ME2 plots).

Definition at line 585 of file alignmentValidation.py.

References plotscripts.segdiff().

Referenced by doIterationPlots().

586 def doSegDiffPlotsCSC(csc_basedir, tfiles_plotting, iter_reports):
587  """write segment-difference plots for CSC
588 
589  segdiff "csc_resid" and "csc_slope"
590 
591  set of plots of
592  rphi vs qpt, rphi for positive, rphi for negative ("csc_resid")
593  drphidz vs qpt, drphidz for positive, drphidz for negative ("csc_slope")
594  done for ME1-ME2, ME2-ME3, and ME3-ME4 stations combinations with
595  endcap "m" or "p"
596  ring 1 or 2
597  chamber 1-18 (r1) or 1-36 (r2)
598  note: there's no ME3-ME4 plots for R2
599 
600  Interface: could be accessed through a general CSC chambers map, but only for chambers in
601  stations 2-4 (e.g., station 2 would provide ME1-ME2 plots)."""
602 
603  qcount = 0
604  for iendcap in CSC_TYPES:
605  for istation in iendcap[2]:
606  if istation[1]=="1": continue
607  dstations = (int(istation[1])-1)*10 + int(istation[1])
608  for iring in istation[2]:
609  if iring[1]=="ALL": continue
610  if istation[1]=="4" and iring[1]=="2": continue
611  for ichamber in range(1,iring[2]+1):
612  if qcount>QUICKTESTN: break
613  qcount += 1
614  schamber = "%02d" % ichamber
615  pdir = csc_basedir+'/'+iendcap[0]+'/'+istation[1]+'/'+iring[1]+'/'+schamber+'/'
616  segdiff(tfiles_plotting, "csc_resid", dstations,
617  endcap=iendcap[1], ring=int(iring[1]), chamber=ichamber, window=10.)
618  c1.SaveAs(pdir + 'segdif_csc_resid.png')
619  segdiff(tfiles_plotting, "csc_slope", dstations,
620  endcap=iendcap[1], ring=int(iring[1]), chamber=ichamber, window=10.)
621  c1.SaveAs(pdir + 'segdif_csc_slope.png')
622 
def alignmentValidation.doSegDiffPlotsDT (   dt_basedir,
  tfiles_plotting,
  iter_reports 
)
write segment-difference plots for DT

 segdiff "dt13_resid" and "dt13_slope"

set of plots of
x vs qpt, x for positive, x for negative ("dt13_resid")
dxdz vs qpt, dxdz for positive, dxdz for negative ("dt13_slope")
done for MB1-MB2, MB2-MB3, and MB3-MB4 stations combinations with all possible (wheel, sector)

Interface: could be accessed through a general DT chambers map, but only for chambers in
stations 2-4 (e.g., station 2 would provide MB1-MB2 plots).

 segdiff "dt2_resid" and "dt2_slope"

set of plots of
y vs q/pt, y for positive, y for negative ("dt2_resid")
dydz vs q/pt, dydz for positive, dydz for negative ("dt2_slope")
done for MB1-MB2, MB2-MB3 stations combinations with all possible (wheel, sector)

Interface: then the interface would still be a general DT map,
but the info only available from station 2 & 3 chambers.

Definition at line 500 of file alignmentValidation.py.

References plotscripts.segdiff(), and plotscripts.segdiffvsphi().

Referenced by doIterationPlots().

501 def doSegDiffPlotsDT(dt_basedir, tfiles_plotting, iter_reports):
502  """write segment-difference plots for DT
503 
504  segdiff "dt13_resid" and "dt13_slope"
505 
506  set of plots of
507  x vs qpt, x for positive, x for negative ("dt13_resid")
508  dxdz vs qpt, dxdz for positive, dxdz for negative ("dt13_slope")
509  done for MB1-MB2, MB2-MB3, and MB3-MB4 stations combinations with all possible (wheel, sector)
510 
511  Interface: could be accessed through a general DT chambers map, but only for chambers in
512  stations 2-4 (e.g., station 2 would provide MB1-MB2 plots).
513 
514  segdiff "dt2_resid" and "dt2_slope"
515 
516  set of plots of
517  y vs q/pt, y for positive, y for negative ("dt2_resid")
518  dydz vs q/pt, dydz for positive, dydz for negative ("dt2_slope")
519  done for MB1-MB2, MB2-MB3 stations combinations with all possible (wheel, sector)
520 
521  Interface: then the interface would still be a general DT map,
522  but the info only available from station 2 & 3 chambers."""
523 
524  qcount = 0
525  for iwheel in DT_TYPES:
526  if iwheel[1]=="ALL": continue
527  for istation in iwheel[2]:
528  if istation[1]=="1": continue
529  dstations = (int(istation[1])-1)*10 + int(istation[1])
530  #print dstations
531  for isector in range(1, istation[2] + 1):
532  if isector > 12: continue
533  if qcount>QUICKTESTN: break
534  qcount += 1
535  ssector = "%02d" % isector
536  pdir = dt_basedir + '/' + iwheel[0] + '/' + istation[1] + '/' + ssector + '/'
537 
538  segdiff(tfiles_plotting, "dt13_resid", dstations, wheel=int(iwheel[1]), sector=isector, window=10.)
539  c1.SaveAs(pdir + 'segdif_dt13_resid.png')
540  segdiff(tfiles_plotting, "dt13_slope", dstations, wheel=int(iwheel[1]), sector=isector, window=10.)
541  c1.SaveAs(pdir + 'segdif_dt13_slope.png')
542 
543  if istation[1] == '4': continue
544  segdiff(tfiles_plotting, "dt2_resid", dstations, wheel=int(iwheel[1]), sector=isector, window=10.)
545  c1.SaveAs(pdir + 'segdif_dt2_resid.png')
546  segdiff(tfiles_plotting, "dt2_slope", dstations, wheel=int(iwheel[1]), sector=isector, window=10.)
547  c1.SaveAs(pdir + 'segdif_dt2_slope.png')
548 
549  """segdiffvsphi "dt13_resid" and "dt13_slope"
550 
551  plot for a specific wheel #:
552  x vs phi of pair ("dt13_resid")
553  dxdz vs phi of pair ("dt13_slope")
554  contains all three combinations of neighboring stations
555  made for all possible wheel values
556 
557  Interface: could be accessed by clicking on wheel number under the "wheel" column
558  in a general DT map
559 
560  segdiffvsphi "dt2_resid" and "dt2_slope"
561 
562  plot for a specific wheel #:
563  y vs phi of pair ("dt2_resid")
564  dydz vs phi of pair ("dt2_slope")
565  contains both MB1-MB2 and MB2-MB3 combinations
566  made for all possible wheel values
567 
568  Interface: could be accessed by clicking on wheel number under the "wheel" column
569  in a general DT map"""
570 
571  if len(iter_reports)==0: return
572 
573  for iwheel in DT_TYPES:
574  if iwheel[1]=="ALL": continue
575  pdir = dt_basedir + '/' + iwheel[0] + '/'
576  segdiffvsphi(tfiles_plotting, iter_reports, "dt13_resid", int(iwheel[1]), window=15., excludesectors=(1,7))
577  c1.SaveAs(pdir + 'segdifphi_dt13_resid.png')
578  segdiffvsphi(tfiles_plotting, iter_reports, "dt13_slope", int(iwheel[1]), window=15., excludesectors=(1,7))
579  c1.SaveAs(pdir + 'segdifphi_dt13_slope.png')
580  segdiffvsphi(tfiles_plotting, iter_reports, "dt2_resid", int(iwheel[1]), window=15., excludesectors=(1,7))
581  c1.SaveAs(pdir + 'segdifphi_dt2_resid.png')
582  segdiffvsphi(tfiles_plotting, iter_reports, "dt2_slope", int(iwheel[1]), window=15., excludesectors=(1,7))
583  c1.SaveAs(pdir + 'segdifphi_dt2_slope.png')
584 
def alignmentValidation.idsForFile (   dir_name,
  file_name 
)
Recursively looks for file named file_name under dir_name directory
and fill the list with dir names converted to IDs 

Definition at line 775 of file alignmentValidation.py.

References dirToID().

Referenced by createCanvasToIDList().

776 def idsForFile(dir_name, file_name):
777  '''Recursively looks for file named file_name under dir_name directory
778  and fill the list with dir names converted to IDs
779  '''
780  id_list = []
781  for f in os.listdir(dir_name):
782  dirfile = os.path.join(dir_name, f)
783  if os.path.isfile(dirfile) and f==file_name:
784  id_list.append(dirToID(dir_name))
785  # recursively access file names in subdirectories
786  elif os.path.isdir(dirfile):
787  #print "Accessing directory:", dirfile
788  ids = idsForFile(dirfile, file_name)
789  if (len(ids)>0):
790  id_list.extend(ids)
791  return id_list
792 
def alignmentValidation.isFileUnderDir (   dir_name,
  file_name 
)

functions definitions

Recursively looks for file named file_name under dir_name directory

Definition at line 265 of file alignmentValidation.py.

Referenced by createCanvasesList().

266 def isFileUnderDir(dir_name, file_name):
267  '''Recursively looks for file named file_name under dir_name directory
268  '''
269  if not DO_DT and dir_name.find("MB")>-1:
270  return False
271  if not DO_CSC and dir_name.find("ME")>-1:
272  return False
273 
274  for f in os.listdir(dir_name):
275  dirfile = os.path.join(dir_name, f)
276  if os.path.isfile(dirfile) and f==file_name:
277  return True
278  # recursively access file names in subdirectories
279  elif os.path.isdir(dirfile):
280  #print "Accessing directory:", dirfile
281  if isFileUnderDir(dirfile, file_name): return True
282  return False
283 
284 
# to time saving of plots
def isFileUnderDir
functions definitions
def alignmentValidation.saveAs (   nm)

Definition at line 285 of file alignmentValidation.py.

Referenced by doCurvaturePlotsDT(), doFitFunctionsPlotsCSC(), and doFitFunctionsPlotsDT().

286 def saveAs(nm):
287  t1 = time.time()
288  ddt[15] += 1
289  c1.SaveAs(nm)
290  tn = time.time()
291  ddt[16] = 1./ddt[15]*((ddt[15]-1)*ddt[16] + tn-t1)
292 

Variable Documentation

string alignmentValidation.action = "store_true"

Definition at line 80 of file alignmentValidation.py.

Referenced by FWConvTrackHitsDetailView.build(), FWTrackHitsDetailView.build(), crabWrap.crabAction(), crabWrap.crabActionCRAB251(), crabWrap.crabStatus(), crabWrap.crabWatch(), CmsShowMainFrame.createNewViewerAction(), edm::EDLooperBase.doDuringLoop(), edm::Worker.doWork(), FWGUIManager.FWGUIManager(), edm::Path.handleWorkerFailure(), edm::Schedule.processOneOccurrence(), and edm::EventProcessor.readAndProcessEvent().

string alignmentValidation.allOptions = "-l "

Definition at line 198 of file alignmentValidation.py.

tuple alignmentValidation.c1 = ROOT.TCanvas("c1","c1",800,600)

do drawing

Definition at line 888 of file alignmentValidation.py.

Referenced by reco::NamedCompositeCandidate.addDaughter(), reco::CompositeCandidate.addDaughter(), DimuonStatistics.analyze(), GlbMuQualityCutsAnalysis.analyze(), reco::NamedCompositeCandidate.applyRoles(), reco::CompositeCandidate.applyRoles(), TwoBodyDecayModel.cartesianSecondaryMomenta(), condbon.cdbon_write(), NamedCandCombinerBase.combine(), CandCombinerBase< OutputCollection, CandPtr >.combine(), HICTrajectoryCorrector.correct(), TwoBodyDecayDerivatives.dqsdm(), TwoBodyDecayDerivatives.dqsdphi(), TwoBodyDecayDerivatives.dqsdpx(), TwoBodyDecayDerivatives.dqsdpy(), TwoBodyDecayDerivatives.dqsdpz(), TwoBodyDecayDerivatives.dqsdtheta(), EcalBarrelRecHitsMaker.EcalBarrelRecHitsMaker(), EcalEndcapRecHitsMaker.EcalEndcapRecHitsMaker(), DTNoiseComputation.endJob(), DTCreateSummaryHistos.endJob(), DTAlbertoBenvenutiTask.endJob(), HOCalibAnalyzer.endJob(), SiStripQualityDQM.fillGrandSummaryMEs(), SiStripApvGainsDQM.fillSummaryMEs(), SiStripPedestalsDQM.fillSummaryMEs(), SiStripLorentzAngleDQM.fillSummaryMEs(), SiStripQualityDQM.fillSummaryMEs(), SiStripBaseCondObjDQM.fillSummaryMEs(), DTSegmentUpdator.Fit4Var(), SiStripCablingDQM.getActiveDetIds(), GridInterpolator3DException.GridInterpolator3DException(), MonitorElementsDb.htmlOutput(), PFDisplacedVertexHelper.identifyVertex(), CSCWireGeometry.intersection(), CSCLayerGeometry.intersectionOfTwoLines(), PFDisplacedVertexHelper.lambdaCP(), RadialStripTopology.localError(), main(), GSRecHitMatcher.match(), SiStripRecHitMatcher.match(), GlobalTrackerMuonAlignment.misalignMuon(), GlobalTrackerMuonAlignment.misalignMuonL(), SiPixelHistoricInfoReader.plot(), PFAlgo.processBlock(), DimuonMCMatcher.produce(), CSCTFPtMethods.Pt3Stn(), DTConfigDBProducer.readDTCCBConfig(), PFSCEnergyCalibration.SCCorrEtEtaBarrel(), LinearEquation3< T >.solution(), align.toMatrix(), VVIObj.VVIObj(), CSCWireGeometry.wireEnds(), and GlobalTrackerMuonAlignment.writeGlPosRcd().

list alignmentValidation.CANVASES_LIST_TEMPLATE

Definition at line 222 of file alignmentValidation.py.

string alignmentValidation.comdir = "common/"

setup output:

Definition at line 873 of file alignmentValidation.py.

int alignmentValidation.default = ''

Definition at line 39 of file alignmentValidation.py.

string alignmentValidation.dest = "runLabel"

Definition at line 40 of file alignmentValidation.py.

Referenced by edm::service::ELadministrator.attach(), SimpleNavigableLayer.crossingState(), ora::DatabaseUtilitySession.dumpMapping(), FieldHandler< TOutput, bool, char >.extractValue(), ASCIIBoolFieldHandler< TOutput, FalseCharacter >.extractValue(), edm::service::ELadministrator.finishMsg(), getAnyIMG(), ora::OraContainerHeaderTable.getContainerData(), ora::PoolContainerHeaderTable.getContainerData(), getIMG(), getIMG2(), getIMGTProfile(), WatcherStreamFileReader.getInputFile(), and CosmicMuonUtilities.stepPropagate().

alignmentValidation.DO_CSC = False

Definition at line 167 of file alignmentValidation.py.

alignmentValidation.DO_CURVATURE = False

Definition at line 182 of file alignmentValidation.py.

alignmentValidation.DO_DIAGNOSTIC = options.diagnostic

Definition at line 196 of file alignmentValidation.py.

alignmentValidation.DO_DT = False

Definition at line 166 of file alignmentValidation.py.

alignmentValidation.DO_FIT = False

Definition at line 183 of file alignmentValidation.py.

alignmentValidation.DO_MAP = False

Definition at line 180 of file alignmentValidation.py.

alignmentValidation.DO_MEDIAN = False

Definition at line 184 of file alignmentValidation.py.

alignmentValidation.DO_SEGDIFF = False

Definition at line 181 of file alignmentValidation.py.

string alignmentValidation.fname = options.inputDir+'/'

main script

Definition at line 822 of file alignmentValidation.py.

Referenced by HcalTBWriter.analyze(), EcalSRCondTools.analyze(), dd_to_html(), GeometryInfoDump.dumpInfo(), generateHtml(), MatacqProducer.getMatacqFile(), SiStripUtility.goToDir(), SiStripWebInterface.handleAnalyserRequest(), edm.loadCap(), stor::SharedResources.localDebug(), HcalLuttoDB.openChecksums(), HcalLuttoDB.openPerCrate(), HcalLuttoDB.openPerLut1(), HcalLuttoDB.openPerLut2(), DDLParser.parseFile(), cond::PayLoadInspector< DataT >.plot(), PlotCombiner(), SiStripInformationExtractor.plotHistosFromLayout(), MODCCSHFDat.populateClob(), KFFittingSmootherESProducer.produce(), RPCTriggerConfig.produce(), ODLTCConfig.setParameters(), ODTTCFConfig.setParameters(), ODTTCciConfig.setParameters(), ODDCCConfig.setParameters(), ODSRPConfig.setParameters(), ODLaserConfig.setParameters(), gen::Pythia6Service.setSLHAFromHeader(), CmsShowMain.setupDataHandling(), MODCCSHFDat.writeDB(), and writeMaterials().

string alignmentValidation.help = "[REQUIRED] label to use for a run"

Definition at line 37 of file alignmentValidation.py.

Referenced by CmsShowMainFrame.CmsShowMainFrame(), and DualKalmanTrajectory.hitErrorWithAPE().

alignmentValidation.i1prefix = options.i1prefix

Definition at line 155 of file alignmentValidation.py.

alignmentValidation.iNprefix = options.iNprefix

Definition at line 158 of file alignmentValidation.py.

alignmentValidation.iter1_reports = []

Definition at line 825 of file alignmentValidation.py.

tuple alignmentValidation.iter1_tfile = None

Definition at line 824 of file alignmentValidation.py.

string alignmentValidation.iteration1 = "iter1"

Definition at line 874 of file alignmentValidation.py.

string alignmentValidation.iterationN = "iterN"

Definition at line 875 of file alignmentValidation.py.

alignmentValidation.iterN_reports = []

Definition at line 846 of file alignmentValidation.py.

tuple alignmentValidation.iterN_tfile = None

Definition at line 845 of file alignmentValidation.py.

alignmentValidation.outdir = options.outputDir

Definition at line 152 of file alignmentValidation.py.

tuple alignmentValidation.parser = optparse.OptionParser(usage)

Definition at line 34 of file alignmentValidation.py.

int alignmentValidation.QUICKTESTN = 10000

Definition at line 215 of file alignmentValidation.py.

alignmentValidation.SINGLE_ITERATION = False

Definition at line 177 of file alignmentValidation.py.

list alignmentValidation.tfiles1_plotting = []

Definition at line 823 of file alignmentValidation.py.

list alignmentValidation.tfilesN_plotting = []

Definition at line 844 of file alignmentValidation.py.

string alignmentValidation.type = "string"

Definition at line 38 of file alignmentValidation.py.

string alignmentValidation.usage = '%prog [options]\n'

To parse commandline args.

Definition at line 17 of file alignmentValidation.py.