|
@@ -57,7 +57,7 @@ def plot_residuals_v_ladder(rs, var, layer):
|
|
|
fmt_var = {'phi': r'\phi',
|
|
|
'z': 'z',
|
|
|
}[var]
|
|
|
- scale = {'phi': 10**6,
|
|
|
+ scale = {'phi': 10**3,
|
|
|
'z': 10**4,
|
|
|
}[var]
|
|
|
xlabel = {'phi': r'$\Delta \phi_1$(rad)',
|
|
@@ -80,7 +80,6 @@ def plot_residuals_v_ladder(rs, var, layer):
|
|
|
@decl_plot
|
|
|
def sc_extrapolation_first(rs, var, layer, hit, even_odd, log=False, norm=None, cut=None):
|
|
|
''' Raphael's plots '''
|
|
|
- errors = True
|
|
|
|
|
|
# def preproc(h):
|
|
|
# return hist_slice(hist(h.ProjectionY()), (-0.07, 0.07))
|
|
@@ -118,7 +117,7 @@ def sc_extrapolation_first(rs, var, layer, hit, even_odd, log=False, norm=None,
|
|
|
('z', 'B2', 2, 'odd'): rs.sc_second_hits_in_B2_dz_odd,
|
|
|
('z', 'B3', 2, 'odd'): rs.sc_second_hits_in_B3_dz_odd,
|
|
|
}[(var, layer, hit, even_odd)]
|
|
|
- scale = {'phi': 10**6,
|
|
|
+ scale = {'phi': 10**3,
|
|
|
'z': 10**4,
|
|
|
}[var]
|
|
|
varlabel = {('z', 1): r"$\Delta z_1(\mu \mathrm{m})$",
|
|
@@ -144,8 +143,12 @@ def generate_dashboard(plots):
|
|
|
|
|
|
env = Environment(
|
|
|
loader=PackageLoader('plots', 'templates'),
|
|
|
- autoescape=select_autoescape(['htm', 'html', 'xml'])
|
|
|
+ autoescape=select_autoescape(['htm', 'html', 'xml']),
|
|
|
)
|
|
|
+ env.globals.update({'quote': quote,
|
|
|
+ 'enumerate': enumerate,
|
|
|
+ 'zip': zip,
|
|
|
+ })
|
|
|
|
|
|
def render_to_file(template_name, **kwargs):
|
|
|
with open(join('output', template_name), 'w') as tempout:
|
|
@@ -159,9 +162,7 @@ def generate_dashboard(plots):
|
|
|
l = l[n:]
|
|
|
|
|
|
render_to_file('dashboard.htm', plots=get_by_n(plots, 3),
|
|
|
- outdir="figures/",
|
|
|
- quote=quote,
|
|
|
- enumerate=enumerate)
|
|
|
+ outdir="figures/")
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
@@ -205,18 +206,19 @@ if __name__ == '__main__':
|
|
|
dz1_v_ladder_B1 = (plot_residuals_v_ladder, (rs, 'z', 'B1'), {})
|
|
|
dz1_v_ladder_B2 = (plot_residuals_v_ladder, (rs, 'z', 'B2'), {})
|
|
|
|
|
|
- dphi1_sc_ex_B1 = (sc_extrapolation_first, (rs, 'phi', 'B1', 1, 'either'), {'log': True, 'norm': 1.0})
|
|
|
- dphi1_sc_ex_B2 = (sc_extrapolation_first, (rs, 'phi', 'B2', 1, 'either'), {'log': True, 'norm': 1.0})
|
|
|
+ opts = {'log': False, 'norm': 1.0, 'cut': 25}
|
|
|
+ dphi1_sc_ex_B1 = (sc_extrapolation_first, (rs, 'phi', 'B1', 1, 'either'), opts )
|
|
|
+ dphi1_sc_ex_B2 = (sc_extrapolation_first, (rs, 'phi', 'B2', 1, 'either'), opts)
|
|
|
dz1_sc_ex_B1 = (sc_extrapolation_first, (rs, 'z', 'B1', 1, 'either'), {'norm': 1.0})
|
|
|
dz1_sc_ex_B2 = (sc_extrapolation_first, (rs, 'z', 'B2', 1, 'either'), {'norm': 1.0})
|
|
|
|
|
|
- dphi1_sc_ex_B1_even = (sc_extrapolation_first, (rs, 'phi', 'B1', 1, 'even'), {'log': True, 'norm': 1.0})
|
|
|
- dphi1_sc_ex_B2_even = (sc_extrapolation_first, (rs, 'phi', 'B2', 1, 'even'), {'log': True, 'norm': 1.0})
|
|
|
+ dphi1_sc_ex_B1_even = (sc_extrapolation_first, (rs, 'phi', 'B1', 1, 'even'), opts)
|
|
|
+ dphi1_sc_ex_B2_even = (sc_extrapolation_first, (rs, 'phi', 'B2', 1, 'even'), opts)
|
|
|
dz1_sc_ex_B1_even = (sc_extrapolation_first, (rs, 'z', 'B1', 1, 'even'), {'norm': 1.0})
|
|
|
dz1_sc_ex_B2_even = (sc_extrapolation_first, (rs, 'z', 'B2', 1, 'even'), {'norm': 1.0})
|
|
|
|
|
|
- dphi1_sc_ex_B1_odd = (sc_extrapolation_first, (rs, 'phi', 'B1', 1, 'odd'), {'log': True, 'norm': 1.0})
|
|
|
- dphi1_sc_ex_B2_odd = (sc_extrapolation_first, (rs, 'phi', 'B2', 1, 'odd'), {'log': True, 'norm': 1.0})
|
|
|
+ dphi1_sc_ex_B1_odd = (sc_extrapolation_first, (rs, 'phi', 'B1', 1, 'odd'), opts)
|
|
|
+ dphi1_sc_ex_B2_odd = (sc_extrapolation_first, (rs, 'phi', 'B2', 1, 'odd'), opts)
|
|
|
dz1_sc_ex_B1_odd = (sc_extrapolation_first, (rs, 'z', 'B1', 1, 'odd'), {'norm': 1.0})
|
|
|
dz1_sc_ex_B2_odd = (sc_extrapolation_first, (rs, 'z', 'B2', 1, 'odd'), {'norm': 1.0})
|
|
|
|
|
@@ -248,6 +250,9 @@ if __name__ == '__main__':
|
|
|
Plot([[dphi1_sc_ex_B1_odd, dphi1_sc_ex_B2_odd],
|
|
|
[dz1_sc_ex_B1_odd, dz1_sc_ex_B2_odd]],
|
|
|
'sc_ex_1_odd'),
|
|
|
+ Plot([[[dphi1_sc_ex_B1_odd, dphi1_sc_ex_B1_even], "FL"],
|
|
|
+ [dz1_sc_ex_B1_odd, dz1_sc_ex_B1_even]],
|
|
|
+ 'sc_ex_1_odd_v_even'),
|
|
|
]
|
|
|
|
|
|
# Finally, render and save the plots and generate the html+bootstrap
|