plt.xticks(np.arange(19), stLabel, rotation=45) plt.ylabel("Average Counts (au)", fontsize=22) plt.xticks(fontsize=18) plt.yticks(fontsize=18) plt.savefig("../../plots/bothAllAveFrstBinCnt"+pmtId+".png", dpi=100) plt.show() plt.clf() print("bothAllAveFrstBinCnt OK") ''' # ======================= # *** For Peak Offset *** # *** Average *** extrUub = extrtor(histosUub) extrUub.getAveOffset(0, 1) print(extrUub.aveStOffset) ''' data = {} data['uub'] = [] data['ub'] = [] for i in range(0, 2): data['uub'].append({ 'station': i, 'aveOffset': aveStatUub[i] }) data['ub'].append({
else: nameElec = "../../nouub/fitHist/mltpst/ubCalibHist" + pmtId + ".root" inFile = ROOT.TFile.Open(nameElec, "READ") outname = "ubAllAveHbaseCalib" + pmtId + ".json" print("Reading files for:\n", nameElec) stLabel = [ "863", "1211", "1217", "1219", "1221", "1222", "1223", "1729", "1735", "1740", "1741", "1743", "1745", "1746", "1747", "1791", "1818", "1819", "1851" ] histos = inFile.Get("Histograms") extPerStat = extrtor(histos) extPerStat.getHbaseDist(stLabel) extPerStat.getCalibDist(stLabel) extPerStat.getHbaseAveRms() extPerStat.getCalibAveRms() extPerStat.getBinCenterDistHbase(stLabel) extPerStat.getBinCenterDistCalib(stLabel) extPerStat.getBinCenterAveRmsHbase() extPerStat.getBinCenterAveRmsCalib() data = {} data[whichElec] = [] for i in range(0, len(stLabel)): data[whichElec].append({
if whichElec=='uub': nameElec = "../mltpst/uubCalibHist"+pmtId+".root" inFile = ROOT.TFile.Open(nameElec, "READ") outname = "uubAllAveOffset"+pmtId+".json" else: nameElec = "../../nouub/fitHist/mltpst/ubCalibHist"+pmtId+".root" inFile = ROOT.TFile.Open(nameElec, "READ") outname = "ubAllAveOffset"+pmtId+".json" print("Reading files for:\n", nameElec) stLabel = [] histos = inFile.Get("Histograms") extAveOffset = extrtor(histos) extAveOffset.getOffsetDist(stLabel) extAveOffset.getAveOffsetAveRms() data = {} data[whichElec] = [] for i in range(0, len(stLabel)): data[whichElec].append({ 'stationId': 'extAveOffset': extAveOffset.aveStOffset[i], 'extRmsOffset': extAveOffset.rmsStOffset[i] }) json_object = json.dumps(data, indent = 4) #outputName = "ubAveOffset"+sys.argv[2]+str(runSt1-1)+".json"