CMS 3D CMS Logo

printsummarytable.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import os
4 import sys
5 
6 if len(sys.argv) > 1:
7  folder = sys.argv[1]
8 else:
9  folder = "."
10 
12 from Alignment.OfflineValidation.TkAlAllInOneTool.helperFunctions import recursivesubclasses
17 
18 subclasses = recursivesubclasses(ValidationWithPlotsSummaryBase)
19 subclasses = [subcls for subcls in subclasses if not subcls.__abstractmethods__]
20 printedanything = False
21 tried = []
22 for subcls in subclasses:
23  tried += ["{}Summary.txt".format(subcls.__name__), os.path.join(subcls.plotsdirname(), "{}Summary.txt".format(subcls.__name__))]
24  if os.path.exists(os.path.join(folder, "{}Summary.txt".format(subcls.__name__))):
25  printedanything = True
26  subcls.printsummaryitems(folder=folder)
27  elif os.path.exists(os.path.join(folder, subcls.plotsdirname(), "{}Summary.txt".format(subcls.__name__))):
28  subcls.printsummaryitems(folder=os.path.join(folder, subcls.plotsdirname()))
29  printedanything = True
30 
31 if not printedanything:
32  raise ValueError("Didn't find any *ValidationSummary.txt. Maybe try somewhere else?\nPaths searched:\n" + "\n".join(tried))
offlineValidation
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
helperFunctions.recursivesubclasses
def recursivesubclasses(cls)
Definition: helperFunctions.py:150
primaryVertexValidation
genericValidation
format
zMuMuValidation
trackSplittingValidation