7 from __future__
import print_function
8 from builtins
import range
26 from matplotlib
import pyplot
as plt
30 from RecoLuminosity.LumiDB.mpl_axes_hist_fix
import hist
31 if matplotlib.__version__ !=
'1.0.1':
32 print(
"ERROR The %s script contains a hard-coded bug-fix " \
33 "for Matplotlib 1.0.1. The Matplotlib version loaded " \
34 "is %s" % (__file__, matplotlib.__version__), file=sys.stderr)
36 matplotlib.axes.Axes.hist = hist
39 from RecoLuminosity.LumiDB.public_plots_tools
import ColorScheme
40 from RecoLuminosity.LumiDB.public_plots_tools
import LatexifyUnits
41 from RecoLuminosity.LumiDB.public_plots_tools
import AddLogo
42 from RecoLuminosity.LumiDB.public_plots_tools
import InitMatplotlib
43 from RecoLuminosity.LumiDB.public_plots_tools
import SavePlot
44 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_SUPTITLE
45 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_TITLE
46 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_AX_TITLE
47 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_TICK_LABEL
58 DATE_FMT_STR_LUMICALC =
"%m/%d/%y %H:%M:%S" 59 DATE_FMT_STR_LUMICALC_DAY =
"%m/%d/%y" 60 DATE_FMT_STR_OUT =
"%Y-%m-%d %H:%M" 61 DATE_FMT_STR_AXES =
"%-d %b" 62 DATE_FMT_STR_CFG =
"%Y-%m-%d" 63 NUM_SEC_IN_LS = 2**18 / 11246.
65 KNOWN_ACCEL_MODES = [
"PROTPHYS",
"IONPHYS",
"PAPHYS",
66 "2013_amode_bug_workaround"]
67 LEAD_SCALE_FACTOR = 82. / 208.
72 """Holds info from one line of lumiCalc lumibyls output.""" 77 line_split = line.split(
",")
78 tmp = line_split[0].
split(
":")
81 tmp = line_split[1].
split(
":")
84 self.
timestamp = datetime.datetime.strptime(tmp, DATE_FMT_STR_LUMICALC)
107 """A supposedly coherent block of LumiDataPoints. 109 NOTE: No checks on duplicates, sorting, etc. 136 self.data_points.extend(other.data_points)
142 return self.
time_mid() < other.time_mid()
145 self.data_points.append(new_point)
150 return copy.deepcopy(self)
158 res *= LumiDataBlock.scale_factors[units]
164 res *= LumiDataBlock.scale_factors[units]
170 res *= LumiDataBlock.scale_factors[units]
179 res *= LumiDataBlock.scale_factors[units]
184 self.data_points.sort()
199 delta_sec = delta.days * 24 * 60 * 60 + delta.seconds
200 res = self.
time_begin() + datetime.timedelta(seconds=.5*delta_sec)
209 """A collection of LumiDataBlocks.""" 223 self.data_blocks.append(new_block)
227 self.data_blocks.sort()
231 res = datetime.datetime.max
238 res = datetime.datetime.min
250 res = [i.lum_del_tot(units)
for i
in self.
data_blocks]
255 res = [i.lum_rec_tot(units)
for i
in self.
data_blocks]
260 res = [i.lum_cert_tot(units)
for i
in self.
data_blocks]
266 return sum(self.
lum_del(units))
270 return sum(self.
lum_rec(units))
277 res = [i.max_inst_lum(units)
for i
in self.
data_blocks]
286 cache_file_path = os.path.abspath(cache_file_dir)
288 cache_file_name =
"lumicalc_cache_%s.csv" % day.isoformat()
289 cache_file_path = os.path.join(cache_file_path, cache_file_name)
290 return cache_file_path
295 res = datetime.datetime.combine(datetime_in.date(), datetime.time())
304 tmp = datetime_in.date()
306 datetime.timedelta(days=tmp.weekday()) + \
307 datetime.timedelta(days=3)
308 res = datetime.datetime.combine(date_tmp, datetime.time())
319 "cum_day" :
"pb^{-1}",
320 "cum_week" :
"pb^{-1}",
321 "cum_year" :
"pb^{-1}",
322 "max_inst" :
"Hz/ub",
325 "cum_day" :
"pb^{-1}",
326 "cum_week" :
"pb^{-1}",
327 "cum_year" :
"fb^{-1}",
328 "max_inst" :
"Hz/nb",
331 "cum_day" :
"pb^{-1}",
332 "cum_week" :
"fb^{-1}",
333 "cum_year" :
"fb^{-1}",
334 "max_inst" :
"Hz/nb",
337 "cum_day" :
"pb^{-1}",
338 "cum_week" :
"pb^{-1}",
339 "cum_year" :
"pb^{-1}",
340 "max_inst" :
"Hz/ub",
345 "cum_day" :
"ub^{-1}",
346 "cum_week" :
"ub^{-1}",
347 "cum_year" :
"ub^{-1}",
348 "max_inst" :
"Hz/mb",
353 "cum_day" :
"nb^{-1}",
354 "cum_week" :
"nb^{-1}",
355 "cum_year" :
"nb^{-1}",
356 "max_inst" :
"Hz/mb",
364 units = units_spec[accel_mode][year][mode]
366 if mode ==
"cum_day":
368 elif mode ==
"cum_week":
370 elif mode ==
"cum_year":
372 elif mode ==
"max_inst":
376 assert not units
is None 386 assert amodetag
in [
"IONPHYS",
"PAPHYS"]
389 res = LEAD_SCALE_FACTOR
390 if amodetag ==
"PAPHYS":
399 """Returns the number of days in the given year.""" 401 date_lo = datetime.date(year, 1, 1)
402 date_hi = datetime.date(year + 1, 1, 1)
403 num_days = (date_hi - date_lo).days
411 """Pick a DateLocator based on the range of the x-axis.""" 412 (x_lo, x_hi) = ax.get_xlim()
413 num_days = x_hi - x_lo
414 min_num_ticks =
min(num_days, 5)
415 locator = matplotlib.dates.AutoDateLocator(minticks=min_num_ticks,
423 add_extra_head_room=
False):
426 (time_begin, time_end) = time_range
428 ax.autoscale_view(
False,
True,
True)
429 for label
in ax.get_xticklabels():
430 label.set_ha(
"right")
431 label.set_rotation(30.)
435 if add_extra_head_room:
436 y_ticks = ax.get_yticks()
437 (y_min, y_max) = ax.get_ylim()
438 is_log = (ax.get_yscale() ==
"log")
441 tmp = y_ticks[-1] / y_ticks[-2]
442 y_max_new = y_max * math.pow(tmp, add_extra_head_room)
444 tmp = y_ticks[-1] - y_ticks[-2]
445 y_max_new = y_max + add_extra_head_room * tmp
446 ax.set_ylim(y_min, y_max_new)
450 ax_sec.set_ylim(ax.get_ylim())
451 ax_sec.set_yscale(ax.get_yscale())
453 for ax_tmp
in fig.axes:
454 for sub_ax
in [ax_tmp.xaxis, ax_tmp.yaxis]:
455 for label
in sub_ax.get_ticklabels():
456 label.set_font_properties(FONT_PROPS_TICK_LABEL)
458 ax.set_xlim(time_begin, time_end)
461 ax.xaxis.set_major_locator(locator)
462 formatter = matplotlib.dates.DateFormatter(DATE_FMT_STR_AXES)
463 ax.xaxis.set_major_formatter(formatter)
465 fig.subplots_adjust(top=.85, bottom=.14, left=.13, right=.91)
471 """Check if this run and LS are certified as good and return a boolean parameter.""" 473 ls_ranges = certification_data[run_number]
474 for ranges
in ls_ranges:
475 if (ls >= ranges[0])
and (ls <= ranges[1]):
486 full_file = open(json_file_name,
"r") 487 full_file_content = ["".
join(l)
for l
in full_file.readlines()]
488 full_object = cjson.decode(full_file_content[0])
491 tmp = full_object.keys()
492 tmp = [
int(i)
for i
in tmp]
493 run_list = sorted(tmp)
494 certification_data = {}
496 ls_ranges = full_object.get(
str(run),
None)
497 certification_data[run] = ls_ranges
499 return certification_data
503 if __name__ ==
"__main__":
505 desc_str =
"This script creates the official CMS luminosity plots " \
506 "based on the output from the lumiCalc family of scripts." 507 arg_parser = optparse.OptionParser(description=desc_str)
508 arg_parser.add_option(
"--ignore-cache", action=
"store_true",
509 help=
"Ignore all cached lumiCalc results " \
510 "and re-query lumiCalc. " \
511 "(Rebuilds the cache as well.)")
512 (options, args) = arg_parser.parse_args()
514 print(
"ERROR Need exactly one argument: a config file name", file=sys.stderr)
516 config_file_name = args[0]
517 ignore_cache = options.ignore_cache
520 "lumicalc_flags" :
"",
522 "color_schemes" :
"Joe, Greg",
523 "beam_energy" :
None,
524 "beam_fluctuation" :
None,
526 "oracle_connection" :
None,
529 cfg_parser = ConfigParser.SafeConfigParser(cfg_defaults)
530 if not os.path.exists(config_file_name):
531 print(
"ERROR Config file '%s' does not exist" % config_file_name, file=sys.stderr)
533 cfg_parser.read(config_file_name)
536 color_scheme_names_tmp = cfg_parser.get(
"general",
"color_schemes")
537 color_scheme_names = [i.strip()
for i
in color_scheme_names_tmp.split(
",")]
539 cache_file_dir = cfg_parser.get(
"general",
"cache_dir")
541 verbose = cfg_parser.getboolean(
"general",
"verbose")
544 lumicalc_script = cfg_parser.get(
"general",
"lumicalc_script")
545 lumicalc_flags_from_cfg = cfg_parser.get(
"general",
"lumicalc_flags")
546 accel_mode = cfg_parser.get(
"general",
"accel_mode")
548 if not accel_mode
in KNOWN_ACCEL_MODES:
549 print(
"ERROR Unknown accelerator mode '%s'" % \
550 accel_mode, file=sys.stderr)
553 amodetag_bug_workaround =
False 554 if accel_mode ==
"2013_amode_bug_workaround":
555 amodetag_bug_workaround =
True 556 accel_mode =
"PAPHYS" 559 beam_energy_tmp = cfg_parser.get(
"general",
"beam_energy")
563 beam_energy_from_cfg =
None 564 if not beam_energy_tmp:
565 print(
"No beam energy specified --> using defaults for '%s'" % \
567 beam_energy_from_cfg =
False 569 beam_energy_from_cfg =
True 570 beam_energy =
float(beam_energy_tmp)
572 beam_fluctuation_tmp = cfg_parser.get(
"general",
"beam_fluctuation")
575 beam_fluctuation =
None 576 beam_fluctuation_from_cfg =
None 577 if not beam_fluctuation_tmp:
578 print(
"No beam energy fluctuation specified --> using the defaults to '%s'" % \
580 beam_fluctuation_from_cfg =
False 582 beam_fluctuation_from_cfg =
True 583 beam_fluctuation =
float(beam_fluctuation_tmp)
586 tmp = cfg_parser.get(
"general",
"date_begin")
587 date_begin = datetime.datetime.strptime(tmp, DATE_FMT_STR_CFG).
date()
588 tmp = cfg_parser.get(
"general",
"date_end")
591 date_end = datetime.datetime.strptime(tmp, DATE_FMT_STR_CFG).
date()
593 today = datetime.datetime.utcnow().
date()
595 print(
"No end date given --> using today")
599 print(
"End date lies in the future --> using today instead")
602 if date_end < date_begin:
603 print(
"ERROR End date before begin date (%s < %s)" % \
604 (date_end.isoformat(), date_begin.isoformat()), file=sys.stderr)
610 oracle_connection_string = cfg_parser.get(
"general",
"oracle_connection")
611 use_oracle = (len(oracle_connection_string) != 0)
615 json_file_name = cfg_parser.get(
"general",
"json_file")
616 if len(json_file_name) < 1:
617 json_file_name =
None 619 if not os.path.exists(json_file_name):
620 print(
"ERROR Requested JSON file '%s' is not available" % json_file_name, file=sys.stderr)
622 print(
"Using JSON file '%s' for certified data" % json_file_name)
625 print(
"No JSON file specified, filling only standard lumi plot.")
629 certification_data =
None 637 particle_type_strings = {
642 particle_type_str = particle_type_strings[accel_mode]
644 beam_energy_defaults = {
645 "PROTPHYS" : {2010 : 3500.,
649 "IONPHYS" : {2010 : 3500.,
651 "PAPHYS" : {2013 : 4000.}
653 beam_fluctuation_defaults = {
654 "PROTPHYS" : {2010 : .15,
658 "IONPHYS" : {2010 : .15,
660 "PAPHYS" : {2013 : .15}
667 os.putenv(
"TNS_ADMIN",
"/afs/cern.ch/cms/lumi/DB")
672 print(
"Using configuration from file '%s'" % config_file_name)
674 print(
"Ignoring all cached lumiCalc results (and rebuilding the cache)")
676 print(
"Using cached lumiCalc results from %s" % \
678 print(
"Using color schemes '%s'" %
", ".
join(color_scheme_names))
679 print(
"Using lumiCalc script '%s'" % lumicalc_script)
680 print(
"Using additional lumiCalc flags from configuration: '%s'" % \
681 lumicalc_flags_from_cfg)
682 print(
"Selecting data for accelerator mode '%s'" % accel_mode)
683 if beam_energy_from_cfg:
684 print(
"Selecting data for beam energy %.0f GeV" % beam_energy)
686 print(
"Selecting data for default beam energy for '%s' from:" % accel_mode)
687 for (key, val)
in six.iteritems(beam_energy_defaults[accel_mode]):
688 print(
" %d : %.1f GeV" % (key, val))
689 if beam_fluctuation_from_cfg:
690 print(
"Using beam energy fluctuation of +/- %.0f%%" % \
691 (100. * beam_fluctuation))
693 print(
"Using default beam energy fluctuation for '%s' from:" % accel_mode)
694 for (key, val)
in six.iteritems(beam_fluctuation_defaults[accel_mode]):
695 print(
" %d : +/- %.0f%%" % (key, 100. * val))
697 print(
"Using direct access to the Oracle luminosity database")
699 print(
"Using access to the luminosity database through the Frontier cache")
705 if not os.path.exists(path_name):
707 print(
"Cache file path does not exist: creating it")
709 os.makedirs(path_name)
710 except Exception
as err:
711 print(
"ERROR Could not create cache dir: %s" % path_name, file=sys.stderr)
720 week_begin = date_begin.isocalendar()[1]
721 week_end = date_end.isocalendar()[1]
722 year_begin = date_begin.isocalendar()[0]
723 year_end = date_end.isocalendar()[0]
725 assert year_end >= year_begin
727 print(
"Building a list of days to include in the plots")
728 print(
" first day to consider: %s (%d, week %d)" % \
729 (date_begin.isoformat(), year_begin, week_begin))
730 print(
" last day to consider: %s (%d, week %d)" % \
731 (date_end.isoformat(), year_end, week_end))
732 num_days = (date_end - date_begin).days + 1
733 days = [date_begin + datetime.timedelta(days=i)
for i
in range(num_days)]
734 years =
list(range(year_begin, year_end + 1))
737 while day_cur <= date_end:
738 year = day_cur.isocalendar()[0]
739 week = day_cur.isocalendar()[1]
740 weeks.append((year, week))
741 day_cur += datetime.timedelta(days=7)
743 year = date_end.isocalendar()[0]
744 week = date_end.isocalendar()[1]
745 weeks.append((year, week))
746 weeks =
list(set(weeks))
753 last_day_from_cache =
min(today - datetime.timedelta(days=2), date_end)
755 print(
"Last day for which the cache will be used: %s" % \
756 last_day_from_cache.isoformat())
760 print(
"Running lumiCalc for all requested days")
762 print(
" %s" % day.isoformat())
763 use_cache = (
not ignore_cache)
and (day <= last_day_from_cache)
765 cache_file_tmp = cache_file_path.replace(
".csv",
"_tmp.csv")
766 if (
not os.path.exists(cache_file_path))
or (
not use_cache):
767 date_begin_str = day.strftime(DATE_FMT_STR_LUMICALC)
768 date_begin_day_str = day.strftime(DATE_FMT_STR_LUMICALC_DAY)
769 date_end_str = (day + datetime.timedelta(days=1)).strftime(DATE_FMT_STR_LUMICALC)
770 date_previous_str = (day - datetime.timedelta(days=1)).strftime(DATE_FMT_STR_LUMICALC)
771 if not beam_energy_from_cfg:
772 year = day.isocalendar()[0]
773 beam_energy = beam_energy_defaults[accel_mode][year]
774 if not beam_fluctuation_from_cfg:
775 year = day.isocalendar()[0]
776 beam_fluctuation = beam_fluctuation_defaults[accel_mode][year]
781 if amodetag_bug_workaround:
784 lumicalc_flags =
"%s --without-checkforupdate " \
785 "--beamenergy %.1f " \
786 "--beamfluctuation %.2f " \
788 (lumicalc_flags_from_cfg,
789 beam_energy, beam_fluctuation)
792 lumicalc_flags =
"%s --without-checkforupdate " \
793 "--beamenergy %.1f " \
794 "--beamfluctuation %.2f " \
797 (lumicalc_flags_from_cfg,
798 beam_energy, beam_fluctuation,
802 lumicalc_flags = lumicalc_flags.strip()
803 lumicalc_cmd =
"%s %s" % (lumicalc_script, lumicalc_flags)
805 lumicalc_cmd =
"%s %s" % (lumicalc_cmd, oracle_connection_string)
806 cmd =
"%s --begin '%s' --end '%s' -o %s" % \
807 (lumicalc_cmd, date_previous_str, date_end_str, cache_file_tmp)
809 print(
" running lumicalc as '%s'" % cmd)
810 (status, output) = commands.getstatusoutput(cmd)
813 output_0 = copy.deepcopy(output)
817 if ((status >> 8) == 13
or (status >> 8) == 14):
824 print(
"No lumi data for %s, " \
825 "writing dummy cache file to avoid re-querying the DB" % \
827 dummy_file = open(cache_file_tmp,
"w")
828 dummy_file.write(
"Run:Fill,LS,UTCTime,Beam Status,E(GeV),Delivered(/ub),Recorded(/ub),avgPU\r\n")
831 print(
"ERROR Problem running lumiCalc: %s" % output, file=sys.stderr)
839 lines_to_be_kept = []
840 lines_ori = open(cache_file_tmp).readlines()
841 for line
in lines_ori:
842 if (date_begin_day_str
in line)
or (
"Delivered" in line):
843 lines_to_be_kept.append(line)
844 newfile = open(cache_file_path,
"w")
845 newfile.writelines(lines_to_be_kept)
850 print(
" CSV file for the day written to %s" % \
854 print(
" cache file for %s exists" % day.isoformat())
857 print(
"Reading back lumiCalc results")
858 lumi_data_by_day = {}
860 print(
" %s" % day.isoformat())
864 in_file = open(cache_file_path)
865 lines = in_file.readlines()
868 print(
" skipping empty file for %s" % day.isoformat())
871 assert lines[0] ==
"Run:Fill,LS,UTCTime,Beam Status,E(GeV),Delivered(/ub),Recorded(/ub),avgPU\r\n" 873 for line
in lines[1:]:
876 except IOError
as err:
877 print(
"ERROR Could not read lumiCalc results from file '%s': %s" % \
878 (cache_file_path,
str(err)), file=sys.stderr)
881 if not lumi_data_day.is_empty():
882 lumi_data_by_day[day] = lumi_data_day
887 print(
"Combining lumiCalc data week-by-week")
888 lumi_data_by_week = {}
889 for (day, lumi)
in six.iteritems(lumi_data_by_day):
890 year = day.isocalendar()[0]
891 week = day.isocalendar()[1]
893 lumi_data_by_week[year][week] += lumi
896 lumi_data_by_week[year][week] = lumi.copy()
898 lumi_data_by_week[year] = {week: lumi.copy()}
900 lumi_data_by_week_per_year = {}
901 for (year, tmp_lumi)
in six.iteritems(lumi_data_by_week):
902 for (week, lumi)
in six.iteritems(tmp_lumi):
904 lumi_data_by_week_per_year[year].
add(lumi)
909 print(
"Combining lumiCalc data year-by-year")
910 lumi_data_by_year = {}
911 for (day, lumi)
in six.iteritems(lumi_data_by_day):
912 year = day.isocalendar()[0]
914 lumi_data_by_year[year] += lumi
916 lumi_data_by_year[year] = lumi.copy()
918 lumi_data_by_day_per_year = {}
919 for (day, lumi)
in six.iteritems(lumi_data_by_day):
920 year = day.isocalendar()[0]
922 lumi_data_by_day_per_year[year].
add(lumi)
932 print(
"Delivered lumi day-by-day (%s):" % units)
935 tmp_str =
" - (no data, presumably no lumi either)" 937 tmp = lumi_data_by_day[day].lum_del_tot(units)
939 if (tmp < .1)
and (tmp > 0.):
940 helper_str =
" (non-zero but very small)" 941 tmp_str =
"%6.1f%s" % (tmp, helper_str)
944 print(
" %s: %s" % (day.isoformat(), tmp_str))
946 units =
GetUnits(years[-1], accel_mode,
"cum_week")
947 print(
"Delivered lumi week-by-week (%s):" % units)
949 for (year, week)
in weeks:
950 tmp_str =
" - (no data, presumably no lumi either)" 952 tmp = lumi_data_by_week[year][week].lum_del_tot(units)
954 if (tmp < .1)
and (tmp > 0.):
955 helper_str =
" (non-zero but very small)" 956 tmp_str =
"%6.1f%s" % (tmp, helper_str)
959 print(
" %d-%2d: %s" % (year, week, tmp_str))
961 units =
GetUnits(years[-1], accel_mode,
"cum_year")
962 print(
"Delivered lumi year-by-year (%s):" % units)
965 tmp_str =
" - (no data, presumably no lumi either)" 967 tmp = lumi_data_by_year[year].lum_del_tot(units)
969 if (tmp < .01)
and (tmp > 0.):
970 helper_str =
" (non-zero but very small)" 971 tmp_str =
"%5.2f%s" % (tmp, helper_str)
980 if not len(lumi_data_by_day_per_year):
981 print(
"ERROR No lumi found?", file=sys.stderr)
987 print(
"Drawing things...")
988 ColorScheme.InitColors()
996 print(
" daily lumi plots for %d" % year)
998 if not beam_energy_from_cfg:
999 beam_energy = beam_energy_defaults[accel_mode][year]
1000 cms_energy = 2. * beam_energy
1001 cms_energy_str =
"???" 1002 if accel_mode ==
"PROTPHYS":
1006 cms_energy_str =
"%.*f TeV" % (width, 1.e-3 * cms_energy)
1007 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1008 cms_energy_str =
"%.2f TeV/nucleon" % \
1011 lumi_data = sorted(lumi_data_by_day_per_year[year])
1016 datetime.timedelta(seconds=12*60*60)
1018 datetime.timedelta(seconds=12*60*60)
1023 bin_edges = np.linspace(matplotlib.dates.date2num(day_lo),
1024 matplotlib.dates.date2num(day_hi),
1025 (day_hi - day_lo).days + 1)
1027 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1029 units =
GetUnits(year, accel_mode,
"cum_day")
1030 weights_del = lumi_data.lum_del(units)
1031 weights_rec = lumi_data.lum_rec(units)
1033 units =
GetUnits(year, accel_mode,
"cum_year")
1034 weights_del_for_cum = lumi_data.lum_del(units)
1035 weights_rec_for_cum = lumi_data.lum_rec(units)
1036 weights_cert_for_cum = lumi_data.lum_cert(units)
1038 units =
GetUnits(year, accel_mode,
"max_inst")
1039 weights_del_inst = lumi_data.lum_inst_max(units)
1043 time_begin = datetime.datetime.combine(lumi_data.time_begin(),
1044 datetime.time()) - \
1045 datetime.timedelta(days=.5)
1046 time_end = datetime.datetime.combine(lumi_data.time_end(),
1047 datetime.time()) + \
1048 datetime.timedelta(days=.5)
1051 if sum(weights_del) > 0.:
1052 str_begin = lumi_data.time_begin().strftime(DATE_FMT_STR_OUT)
1053 str_end = lumi_data.time_end().strftime(DATE_FMT_STR_OUT)
1058 for color_scheme_name
in color_scheme_names:
1060 color_scheme = ColorScheme(color_scheme_name)
1061 color_fill_del = color_scheme.color_fill_del
1062 color_fill_rec = color_scheme.color_fill_rec
1063 color_fill_cert = color_scheme.color_fill_cert
1064 color_fill_peak = color_scheme.color_fill_peak
1065 color_line_del = color_scheme.color_line_del
1066 color_line_rec = color_scheme.color_line_rec
1067 color_line_cert = color_scheme.color_line_cert
1068 color_line_peak = color_scheme.color_line_peak
1069 logo_name = color_scheme.logo_name
1070 file_suffix = color_scheme.file_suffix
1076 for type
in [
"lin",
"log"]:
1077 is_log = (type ==
"log")
1080 min_val =
min(weights_del_inst)
1081 exp = math.floor(math.log10(min_val))
1082 log_setting = math.pow(10., exp)
1085 ax = fig.add_subplot(111)
1087 units =
GetUnits(year, accel_mode,
"max_inst")
1090 max_inst =
max(weights_del_inst)
1092 if sum(weights_del) > 0.:
1094 ax.hist(times, bin_edges, weights=weights_del_inst,
1095 histtype=
"stepfilled",
1097 facecolor=color_fill_peak, edgecolor=color_line_peak,
1098 label=
"Max. inst. lumi.: %.2f %s" % \
1101 tmp_leg = ax.legend(loc=
"upper left",
1102 bbox_to_anchor=(0.025, 0., 1., .97),
1104 tmp_leg.legendHandles[0].set_visible(
False)
1105 for t
in tmp_leg.get_texts():
1106 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1109 fig.suptitle(
r"CMS Peak Luminosity Per Day, " \
1110 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1111 (particle_type_str, year, cms_energy_str),
1112 fontproperties=FONT_PROPS_SUPTITLE)
1113 ax.set_title(
"Data included from %s to %s UTC \n" % \
1114 (str_begin, str_end),
1115 fontproperties=FONT_PROPS_TITLE)
1116 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1117 ax.set_ylabel(
r"Peak Delivered Luminosity (%s)" % \
1119 fontproperties=FONT_PROPS_AX_TITLE)
1123 TweakPlot(fig, ax, (time_begin, time_end),
True)
1128 SavePlot(fig,
"peak_lumi_per_day_%s_%d%s%s" % \
1129 (particle_type_str.lower(), year,
1130 log_suffix, file_suffix))
1135 for type
in [
"lin",
"log"]:
1136 is_log = (type ==
"log")
1139 min_val =
min(weights_rec)
1140 exp = math.floor(math.log10(min_val))
1141 log_setting = math.pow(10., exp)
1144 ax = fig.add_subplot(111)
1146 units =
GetUnits(year, accel_mode,
"cum_day")
1152 if sum(weights_del) > 0.:
1154 ax.hist(times, bin_edges, weights=weights_del,
1155 histtype=
"stepfilled",
1157 facecolor=color_fill_del, edgecolor=color_line_del,
1158 label=
"LHC Delivered, max: %.1f %s/day" % \
1160 ax.hist(times, bin_edges, weights=weights_rec,
1161 histtype=
"stepfilled",
1163 facecolor=color_fill_rec, edgecolor=color_line_rec,
1164 label=
"CMS Recorded, max: %.1f %s/day" % \
1166 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(0.125, 0., 1., 1.01),
1168 for t
in leg.get_texts():
1169 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1171 fig.suptitle(
r"CMS Integrated Luminosity Per Day, " \
1172 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1173 (particle_type_str, year, cms_energy_str),
1174 fontproperties=FONT_PROPS_SUPTITLE)
1175 ax.set_title(
"Data included from %s to %s UTC \n" % \
1176 (str_begin, str_end),
1177 fontproperties=FONT_PROPS_TITLE)
1178 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1179 ax.set_ylabel(
r"Integrated Luminosity (%s/day)" % \
1181 fontproperties=FONT_PROPS_AX_TITLE)
1185 TweakPlot(fig, ax, (time_begin, time_end),
True)
1190 SavePlot(fig,
"int_lumi_per_day_%s_%d%s%s" % \
1191 (particle_type_str.lower(), year,
1192 log_suffix, file_suffix))
1197 units =
GetUnits(year, accel_mode,
"cum_year")
1200 min_del =
min(weights_del_for_cum)
1201 tot_del = sum(weights_del_for_cum)
1202 tot_rec = sum(weights_rec_for_cum)
1203 tot_cert = sum(weights_cert_for_cum)
1205 for type
in [
"lin",
"log"]:
1206 is_log = (type ==
"log")
1209 min_val =
min(weights_del_for_cum)
1210 exp = math.floor(math.log10(min_val))
1211 log_setting = math.pow(10., exp)
1214 ax = fig.add_subplot(111)
1216 if sum(weights_del) > 0.:
1218 ax.hist(times, bin_edges, weights=weights_del_for_cum,
1219 histtype=
"stepfilled", cumulative=
True,
1221 facecolor=color_fill_del, edgecolor=color_line_del,
1222 label=
"LHC Delivered: %.2f %s" % \
1224 ax.hist(times, bin_edges, weights=weights_rec_for_cum,
1225 histtype=
"stepfilled", cumulative=
True,
1227 facecolor=color_fill_rec, edgecolor=color_line_rec,
1228 label=
"CMS Recorded: %.2f %s" % \
1230 if sum(weights_cert_for_cum) > 0.:
1231 ax.hist(times, bin_edges, weights=weights_cert_for_cum,
1232 histtype=
"stepfilled", cumulative=
True,
1234 facecolor=color_fill_cert, edgecolor=color_line_cert,
1235 label=
"CMS Validated: %.2f %s" % \
1237 leg = ax.legend(loc=
"upper left",
1238 bbox_to_anchor=(0.125, 0., 1., 1.01),
1240 for t
in leg.get_texts():
1241 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1244 fig.suptitle(
r"CMS Integrated Luminosity, " \
1245 r"%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1246 (particle_type_str, year, cms_energy_str),
1247 fontproperties=FONT_PROPS_SUPTITLE)
1248 ax.set_title(
"Data included from %s to %s UTC \n" % \
1249 (str_begin, str_end),
1250 fontproperties=FONT_PROPS_TITLE)
1251 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1252 ax.set_ylabel(
r"Total Integrated Luminosity (%s)" % \
1254 fontproperties=FONT_PROPS_AX_TITLE)
1258 ax.text(0.05, 0.7,
"CMS Preliminary",
1259 verticalalignment=
"center", horizontalalignment=
"left",
1260 transform = ax.transAxes, fontsize=15)
1264 TweakPlot(fig, ax, (time_begin, time_end),
1265 add_extra_head_room=is_log)
1270 SavePlot(fig,
"int_lumi_per_day_cumulative_%s_%d%s%s" % \
1271 (particle_type_str.lower(), year,
1272 log_suffix, file_suffix))
1280 print(
" weekly lumi plots for %d" % year)
1282 if not beam_energy_from_cfg:
1283 beam_energy = beam_energy_defaults[accel_mode][year]
1284 cms_energy = 2. * beam_energy
1285 cms_energy_str =
"???" 1286 if accel_mode ==
"PROTPHYS":
1290 cms_energy_str =
"%.*f TeV" % (width, 1.e-3 * cms_energy)
1291 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1292 cms_energy_str =
"%.2f TeV/nucleon" % \
1295 lumi_data = sorted(lumi_data_by_week_per_year[year])
1300 datetime.timedelta(days=3, seconds=12*60*60)
1302 datetime.timedelta(days=3, seconds=12*60*60)
1307 num_weeks = week_hi.isocalendar()[1] - week_lo.isocalendar()[1] + 1
1308 bin_edges = np.linspace(matplotlib.dates.date2num(week_lo),
1309 matplotlib.dates.date2num(week_hi),
1311 times_tmp = [
AtMidWeek(i)
for i
in lumi_data.times()]
1312 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1314 units =
GetUnits(year, accel_mode,
"cum_week")
1315 weights_del = lumi_data.lum_del(units)
1316 weights_rec = lumi_data.lum_rec(units)
1318 units =
GetUnits(year, accel_mode,
"cum_year")
1319 weights_del_for_cum = lumi_data.lum_del(units)
1320 weights_rec_for_cum = lumi_data.lum_rec(units)
1322 units =
GetUnits(year, accel_mode,
"max_inst")
1323 weights_del_inst = lumi_data.lum_inst_max(units)
1329 if sum(weights_del) > 0.:
1330 str_begin = lumi_data.time_begin().strftime(DATE_FMT_STR_OUT)
1331 str_end = lumi_data.time_end().strftime(DATE_FMT_STR_OUT)
1336 for color_scheme_name
in color_scheme_names:
1338 print(
" color scheme '%s'" % color_scheme_name)
1340 color_scheme = ColorScheme(color_scheme_name)
1341 color_fill_del = color_scheme.color_fill_del
1342 color_fill_rec = color_scheme.color_fill_rec
1343 color_fill_peak = color_scheme.color_fill_peak
1344 color_line_del = color_scheme.color_line_del
1345 color_line_rec = color_scheme.color_line_rec
1346 color_line_peak = color_scheme.color_line_peak
1347 logo_name = color_scheme.logo_name
1348 file_suffix = color_scheme.file_suffix
1354 for type
in [
"lin",
"log"]:
1355 is_log = (type ==
"log")
1358 min_val =
min(weights_del_inst)
1359 exp = math.floor(math.log10(min_val))
1360 log_setting = math.pow(10., exp)
1363 ax = fig.add_subplot(111)
1365 units =
GetUnits(year, accel_mode,
"max_inst")
1368 max_inst =
max(weights_del_inst)
1370 if sum(weights_del) > 0.:
1372 ax.hist(times, bin_edges, weights=weights_del_inst,
1373 histtype=
"stepfilled",
1375 facecolor=color_fill_peak, edgecolor=color_line_peak,
1376 label=
"Max. inst. lumi.: %.2f %s" % \
1379 tmp_leg = ax.legend(loc=
"upper left",
1380 bbox_to_anchor=(0.025, 0., 1., .97),
1382 tmp_leg.legendHandles[0].set_visible(
False)
1383 for t
in tmp_leg.get_texts():
1384 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1387 fig.suptitle(
r"CMS Peak Luminosity Per Week, " \
1388 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1389 (particle_type_str, year, cms_energy_str),
1390 fontproperties=FONT_PROPS_SUPTITLE)
1391 ax.set_title(
"Data included from %s to %s UTC \n" % \
1392 (str_begin, str_end),
1393 fontproperties=FONT_PROPS_TITLE)
1394 ax.set_xlabel(
r"Date (UTC)",
1395 fontproperties=FONT_PROPS_AX_TITLE)
1396 ax.set_ylabel(
r"Peak Delivered Luminosity (%s)" % \
1398 fontproperties=FONT_PROPS_AX_TITLE)
1402 TweakPlot(fig, ax, (week_lo, week_hi),
True)
1407 SavePlot(fig,
"peak_lumi_per_week_%s_%d%s%s" % \
1408 (particle_type_str.lower(), year,
1409 log_suffix, file_suffix))
1414 for type
in [
"lin",
"log"]:
1415 is_log = (type ==
"log")
1418 min_val =
min(weights_rec)
1419 exp = math.floor(math.log10(min_val))
1420 log_setting = math.pow(10., exp)
1423 ax = fig.add_subplot(111)
1425 units =
GetUnits(year, accel_mode,
"cum_week")
1428 max_del =
max(weights_del)
1429 max_rec =
max(weights_rec)
1431 if sum(weights_del) > 0.:
1433 ax.hist(times, bin_edges, weights=weights_del,
1434 histtype=
"stepfilled",
1436 facecolor=color_fill_del, edgecolor=color_line_del,
1437 label=
"LHC Delivered, max: %.1f %s/week" % \
1439 ax.hist(times, bin_edges, weights=weights_rec,
1440 histtype=
"stepfilled",
1442 facecolor=color_fill_rec, edgecolor=color_line_rec,
1443 label=
"CMS Recorded, max: %.1f %s/week" % \
1445 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(0.125, 0., 1., 1.01),
1447 for t
in leg.get_texts():
1448 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1451 fig.suptitle(
r"CMS Integrated Luminosity Per Week, " \
1452 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1453 (particle_type_str, year, cms_energy_str),
1454 fontproperties=FONT_PROPS_SUPTITLE)
1455 ax.set_title(
"Data included from %s to %s UTC \n" % \
1456 (str_begin, str_end),
1457 fontproperties=FONT_PROPS_TITLE)
1458 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1459 ax.set_ylabel(
r"Integrated Luminosity (%s/week)" % \
1461 fontproperties=FONT_PROPS_AX_TITLE)
1465 TweakPlot(fig, ax, (week_lo, week_hi),
True)
1470 SavePlot(fig,
"int_lumi_per_week_%s_%d%s%s" % \
1471 (particle_type_str.lower(), year,
1472 log_suffix, file_suffix))
1477 units =
GetUnits(year, accel_mode,
"cum_year")
1480 min_del =
min(weights_del_for_cum)
1481 tot_del = sum(weights_del_for_cum)
1482 tot_rec = sum(weights_rec_for_cum)
1484 for type
in [
"lin",
"log"]:
1485 is_log = (type ==
"log")
1488 min_val =
min(weights_del_for_cum)
1489 exp = math.floor(math.log10(min_val))
1490 log_setting = math.pow(10., exp)
1493 ax = fig.add_subplot(111)
1495 if sum(weights_del) > 0.:
1497 ax.hist(times, bin_edges, weights=weights_del_for_cum,
1498 histtype=
"stepfilled", cumulative=
True,
1500 facecolor=color_fill_del, edgecolor=color_line_del,
1501 label=
"LHC Delivered: %.2f %s" % \
1503 ax.hist(times, bin_edges, weights=weights_rec_for_cum,
1504 histtype=
"stepfilled", cumulative=
True,
1506 facecolor=color_fill_rec, edgecolor=color_line_rec,
1507 label=
"CMS Recorded: %.2f %s" % \
1509 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(0.125, 0., 1., 1.01),
1511 for t
in leg.get_texts():
1512 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1515 fig.suptitle(
r"CMS Integrated Luminosity, " \
1516 r"%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1517 (particle_type_str, year, cms_energy_str),
1518 fontproperties=FONT_PROPS_SUPTITLE)
1519 ax.set_title(
"Data included from %s to %s UTC \n" % \
1520 (str_begin, str_end),
1521 fontproperties=FONT_PROPS_TITLE)
1522 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1523 ax.set_ylabel(
r"Total Integrated Luminosity (%s)" % \
1525 fontproperties=FONT_PROPS_AX_TITLE)
1530 add_extra_head_room=is_log)
1535 SavePlot(fig,
"int_lumi_per_week_cumulative_%s_%d%s%s" % \
1536 (particle_type_str.lower(), year,
1537 log_suffix, file_suffix))
1545 print(
" cumulative luminosity for %s together" %
", ".
join([
str(i)
for i
in years]))
1548 """Mode 1: years side-by-side, mode 2: years overlaid.""" 1550 units =
GetUnits(years[-1], accel_mode,
"cum_year")
1552 scale_factor_2010 = 100.
1555 for color_scheme_name
in color_scheme_names:
1557 print(
" color scheme '%s'" % color_scheme_name)
1559 color_scheme = ColorScheme(color_scheme_name)
1560 color_by_year = color_scheme.color_by_year
1561 logo_name = color_scheme.logo_name
1562 file_suffix = color_scheme.file_suffix
1564 for type
in [
"lin",
"log"]:
1565 is_log = (type ==
"log")
1568 aspect_ratio = matplotlib.figure.figaspect(1. / 2.5)
1569 fig = plt.figure(figsize=aspect_ratio)
1572 ax = fig.add_subplot(111)
1574 time_begin_ultimate = lumi_data_by_day_per_year[years[0]].
time_begin()
1575 str_begin_ultimate = time_begin_ultimate.strftime(DATE_FMT_STR_OUT)
1576 for (year_index, year)
in enumerate(years):
1578 lumi_data = sorted(lumi_data_by_day_per_year[year])
1579 times_tmp = [
AtMidnight(i)
for i
in lumi_data.times()]
1585 for y
in years[:year_index]:
1587 time_shift = datetime.timedelta(days=num_days)
1588 times_tmp = [(i - time_shift) \
1590 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1592 for i
in range(len(times) - 1):
1593 assert times[i] < times[i + 1]
1595 weights_del = lumi_data.lum_del(units)
1596 weights_del_cum = [0.] * len(weights_del)
1598 for (i, val)
in enumerate(weights_del):
1600 weights_del_cum[i] = tot_del
1601 if not beam_energy_from_cfg:
1602 beam_energy = beam_energy_defaults[accel_mode][year]
1603 cms_energy = 2. * beam_energy
1604 cms_energy_str =
"???" 1605 if accel_mode ==
"PROTPHYS":
1609 cms_energy_str =
"%.*f TeV" % \
1610 (width, 1.e-3 * cms_energy)
1611 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1612 cms_energy_str =
"%.2f TeV/nucleon" % \
1618 label =
r"%d, %s, %.1f %s" % \
1619 (year, cms_energy_str,
1623 label =
r"%d, %s, %.1f %s" % \
1624 (year, cms_energy_str, tot_del,
1630 weights_tmp = [scale_factor_2010 * i \
1631 for i
in weights_del_cum]
1633 weights_tmp = weights_del_cum
1634 ax.plot(times, weights_tmp,
1635 color=color_by_year[year],
1636 marker=
"none", linestyle=
"solid",
1640 ax.set_yscale(
"log")
1644 ax.annotate(
r"$\times$ %.0f" % scale_factor_2010,
1645 xy=(times[-1], weights_tmp[-1]),
1647 xycoords=
"data", textcoords=
"offset points")
1651 time_begin = lumi_data.time_begin()
1652 time_end = lumi_data.time_end()
1653 str_begin = time_begin.strftime(DATE_FMT_STR_OUT)
1654 str_end = time_end.strftime(DATE_FMT_STR_OUT)
1656 time_begin = datetime.datetime(years[0], 1, 1, 0, 0, 0)
1657 time_end = datetime.datetime(years[-1], 12, 31, 23, 59,59)
1659 time_begin = datetime.datetime(years[0], 1, 1, 0, 0, 0)
1660 time_end = datetime.datetime(years[0], 12, 31, 23, 59,59)
1665 num_cols = len(years)
1672 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(tmp_x, 0., 1., tmp_y),
1673 frameon=
False, ncol=num_cols)
1674 for t
in leg.get_texts():
1675 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1678 fig.suptitle(
r"CMS Integrated Luminosity, %s" % particle_type_str,
1679 fontproperties=FONT_PROPS_SUPTITLE)
1680 ax.set_title(
"Data included from %s to %s UTC \n" % \
1682 (str_begin_ultimate, str_end),
1683 fontproperties=FONT_PROPS_TITLE)
1684 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1685 ax.set_ylabel(
r"Total Integrated Luminosity (%s)" % \
1687 fontproperties=FONT_PROPS_AX_TITLE)
1693 AddLogo(logo_name, ax, zoom=zoom)
1701 TweakPlot(fig, ax, (time_begin_ultimate, time_end),
1702 add_extra_head_room=extra_head_room)
1707 SavePlot(fig,
"int_lumi_cumulative_%s_%d%s%s" % \
1708 (particle_type_str.lower(), mode,
1709 log_suffix, file_suffix))
1712 print(
" mode %d" % mode)
1721 print(
" peak luminosity for %s together" %
", ".
join([
str(i)
for i
in years]))
1723 units =
GetUnits(years[-1], accel_mode,
"max_inst")
1725 scale_factor_2010 = 10.
1728 for color_scheme_name
in color_scheme_names:
1730 print(
" color scheme '%s'" % color_scheme_name)
1732 color_scheme = ColorScheme(color_scheme_name)
1733 color_by_year = color_scheme.color_by_year
1734 logo_name = color_scheme.logo_name
1735 file_suffix = color_scheme.file_suffix
1737 for type
in [
"lin",
"log"]:
1738 is_log = (type ==
"log")
1740 aspect_ratio = matplotlib.figure.figaspect(1. / 2.5)
1741 fig = plt.figure(figsize=aspect_ratio)
1742 ax = fig.add_subplot(111)
1744 time_begin_ultimate = lumi_data_by_day_per_year[years[0]].
time_begin()
1745 str_begin_ultimate = time_begin_ultimate.strftime(DATE_FMT_STR_OUT)
1746 for (year_index, year)
in enumerate(years):
1748 lumi_data = sorted(lumi_data_by_day_per_year[year])
1749 times_tmp = [
AtMidnight(i)
for i
in lumi_data.times()]
1750 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1752 for i
in range(len(times) - 1):
1753 assert times[i] < times[i + 1]
1755 weights_inst = lumi_data.lum_inst_max(units)
1756 max_inst =
max(weights_inst)
1757 if not beam_energy_from_cfg:
1758 beam_energy = beam_energy_defaults[accel_mode][year]
1759 cms_energy = 2. * beam_energy
1760 cms_energy_str =
"???" 1761 if accel_mode ==
"PROTPHYS":
1765 cms_energy_str =
"%.*f TeV" % \
1766 (width, 1.e-3 * cms_energy)
1767 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1768 cms_energy_str =
"%.2f TeV/nucleon" % \
1774 label =
r"%d, %s, max. %.1f %s" % \
1775 (year, cms_energy_str,
1779 label =
r"%d, %s, max. %.1f %s" % \
1780 (year, cms_energy_str, max_inst,
1786 weights_tmp = [scale_factor_2010 * i \
1787 for i
in weights_inst]
1789 weights_tmp = weights_inst
1790 ax.plot(times, weights_tmp,
1791 color=color_by_year[year],
1792 marker=
".", markersize=8.,
1796 ax.set_yscale(
"log")
1800 ax.annotate(
r"$\times$ %.0f" % scale_factor_2010,
1801 xy=(times[-1],
max(weights_tmp)),
1803 xycoords=
"data", textcoords=
"offset points")
1807 time_begin = lumi_data.time_begin()
1808 time_end = lumi_data.time_end()
1809 str_begin = time_begin.strftime(DATE_FMT_STR_OUT)
1810 str_end = time_end.strftime(DATE_FMT_STR_OUT)
1811 time_begin = datetime.datetime(years[0], 1, 1, 0, 0, 0)
1812 time_end = datetime.datetime(years[-1], 12, 31, 23, 59,59)
1816 num_cols = len(years) - 2
1819 leg = ax.legend(loc=
"upper left",
1820 bbox_to_anchor=(tmp_x, 0., 1., tmp_y),
1823 frameon=
False, ncol=num_cols)
1824 for t
in leg.get_texts():
1825 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1828 fig.suptitle(
r"CMS Peak Luminosity Per Day, %s" % particle_type_str,
1829 fontproperties=FONT_PROPS_SUPTITLE)
1830 ax.set_title(
"Data included from %s to %s UTC \n" % \
1832 (str_begin_ultimate, str_end),
1833 fontproperties=FONT_PROPS_TITLE)
1834 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1835 ax.set_ylabel(
r"Peak Delivered Luminosity (%s)" % \
1837 fontproperties=FONT_PROPS_AX_TITLE)
1841 AddLogo(logo_name, ax, zoom=zoom)
1846 TweakPlot(fig, ax, (time_begin_ultimate, time_end),
1847 add_extra_head_room=head_room)
1852 SavePlot(fig,
"peak_lumi_%s%s%s" % \
1853 (particle_type_str.lower(),
1854 log_suffix, file_suffix))
def lum_rec_tot(self, units="b^{-1}")
def lum_rec_tot(self, units="b^{-1}")
def __init__(self, line, json_file_name=None)
def __init__(self, data_block=None)
def __init__(self, data_point=None)
def PlotAllYears(lumi_data_by_day_per_year, mode)
S & print(S &os, JobReport::InputFile const &f)
def lum_del_tot(self, units="b^{-1}")
def checkCertification(run_number, ls)
def TweakPlot(fig, ax, time_range, add_extra_head_room=False)
def GetEnergyPerNucleonScaleFactor(amodetag)
def lum_cert_tot(self, units="b^{-1}")
def lum_cert(self, units="b^{-1}")
def __iadd__(self, other)
def max_inst_lum(self, units="Hz/b")
def AtMidWeek(datetime_in)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
static std::string join(char **cmd)
def loadCertificationJSON(json_file_name)
def CacheFilePath(cache_file_dir, day=None)
def lum_inst_max(self, units="Hz/b")
def GetUnits(year, accel_mode, mode)
def lum_rec(self, units="b^{-1}")
def lum_del_tot(self, units="b^{-1}")
def AtMidnight(datetime_in)
def lum_del(self, units="b^{-1}")
def lum_cert_tot(self, units="b^{-1}")
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run