Skip to content

Allow FSRootDataReader to Read Included Weight Branch#380

Merged
jrstevenjlab merged 6 commits intomasterfrom
fsroot_reader_weights
Dec 23, 2025
Merged

Allow FSRootDataReader to Read Included Weight Branch#380
jrstevenjlab merged 6 commits intomasterfrom
fsroot_reader_weights

Conversation

@kevScheuer
Copy link
Contributor

The current FSRootDataReader can only read event weights if a specified friend tree is included in the config file, but it's possible for the file itself to have a weight branch that can be read, like in ROOTDataReader. These commits add this ability.

There is also some small checks for opening the files and trees, and avoids a potential issue of having ifstream and TFile open at the same time.

If a friend tree for the weights is not provided,
the weight defaults to 1.0, but there is a
possibility for the user to provide a weight
branch in the main tree as well. This commit
checks for that possibility.
Backwards compatibility is maintained, but user
can now specify a custom branch name for event
weights. Also added some usage comments, and
aligned some of the styles between the two
readers.
@kevScheuer
Copy link
Contributor Author

Just added the ability for the user to specify the name of the weight branch. Since the argument lists were getting quite long, I've added some comments for guidance as well. The usage is still backwards compatible though.

Copy link
Contributor

@jrstevenjlab jrstevenjlab 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

@jrstevenjlab
Copy link
Contributor

@aaust is auto-build not running for halld_sim? I think this is ready to merge but it doesn't look like the build kicked off successfully

@gluex
Copy link

gluex commented Dec 23, 2025

Build status for this pull request: FAILURE

Build log: /work/halld/pull_request_test/halld_sim^fsroot_reader_weights/make_fsroot_reader_weights.log
Build report: /work/halld/pull_request_test/halld_sim^fsroot_reader_weights/report_fsroot_reader_weights.txt
Location of build: /work/halld/pull_request_test/halld_sim^fsroot_reader_weights

if (args.size() == 7) {
fourMomentumPrefix = args[6];
}
else if (args.size() == 8) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing curly bracket?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, I just pushed an update

@gluex
Copy link

gluex commented Dec 23, 2025

@jrstevenjlab jrstevenjlab merged commit a76c94a into master Dec 23, 2025
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.

4 participants