23 from matplotlib
import pyplot
as plt
27 from RecoLuminosity.LumiDB.mpl_axes_hist_fix
import hist
28 if matplotlib.__version__ !=
'1.0.1':
29 print >> sys.stderr, \
30 "ERROR The %s script contains a hard-coded bug-fix " \
31 "for Matplotlib 1.0.1. The Matplotlib version loaded " \
32 "is %s" % (__file__, matplotlib.__version__)
34 matplotlib.axes.Axes.hist = hist
37 from RecoLuminosity.LumiDB.public_plots_tools
import ColorScheme
38 from RecoLuminosity.LumiDB.public_plots_tools
import LatexifyUnits
39 from RecoLuminosity.LumiDB.public_plots_tools
import AddLogo
40 from RecoLuminosity.LumiDB.public_plots_tools
import InitMatplotlib
41 from RecoLuminosity.LumiDB.public_plots_tools
import SavePlot
42 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_SUPTITLE
43 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_TITLE
44 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_AX_TITLE
45 from RecoLuminosity.LumiDB.public_plots_tools
import FONT_PROPS_TICK_LABEL
56 DATE_FMT_STR_LUMICALC =
"%m/%d/%y %H:%M:%S"
57 DATE_FMT_STR_LUMICALC_DAY =
"%m/%d/%y"
58 DATE_FMT_STR_OUT =
"%Y-%m-%d %H:%M"
59 DATE_FMT_STR_AXES =
"%-d %b"
60 DATE_FMT_STR_CFG =
"%Y-%m-%d"
61 NUM_SEC_IN_LS = 2**18 / 11246.
63 KNOWN_ACCEL_MODES = [
"PROTPHYS",
"IONPHYS",
"PAPHYS",
64 "2013_amode_bug_workaround"]
65 LEAD_SCALE_FACTOR = 82. / 208.
70 """Holds info from one line of lumiCalc lumibyls output."""
75 line_split = line.split(
",")
76 tmp = line_split[0].
split(
":")
79 tmp = line_split[1].
split(
":")
82 self.
timestamp = datetime.datetime.strptime(tmp, DATE_FMT_STR_LUMICALC)
85 self.
lum_del = scale_factor * float(line_split[5])
86 self.
lum_rec = scale_factor * float(line_split[6])
92 self.
lum_cert = scale_factor * float(line_split[6])
105 """A supposedly coherent block of LumiDataPoints.
107 NOTE: No checks on duplicates, sorting, etc.
134 self.data_points.extend(other.data_points)
140 return self.
time_mid() < other.time_mid()
143 self.data_points.append(new_point)
148 return copy.deepcopy(self)
156 res *= LumiDataBlock.scale_factors[units]
162 res *= LumiDataBlock.scale_factors[units]
168 res *= LumiDataBlock.scale_factors[units]
177 res *= LumiDataBlock.scale_factors[units]
182 self.data_points.sort()
197 delta_sec = delta.days * 24 * 60 * 60 + delta.seconds
198 res = self.
time_begin() + datetime.timedelta(seconds=.5*delta_sec)
207 """A collection of LumiDataBlocks."""
221 self.data_blocks.append(new_block)
225 self.data_blocks.sort()
229 res = datetime.datetime.max
236 res = datetime.datetime.min
248 res = [i.lum_del_tot(units)
for i
in self.
data_blocks]
253 res = [i.lum_rec_tot(units)
for i
in self.
data_blocks]
258 res = [i.lum_cert_tot(units)
for i
in self.
data_blocks]
264 return sum(self.
lum_del(units))
268 return sum(self.
lum_rec(units))
275 res = [i.max_inst_lum(units)
for i
in self.
data_blocks]
284 cache_file_path = os.path.abspath(cache_file_dir)
286 cache_file_name =
"lumicalc_cache_%s.csv" % day.isoformat()
287 cache_file_path = os.path.join(cache_file_path, cache_file_name)
288 return cache_file_path
293 res = datetime.datetime.combine(datetime_in.date(), datetime.time())
302 tmp = datetime_in.date()
304 datetime.timedelta(days=tmp.weekday()) + \
305 datetime.timedelta(days=3)
306 res = datetime.datetime.combine(date_tmp, datetime.time())
317 "cum_day" :
"pb^{-1}",
318 "cum_week" :
"pb^{-1}",
319 "cum_year" :
"pb^{-1}",
320 "max_inst" :
"Hz/ub",
323 "cum_day" :
"pb^{-1}",
324 "cum_week" :
"pb^{-1}",
325 "cum_year" :
"fb^{-1}",
326 "max_inst" :
"Hz/nb",
329 "cum_day" :
"pb^{-1}",
330 "cum_week" :
"fb^{-1}",
331 "cum_year" :
"fb^{-1}",
332 "max_inst" :
"Hz/nb",
335 "cum_day" :
"pb^{-1}",
336 "cum_week" :
"pb^{-1}",
337 "cum_year" :
"pb^{-1}",
338 "max_inst" :
"Hz/ub",
343 "cum_day" :
"ub^{-1}",
344 "cum_week" :
"ub^{-1}",
345 "cum_year" :
"ub^{-1}",
346 "max_inst" :
"Hz/mb",
351 "cum_day" :
"nb^{-1}",
352 "cum_week" :
"nb^{-1}",
353 "cum_year" :
"nb^{-1}",
354 "max_inst" :
"Hz/mb",
362 units = units_spec[accel_mode][year][mode]
364 if mode ==
"cum_day":
366 elif mode ==
"cum_week":
368 elif mode ==
"cum_year":
370 elif mode ==
"max_inst":
374 assert not units
is None
384 assert amodetag
in [
"IONPHYS",
"PAPHYS"]
387 res = LEAD_SCALE_FACTOR
388 if amodetag ==
"PAPHYS":
397 """Returns the number of days in the given year."""
399 date_lo = datetime.date(year, 1, 1)
400 date_hi = datetime.date(year + 1, 1, 1)
401 num_days = (date_hi - date_lo).days
409 """Pick a DateLocator based on the range of the x-axis."""
410 (x_lo, x_hi) = ax.get_xlim()
411 num_days = x_hi - x_lo
412 min_num_ticks =
min(num_days, 5)
413 locator = matplotlib.dates.AutoDateLocator(minticks=min_num_ticks,
420 def TweakPlot(fig, ax, (time_begin, time_end),
421 add_extra_head_room=
False):
425 ax.autoscale_view(
False,
True,
True)
426 for label
in ax.get_xticklabels():
427 label.set_ha(
"right")
428 label.set_rotation(30.)
432 if add_extra_head_room:
433 y_ticks = ax.get_yticks()
434 (y_min, y_max) = ax.get_ylim()
435 is_log = (ax.get_yscale() ==
"log")
438 tmp = y_ticks[-1] / y_ticks[-2]
439 y_max_new = y_max * math.pow(tmp, add_extra_head_room)
441 tmp = y_ticks[-1] - y_ticks[-2]
442 y_max_new = y_max + add_extra_head_room * tmp
443 ax.set_ylim(y_min, y_max_new)
447 ax_sec.set_ylim(ax.get_ylim())
448 ax_sec.set_yscale(ax.get_yscale())
450 for ax_tmp
in fig.axes:
451 for sub_ax
in [ax_tmp.xaxis, ax_tmp.yaxis]:
452 for label
in sub_ax.get_ticklabels():
453 label.set_font_properties(FONT_PROPS_TICK_LABEL)
455 ax.set_xlim(time_begin, time_end)
458 ax.xaxis.set_major_locator(locator)
459 formatter = matplotlib.dates.DateFormatter(DATE_FMT_STR_AXES)
460 ax.xaxis.set_major_formatter(formatter)
462 fig.subplots_adjust(top=.85, bottom=.14, left=.13, right=.91)
468 """Check if this run and LS are certified as good and return a boolean parameter."""
470 ls_ranges = certification_data[run_number]
471 for ranges
in ls_ranges:
472 if (ls >= ranges[0])
and (ls <= ranges[1]):
483 full_file = open(json_file_name,
"r")
484 full_file_content = ["".
join(l)
for l
in full_file.readlines()]
485 full_object = cjson.decode(full_file_content[0])
488 tmp = full_object.keys()
489 tmp = [int(i)
for i
in tmp]
490 run_list = sorted(tmp)
491 certification_data = {}
493 ls_ranges = full_object.get(str(run),
None)
494 certification_data[run] = ls_ranges
496 return certification_data
500 if __name__ ==
"__main__":
502 desc_str =
"This script creates the official CMS luminosity plots " \
503 "based on the output from the lumiCalc family of scripts."
504 arg_parser = optparse.OptionParser(description=desc_str)
505 arg_parser.add_option(
"--ignore-cache", action=
"store_true",
506 help=
"Ignore all cached lumiCalc results " \
507 "and re-query lumiCalc. " \
508 "(Rebuilds the cache as well.)")
509 (options, args) = arg_parser.parse_args()
511 print >> sys.stderr, \
512 "ERROR Need exactly one argument: a config file name"
514 config_file_name = args[0]
515 ignore_cache = options.ignore_cache
518 "lumicalc_flags" :
"",
520 "color_schemes" :
"Joe, Greg",
521 "beam_energy" :
None,
522 "beam_fluctuation" :
None,
524 "oracle_connection" :
None,
527 cfg_parser = ConfigParser.SafeConfigParser(cfg_defaults)
528 if not os.path.exists(config_file_name):
529 print >> sys.stderr, \
530 "ERROR Config file '%s' does not exist" % config_file_name
532 cfg_parser.read(config_file_name)
535 color_scheme_names_tmp = cfg_parser.get(
"general",
"color_schemes")
536 color_scheme_names = [i.strip()
for i
in color_scheme_names_tmp.split(
",")]
538 cache_file_dir = cfg_parser.get(
"general",
"cache_dir")
540 verbose = cfg_parser.getboolean(
"general",
"verbose")
543 lumicalc_script = cfg_parser.get(
"general",
"lumicalc_script")
544 lumicalc_flags_from_cfg = cfg_parser.get(
"general",
"lumicalc_flags")
545 accel_mode = cfg_parser.get(
"general",
"accel_mode")
547 if not accel_mode
in KNOWN_ACCEL_MODES:
548 print >> sys.stderr, \
549 "ERROR Unknown accelerator mode '%s'" % \
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 >> sys.stderr, \
604 "ERROR End date before begin date (%s < %s)" % \
605 (date_end.isoformat(), date_begin.isoformat())
611 oracle_connection_string = cfg_parser.get(
"general",
"oracle_connection")
612 use_oracle = (len(oracle_connection_string) != 0)
616 json_file_name = cfg_parser.get(
"general",
"json_file")
617 if len(json_file_name) < 1:
618 json_file_name =
None
620 if not os.path.exists(json_file_name):
621 print >> sys.stderr, \
622 "ERROR Requested JSON file '%s' is not available" % json_file_name
624 print "Using JSON file '%s' for certified data" % json_file_name
627 print "No JSON file specified, filling only standard lumi plot."
631 certification_data =
None
639 particle_type_strings = {
644 particle_type_str = particle_type_strings[accel_mode]
646 beam_energy_defaults = {
647 "PROTPHYS" : {2010 : 3500.,
651 "IONPHYS" : {2010 : 3500.,
653 "PAPHYS" : {2013 : 4000.}
655 beam_fluctuation_defaults = {
656 "PROTPHYS" : {2010 : .15,
660 "IONPHYS" : {2010 : .15,
662 "PAPHYS" : {2013 : .15}
669 os.putenv(
"TNS_ADMIN",
"/afs/cern.ch/cms/lumi/DB")
674 print "Using configuration from file '%s'" % config_file_name
676 print "Ignoring all cached lumiCalc results (and rebuilding the cache)"
678 print "Using cached lumiCalc results from %s" % \
680 print "Using color schemes '%s'" %
", ".
join(color_scheme_names)
681 print "Using lumiCalc script '%s'" % lumicalc_script
682 print "Using additional lumiCalc flags from configuration: '%s'" % \
683 lumicalc_flags_from_cfg
684 print "Selecting data for accelerator mode '%s'" % accel_mode
685 if beam_energy_from_cfg:
686 print "Selecting data for beam energy %.0f GeV" % beam_energy
688 print "Selecting data for default beam energy for '%s' from:" % accel_mode
689 for (key, val)
in beam_energy_defaults[accel_mode].iteritems():
690 print " %d : %.1f GeV" % (key, val)
691 if beam_fluctuation_from_cfg:
692 print "Using beam energy fluctuation of +/- %.0f%%" % \
693 (100. * beam_fluctuation)
695 print "Using default beam energy fluctuation for '%s' from:" % accel_mode
696 for (key, val)
in beam_fluctuation_defaults[accel_mode].iteritems():
697 print " %d : +/- %.0f%%" % (key, 100. * val)
699 print "Using direct access to the Oracle luminosity database"
701 print "Using access to the luminosity database through the Frontier cache"
707 if not os.path.exists(path_name):
709 print "Cache file path does not exist: creating it"
711 os.makedirs(path_name)
712 except Exception, err:
713 print >> sys.stderr, \
714 "ERROR Could not create cache dir: %s" % path_name
723 week_begin = date_begin.isocalendar()[1]
724 week_end = date_end.isocalendar()[1]
725 year_begin = date_begin.isocalendar()[0]
726 year_end = date_end.isocalendar()[0]
728 assert year_end >= year_begin
730 print "Building a list of days to include in the plots"
731 print " first day to consider: %s (%d, week %d)" % \
732 (date_begin.isoformat(), year_begin, week_begin)
733 print " last day to consider: %s (%d, week %d)" % \
734 (date_end.isoformat(), year_end, week_end)
735 num_days = (date_end - date_begin).days + 1
736 days = [date_begin + datetime.timedelta(days=i)
for i
in xrange(num_days)]
737 years = range(year_begin, year_end + 1)
740 while day_cur <= date_end:
741 year = day_cur.isocalendar()[0]
742 week = day_cur.isocalendar()[1]
743 weeks.append((year, week))
744 day_cur += datetime.timedelta(days=7)
746 year = date_end.isocalendar()[0]
747 week = date_end.isocalendar()[1]
748 weeks.append((year, week))
749 weeks =
list(set(weeks))
756 last_day_from_cache =
min(today - datetime.timedelta(days=2), date_end)
758 print "Last day for which the cache will be used: %s" % \
759 last_day_from_cache.isoformat()
763 print "Running lumiCalc for all requested days"
765 print " %s" % day.isoformat()
766 use_cache = (
not ignore_cache)
and (day <= last_day_from_cache)
768 cache_file_tmp = cache_file_path.replace(
".csv",
"_tmp.csv")
769 if (
not os.path.exists(cache_file_path))
or (
not use_cache):
770 date_begin_str = day.strftime(DATE_FMT_STR_LUMICALC)
771 date_begin_day_str = day.strftime(DATE_FMT_STR_LUMICALC_DAY)
772 date_end_str = (day + datetime.timedelta(days=1)).strftime(DATE_FMT_STR_LUMICALC)
773 date_previous_str = (day - datetime.timedelta(days=1)).strftime(DATE_FMT_STR_LUMICALC)
774 if not beam_energy_from_cfg:
775 year = day.isocalendar()[0]
776 beam_energy = beam_energy_defaults[accel_mode][year]
777 if not beam_fluctuation_from_cfg:
778 year = day.isocalendar()[0]
779 beam_fluctuation = beam_fluctuation_defaults[accel_mode][year]
784 if amodetag_bug_workaround:
787 lumicalc_flags =
"%s --without-checkforupdate " \
788 "--beamenergy %.1f " \
789 "--beamfluctuation %.2f " \
791 (lumicalc_flags_from_cfg,
792 beam_energy, beam_fluctuation)
795 lumicalc_flags =
"%s --without-checkforupdate " \
796 "--beamenergy %.1f " \
797 "--beamfluctuation %.2f " \
800 (lumicalc_flags_from_cfg,
801 beam_energy, beam_fluctuation,
805 lumicalc_flags = lumicalc_flags.strip()
806 lumicalc_cmd =
"%s %s" % (lumicalc_script, lumicalc_flags)
808 lumicalc_cmd =
"%s %s" % (lumicalc_cmd, oracle_connection_string)
809 cmd =
"%s --begin '%s' --end '%s' -o %s" % \
810 (lumicalc_cmd, date_previous_str, date_end_str, cache_file_tmp)
812 print " running lumicalc as '%s'" % cmd
813 (status, output) = commands.getstatusoutput(cmd)
816 output_0 = copy.deepcopy(output)
820 if ((status >> 8) == 13
or (status >> 8) == 14):
827 print "No lumi data for %s, " \
828 "writing dummy cache file to avoid re-querying the DB" % \
830 dummy_file = open(cache_file_tmp,
"w")
831 dummy_file.write(
"Run:Fill,LS,UTCTime,Beam Status,E(GeV),Delivered(/ub),Recorded(/ub),avgPU\r\n")
834 print >> sys.stderr, \
835 "ERROR Problem running lumiCalc: %s" % output
843 lines_to_be_kept = []
844 lines_ori = open(cache_file_tmp).readlines()
845 for line
in lines_ori:
846 if (date_begin_day_str
in line)
or (
"Delivered" in line):
847 lines_to_be_kept.append(line)
848 newfile = open(cache_file_path,
"w")
849 newfile.writelines(lines_to_be_kept)
854 print " CSV file for the day written to %s" % \
858 print " cache file for %s exists" % day.isoformat()
861 print "Reading back lumiCalc results"
862 lumi_data_by_day = {}
864 print " %s" % day.isoformat()
868 in_file = open(cache_file_path)
869 lines = in_file.readlines()
872 print " skipping empty file for %s" % day.isoformat()
875 assert lines[0] ==
"Run:Fill,LS,UTCTime,Beam Status,E(GeV),Delivered(/ub),Recorded(/ub),avgPU\r\n"
877 for line
in lines[1:]:
881 print >> sys.stderr, \
882 "ERROR Could not read lumiCalc results from file '%s': %s" % \
883 (cache_file_path, str(err))
886 if not lumi_data_day.is_empty():
887 lumi_data_by_day[day] = lumi_data_day
892 print "Combining lumiCalc data week-by-week"
893 lumi_data_by_week = {}
894 for (day, lumi)
in lumi_data_by_day.iteritems():
895 year = day.isocalendar()[0]
896 week = day.isocalendar()[1]
898 lumi_data_by_week[year][week] += lumi
901 lumi_data_by_week[year][week] = lumi.copy()
903 lumi_data_by_week[year] = {week: lumi.copy()}
905 lumi_data_by_week_per_year = {}
906 for (year, tmp_lumi)
in lumi_data_by_week.iteritems():
907 for (week, lumi)
in tmp_lumi.iteritems():
909 lumi_data_by_week_per_year[year].
add(lumi)
914 print "Combining lumiCalc data year-by-year"
915 lumi_data_by_year = {}
916 for (day, lumi)
in lumi_data_by_day.iteritems():
917 year = day.isocalendar()[0]
919 lumi_data_by_year[year] += lumi
921 lumi_data_by_year[year] = lumi.copy()
923 lumi_data_by_day_per_year = {}
924 for (day, lumi)
in lumi_data_by_day.iteritems():
925 year = day.isocalendar()[0]
927 lumi_data_by_day_per_year[year].
add(lumi)
937 print "Delivered lumi day-by-day (%s):" % units
940 tmp_str =
" - (no data, presumably no lumi either)"
942 tmp = lumi_data_by_day[day].lum_del_tot(units)
944 if (tmp < .1)
and (tmp > 0.):
945 helper_str =
" (non-zero but very small)"
946 tmp_str =
"%6.1f%s" % (tmp, helper_str)
949 print " %s: %s" % (day.isoformat(), tmp_str)
951 units =
GetUnits(years[-1], accel_mode,
"cum_week")
952 print "Delivered lumi week-by-week (%s):" % units
954 for (year, week)
in weeks:
955 tmp_str =
" - (no data, presumably no lumi either)"
957 tmp = lumi_data_by_week[year][week].lum_del_tot(units)
959 if (tmp < .1)
and (tmp > 0.):
960 helper_str =
" (non-zero but very small)"
961 tmp_str =
"%6.1f%s" % (tmp, helper_str)
964 print " %d-%2d: %s" % (year, week, tmp_str)
966 units =
GetUnits(years[-1], accel_mode,
"cum_year")
967 print "Delivered lumi year-by-year (%s):" % units
970 tmp_str =
" - (no data, presumably no lumi either)"
972 tmp = lumi_data_by_year[year].lum_del_tot(units)
974 if (tmp < .01)
and (tmp > 0.):
975 helper_str =
" (non-zero but very small)"
976 tmp_str =
"%5.2f%s" % (tmp, helper_str)
985 if not len(lumi_data_by_day_per_year):
986 print >> sys.stderr,
"ERROR No lumi found?"
992 print "Drawing things..."
993 ColorScheme.InitColors()
1001 print " daily lumi plots for %d" % year
1003 if not beam_energy_from_cfg:
1004 beam_energy = beam_energy_defaults[accel_mode][year]
1005 cms_energy = 2. * beam_energy
1006 cms_energy_str =
"???"
1007 if accel_mode ==
"PROTPHYS":
1011 cms_energy_str =
"%.*f TeV" % (width, 1.e-3 * cms_energy)
1012 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1013 cms_energy_str =
"%.2f TeV/nucleon" % \
1016 lumi_data = lumi_data_by_day_per_year[year]
1022 datetime.timedelta(seconds=12*60*60)
1024 datetime.timedelta(seconds=12*60*60)
1029 bin_edges = np.linspace(matplotlib.dates.date2num(day_lo),
1030 matplotlib.dates.date2num(day_hi),
1031 (day_hi - day_lo).days + 1)
1033 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1035 units =
GetUnits(year, accel_mode,
"cum_day")
1036 weights_del = lumi_data.lum_del(units)
1037 weights_rec = lumi_data.lum_rec(units)
1039 units =
GetUnits(year, accel_mode,
"cum_year")
1040 weights_del_for_cum = lumi_data.lum_del(units)
1041 weights_rec_for_cum = lumi_data.lum_rec(units)
1042 weights_cert_for_cum = lumi_data.lum_cert(units)
1044 units =
GetUnits(year, accel_mode,
"max_inst")
1045 weights_del_inst = lumi_data.lum_inst_max(units)
1049 time_begin = datetime.datetime.combine(lumi_data.time_begin(),
1050 datetime.time()) - \
1051 datetime.timedelta(days=.5)
1052 time_end = datetime.datetime.combine(lumi_data.time_end(),
1053 datetime.time()) + \
1054 datetime.timedelta(days=.5)
1057 if sum(weights_del) > 0.:
1058 str_begin = lumi_data.time_begin().strftime(DATE_FMT_STR_OUT)
1059 str_end = lumi_data.time_end().strftime(DATE_FMT_STR_OUT)
1064 for color_scheme_name
in color_scheme_names:
1066 color_scheme = ColorScheme(color_scheme_name)
1067 color_fill_del = color_scheme.color_fill_del
1068 color_fill_rec = color_scheme.color_fill_rec
1069 color_fill_cert = color_scheme.color_fill_cert
1070 color_fill_peak = color_scheme.color_fill_peak
1071 color_line_del = color_scheme.color_line_del
1072 color_line_rec = color_scheme.color_line_rec
1073 color_line_cert = color_scheme.color_line_cert
1074 color_line_peak = color_scheme.color_line_peak
1075 logo_name = color_scheme.logo_name
1076 file_suffix = color_scheme.file_suffix
1082 for type
in [
"lin",
"log"]:
1083 is_log = (type ==
"log")
1086 min_val =
min(weights_del_inst)
1087 exp = math.floor(math.log10(min_val))
1088 log_setting = math.pow(10., exp)
1091 ax = fig.add_subplot(111)
1093 units =
GetUnits(year, accel_mode,
"max_inst")
1096 max_inst =
max(weights_del_inst)
1098 if sum(weights_del) > 0.:
1100 ax.hist(times, bin_edges, weights=weights_del_inst,
1101 histtype=
"stepfilled",
1103 facecolor=color_fill_peak, edgecolor=color_line_peak,
1104 label=
"Max. inst. lumi.: %.2f %s" % \
1107 tmp_leg = ax.legend(loc=
"upper left",
1108 bbox_to_anchor=(0.025, 0., 1., .97),
1110 tmp_leg.legendHandles[0].set_visible(
False)
1111 for t
in tmp_leg.get_texts():
1112 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1115 fig.suptitle(
r"CMS Peak Luminosity Per Day, " \
1116 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1117 (particle_type_str, year, cms_energy_str),
1118 fontproperties=FONT_PROPS_SUPTITLE)
1119 ax.set_title(
"Data included from %s to %s UTC \n" % \
1120 (str_begin, str_end),
1121 fontproperties=FONT_PROPS_TITLE)
1122 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1123 ax.set_ylabel(
r"Peak Delivered Luminosity (%s)" % \
1125 fontproperties=FONT_PROPS_AX_TITLE)
1129 TweakPlot(fig, ax, (time_begin, time_end),
True)
1134 SavePlot(fig,
"peak_lumi_per_day_%s_%d%s%s" % \
1135 (particle_type_str.lower(), year,
1136 log_suffix, file_suffix))
1141 for type
in [
"lin",
"log"]:
1142 is_log = (type ==
"log")
1145 min_val =
min(weights_rec)
1146 exp = math.floor(math.log10(min_val))
1147 log_setting = math.pow(10., exp)
1150 ax = fig.add_subplot(111)
1152 units =
GetUnits(year, accel_mode,
"cum_day")
1158 if sum(weights_del) > 0.:
1160 ax.hist(times, bin_edges, weights=weights_del,
1161 histtype=
"stepfilled",
1163 facecolor=color_fill_del, edgecolor=color_line_del,
1164 label=
"LHC Delivered, max: %.1f %s/day" % \
1166 ax.hist(times, bin_edges, weights=weights_rec,
1167 histtype=
"stepfilled",
1169 facecolor=color_fill_rec, edgecolor=color_line_rec,
1170 label=
"CMS Recorded, max: %.1f %s/day" % \
1172 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(0.125, 0., 1., 1.01),
1174 for t
in leg.get_texts():
1175 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1177 fig.suptitle(
r"CMS Integrated Luminosity Per Day, " \
1178 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1179 (particle_type_str, year, cms_energy_str),
1180 fontproperties=FONT_PROPS_SUPTITLE)
1181 ax.set_title(
"Data included from %s to %s UTC \n" % \
1182 (str_begin, str_end),
1183 fontproperties=FONT_PROPS_TITLE)
1184 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1185 ax.set_ylabel(
r"Integrated Luminosity (%s/day)" % \
1187 fontproperties=FONT_PROPS_AX_TITLE)
1191 TweakPlot(fig, ax, (time_begin, time_end),
True)
1196 SavePlot(fig,
"int_lumi_per_day_%s_%d%s%s" % \
1197 (particle_type_str.lower(), year,
1198 log_suffix, file_suffix))
1203 units =
GetUnits(year, accel_mode,
"cum_year")
1206 min_del =
min(weights_del_for_cum)
1207 tot_del = sum(weights_del_for_cum)
1208 tot_rec = sum(weights_rec_for_cum)
1209 tot_cert = sum(weights_cert_for_cum)
1211 for type
in [
"lin",
"log"]:
1212 is_log = (type ==
"log")
1215 min_val =
min(weights_del_for_cum)
1216 exp = math.floor(math.log10(min_val))
1217 log_setting = math.pow(10., exp)
1220 ax = fig.add_subplot(111)
1222 if sum(weights_del) > 0.:
1224 ax.hist(times, bin_edges, weights=weights_del_for_cum,
1225 histtype=
"stepfilled", cumulative=
True,
1227 facecolor=color_fill_del, edgecolor=color_line_del,
1228 label=
"LHC Delivered: %.2f %s" % \
1230 ax.hist(times, bin_edges, weights=weights_rec_for_cum,
1231 histtype=
"stepfilled", cumulative=
True,
1233 facecolor=color_fill_rec, edgecolor=color_line_rec,
1234 label=
"CMS Recorded: %.2f %s" % \
1236 if sum(weights_cert_for_cum) > 0.:
1237 ax.hist(times, bin_edges, weights=weights_cert_for_cum,
1238 histtype=
"stepfilled", cumulative=
True,
1240 facecolor=color_fill_cert, edgecolor=color_line_cert,
1241 label=
"CMS Validated: %.2f %s" % \
1243 leg = ax.legend(loc=
"upper left",
1244 bbox_to_anchor=(0.125, 0., 1., 1.01),
1246 for t
in leg.get_texts():
1247 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1250 fig.suptitle(
r"CMS Integrated Luminosity, " \
1251 r"%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1252 (particle_type_str, year, cms_energy_str),
1253 fontproperties=FONT_PROPS_SUPTITLE)
1254 ax.set_title(
"Data included from %s to %s UTC \n" % \
1255 (str_begin, str_end),
1256 fontproperties=FONT_PROPS_TITLE)
1257 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1258 ax.set_ylabel(
r"Total Integrated Luminosity (%s)" % \
1260 fontproperties=FONT_PROPS_AX_TITLE)
1264 ax.text(0.05, 0.7,
"CMS Preliminary",
1265 verticalalignment=
"center", horizontalalignment=
"left",
1266 transform = ax.transAxes, fontsize=15)
1270 TweakPlot(fig, ax, (time_begin, time_end),
1271 add_extra_head_room=is_log)
1276 SavePlot(fig,
"int_lumi_per_day_cumulative_%s_%d%s%s" % \
1277 (particle_type_str.lower(), year,
1278 log_suffix, file_suffix))
1286 print " weekly lumi plots for %d" % year
1288 if not beam_energy_from_cfg:
1289 beam_energy = beam_energy_defaults[accel_mode][year]
1290 cms_energy = 2. * beam_energy
1291 cms_energy_str =
"???"
1292 if accel_mode ==
"PROTPHYS":
1296 cms_energy_str =
"%.*f TeV" % (width, 1.e-3 * cms_energy)
1297 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1298 cms_energy_str =
"%.2f TeV/nucleon" % \
1301 lumi_data = lumi_data_by_week_per_year[year]
1307 datetime.timedelta(days=3, seconds=12*60*60)
1309 datetime.timedelta(days=3, seconds=12*60*60)
1314 num_weeks = week_hi.isocalendar()[1] - week_lo.isocalendar()[1] + 1
1315 bin_edges = np.linspace(matplotlib.dates.date2num(week_lo),
1316 matplotlib.dates.date2num(week_hi),
1318 times_tmp = [
AtMidWeek(i)
for i
in lumi_data.times()]
1319 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1321 units =
GetUnits(year, accel_mode,
"cum_week")
1322 weights_del = lumi_data.lum_del(units)
1323 weights_rec = lumi_data.lum_rec(units)
1325 units =
GetUnits(year, accel_mode,
"cum_year")
1326 weights_del_for_cum = lumi_data.lum_del(units)
1327 weights_rec_for_cum = lumi_data.lum_rec(units)
1329 units =
GetUnits(year, accel_mode,
"max_inst")
1330 weights_del_inst = lumi_data.lum_inst_max(units)
1336 if sum(weights_del) > 0.:
1337 str_begin = lumi_data.time_begin().strftime(DATE_FMT_STR_OUT)
1338 str_end = lumi_data.time_end().strftime(DATE_FMT_STR_OUT)
1343 for color_scheme_name
in color_scheme_names:
1345 print " color scheme '%s'" % color_scheme_name
1347 color_scheme = ColorScheme(color_scheme_name)
1348 color_fill_del = color_scheme.color_fill_del
1349 color_fill_rec = color_scheme.color_fill_rec
1350 color_fill_peak = color_scheme.color_fill_peak
1351 color_line_del = color_scheme.color_line_del
1352 color_line_rec = color_scheme.color_line_rec
1353 color_line_peak = color_scheme.color_line_peak
1354 logo_name = color_scheme.logo_name
1355 file_suffix = color_scheme.file_suffix
1361 for type
in [
"lin",
"log"]:
1362 is_log = (type ==
"log")
1365 min_val =
min(weights_del_inst)
1366 exp = math.floor(math.log10(min_val))
1367 log_setting = math.pow(10., exp)
1370 ax = fig.add_subplot(111)
1372 units =
GetUnits(year, accel_mode,
"max_inst")
1375 max_inst =
max(weights_del_inst)
1377 if sum(weights_del) > 0.:
1379 ax.hist(times, bin_edges, weights=weights_del_inst,
1380 histtype=
"stepfilled",
1382 facecolor=color_fill_peak, edgecolor=color_line_peak,
1383 label=
"Max. inst. lumi.: %.2f %s" % \
1386 tmp_leg = ax.legend(loc=
"upper left",
1387 bbox_to_anchor=(0.025, 0., 1., .97),
1389 tmp_leg.legendHandles[0].set_visible(
False)
1390 for t
in tmp_leg.get_texts():
1391 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1394 fig.suptitle(
r"CMS Peak Luminosity Per Week, " \
1395 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1396 (particle_type_str, year, cms_energy_str),
1397 fontproperties=FONT_PROPS_SUPTITLE)
1398 ax.set_title(
"Data included from %s to %s UTC \n" % \
1399 (str_begin, str_end),
1400 fontproperties=FONT_PROPS_TITLE)
1401 ax.set_xlabel(
r"Date (UTC)",
1402 fontproperties=FONT_PROPS_AX_TITLE)
1403 ax.set_ylabel(
r"Peak Delivered Luminosity (%s)" % \
1405 fontproperties=FONT_PROPS_AX_TITLE)
1409 TweakPlot(fig, ax, (week_lo, week_hi),
True)
1414 SavePlot(fig,
"peak_lumi_per_week_%s_%d%s%s" % \
1415 (particle_type_str.lower(), year,
1416 log_suffix, file_suffix))
1421 for type
in [
"lin",
"log"]:
1422 is_log = (type ==
"log")
1425 min_val =
min(weights_rec)
1426 exp = math.floor(math.log10(min_val))
1427 log_setting = math.pow(10., exp)
1430 ax = fig.add_subplot(111)
1432 units =
GetUnits(year, accel_mode,
"cum_week")
1435 max_del =
max(weights_del)
1436 max_rec =
max(weights_rec)
1438 if sum(weights_del) > 0.:
1440 ax.hist(times, bin_edges, weights=weights_del,
1441 histtype=
"stepfilled",
1443 facecolor=color_fill_del, edgecolor=color_line_del,
1444 label=
"LHC Delivered, max: %.1f %s/week" % \
1446 ax.hist(times, bin_edges, weights=weights_rec,
1447 histtype=
"stepfilled",
1449 facecolor=color_fill_rec, edgecolor=color_line_rec,
1450 label=
"CMS Recorded, max: %.1f %s/week" % \
1452 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(0.125, 0., 1., 1.01),
1454 for t
in leg.get_texts():
1455 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1458 fig.suptitle(
r"CMS Integrated Luminosity Per Week, " \
1459 "%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1460 (particle_type_str, year, cms_energy_str),
1461 fontproperties=FONT_PROPS_SUPTITLE)
1462 ax.set_title(
"Data included from %s to %s UTC \n" % \
1463 (str_begin, str_end),
1464 fontproperties=FONT_PROPS_TITLE)
1465 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1466 ax.set_ylabel(
r"Integrated Luminosity (%s/week)" % \
1468 fontproperties=FONT_PROPS_AX_TITLE)
1472 TweakPlot(fig, ax, (week_lo, week_hi),
True)
1477 SavePlot(fig,
"int_lumi_per_week_%s_%d%s%s" % \
1478 (particle_type_str.lower(), year,
1479 log_suffix, file_suffix))
1484 units =
GetUnits(year, accel_mode,
"cum_year")
1487 min_del =
min(weights_del_for_cum)
1488 tot_del = sum(weights_del_for_cum)
1489 tot_rec = sum(weights_rec_for_cum)
1491 for type
in [
"lin",
"log"]:
1492 is_log = (type ==
"log")
1495 min_val =
min(weights_del_for_cum)
1496 exp = math.floor(math.log10(min_val))
1497 log_setting = math.pow(10., exp)
1500 ax = fig.add_subplot(111)
1502 if sum(weights_del) > 0.:
1504 ax.hist(times, bin_edges, weights=weights_del_for_cum,
1505 histtype=
"stepfilled", cumulative=
True,
1507 facecolor=color_fill_del, edgecolor=color_line_del,
1508 label=
"LHC Delivered: %.2f %s" % \
1510 ax.hist(times, bin_edges, weights=weights_rec_for_cum,
1511 histtype=
"stepfilled", cumulative=
True,
1513 facecolor=color_fill_rec, edgecolor=color_line_rec,
1514 label=
"CMS Recorded: %.2f %s" % \
1516 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(0.125, 0., 1., 1.01),
1518 for t
in leg.get_texts():
1519 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1522 fig.suptitle(
r"CMS Integrated Luminosity, " \
1523 r"%s, %d, $\mathbf{\sqrt{s} =}$ %s" % \
1524 (particle_type_str, year, cms_energy_str),
1525 fontproperties=FONT_PROPS_SUPTITLE)
1526 ax.set_title(
"Data included from %s to %s UTC \n" % \
1527 (str_begin, str_end),
1528 fontproperties=FONT_PROPS_TITLE)
1529 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1530 ax.set_ylabel(
r"Total Integrated Luminosity (%s)" % \
1532 fontproperties=FONT_PROPS_AX_TITLE)
1537 add_extra_head_room=is_log)
1542 SavePlot(fig,
"int_lumi_per_week_cumulative_%s_%d%s%s" % \
1543 (particle_type_str.lower(), year,
1544 log_suffix, file_suffix))
1552 print " cumulative luminosity for %s together" %
", ".
join([str(i)
for i
in years])
1555 """Mode 1: years side-by-side, mode 2: years overlaid."""
1557 units =
GetUnits(years[-1], accel_mode,
"cum_year")
1559 scale_factor_2010 = 100.
1562 for color_scheme_name
in color_scheme_names:
1564 print " color scheme '%s'" % color_scheme_name
1566 color_scheme = ColorScheme(color_scheme_name)
1567 color_by_year = color_scheme.color_by_year
1568 logo_name = color_scheme.logo_name
1569 file_suffix = color_scheme.file_suffix
1571 for type
in [
"lin",
"log"]:
1572 is_log = (type ==
"log")
1575 aspect_ratio = matplotlib.figure.figaspect(1. / 2.5)
1576 fig = plt.figure(figsize=aspect_ratio)
1579 ax = fig.add_subplot(111)
1581 time_begin_ultimate = lumi_data_by_day_per_year[years[0]].
time_begin()
1582 str_begin_ultimate = time_begin_ultimate.strftime(DATE_FMT_STR_OUT)
1583 for (year_index, year)
in enumerate(years):
1585 lumi_data = lumi_data_by_day_per_year[year]
1587 times_tmp = [
AtMidnight(i)
for i
in lumi_data.times()]
1593 for y
in years[:year_index]:
1595 time_shift = datetime.timedelta(days=num_days)
1596 times_tmp = [(i - time_shift) \
1598 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1600 for i
in xrange(len(times) - 1):
1601 assert times[i] < times[i + 1]
1603 weights_del = lumi_data.lum_del(units)
1604 weights_del_cum = [0.] * len(weights_del)
1606 for (i, val)
in enumerate(weights_del):
1608 weights_del_cum[i] = tot_del
1609 if not beam_energy_from_cfg:
1610 beam_energy = beam_energy_defaults[accel_mode][year]
1611 cms_energy = 2. * beam_energy
1612 cms_energy_str =
"???"
1613 if accel_mode ==
"PROTPHYS":
1617 cms_energy_str =
"%.*f TeV" % \
1618 (width, 1.e-3 * cms_energy)
1619 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1620 cms_energy_str =
"%.2f TeV/nucleon" % \
1626 label =
r"%d, %s, %.1f %s" % \
1627 (year, cms_energy_str,
1631 label =
r"%d, %s, %.1f %s" % \
1632 (year, cms_energy_str, tot_del,
1638 weights_tmp = [scale_factor_2010 * i \
1639 for i
in weights_del_cum]
1641 weights_tmp = weights_del_cum
1642 ax.plot(times, weights_tmp,
1643 color=color_by_year[year],
1644 marker=
"none", linestyle=
"solid",
1648 ax.set_yscale(
"log")
1652 ax.annotate(
r"$\times$ %.0f" % scale_factor_2010,
1653 xy=(times[-1], weights_tmp[-1]),
1655 xycoords=
"data", textcoords=
"offset points")
1659 time_begin = lumi_data.time_begin()
1660 time_end = lumi_data.time_end()
1661 str_begin = time_begin.strftime(DATE_FMT_STR_OUT)
1662 str_end = time_end.strftime(DATE_FMT_STR_OUT)
1664 time_begin = datetime.datetime(years[0], 1, 1, 0, 0, 0)
1665 time_end = datetime.datetime(years[-1], 12, 31, 23, 59,59)
1667 time_begin = datetime.datetime(years[0], 1, 1, 0, 0, 0)
1668 time_end = datetime.datetime(years[0], 12, 31, 23, 59,59)
1673 num_cols = len(years)
1680 leg = ax.legend(loc=
"upper left", bbox_to_anchor=(tmp_x, 0., 1., tmp_y),
1681 frameon=
False, ncol=num_cols)
1682 for t
in leg.get_texts():
1683 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1686 fig.suptitle(
r"CMS Integrated Luminosity, %s" % particle_type_str,
1687 fontproperties=FONT_PROPS_SUPTITLE)
1688 ax.set_title(
"Data included from %s to %s UTC \n" % \
1690 (str_begin_ultimate, str_end),
1691 fontproperties=FONT_PROPS_TITLE)
1692 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1693 ax.set_ylabel(
r"Total Integrated Luminosity (%s)" % \
1695 fontproperties=FONT_PROPS_AX_TITLE)
1701 AddLogo(logo_name, ax, zoom=zoom)
1709 TweakPlot(fig, ax, (time_begin_ultimate, time_end),
1710 add_extra_head_room=extra_head_room)
1715 SavePlot(fig,
"int_lumi_cumulative_%s_%d%s%s" % \
1716 (particle_type_str.lower(), mode,
1717 log_suffix, file_suffix))
1720 print " mode %d" % mode
1729 print " peak luminosity for %s together" %
", ".
join([str(i)
for i
in years])
1731 units =
GetUnits(years[-1], accel_mode,
"max_inst")
1733 scale_factor_2010 = 10.
1736 for color_scheme_name
in color_scheme_names:
1738 print " color scheme '%s'" % color_scheme_name
1740 color_scheme = ColorScheme(color_scheme_name)
1741 color_by_year = color_scheme.color_by_year
1742 logo_name = color_scheme.logo_name
1743 file_suffix = color_scheme.file_suffix
1745 for type
in [
"lin",
"log"]:
1746 is_log = (type ==
"log")
1748 aspect_ratio = matplotlib.figure.figaspect(1. / 2.5)
1749 fig = plt.figure(figsize=aspect_ratio)
1750 ax = fig.add_subplot(111)
1752 time_begin_ultimate = lumi_data_by_day_per_year[years[0]].
time_begin()
1753 str_begin_ultimate = time_begin_ultimate.strftime(DATE_FMT_STR_OUT)
1754 for (year_index, year)
in enumerate(years):
1756 lumi_data = lumi_data_by_day_per_year[year]
1758 times_tmp = [
AtMidnight(i)
for i
in lumi_data.times()]
1759 times = [matplotlib.dates.date2num(i)
for i
in times_tmp]
1761 for i
in xrange(len(times) - 1):
1762 assert times[i] < times[i + 1]
1764 weights_inst = lumi_data.lum_inst_max(units)
1765 max_inst =
max(weights_inst)
1766 if not beam_energy_from_cfg:
1767 beam_energy = beam_energy_defaults[accel_mode][year]
1768 cms_energy = 2. * beam_energy
1769 cms_energy_str =
"???"
1770 if accel_mode ==
"PROTPHYS":
1774 cms_energy_str =
"%.*f TeV" % \
1775 (width, 1.e-3 * cms_energy)
1776 elif accel_mode
in [
"IONPHYS",
"PAPHYS"]:
1777 cms_energy_str =
"%.2f TeV/nucleon" % \
1783 label =
r"%d, %s, max. %.1f %s" % \
1784 (year, cms_energy_str,
1788 label =
r"%d, %s, max. %.1f %s" % \
1789 (year, cms_energy_str, max_inst,
1795 weights_tmp = [scale_factor_2010 * i \
1796 for i
in weights_inst]
1798 weights_tmp = weights_inst
1799 ax.plot(times, weights_tmp,
1800 color=color_by_year[year],
1801 marker=
".", markersize=8.,
1805 ax.set_yscale(
"log")
1809 ax.annotate(
r"$\times$ %.0f" % scale_factor_2010,
1810 xy=(times[-1],
max(weights_tmp)),
1812 xycoords=
"data", textcoords=
"offset points")
1816 time_begin = lumi_data.time_begin()
1817 time_end = lumi_data.time_end()
1818 str_begin = time_begin.strftime(DATE_FMT_STR_OUT)
1819 str_end = time_end.strftime(DATE_FMT_STR_OUT)
1820 time_begin = datetime.datetime(years[0], 1, 1, 0, 0, 0)
1821 time_end = datetime.datetime(years[-1], 12, 31, 23, 59,59)
1825 num_cols = len(years) - 2
1828 leg = ax.legend(loc=
"upper left",
1829 bbox_to_anchor=(tmp_x, 0., 1., tmp_y),
1832 frameon=
False, ncol=num_cols)
1833 for t
in leg.get_texts():
1834 t.set_font_properties(FONT_PROPS_TICK_LABEL)
1837 fig.suptitle(
r"CMS Peak Luminosity Per Day, %s" % particle_type_str,
1838 fontproperties=FONT_PROPS_SUPTITLE)
1839 ax.set_title(
"Data included from %s to %s UTC \n" % \
1841 (str_begin_ultimate, str_end),
1842 fontproperties=FONT_PROPS_TITLE)
1843 ax.set_xlabel(
r"Date (UTC)", fontproperties=FONT_PROPS_AX_TITLE)
1844 ax.set_ylabel(
r"Peak Delivered Luminosity (%s)" % \
1846 fontproperties=FONT_PROPS_AX_TITLE)
1850 AddLogo(logo_name, ax, zoom=zoom)
1855 TweakPlot(fig, ax, (time_begin_ultimate, time_end),
1856 add_extra_head_room=head_room)
1861 SavePlot(fig,
"peak_lumi_%s%s%s" % \
1862 (particle_type_str.lower(),
1863 log_suffix, file_suffix))
def GetEnergyPerNucleonScaleFactor
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
static std::string join(char **cmd)
def loadCertificationJSON
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