Allow angle restriction and force photon generation for CAPHRI studies#1714
Allow angle restriction and force photon generation for CAPHRI studies#1714michaelmackenzie wants to merge 1 commit intoMu2e:mainfrom
Conversation
|
Hi @michaelmackenzie,
which require these tests: build. @Mu2e/fnalbuild-users, @Mu2e/write have access to CI actions on main. ⌛ The following tests have been triggered for 6f29681: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 6f29681.
N.B. These results were obtained from a build of this Pull Request at 6f29681 after being merged into the base branch at 4f1ca06. For more information, please check the job page here. |
|
|
||
| double rand = _randFlat->fire(); | ||
| if (rand < _intensity) { | ||
| const bool fire = (_fireAll) ? true : _randFlat->fire() < _intensity; |
There was a problem hiding this comment.
Could simply be if (_fireAll || _randFlat->fire() < _intensity) {
There was a problem hiding this comment.
Pull request overview
This pull request enhances the MuCap1809keVGammaGenerator_tool to support CAPHRI studies by adding the ability to restrict the angular distribution of generated photons and optionally force photon generation in every event.
Changes:
- Added configurable angle restrictions (
czMin,czMax) to limit the cos(theta_z) range for photon generation - Added a
fireAllflag to force photon generation in every event instead of using the branching fraction - Added validation to ensure angle parameters are physically valid
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| struct PhysConfig { | ||
| using Name=fhicl::Name; | ||
| using Comment=fhicl::Comment; | ||
| fhicl::Atom<double> czMin {Name("czmin") , Comment("Restrict cos(theta_z) minimum"), -1.}; |
There was a problem hiding this comment.
The parameter name "czmin" in the Name() should use lowercase to match the established convention across the codebase. All other similar generators use lowercase "czmin" (see RMCGenerator_tool.cc, PrimaryAntiProtonGun_module.cc, StoppedMuonXRayGammaRayGun_module.cc, etc.).
| using Name=fhicl::Name; | ||
| using Comment=fhicl::Comment; | ||
| fhicl::Atom<double> czMin {Name("czmin") , Comment("Restrict cos(theta_z) minimum"), -1.}; | ||
| fhicl::Atom<double> czMax {Name("czmax") , Comment("Restrict cos(theta_z) maximum"), 1.}; |
There was a problem hiding this comment.
The parameter name "czmax" in the Name() should use lowercase to match the established convention across the codebase. All other similar generators use lowercase "czmax" (see RMCGenerator_tool.cc, PrimaryAntiProtonGun_module.cc, StoppedMuonXRayGammaRayGun_module.cc, etc.).
|
|
||
| double rand = _randFlat->fire(); | ||
| if (rand < _intensity) { | ||
| const bool fire = (_fireAll) ? true : _randFlat->fire() < _intensity; |
There was a problem hiding this comment.
The ternary expression can be simplified. Instead of (_fireAll) ? true : _randFlat->fire() < _intensity, use _fireAll || _randFlat->fire() < _intensity which is more concise and idiomatic.
| const bool fire = (_fireAll) ? true : _randFlat->fire() < _intensity; | |
| const bool fire = _fireAll || _randFlat->fire() < _intensity; |
|
Do we need copilot for a 10-lines PR ? |
|
📝 The HEAD of |
No description provided.