How to use make_styler method in Slash

Best Python code snippet using slash

WHPlotterEET.py

Source:WHPlotterEET.py Github

copy

Full Screen

...47 ## # Make Z->mumu + tau jet control48 ## #49 ## # Makes Tau fr control plot50 ## #51 ## zmm_weighted = plotter.plot('data', 'os/p1p2f3/w3/e1_e2_Mass', 'hist', styler=make_styler(2, 'hist'), xrange=(60, 120))52 ## zmm_weighted.SetTitle("Zee + fake #tau_{h} est.")53 ## zmm_weighted.legendstyle='l'54 ## zmm_weighted.GetXaxis().SetTitle("m_{ee} (GeV)")55 ## zmm_unweighted = plotter.plot('data', 'os/p1p2p3/e1_e2_Mass', 'same', styler=make_styler(1), xrange=(60, 120))56 ## zmm_unweighted.SetTitle("Zee observed")57 ## zmm_unweighted.SetTitle("Zee + fake #tau_{h} obs.")58 ## zmm_unweighted.legendstyle='pe'59 ## plotter.add_legend([zmm_weighted, zmm_unweighted])60 ## plotter.add_cms_blurb(sqrts)61 ## plotter.save('zmm-os-fr-control')62 ## #63 ## # Makes charge fr control plot64 ## #65 ## zeet_os_weighted = plotter.plot('data', 'os/p1p2f3/c1/e1_e2_Mass', 'hist', styler=make_styler(2, 'hist'), xrange=(60, 120))66 ## zeet_os_weighted.SetTitle("Ze^{#pm}e^{#mp} + fake #tau_{h} charge flip est.")67 ## zeet_os_weighted.legendstyle='l'68 ## zeet_os_weighted.GetXaxis().SetTitle("M_{ee} (GeV)")69 ## zee_ss_unweighted = plotter.plot('data', 'ss/p1p2f3/e1_e2_Mass', 'same', styler=make_styler(1), xrange=(60, 120))70 ## zee_ss_unweighted.SetTitle("Ze^{#pm}e^{#pm} + fake #tau_{h} obs.")71 ## zee_ss_unweighted.legendstyle='pe'72 ## plotter.add_legend([zeet_os_weighted, zee_ss_unweighted])73 ## plotter.add_cms_blurb(sqrts)74 ## plotter.save('zee-os-ss-charge-flip-control')75 ## plotter.plot('Zjets_M50', 'os/p1p2f3/weight')76 ## plotter.save('zee-mc-event-weights')77 ## # Check MC weights78 ## ## plotter.plot('Zjets_M50', 'os/p1p2f3/weight_nopu')79 ## ## plotter.save('zee-mc-event-weight_nopu')80 ## ###########################################################################81 ## ## FR sideband MC-vs-Data ################################################82 ## ###########################################################################83 ## plotter.plot_mc_vs_data('ss/p1f2p3', 'e1Pt', rebin=10, xaxis='e_{1} p_{T} (GeV)', leftside=False)...

Full Screen

Full Screen

WHPlotterMMT.py

Source:WHPlotterMMT.py Github

copy

Full Screen

...65 plotter.save('mcdata-os-p1p2p3-rho')66 plotter.plot_mc_vs_data('os/p1p2p3', 'nvtx')67 plotter.save('mcdata-os-p1p2p3-nvtx')68 # Make Z->mumu + tau jet control69 antiiso_m2JetPt = plotter.plot('data', 'ss/p1f2p3/m2JetPt', 'hist', styler=make_styler(2, 'hist'), xrange=(0, 120), rebin=10)70 antiiso_m2JetPt.SetTitle("Anti-iso CR yield")71 antiiso_m2JetPt.legendstyle='l'72 antiiso_m2JetPt.GetXaxis().SetTitle("#mu_{2} Jet Pt")73 plotter.save('data-p1f2p3-m2JetPt')74 antiiso_m1JetPt = plotter.plot('data', 'ss/f1p2p3/m1JetPt', 'hist', styler=make_styler(2, 'hist'), xrange=(0, 120), rebin=10)75 antiiso_m1JetPt.SetTitle("Anti-iso CR yield")76 antiiso_m1JetPt.legendstyle='l'77 antiiso_m1JetPt.GetXaxis().SetTitle("#mu_{1} Jet Pt")78 plotter.save('data-f1p2p3-m1JetPt')79 zmm_weighted = plotter.plot('data', 'os/p1p2f3/w3/m1_m2_Mass', 'hist', styler=make_styler(2, 'hist'), xrange=(60, 120))80 zmm_weighted.SetTitle("Z#mu#mu + fake #tau_{h} est.")81 zmm_weighted.legendstyle='l'82 zmm_weighted.GetXaxis().SetTitle("m_{#mu#mu} (GeV)")83 zmm_unweighted = plotter.plot('data', 'os/p1p2p3/m1_m2_Mass', 'same', styler=make_styler(1), xrange=(60, 120))84 zmm_unweighted.SetTitle("Z#mu#mu observed")85 zmm_unweighted.SetTitle("Z#mu#mu + fake #tau_{h} obs.")86 zmm_unweighted.legendstyle='pe'87 plotter.add_legend([zmm_weighted, zmm_unweighted])88 plotter.add_cms_blurb(sqrts)89 plotter.save('zmm-os-fr-control')90 ## plotter.plot('data', 'os/p1p2p3/prescale', styler=make_styler(1))91 ## plotter.save('zmm-os-prescale-check')92 plotter.plot('Zjets_M50', 'os/p1p2f3/weight')93 plotter.save('zmm-mc-event-weights')94 # Check MC weights95 ## plotter.plot('Zjets_M50', 'os/p1p2f3/weight_nopu')96 ## plotter.save('zmm-mc-event-weight_nopu')97 plotter.plot('Zjets_M50', 'os/p1p2f3/nTruePU', 'nTruePU', rebin=1, xaxis='True PU')98 plotter.save('zjets-os-p1p2f3-nTruePU')99 ###########################################################################100 ## FR sideband MC-vs-Data ################################################101 ###########################################################################102 plotter.plot_mc_vs_data('ss/p1f2p3', 'm1Pt', rebin=10, xaxis='#mu_{1} p_{T} (GeV)', leftside=False)103 plotter.add_cms_blurb(sqrts)104 plotter.save('mcdata-ss-p1f2p3-m1Pt')...

