6 ReleaseBase = os.path.join(os.environ[
'CMSSW_BASE'],
"src")
7 ReleaseVersion = os.environ[
'CMSSW_VERSION']
9 print "CMSSW enviroment not set, please run cmsenv!"
13 import FWCore.ParameterSet.VarParsing
as VarParsing
18 options.register(
'usesLegacyProdNames',
20 VarParsing.VarParsing.multiplicity.singleton,
21 VarParsing.VarParsing.varType.int,
22 "Set to 1 if the reference files contains old (eg pfRecoTauProducer) PFTau product names"
25 options.register(
'scale',
27 VarParsing.VarParsing.multiplicity.singleton,
28 VarParsing.VarParsing.varType.string,
29 "Set scale of yaxis on plots (linear/log)"
32 options.parseArguments()
34 process = cms.Process(
'MakingPlots')
35 process.DQMStore = cms.Service(
"DQMStore")
37 process.maxEvents = cms.untracked.PSet(
38 input = cms.untracked.int32(0)
41 process.source = cms.Source(
"EmptySource")
44 rootFilesInCurrentDirectory = glob.glob(
"*.root")
45 if len(rootFilesInCurrentDirectory) != 1:
46 print "There must be one (and only one) root files in the current directory, otherwise I don't know what to compare!"
48 testRootFile = rootFilesInCurrentDirectory[0]
49 print "Loading test file: ", testRootFile
53 if testRootFile.find(
"ZTT"):
55 elif testRootFile.find(
'QCD'):
57 elif testRootFile.find(
'ZEE'):
59 elif testRootFile.find(
'ZMM'):
63 PlotOutputDir =
"SummaryPlots"
64 if not os.path.exists(PlotOutputDir):
65 os.makedirs(PlotOutputDir)
68 process.load(
"Validation.RecoTau.RecoTauValidation_cfi")
72 if options.scale ==
'log':
73 print "Setting everything to log scale"
96 process.p = cms.Path( process.loadTau
97 +process.plotTauValidation
100 cfgLog = open(os.path.join(PlotOutputDir,
"plot_config.py"),
"write")
102 print >>cfgLog, process.dumpPython()
def SetPlotOnlyStepByStep
def SetReferenceFileToPlot