Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-03 02:23:13

0001 #!/usr/bin/env python3
0002 
0003 import os
0004 import sys
0005 
0006 if len(sys.argv) > 1:
0007     folder = sys.argv[1]
0008 else:
0009     folder = "."
0010 
0011 from Alignment.OfflineValidation.TkAlAllInOneTool.genericValidation import *
0012 from Alignment.OfflineValidation.TkAlAllInOneTool.helperFunctions import recursivesubclasses
0013 from Alignment.OfflineValidation.TkAlAllInOneTool.offlineValidation import *
0014 from Alignment.OfflineValidation.TkAlAllInOneTool.primaryVertexValidation import *
0015 from Alignment.OfflineValidation.TkAlAllInOneTool.trackSplittingValidation import *
0016 from Alignment.OfflineValidation.TkAlAllInOneTool.zMuMuValidation import *
0017 
0018 subclasses = recursivesubclasses(ValidationWithPlotsSummaryBase)
0019 subclasses = [subcls for subcls in subclasses if not subcls.__abstractmethods__]
0020 printedanything = False
0021 tried = []
0022 for subcls in subclasses:
0023     tried += ["{}Summary.txt".format(subcls.__name__), os.path.join(subcls.plotsdirname(), "{}Summary.txt".format(subcls.__name__))]
0024     if os.path.exists(os.path.join(folder, "{}Summary.txt".format(subcls.__name__))):
0025         printedanything = True
0026         subcls.printsummaryitems(folder=folder)
0027     elif os.path.exists(os.path.join(folder, subcls.plotsdirname(), "{}Summary.txt".format(subcls.__name__))):
0028         subcls.printsummaryitems(folder=os.path.join(folder, subcls.plotsdirname()))
0029         printedanything = True
0030 
0031 if not printedanything:
0032     raise ValueError("Didn't find any *ValidationSummary.txt.  Maybe try somewhere else?\nPaths searched:\n" + "\n".join(tried))