Full Screen

Full Screen

WHPlotterEMT.py

Source:WHPlotterEMT.py Github

copy

Full Screen

...50 #plotter.save('mcdata-os-p1p2p3-rho')51 #plotter.plot_mc_vs_data('os/p1p2p3', 'nvtx')52 #plotter.save('mcdata-os-p1p2p3-nvtx')53 # Make Z->mumu + tau jet control54 weighted = plotter.plot('data', 'os/p1p2f3/w3/e_m_Mass', 'hist', rebin=20, styler=make_styler(2, 'hist'), xaxis='m_{e#mu} (GeV)')55 unweighted = plotter.plot('data', 'os/p1p2p3/e_m_Mass', 'same', rebin=20, styler=make_styler(1), xaxis='m_{e#mu} (GeV)')56 weighted.SetTitle('e^{+}#mu^{-} + fake #tau_{h} est.')57 weighted.legendstyle = 'l'58 unweighted.SetTitle('e^{+}#mu^{-} + fake #tau_{h} obs.')59 unweighted.legendstyle = 'pe'60 plotter.add_legend([weighted, unweighted])61 plotter.add_cms_blurb(sqrts)62 plotter.save('ztt-os-fr-control')63 #plotter.plot('data', 'os/p1p2p3/prescale', styler=make_styler(1))64 #plotter.save('ztt-os-prescale-check')65 #plotter.plot('Zjets_M50', 'os/p1p2f3/weight')66 #plotter.save('ztt-mc-event-weights')67 ## Check MC weights68 #plotter.plot('Zjets_M50', 'os/p1p2f3/weight_nopu')69 #plotter.save('ztt-mc-event-weight_nopu')70 ###########################################################################71 ## FR sideband MC-vs-Data ################################################72 ###########################################################################73 plotter.plot_mc_vs_data('ss/p1f2p3', 'mPt', 5, '#mu_{1} p_{T}', leftside=False)74 plotter.save('mcdata-ss-p1f2p3-mPt')75 plotter.plot_mc_vs_data('ss/p1f2p3', 'subMass', 20, 'Subleading mass (GeV)', leftside=False)76 plotter.save('mcdata-ss-p1f2p3-subMass')77 plotter.plot_mc_vs_data('ss/p1p2f3', 'subMass', 20, 'Subleading mass (GeV)', leftside=False)...

Full Screen

Full Screen

cli_utils.py

Source:cli_utils.py Github

copy

Full Screen

...111 def colorize(self):112 if self.style:113 return '{}{}{}'.format(self.style, self, COLOR_RESET)114 return str(self)115def make_styler(style):116 return lambda string: ColorizedString(string, style=style)117UNDERLINED = '\x1b[4m'118class Printer(object):119 def __init__(self, report_stread, enable_output=True, force_color=False, enable_color=True, error_stream=None):120 self._stream = report_stread121 self._error_stream = error_stream if error_stream is not None else self._stream122 self._output_enabled = enable_output123 self._force_color = force_color124 self._color_enabled = enable_color125 def _colored_print(self, *args, **print_kwargs):126 self._print(*(getattr(arg, 'colorize', arg.__str__)() for arg in args), **print_kwargs)127 def _print(self, *args, **print_kwargs):128 is_error = print_kwargs.pop('error', False)129 print_kwargs['file'] = self._error_stream if is_error else self._stream...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Slash automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful