@@ -198,11 +198,13 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
198198 size_thg = 0.05
199199 offset_thg = 0.85
200200
201- gStyle .SetErrorX (0 )
201+ gStyle .SetErrorX (0 ) # do not plot horizontal error bars of histograms
202202 fontsize = 0.035
203203 opt_leg_g = "FP"
204204 opt_plot_g = "2"
205205
206+ list_new = [] # list to avoid loosing objects created in loops
207+
206208 # labels
207209
208210 x_latex = 0.16
@@ -215,12 +217,14 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
215217 title_full_ratio = ";%s;data/MC: ratio of %s" % (title_x , title_y )
216218
217219 text_alice = "#bf{ALICE} Preliminary, pp, #sqrt{#it{s}} = 13 TeV"
220+ text_alice_sim = "#bf{ALICE} Simulation, pp, #sqrt{#it{s}} = 13 TeV"
218221 text_pythia = "PYTHIA 8 (Monash)"
219222 text_pythia_split = "#splitline{PYTHIA 8}{(Monash)}"
220223 text_jets = "charged jets, anti-#it{k}_{T}, #it{R} = 0.4"
221224 text_ptjet = "%g #leq %s < %g GeV/#it{c}, #left|#it{#eta}_{jet}#right| #leq 0.5" % (lvar2_binmin_reco [ibin2 ], p_latexbin2var , lvar2_binmax_reco [ibin2 ])
222225 text_pth = "%g #leq #it{p}_{T}^{%s} < %g GeV/#it{c}, #left|#it{y}_{%s}#right| #leq 0.8" % (lpt_finbinmin [0 ], p_latexnhadron , min (lpt_finbinmax [- 1 ], lvar2_binmax_reco [ibin2 ]), p_latexnhadron )
223226 text_ptcut = "#it{p}_{T, incl. ch. jet}^{leading track} #geq 5.33 GeV/#it{c}"
227+ text_ptcut_sim = "#it{p}_{T, incl. ch. jet}^{leading h^{#pm}} #geq 5.33 GeV/#it{c} (varied)"
224228 text_sd = "Soft Drop (#it{z}_{cut} = 0.1, #it{#beta} = 0)"
225229
226230 title_thetag = "#it{#theta}_{g} = #it{R}_{g}/#it{R}"
@@ -230,9 +234,17 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
230234 c_hf_data = 0
231235 c_incl_data = 1
232236 c_hf_mc = 2
233- c_incl_mc = 3
234- c_quark_mc = 4
235- c_gluon_mc = 5
237+ c_incl_mc = 6
238+ c_quark_mc = 5
239+ c_gluon_mc = 0
240+
241+ # markers
242+ m_hf_data = get_marker (0 )
243+ m_incl_data = get_marker (1 )
244+ m_hf_mc = get_marker (0 , 2 )
245+ m_incl_mc = get_marker (1 , 2 )
246+ m_quark_mc = get_marker (2 )
247+ m_gluon_mc = get_marker (3 )
236248
237249 # make the horizontal error bars smaller
238250 if shape == "nsd" :
@@ -249,7 +261,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
249261 list_obj = [hf_data_syst , incl_data_syst , hf_data_stat , incl_data_stat ]
250262 labels_obj = ["%s-tagged" % p_latexnhadron , "inclusive" , "" , "" ]
251263 colours = [get_colour (i , j ) for i , j in zip ((c_hf_data , c_incl_data , c_hf_data , c_incl_data ), (2 , 2 , 1 , 1 ))]
252- markers = [get_marker ( i ) for i in ( c_hf_data , c_incl_data , c_hf_data , c_incl_data ) ]
264+ markers = [m_hf_data , m_incl_data , m_hf_data , m_incl_data ]
253265 y_margin_up = 0.46
254266 y_margin_down = 0.05
255267 cshape_data , list_obj_data_new = make_plot ("cshape_data_" + suffix , size = size_can , \
@@ -261,6 +273,13 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
261273 list_obj_data_new [0 ].SetTextSize (fontsize )
262274 if shape == "nsd" :
263275 hf_data_syst .GetXaxis ().SetNdivisions (5 )
276+ # Draw a line through the points.
277+ if shape == "nsd" :
278+ for h in (hf_data_stat , incl_data_stat ):
279+ h_line = h .Clone (h .GetName () + "_line" )
280+ h_line .SetLineStyle (2 )
281+ h_line .Draw ("l hist same" )
282+ list_new .append (h_line )
264283 cshape_data .Update ()
265284 if shape == "rg" :
266285 # plot the theta_g axis
@@ -298,7 +317,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
298317 list_obj = [hf_data_syst_cl , hf_data_stat , hf_pythia_stat ]
299318 labels_obj = ["data" , "" , text_pythia_split ]
300319 colours = [get_colour (i , j ) for i , j in zip ((c_hf_data , c_hf_data , c_hf_mc ), (2 , 1 , 1 ))]
301- markers = [get_marker ( i ) for i in ( c_hf_data , c_hf_data , c_hf_mc ) ]
320+ markers = [m_hf_data , m_hf_data , m_hf_mc ]
302321 y_margin_up = 0.4
303322 y_margin_down = 0.05
304323 cshape_data_mc_hf , list_obj_data_mc_hf_new = make_plot ("cshape_data_mc_hf_" + suffix , size = size_can , \
@@ -355,7 +374,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
355374 list_obj = [incl_data_syst , incl_pythia_syst , incl_data_stat , incl_pythia_stat ]
356375 labels_obj = ["data" , text_pythia_split ]
357376 colours = [get_colour (i , j ) for i , j in zip ((c_incl_data , c_incl_mc , c_incl_data , c_incl_mc ), (2 , 2 , 1 , 1 ))]
358- markers = [get_marker ( i ) for i in ( c_incl_data , c_incl_mc , c_incl_data , c_incl_mc ) ]
377+ markers = [m_incl_data , m_incl_mc , m_incl_data , m_incl_mc ]
359378 y_margin_up = 0.4
360379 y_margin_down = 0.05
361380 cshape_data_mc_incl , list_obj_data_mc_incl_new = make_plot ("cshape_data_mc_incl_" + suffix , size = size_can , \
@@ -411,7 +430,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
411430 list_obj = [hf_ratio_syst , line_1 , incl_ratio_syst , hf_ratio_stat , incl_ratio_stat ]
412431 labels_obj = ["%s-tagged" % p_latexnhadron , "inclusive" ]
413432 colours = [get_colour (i , j ) for i , j in zip ((c_hf_data , c_incl_data , c_hf_data , c_incl_data ), (2 , 2 , 1 , 1 ))]
414- markers = [get_marker ( i ) for i in ( c_hf_data , c_incl_data , c_hf_data , c_incl_data ) ]
433+ markers = [m_hf_data , m_incl_data , m_hf_data , m_incl_data ]
415434 y_margin_up = 0.52
416435 y_margin_down = 0.05
417436 if shape == "nsd" :
@@ -476,14 +495,14 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
476495 list_obj = [incl_pythia_syst , quark_pythia_syst , gluon_pythia_syst , hf_pythia_stat , incl_pythia_stat , quark_pythia_stat , gluon_pythia_stat ]
477496 labels_obj = ["inclusive" , "quark" , "gluon" , "%s-tagged" % p_latexnhadron ]
478497 colours = [get_colour (i , j ) for i , j in zip ((c_incl_mc , c_quark_mc , c_gluon_mc , c_hf_mc , c_incl_mc , c_quark_mc , c_gluon_mc ), (2 , 2 , 2 , 1 , 1 , 1 , 1 ))]
479- markers = [get_marker ( i ) for i in ( c_incl_mc , c_quark_mc , c_gluon_mc , c_hf_mc , c_incl_mc , c_quark_mc , c_gluon_mc ) ]
498+ markers = [m_incl_mc , m_quark_mc , m_gluon_mc , m_hf_mc , m_incl_mc , m_quark_mc , m_gluon_mc ]
480499 y_margin_up = 0.46
481500 y_margin_down = 0.05
482501 cshape_mc , list_obj_mc_new = make_plot ("cshape_mc_" + suffix , size = size_can , \
483502 list_obj = list_obj , labels_obj = labels_obj , opt_leg_g = opt_leg_g , opt_plot_g = opt_plot_g , offsets_xy = offsets_axes , \
484503 colours = colours , markers = markers , leg_pos = leg_pos , range_y = [y_min_plot , y_max_plot ], margins_c = margins_can , \
485504 title = title_full )
486- cshape_ratio .Update ()
505+ cshape_mc .Update ()
487506 for gr , c in zip ((incl_pythia_syst , quark_pythia_syst , gluon_pythia_syst ), (c_incl_mc , c_quark_mc , c_gluon_mc )):
488507 gr .SetMarkerColor (get_colour (c ))
489508 leg_mc = list_obj_mc_new [0 ]
@@ -513,7 +532,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
513532 # Draw LaTeX
514533 y_latex = y_latex_top
515534 list_latex_mc = []
516- for text_latex in [text_alice , text_jets , text_ptjet , text_pth , text_ptcut , text_sd ]:
535+ for text_latex in [text_alice_sim , text_jets , text_ptjet , text_pth , text_ptcut_sim , text_sd ]:
517536 latex = TLatex (x_latex , y_latex , text_latex )
518537 list_latex_mc .append (latex )
519538 draw_latex (latex , textsize = fontsize )
@@ -528,14 +547,14 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
528547 list_obj = [quark_pythia_syst , gluon_pythia_syst , hf_pythia_stat , quark_pythia_stat , gluon_pythia_stat ]
529548 labels_obj = ["quark" , "gluon" , "%s-tagged" % p_latexnhadron ]
530549 colours = [get_colour (i , j ) for i , j in zip ((c_quark_mc , c_gluon_mc , c_hf_mc , c_quark_mc , c_gluon_mc ), (2 , 2 , 1 , 1 , 1 ))]
531- markers = [get_marker ( i ) for i in ( c_quark_mc , c_gluon_mc , c_hf_mc , c_quark_mc , c_gluon_mc ) ]
550+ markers = [m_quark_mc , m_gluon_mc , m_hf_mc , m_quark_mc , m_gluon_mc ]
532551 y_margin_up = 0.46
533552 y_margin_down = 0.05
534553 cshape_mc , list_obj_mc_new = make_plot ("cshape_mc_qgd_" + suffix , size = size_can , \
535554 list_obj = list_obj , labels_obj = labels_obj , opt_leg_g = opt_leg_g , opt_plot_g = opt_plot_g , offsets_xy = offsets_axes , \
536555 colours = colours , markers = markers , leg_pos = leg_pos , range_y = [y_min_plot , y_max_plot ], margins_c = margins_can , \
537556 title = title_full )
538- cshape_ratio .Update ()
557+ cshape_mc .Update ()
539558 for gr , c in zip ((quark_pythia_syst , gluon_pythia_syst ), (c_quark_mc , c_gluon_mc )):
540559 gr .SetMarkerColor (get_colour (c ))
541560 leg_mc = list_obj_mc_new [0 ]
@@ -565,7 +584,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
565584 # Draw LaTeX
566585 y_latex = y_latex_top
567586 list_latex_mc = []
568- for text_latex in [text_alice , text_jets , text_ptjet , text_pth , text_ptcut , text_sd ]:
587+ for text_latex in [text_alice_sim , text_jets , text_ptjet , text_pth , text_ptcut_sim , text_sd ]:
569588 latex = TLatex (x_latex , y_latex , text_latex )
570589 list_latex_mc .append (latex )
571590 draw_latex (latex , textsize = fontsize )
@@ -577,17 +596,24 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
577596
578597 #leg_pos = [.6, .65, .75, .85]
579598 leg_pos = [.72 , .67 , .85 , .85 ]
580- list_obj = [incl_pythia_syst_cl , hf_pythia_stat , incl_pythia_stat ]
581- labels_obj = ["inclusive" , "%s-tagged" % p_latexnhadron ]
582- colours = [get_colour (i , j ) for i , j in zip ((c_incl_mc , c_hf_mc , c_incl_mc ), (2 , 1 , 1 ))]
583- markers = [get_marker ( i ) for i in ( c_incl_mc , c_hf_mc , c_incl_mc ) ]
599+ list_obj = [incl_pythia_syst_cl , incl_pythia_stat , hf_pythia_stat ]
600+ labels_obj = ["inclusive" , "" , " %s-tagged" % p_latexnhadron ]
601+ colours = [get_colour (i , j ) for i , j in zip ((c_incl_mc , c_incl_mc , c_hf_mc ), (2 , 1 , 1 ))]
602+ markers = [m_incl_mc , m_incl_mc , m_hf_mc ]
584603 y_margin_up = 0.46
585604 y_margin_down = 0.05
586605 cshape_mc , list_obj_mc_new = make_plot ("cshape_mc_id_" + suffix , size = size_can , \
587606 list_obj = list_obj , labels_obj = labels_obj , opt_leg_g = opt_leg_g , opt_plot_g = opt_plot_g , offsets_xy = offsets_axes , \
588607 colours = colours , markers = markers , leg_pos = leg_pos , range_y = [y_min_plot , y_max_plot ], margins_c = margins_can , \
589608 title = title_full )
590- cshape_ratio .Update ()
609+ # Draw a line through the points.
610+ if shape == "nsd" :
611+ for h in (incl_pythia_stat , hf_pythia_stat ):
612+ h_line = h .Clone (h .GetName () + "_line" )
613+ h_line .SetLineStyle (2 )
614+ h_line .Draw ("l hist same" )
615+ list_new .append (h_line )
616+ cshape_mc .Update ()
591617 incl_pythia_syst_cl .SetMarkerColor (get_colour (c_incl_mc ))
592618 leg_mc = list_obj_mc_new [0 ]
593619 leg_mc .SetTextSize (fontsize )
@@ -616,7 +642,7 @@ def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-bra
616642 # Draw LaTeX
617643 y_latex = y_latex_top
618644 list_latex_mc = []
619- for text_latex in [text_alice , text_jets , text_ptjet , text_pth , text_ptcut , text_sd ]:
645+ for text_latex in [text_alice_sim , text_jets , text_ptjet , text_pth , text_ptcut_sim , text_sd ]:
620646 latex = TLatex (x_latex , y_latex , text_latex )
621647 list_latex_mc .append (latex )
622648 draw_latex (latex , textsize = fontsize )
0 commit comments