Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tracking MC validation scripts #13096

Merged
merged 9 commits into from Feb 1, 2016
9 changes: 9 additions & 0 deletions Validation/RecoTrack/python/plotting/html.py
Expand Up @@ -35,6 +35,7 @@ def _lowerFirst(s):
_allTPEfficName = "All tracks (all TPs)"
_fromPVName = "Tracks from PV"
_fromPVAllTPName = "Tracks from PV (all TPs)"
_conversionName = "Tracks for conversions"
_trackQualityNameOrder = collections.OrderedDict([
("seeding_seeds", "Seeds"),
("seeding_seedsa", "Seeds A"),
Expand Down Expand Up @@ -64,6 +65,7 @@ def _lowerFirst(s):
("fromPVAllTP2_highPurity", "High purity "+_lowerFirst(_fromPVAllTPName).replace("PV", "PV v2")),
("fromPVAllTP2_Pt", _fromPVAllTPName.replace("Tracks", "Tracks pT > 0.9 GeV").replace("PV", "PV v2")),
("fromPVAllTP2_highPurityPt", "High purity "+_lowerFirst(_fromPVAllTPName).replace("tracks", "tracks pT > 0.9 GeV").replace("PV", "PV v2")),
("conversion_", _conversionName)
])

_trackAlgoName = {
Expand All @@ -75,6 +77,7 @@ def _lowerFirst(s):
"iter4" : "Iterative Step 4",
"iter5" : "Iterative Step 5",
"iter6" : "Iterative Step 6",
"iter7" : "Iterative Step 7",
"iter9" : "Iterative Step 9",
"iter10": "Iterative Step 10",
}
Expand All @@ -96,13 +99,18 @@ def _lowerFirst(s):
'muonSeededStepInOut',
'muonSeededStepOutIn',
'duplicateMerge',
'convStep',
'conversionStep',
'ckfInOutFromConversions',
'ckfOutInFromConversions',
'iter0',
'iter1',
'iter2',
'iter3',
'iter4',
'iter5',
'iter6',
'iter7',
'iter9',
'iter10',
]
Expand All @@ -127,6 +135,7 @@ def _lowerFirst(s):
("fromPV_highPurity", "High purity "+_lowerFirst(_fromPVName)),
("fromPVAllTP", _fromPVAllTPName),
("fromPVAllTP_highPurity", "High purity "+_lowerFirst(_fromPVAllTPName)),
("conversion", _conversionName),
# These are for vertices
("offlinePrimaryVertices", "All vertices (offlinePrimaryVertices)"),
("selectedOfflinePrimaryVertices", "Selected vertices (selectedOfflinePrimaryVertices)"),
Expand Down
18 changes: 16 additions & 2 deletions Validation/RecoTrack/python/plotting/plotting.py
Expand Up @@ -1976,8 +1976,17 @@ def __init__(self, name, possibleDqmFolders, dqmSubFolders, plotFolder, fallback
if dqmSubFolders is None:
self._dqmSubFolders = None
else:
self._dqmSubFolders = map(lambda sf: DQMSubFolder(sf, self._plotFolder.translateSubFolder(sf)), dqmSubFolders[0])
self._dqmSubFolders = filter(lambda sf: sf.translated is not None, self._dqmSubFolders)
# Match the subfolders between files in case the lists differ
# equality is by the 'translated' name
subfolders = {}
for sf_list in dqmSubFolders:
for sf in sf_list:
sf_translated = self._plotFolder.translateSubFolder(sf)
if sf_translated is not None and not sf_translated in subfolders:
subfolders[sf_translated] = DQMSubFolder(sf, sf_translated)

self._dqmSubFolders = subfolders.values()
self._dqmSubFolders.sort(key=lambda sf: sf.subfolder)

self._fallbackNames = fallbackNames
self._fallbackDqmSubFolders = fallbackDqmSubFolders
Expand Down Expand Up @@ -2218,6 +2227,7 @@ def __init__(self):
ROOT.gStyle.SetStatFontSize(statSize)

ROOT.TH1.AddDirectory(False)
ROOT.TGaxis.SetMaxDigits(4)

def append(self, *args, **kwargs):
"""Append a plot folder to the plotter.
Expand All @@ -2233,6 +2243,10 @@ def appendTable(self, attachToFolder, *args, **kwargs):
return
raise Exception("Did not find plot folder '%s' when trying to attach a table creator to it" % attachToFolder)

def clear(self):
"""Remove all plot folders and tables"""
self._plots = []

def getPlotFolderNames(self):
return [item.getName() for item in self._plots]

Expand Down