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

Added README's for MuonFitter #295

Merged
merged 4 commits into from
Nov 26, 2024
Merged

Added README's for MuonFitter #295

merged 4 commits into from
Nov 26, 2024

Conversation

jminock
Copy link
Contributor

@jminock jminock commented Oct 2, 2024

No description provided.

@marc1uk
Copy link
Collaborator

marc1uk commented Nov 15, 2024

Can i suggest putting both READMEs in the UserTools/MuonFitter directory? They both seem to describe the usage of that tool, rather than the CC_MC_RECO_ntuple toolchain that they're added to (in fact the readme alludes to a MuonFitter toolchain... perhaps we could get that as well?)

The MuonFitterREADME.md suggests that using this tool is a bit ... convoluted. It also says that three python scripts are needed:

1. Data_prepare.py
2. RNN_train.py
3. Fit_data.py

but i can't see those in any of the MuonFitter PRs. Can we use this tool without them? Maybe one of those is that referenced in #294 ?

The way you've added this into a toolchain suggests perhaps you're not following the steps in this README? Is there an updated method for running this? I'm not sure how practical it is to process all data with a toolchain twice to fit for muons....

@jminock
Copy link
Contributor Author

jminock commented Nov 15, 2024

Hi Marcus,

I can add copies of the README's to that directory as well. They describe usage of this Tool if someone wants to include it in their ToolChain, which applies to the CC_MC_RECO toolchain. There does not exist a minimal toolchain that includes this Tool.

Those 3 python scripts are included from #290 and this Tool can be ran in Reco mode and non-Reco mode without them. They help generate the models and additional files to run the Tool in Reco mode.

And the way to run the Tool necessitates the toolchain to be ran twice, with different configuration files used between Reco and non-Reco modes. This was how Julie used it and left it to me. I am fully aware how annoying this is, but it is able to produce correct results. In fact, it's now easier to produce results because it used to be required to generate tanktrackfit files outside of the ToolAnalysis container due to the "torch" python requirement. I don't like how it is either, but fixing it would require a massive refactoring/upheaval of the Tool.

Thank you,

James

@marc1uk
Copy link
Collaborator

marc1uk commented Nov 15, 2024

Ok, after going through things i think i follow now. Please do ensure all variants of the readmes are in the tool folder though, since they're not all very complete.

So Data_prepare.py and RNN_train.py only need to be run once for training, whereas for actual reconstruction the toolchain needs to be run once to generate some stuff, then the Fit_data.py run, then the toolchain run again.

In that case it would only require dumping the salient part of Fit_data.py into a python Tool (lines 26-48 -> Initialise, lines 66-70 -> Execute, no Finalise), and converting it to pass lines of the text file corresponding to each event via the datamodel (replace MuonFitter line 1227 with something that puts it in the datamodel, and Fit_data.py line 66 data.iloc[idx,2:] with that variable pulled out from the datamodel).
Then you could string together an instance of MuonFitter in non-reco mode, the Fit_data Tool, and an instance of MuonFitter in reco mode, in order to avoid having to run two instances of the tooolchain and a bunch of intermediate text files. I'll leave that as homework rather than requiring it for this PR, but I don't need to tell you that would be much nicer.

@jminock
Copy link
Contributor Author

jminock commented Nov 15, 2024

Working on the READMEs now, thank you!

@marc1uk marc1uk merged commit 0b1f89f into ANNIEsoft:Application Nov 26, 2024
1 check passed
@jminock jminock deleted the MFDoc branch December 11, 2024 16:52
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.

2 participants