-
Notifications
You must be signed in to change notification settings - Fork 2
/
plot_log_separado.py
63 lines (50 loc) · 1.68 KB
/
plot_log_separado.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- coding: utf-8 -*-
"""
Created on Tue May 21 13:53:38 2019
@author: H_Mion
"""
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
ds = pd.read_csv('DoubleMuRun2011A.csv')
invariant_mass_1 = ds['M']
no_bins = 300
# Let's calculate the logarithms of the masses and weighs.
inv_mass_log = np.log10(invariant_mass_1)
#print(inv_mass_log.min(),inv_mass_log.max())
#print("")
weights = []
for a in invariant_mass_1:
weights.append(no_bins/np.log(10)/a)
# Let's plot the weighted histogram.
plt.title('The histogram of the invariant masses of two muons \n')
plt.hist(inv_mass_log, bins=no_bins, range=(-0.5,2.5))
plt.yscale('log')
plt.show()
plt.title('Picos Rô, ômega \n')
plt.hist(inv_mass_log, bins=no_bins, range=(-0.15,-0.05), weights=weights, color="red")
plt.yscale('log')
plt.show()
plt.title('Pico Phi \n')
plt.hist(inv_mass_log, bins=no_bins, range=(-0.09,0.09), weights=weights, color="red")
plt.yscale('log')
plt.show()
plt.title('Pico J/Psi \n')
plt.hist(inv_mass_log, bins=no_bins, range=(0.43,0.55), weights=weights, color="red")
plt.yscale('log')
plt.show()
plt.title('Pico Psi linha \n')
plt.hist(inv_mass_log, bins=no_bins, range=(0.51,0.62), weights=weights, color="red")
plt.yscale('log')
plt.show()
plt.title('Pico Upsilon \n')
plt.hist(inv_mass_log, bins=no_bins, range=(0.96,1.05), weights=weights, color="red")
plt.yscale('log')
plt.show()
plt.title('Pico Z \n')
plt.hist(inv_mass_log, bins=no_bins, range=(1.85,2.05), weights=weights, color="red")
plt.yscale('log')
# Naming the labels and the title.
plt.xlabel('log10(invariant mass) [log10(GeV)]')
plt.ylabel('Number of the events')
plt.show()