Muon stop pileup cz restriction#1787
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 12c5d86: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 12c5d86.
N.B. These results were obtained from a build of this Pull Request at 12c5d86 after being merged into the base branch at e229837. For more information, please check the job page here. |
|
Yes, here's my review of PR #1787. I found several issues: Issues Found1. 🐛 Inconsistent rate-scaling approach in
|
| # | Severity | File | Issue |
|---|---|---|---|
| 1 | Medium | DIOGenerator_tool.cc |
Unconditional RandFlat draw changes random sequence for default (no-restriction) configs |
| 2 | Low | 4 files | Typo "accouunt" in comments |
| 3 | Medium | 4 MuCap generators | Passing cz args to RandomUnitSphere ctor may change random sequence even for defaults — needs verification |
| 4 | Low | 4 MuCap generators | _czMin/_czMax should be const for consistency with DIOGenerator |
| 5 | Medium | DIOGenerator_tool.cc |
Unconditional std::cout debug output should be removed or use mf::LogInfo |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 12c5d86: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 12c5d86.
N.B. These results were obtained from a build of this Pull Request at 12c5d86 after being merged into the base branch at fa82e62. For more information, please check the job page here. |
brownd1978
left a comment
There was a problem hiding this comment.
I'm curious what prompted the addition of fireAll option.
|
|
||
| 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.}; | ||
| fhicl::Atom<bool> fireAll {Name("fireAll") , Comment("Always add a particle to the event"), false}; |
There was a problem hiding this comment.
What is the use case for fireAll = false? Shouldn't a generator produce an output ever event? Without that, downstream workflows that rely on MCPrimary will fail. You could add a filter in this case, but how would that be different from fireAll = true?
|
@brownd1978 this I can set this to be true for the DIO tail generator config in Production, or I can set it to false in the pileup tool config and have it default to true, whichever is preferred. I can also remove the default and make it explicit in all cases. |
|
📝 The HEAD of |
|
@michaelmackenzie thanks for the explanation. As it's a formal error for a primary generator to not produce a primary, a way of insuring that in code would be better than a flag that can be misconfigured. How about passing this as a constructor argument, true when the generator is primary, false as part of pileup? I also think some solution to recording the cz acceptance is required; we should not go back to harvesting numbers from log files to get correct downstream job configurations. |
|
I updated to pass the flag for |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for b8f4d97: build (Build queue - API unavailable) |
|
☀️ The build tests passed at b8f4d97.
N.B. These results were obtained from a build of this Pull Request at b8f4d97 after being merged into the base branch at 5912724. For more information, please check the job page here. |
brownd1978
left a comment
There was a problem hiding this comment.
Minor stylistic comments, and a question if isprimary and fireall can be consolidated
|
|
||
| void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { | ||
| void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material, const bool isPrimary) override { | ||
| isPrimary_ = isPrimary; |
There was a problem hiding this comment.
It's confusing that the underscore postpends vs prepends on the other variables
There was a problem hiding this comment.
Are there use cases where fireall and isprimary can be different? If not, I suggest to consolidate them.
There was a problem hiding this comment.
I switched from isPrimary_ --> _isPrimary as suggested since this better matches the style used by the tools.
I also believe all cases of fireAll have been removed with this isPrimary flag update, as this new flag takes the role of the fireAll (as you point out). I've similarly updated the other capture product tools to always produce a single particle if configured a a primary generator instead of the Poisson sampling
|
|
||
| void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { | ||
| void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material, const bool isPrimary) override { | ||
| isPrimary_ = isPrimary; |
There was a problem hiding this comment.
Same comment about the underscore as above
This restricts the mu stop pileup cos(theta_z), and accordingly adjusts the rates for the processes so the pileup module will produce sensible distributions when only looking in this cos(theta_z) region. This significantly speeds up Run 1B pileup production for rough estimates that don't need exact precision.