message: fix correct bin for event normalization
diff: @@ -164,6 +164,7 @@ def scalePtHardHistos(referenceFile):
  # Open input file and get relevant lists
  inputFile = "{0}/AnalysisResultsPtHard{0}.root".format(bin+1)
  print("ooo Scaling Pt-hard bin %d" % (bin+1))
  + print(" o File: {}".format(inputFile))
  f = ROOT.TFile(inputFile, "UPDATE")
  qaList = f.Get(qaListNames[0])
  @@ -181,8 +182,14 @@ def scalePtHardHistos(referenceFile):
  #print("ooo Test entries: {0}".format(hXsecPtHard.GetEntries()))
  trials = 1.*hTrialsPtHard.GetBinContent(1) / nEventsTot
  scaleFactor = xsec/trials
  + if nEventsAcc>0:
  eventScaleFactorAcc = nEventsAccAvg/nEventsAcc # also scale to account that there are different number of events in each Pt-hard bin
  + else:
  + eventScaleFactorAcc = 0
  + if nEventsTot>0:
  eventScaleFactorTot = nNEventsTotAvg/nEventsTot
  + else:
  + eventScaleFactorTot = 0
  print("ooo nEventsAcc: {0}".format(nEventsAcc))
  print("ooo nEventsTot: {0}".format(nEventsTot))
  @@ -237,9 +244,9 @@ def GetNEvents(eventList, bin, hNEvents, verbose, bAcceptedEventsOnly = True):
  if eventCutList:
  hNEventsPtHard = eventCutList.FindObject("fCutStats")
  if bAcceptedEventsOnly:
  - nEvents = hNEventsPtHard.GetBinContent(16)
  + nEvents = hNEventsPtHard.GetBinContent(hNEventsPtHard.GetXaxis().FindBin("All cuts")) #Bin All cuts
  else:
  - nEvents = hNEventsPtHard.GetBinContent(1)
  + nEvents = hNEventsPtHard.GetBinContent(hNEventsPtHard.GetXaxis().FindBin("No cuts")) #Bin No cuts
  if bin is 0:
  if bAcceptedEventsOnly:
  print("Getting accepted number of events from EventCutOutput.")
  