Skip to content

CC Analysis Branch#382

Open
jminock wants to merge 10 commits intoANNIEsoft:Applicationfrom
jminock:CCPR
Open

CC Analysis Branch#382
jminock wants to merge 10 commits intoANNIEsoft:Applicationfrom
jminock:CCPR

Conversation

@jminock
Copy link
Copy Markdown
Collaborator

@jminock jminock commented Apr 6, 2026

Describe your changes

PR that encompasses Tools used for CC Analysis. All CC Analysis related plots come from ntuples generated from this ToolChain. All changes from original CC branch have been rectified and merged in such that THIS branch/PR will generate identical files to those used for the CC analysis. Once again, THIS TOOLCHAIN HAS BEEN TESTED AND MATCHES THE ESTABLISHED CC PHYSICS ANALYSIS.
Added Tools:
Charge Isotropy - returns a value representing the isotropy of the charge in the tank, useful for 0pi selection
CCMCRecoEventLoader - like MCRecoEventLoader but hacked up to provide additional truth information of other particles. I made a new Tool because it diverged too far from the original.
CCMCCorrections - provides correction factors to the MRD and Dirt muon scaling as presented. Corrections and uncertainties are unique to CC Analysis. But infrastructure exists if one wanted to do their own corrections.
Documentation for my ToolChain does NOT CURRENTLY exist. I wanted to include this for reference purposes so any internal notes can link back to a specific tag/PR/commit. I plan to fill out the README files and make a low-level guide for ALL my code after/during paper writing.

Checklist before submitting your PR

  • This PR implements a single change (one new/modified Tool, or a set of changes to implement one new/modified feature)
  • This PR alters the minimum number of files to affect this change
  • If this PR includes a new Tool, a README and minimal demonstration ToolChain is provided
  • If a new Tool/ToolChain requires model or configuration files, their paths are not hard-coded, and means of generating those files is described in the readme, with examples provided on /pnfs/annie/persistent
  • For every new usage, there is a reason the data must be on the heap
  • For every new there is a delete, unless I explicitly know why (e.g. ROOT or a BoostStore takes ownership)

Additional Material

Attach any validation or demonstration files here. You may also link to relavant docdb articles.

@S81D S81D self-assigned this Apr 13, 2026
//RunNumber = atrigt->GetHeader()->GetRun();
//SubrunNumber = 0;

//Pulls run number and subrun number from file name
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this seems like a reasonable way to extract run and subrun, but we should probably make it a config option rather than changing the default.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not sure what this is, or whether it belongs in this repo.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

auto-generated files shouldn't be committed

// =======================================================
// neutrino and nucleon information:
bool iscc = (IsCC == '1');
TLorentzVector* probemomentum = new TLorentzVector(-9999.,-9999.,-9999.,-9999.);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these appear to be leaked


It is possible to look at NUISANCE files on their own (without corresponding WCSim files), in this case the `FileDir` and `FilePattern` need to be specified in the configuration file.
If one wants to get corresponding NUISANCE information for WCSim files, one should specify `LoadWCSimTool` in the `FilePattern` row. In this case the tool will try to extract the information about the corresponding NUISANCE file from the WCSim file and load the respective NUISANCE file automatically. For newer files, the path is SOMETIMES(*see below*) saved alongside the filename and one can set the `FileDir` to `NA`. For older files, only the filename is saved and one needs to specify the `FileDir` in which the NUISANCE files are to be found by hand.
Note that a lot of WCSim files do not have the complete information about their NUISANCE files saved. In this case, a manual matching of NUISANCE files to WCSim files is possible, although the following restrictions to the naming apply: The WCSim files must have the same nomenclature as Marcus' WCSim beam files, i.e. `wcsim_0.X.Y.root`, where `X` is the number of the corresponding NUISANCE file, and `Y` specifies which part of the NUISANCE file is being looked at, with each WCSim file corresponding to 500 entries (1000 entries for James' files) in a NUISANCE file. The matching NUISANCE file would be called `ghtp.X.ghep.root`, with the events `Y*(500) ... (Y+1)*500` (`Y*(1000) ... (Y+1)*1000`) corresponding to the events in the WCSim file.
Copy link
Copy Markdown
Collaborator

@marc1uk marc1uk Apr 14, 2026

Choose a reason for hiding this comment

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

The matching NUISANCE file would be called ghtp.X.ghep.root

is this a typo? It seems like it should be nui.something.root (line 73)

}
}

std::cout << "TIME MIN: " << minT << std::endl;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

prune

if(qval == 0.) Qij = -9999.;
else Qij = num/qval;

std::cout << "num: " << num << std::endl;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

prune

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is perhaps a duplicate of addQij.C in the top level. I'm not quite sure if this is a debug script, or an ad-hoc script that retroactively fills a gap the Tool would normally fill.... I don't mind leaving it if it's useful, but i think it needs some description to say what it's for.

# MCRecoEventLoader config file

verbosity 0
verbosity 10
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

probably a bit high for normal usage

@@ -1,21 +1,21 @@
verbose 0
verbose -1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh dear. I think people may be abusing our logging system if we need to specify negative verbosity levels. 🙈

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

git tells me this file is too big to render (34,000 lines). Maybe this file can be omitted from the commit.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again can be omitted from commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

seems like another standalone for debug or something - can we get a description?

/////////////////////////////////////////////////////////////////

m_variables.Get("verbosity",verbosity);
m_variables.Get("MRDCalFile",mrd_cal_file);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where does MRDCalFile come from? Can we add something to the readme?


if(mufound){
TrueMuonEnergy = primarylepton.GetStartEnergy();
// MCParticleProperties tool fills in MRD track in m, but
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

unrelated to this PR but we may wish to fix that.

@marc1uk
Copy link
Copy Markdown
Collaborator

marc1uk commented Apr 14, 2026

Overall, a lot of good code in this PR 👍
Only very minor comments, some things can be omitted from the repo, some additional notes would be helpful, and one minor memory leak.

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