18 logger = logging.getLogger(
"mpsvalidate")
22 gStyle.SetOptStat(
"emrs")
23 gStyle.SetPadLeftMargin(0.07)
26 for filename
in os.listdir(
"{0}".
format(config.jobDataPath)):
27 if (filename.endswith(
".root")
and filename.startswith(
"millepedemonitor_")):
29 inputname = filename[17:-5]
32 rootfile = TFile(
"{0}/{1}".
format(config.jobDataPath, filename))
34 plotPaths = [
"usedTrackHists/usedptTrack",
"usedTrackHists/usedetaTrack",
35 "usedTrackHists/usedphiTrack",
"usedTrackHists/usednHitTrack"]
38 for plotNumber, plotPath
in enumerate(plotPaths):
40 plotName = plotPath.split(
"/")[1]
42 plot = rootfile.Get(plotPath)
46 ntracks = int(plot.GetEntries())
47 MonitorData(inputname.replace(
"_",
" "), ntracks)
50 canvas = TCanvas(
"canvas{0}_{1}".
format(
51 inputname, plotName),
"Monitor", 300, 0, 800, 600)
62 "{0}/plots/pdf/monitor_{1}_{2}.pdf".
format(config.outputPath, inputname.replace(
".",
"_"), plotName))
65 image = TImage.Create()
68 "{0}/plots/png/monitor_{1}_{2}.png".
format(config.outputPath, inputname.replace(
".",
"_"), plotName))
71 output = OutputData(plottype=
"monitor", name=inputname.replace(
"_",
" "), number=plotName, filename=
"monitor_{1}_{2}".
format(
72 config.outputPath, inputname.replace(
".",
"_"), plotName))
73 config.outputList.append(output)
77 gStyle.SetPadLeftMargin(0.17)
def setstatsize
statistics size