Closed danielwinterbottom closed 12 months ago
Thanks, @danielwinterbottom.
Would you like to add more precise luminosities in a later PR?
The lumi text should be set here: https://github.com/cms-tau-pog/TauFW/blob/c5096f6accffe4e36e3a96438d6f09bbfb2e2c1c/Plotter/python/plot/CMSStyle.py#L131 So to get a 3-digit round, it should be changed to something like
string += "%3g fb^{#minus1}"%(lumi)
where it should yield the following
# tests
for lumi in [59.74,59.75,59.76,137.4,137.5,137.6]:
print("%6s -> %5.3g/fb"%(lumi,lumi))
# output:
59.74 -> 59.7/fb
59.75 -> 59.8/fb
59.76 -> 59.8/fb
137.4 -> 137/fb
137.5 -> 138/fb
137.6 -> 138/fb
Thanks, @danielwinterbottom.
Would you like to add more precise luminosities in a later PR?
The lumi text should be set here:
So to get a 3-digit round, it should be changed to something like
string += "%3g fb^{#minus1}"%(lumi)
where it should yield the following
# tests for lumi in [59.74,59.75,59.76,137.4,137.5,137.6]: print("%6s -> %5.3g/fb"%(lumi,lumi)) # output: 59.74 -> 59.7/fb 59.75 -> 59.8/fb 59.76 -> 59.8/fb 137.4 -> 137/fb 137.5 -> 138/fb 137.6 -> 138/fb
I tried to implement something here: https://github.com/cms-tau-pog/TauFW/pull/44/commits/42a32975ffa85a32fc2114aaf29f196a45d0f665
I had to make slight change of using "%.3g" so that it still print e.g "27.0" when we have lumi=27.0072 But there is an annoying issue if we wanted to print a >=3 digit number where it will always print the decimal place as well e.g printing 138 will print 138.
I had to make slight change of using "%.3g" so that it still print e.g "27.0" when we have lumi=27.0072 But there is an annoying issue if we wanted to print a >=3 digit number where it will always print the decimal place as well e.g printing 138 will print 138.
Thanks, good catch. It's a bit ugly, but I would then suggest:
string += ("%#3g"%(lumi)).rstrip('.') + " fb^{#minus1}"
so we get:
# test:
for lumi in [27.0072,27.04,27.05,27.006,59.74,59.75,59.76,137.4,137.5,137.6]:
print(("%7s -> %#5.3g"%(lumi,lumi)).rstrip('.')+" fb^{#minus1}")
# output:
27.0072 -> 27.0 fb^{#minus1}
27.04 -> 27.0 fb^{#minus1}
27.05 -> 27.1 fb^{#minus1}
27.006 -> 27.0 fb^{#minus1}
59.74 -> 59.7 fb^{#minus1}
59.75 -> 59.8 fb^{#minus1}
59.76 -> 59.8 fb^{#minus1}
137.4 -> 137 fb^{#minus1}
137.5 -> 138 fb^{#minus1}
137.6 -> 138 fb^{#minus1}
Sorry for the typos, this should indeed be correct as you did in https://github.com/cms-tau-pog/TauFW/pull/44/commits/644933ed0896ad6bad0861afc5412b5a5f04c622:
string += ("%#3g"%(lumi)).rstrip('.') + " fb^{#minus1}"
Thanks @danielwinterbottom, I will merge.