Skip to content

Conversation

@AnalitikGnid
Copy link

Useful tools for SST decoupling and optimisation that could be used further

Added:

  • Configuration can be updated using CSV file
  • prestrawdetector — a thin air plane that can be placed anywhere in the simulation to store events.
  • MyGenerator — a new generator module that injects events from a custom input file

@AnalitikGnid AnalitikGnid requested a review from a team as a code owner May 29, 2025 15:58
Copy link
Contributor

@olantwin olantwin left a comment

Choose a reason for hiding this comment

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

Some first impressions.

If we want to merge this eventually, MyGenerator definitely needs a sensible name.

Copy link
Contributor

Choose a reason for hiding this comment

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

In addition to the problem of the config format, I don't like how this depends on being able to modify global state.

Copy link
Author

Choose a reason for hiding this comment

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

Could you please tell more on what do you mean by global state. I've re-imlemented changing parameters using a flag, is it ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer functions without side effects, to not surprise users.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure that the cmakelint and cmake-format pre-commit hooks run cleanly on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Clean up the commented code, update comments etc. which were copy-pasted from the strawtubes

${CMAKE_SOURCE_DIR}/shipdata
${CMAKE_SOURCE_DIR}/veto
${genfit2_INCDIR}
${TPYTHIA6_INCLUDE_DIR}
Copy link
Contributor

Choose a reason for hiding this comment

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

What does your PR have to do with Pythia6?

cout << "-E NtupleGenerator: Error opening the Signal file" << fileName << endl;
}
fTree = (TTree *)fInputFile->Get("ntuple");
fTree = (TTree *)fInputFile->Get("pythia8-Geant4");
Copy link
Contributor

Choose a reason for hiding this comment

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

No C-style casts

Copy link
Contributor

Choose a reason for hiding this comment

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

What is this file?

Copy link
Author

Choose a reason for hiding this comment

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

example file for MyGenerator; to show a needed structure of the ttree

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove it. You can put an example file on EOS, and maybe mention it in the documentation of the generator, but example ROOT files should not be tracked in git.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of this file?

Copy link
Author

Choose a reason for hiding this comment

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

It produces file with variables that are necessary for MyGenerator only.
So only vertex positions, momentum and pdg code stored in strawdetector

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not of sufficient general interest to include in the main framework.

@olantwin
Copy link
Contributor

olantwin commented Jun 5, 2025

Also, please fix the merge conflicts, so that we can run the automatic checks.

parser.add_argument("--SND", dest="SND", help="Activate SND.", action='store_true')
parser.add_argument("--noSND", dest="SND", help="Deactivate SND. NOOP, as it currently defaults to off.", action='store_false')
#parser.add_argument("--psdz", dest="psdz", help="Set Prestrawdetector Z position", required=False, default=2586., type=float)
parser.add_argument("--decouple", dest="decouple", help="Decoupling flag", required=False, default=False, action='store_true')
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs a better name and help message

)
parser.add_argument("--SND", dest="SND", help="Activate SND.", action='store_true')
parser.add_argument("--noSND", dest="SND", help="Deactivate SND. NOOP, as it currently defaults to off.", action='store_false')
#parser.add_argument("--psdz", dest="psdz", help="Set Prestrawdetector Z position", required=False, default=2586., type=float)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this commented out?

)

ship_geo.decouple = options.decouple
ship_geo.psd=2586.0
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs a better name and comments to explain what these are, especially if they are set at the top level!

@olantwin
Copy link
Contributor

@AnalitikGnid Any updates on this? Some responses to the various questions and comments would be appreciated as well.

@olantwin
Copy link
Contributor

@AnalitikGnid Any updates?

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