M_vs_M_Q_14.SetBinX(500) M_vs_M_Q_14.SetBinY(500) M_vs_M_Q_14.SetFigTitle(r'M:M_Q 14$\degree$', 20) M_vs_M_Q_14.SetLabelX('M_Q', 20) M_vs_M_Q_14.SetLabelY('M', 20) M_vs_M_Q_14.SetSizeTicksX(10) M_vs_M_Q_14.SetBoxText( 'Selection:\n Z>0 \n Zi>0 \n M>0 \n -100<Pf<100 \n -110<Yf<50 \n Xf>-1500' ) M_vs_M_Q_14.Histo_2D() #Draw it ######### Save and show the created figure M_vs_M_Q_14.SetOutDir(basepath + 'Modules/' + MODULE_name + '/Outputfiles/Figures/Raw_figures/') M_vs_M_Q_14.SaveFig('M_vs_M_Q_14') M_vs_M_Q_14.Show(1) #show during 1 seconds, the close authomatically M_vs_M_Q_14.Close() #close all windows, axes and figures running backend del M_vs_M_Q_14 #erase M_vs_M_Q_14 (is an object) ################################################################## 21 degrees M_vs_M_Q_21 = Plotter([ data_21_degrees['M_Q'][condition_21], data_21_degrees['M'][condition_21] ]) #Create the base with the variables in a object M_vs_M_Q_21.SetFigSize(12, 7) M_vs_M_Q_21.SetBinX(500) M_vs_M_Q_21.SetBinY(500) M_vs_M_Q_21.SetFigTitle(r'M:M_Q 21$\degree$', 20) M_vs_M_Q_21.SetLabelX('M_Q', 20) M_vs_M_Q_21.SetLabelY('M', 20) M_vs_M_Q_21.SetSizeTicksX(10) M_vs_M_Q_21.SetBoxText( 'Selection:\n Z>0 \n Zi>0 \n M>0 \n -100<Pf<100 \n -110<Yf<50 \n Xf>-1500'
Histo1D_object.SetBinX(100) Histo1D_object.SetFigTitle('Variable 1 histogram 1D', 20) Histo1D_object.SetLimX((0.0, 2.0)) Histo1D_object.SetLabelX('Variable 1', 15) ######### Generate the histogram Histo1D_object.Histo_1D() ######### Save and show the created figure Histo1D_object.SetOutDir(basepath + 'Modules/' + MODULE_name + '/Outputfiles/Figures/') Histo1D_object.SaveFig('figure_TEST_Histo1D') Histo1D_object.Show( 1 ) #show during 1 seconds, then close authomatically. Leave empty for normal plt.show() Histo1D_object.Close() #close all windows, axes and figures running backend del Histo1D_object #erase Histo1D_object ################################################ Bar_diagram() function ######################################################################################### Bar_diagram_object = Plotter( [['a', 'e', 'i', 'o', 'u'], [4, 3, 3, 4, 7]]) #Create the base with (tags, frequency) respectively ######### Some options Bar_diagram_object.SetFigSize(10, 7) Bar_diagram_object.SetFigTitle('Variable Bar diagram', 20) Bar_diagram_object.SetLabelX('Variable 1', 15) ######### Generate the bar diagram Bar_diagram_object.Bar_diagram()
M_vs_M_Q_14.SetBinX(50) M_vs_M_Q_14.SetBinY(50) M_vs_M_Q_14.SetFigTitle(r'run97 M vs M_Q 14$\degree$', 20) M_vs_M_Q_14.SetLabelX('M_Q', 20) M_vs_M_Q_14.SetLabelY('M', 20) M_vs_M_Q_14.SetSizeTicksX(10) M_vs_M_Q_14.SetBoxText( 'Selection:\n Z>0 \n Zi>0 \n 70<M<180 \n 2.25<M_Q<4.0 \n -100<Pf<100 \n -110<Yf<50 \n Xf>-1500 \n MW_Nr>=0' ) M_vs_M_Q_14.Histo_2D() #Draw it ######### Save and show the created figure M_vs_M_Q_14.SetOutDir(basepath + 'Modules/' + MODULE_name + '/Outputfiles/Figures/') M_vs_M_Q_14.SaveFig('M_vs_M_Q_14_run97') M_vs_M_Q_14.Show(1) #show during 1 seconds, the close authomatically M_vs_M_Q_14.Close() #close all windows, axes and figures running backend del M_vs_M_Q_14 #erase M_vs_M_Q_14 (is an object) ################################################ 21 degrees ################################################################ data_hdf5_21 = RAS.Read_hdf5_file(Path_to_tree, 'data_runs_21') M_vs_M_Q_21 = Plotter([data_hdf5_21['M_Q'], data_hdf5_21['M'] ]) #Create the base with the variables in a object M_vs_M_Q_21.SetFigSize(12, 7) M_vs_M_Q_21.SetBinX(500) M_vs_M_Q_21.SetBinY(500) M_vs_M_Q_21.SetFigTitle(r'run124 M vs M_Q 21$\degree$', 20) M_vs_M_Q_21.SetLabelX('M_Q', 20) M_vs_M_Q_21.SetLabelY('M', 20) M_vs_M_Q_21.SetSizeTicksX(10) M_vs_M_Q_21.SetBoxText(
################################################################## 14 degrees Yf_vs_Xf_14 = Plotter([data_14_degrees['Xf'][condition_14], data_14_degrees['Yf'][condition_14]]) #Create the base with the variables in a object Yf_vs_Xf_14.SetFigSize(12,7) Yf_vs_Xf_14.SetBinX(500) Yf_vs_Xf_14.SetBinY(500) Yf_vs_Xf_14.SetFigTitle(r'Yf:Xf 14$\degree$', 20) Yf_vs_Xf_14.SetLabelX('Xf [mm]', 20) Yf_vs_Xf_14.SetLabelY('Yf [mm]', 20) Yf_vs_Xf_14.SetSizeTicksX(10) Yf_vs_Xf_14.SetBoxText('Selection:\n Z>0 \n Zi>0 \n M>0 \n Xf>-1500 \n Yf>-1500') Yf_vs_Xf_14.Histo_2D() #Draw it ######### Save and show the created figure Yf_vs_Xf_14.SetOutDir(basepath + 'Modules/' + MODULE_name + '/Outputfiles/Figures/') Yf_vs_Xf_14.SaveFig('Yf_vs_Xf_14') Yf_vs_Xf_14.Show(1) #show during 1 seconds, the close authomatically Yf_vs_Xf_14.Close() #close all windows, axes and figures running backend del Yf_vs_Xf_14 #erase Yf_vs_Xf_14 (is an object) Pf_vs_Tf_14_mrad = Plotter([data_14_degrees['Tf'][condition_14], data_14_degrees['Pf'][condition_14]]) #Create the base with the variables in a object Pf_vs_Tf_14_mrad.SetFigSize(12,7) Pf_vs_Tf_14_mrad.SetBinX(500) Pf_vs_Tf_14_mrad.SetBinY(500) Pf_vs_Tf_14_mrad.SetFigTitle(r'Pf:Tf 14$\degree$', 20) Pf_vs_Tf_14_mrad.SetLabelX('Tf [mrad]', 20) Pf_vs_Tf_14_mrad.SetLabelY('Pf [mrad]', 20) Pf_vs_Tf_14_mrad.SetSizeTicksX(10) Pf_vs_Tf_14_mrad.SetBoxText('Selection:\n Z>0 \n Zi>0 \n M>0 \n Xf>-1500 \n Yf>-1500') Pf_vs_Tf_14_mrad.Histo_2D() #Draw it ######### Save and show the created figure Pf_vs_Tf_14_mrad.SetOutDir(basepath + 'Modules/' + MODULE_name + '/Outputfiles/Figures/')
##### make histograms in X to see the position of highs ######## left, width = 0.18, 0.45 bottom, height = 0.1, 0.40 bottom_h = left_h = left + width + 0.02 # definition of the rectangule-places for X-Histogram rect_histx = [left, bottom_h, width, 0.2] # define the axes for each plot-zone axHistx = plt.axes(rect_histx) axHistx.plot(bin_edges, histo) axHistx.plot(bin_edges[peaks], histo[peaks], "x") ######### Save and show the created figure M_vs_M_Q_14_pattern_q.SetOutDir(basepath + 'Modules/' + MODULE_name + '/Outputfiles/Figures/14_degrees_pattern_and_q_peaks/') M_vs_M_Q_14_pattern_q.SaveFig('M_vs_M_Q_14_pattern_q_%i' %q) M_vs_M_Q_14_pattern_q.Show(1) #show during 1 seconds, the close authomatically M_vs_M_Q_14_pattern_q.Close() #close all windows, axes and figures running backend del M_vs_M_Q_14_pattern_q #erase M_vs_M_Q_14_pattern_q (is an object) #make the difference between pattern and peaks q_data = bin_edges[peaks] q_pattern = np.array([]) diff_pattern_q = np.array([]) #finding (matching pattern to peaks) first index of first element to match with peaks (the pattern is longer than q_data peaks always) bool_q_x = np.where(q_x >= q_data[0]) bool_q_x = bool_q_x[0] q_pattern = q_x[bool_q_x[0:len(q_data)]] if len(q_pattern) == len(q_data): diff_pattern_q = q_pattern - q_data