Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parametrized functions #5

Closed
bdrum opened this issue Jun 17, 2020 · 1 comment
Closed

Add parametrized functions #5

bdrum opened this issue Jun 17, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request software Issue dedicated to software

Comments

@bdrum
Copy link
Owner

bdrum commented Jun 17, 2020

Now here
I just play with data and get correct pt, but now I have to get pt for different data for comparison and so on

@bdrum bdrum added the enhancement New feature or request label Jun 17, 2020
@bdrum bdrum self-assigned this Jun 17, 2020
@bdrum bdrum added the software Issue dedicated to software label Jun 27, 2020
@bdrum
Copy link
Owner Author

bdrum commented Jul 6, 2020

Add wrapper to histogram

Now, e.g. to draw few histograms on the one figure I use this.

But I would like to generalize it:

Parameters:

  • label
  • legend
  • ranges
  • sizes
  • log
fig = plt.figure(figsize=(15, 7))
ax = fig.add_axes([0,0,1,1])
fig.suptitle(f'4pr Mass | {0} < pt <= {0.15}', fontsize=32)
plt.style.use(hep.style.ROOT)
GoodEvents = GetGoodEvents()
counts, bins = np.histogram(GetMass(Draw=False), bins=100, range=(0,4))
_ = ax.hist(GetMass(Draw=False), bins=bins, color='black', histtype='step', label=f'Q = 0;Entries {np.sum(counts)}')
GoodEvents = GetGoodEvents(ChargeEqualCondition=False)
counts, bins = np.histogram(GetMass(ChargeEqualCondition=False,Draw=False), bins=100, range=(0,4))
_ = ax.hist(GetMass(ChargeEqualCondition=False,Draw=False), bins=bins, color='red', histtype='step', label=f'Q != 0;Entries {np.sum(counts)}')
ax.legend()

@bdrum bdrum closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request software Issue dedicated to software
Projects
None yet
Development

No branches or pull requests

1 participant