Skip to content

first infrastructure for BToJpsiK histmaking and tensor writing#675

Open
pmlugato wants to merge 15 commits intoWMass:mainfrom
pmlugato:merging-upstream-refactoring
Open

first infrastructure for BToJpsiK histmaking and tensor writing#675
pmlugato wants to merge 15 commits intoWMass:mainfrom
pmlugato:merging-upstream-refactoring

Conversation

@pmlugato
Copy link
Collaborator

  • scripts for BToJpsiK histmaking, response maps, and tensor writing
  • bookkeeping that comes along with ^, datasets, datagroups, etc.
  • small generalization to some calibration helpers and response maps scripts, should leave nominal setups unaffected

after refactoring will test pipelines of histmaking --> fitting and make sure things still all good, otherwise as a first push of the infrastructure it is ready enough

Copy link
Collaborator

@davidwalter2 davidwalter2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, there are a couple of more tricky cases due to the different nature of this analysis w.r.t. the existing ones, we should work on these a bit which may involve some structural changes.

General style comments which are specific for this repository and which we have adapted over time:

  • command line arguments:
    • use camelCase
    • don't use "dest" keyword
    • use common parser (in wremnants/utilities/parsing) if possible or stick to common format of option names etc.
  • use snake_case for filenames and variable names if possible
  • use logger instead of print
  • remove comments that has been added for testing

mpl.rcParams["figure.dpi"] = 300

# TODO migrate butojpsik stuff to separate file and leave this untouched or generalize correctly...
BuToJpsiK = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest making this file a proper script and adding command line arguments with sth like --particle, type=str, choices=['muon', 'kaon', 'D'] to specify the particle type and use this option to steer the script.

Also add other options for output plots directory etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, see scripts/corrections/make_response_maps.py alongside wremnants/postprocessing/response_maps_utils.py

)
elif self.era == "2018":
from wremnants.datasets.datagroups2018 import (
make_datagroups_2018 as make_datagroups,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The make_datagroups function does not generally correspond to an era. The idea is that make_datagroups configures a set of samples that are used for a specific analysis. For example the "make_datagroups_2016" is applicable to single and dimuon analyses such as W mass or alphaS but not necessarily restricted to 2016. The fact that we have called it "make_datagroups_2016" is a mistake and should be changed (not in this PR).

That said, it would be good that your PR follows a better logic. Maybe we can pass the make_datagroups function as an argument to the constructor instead?

@cippy
Copy link
Collaborator

cippy commented Mar 17, 2026

Ok, David sent most of the smart comments I also wanted to make. I'll try to have a deeper look soon

Copy link
Collaborator

@davidwalter2 davidwalter2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only found a few smaller details, no commit needed if you can answer the question about why the abs is taken in this one case.

parser.add_argument(
"--particleType",
type=str,
required=True,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make "muon" default and add "pion" as choice, looking ahead

const double qop = charge / pt / std::cosh(eta);

const double dsigma = sigmarel_ * qop;
const double dsigma = std::abs(sigmarel_ * qop);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why absolute?

base_action = lambda x: hh.projectNoFlow(
collapseSyst(x[select]), h, overflow_ax
)
# base_action = lambda x: collapseSyst(x[select])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants