-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Implementation of Dark Bremsstrahlung Custom Process #38329
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38329/30508
|
A new Pull Request was created by @revering for master. It involves the following packages:
@cmsbuild, @civanch, @mdhildreth can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
G4ParticleDefinition* muonplus = G4MuonPlus::MuonPlusDefinition(); | ||
G4ProcessManager* pmplus = muonplus->GetProcessManager(); | ||
G4ProcessManager* pmminus = muonminus->GetProcessManager(); | ||
pmplus->AddProcess(new G4muDarkBremsstrahlung(mgfile), -1, 1, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@revering , I would advice (-1, 1, 1) substitute by (-1, 6, 6)
@revering , sorry, I was not checking your proposal earlier. Now several comments. First of all technical:
Now more complicate comments, I am not 100% sure what is the best solution.
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38329/30576
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38329/30577
|
Pull request #38329 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again. |
@civanch Thank you for the comments! I've modified the implementation to hopefully fix the technical issues detailed in notes 1-7, and changed the process to inherit from G4VEmProcess instead of G4VEnergyLossProcess as suggested in note 4. I produced a small sample of 100 events, and the process still occurs around the expected rates. The main issue remaining is the question of the biasing and multi-threading. While we certainly could implement a global multiplicative factor as you suggest, we would need to re-implement the location dependence and would lose the track weights produced by the biasing operator, limiting the bias factors we could apply without producing non-physical modification to the event locations. I'm not really sure how we could put the location dependence in - my best idea for now would be to modify SampleSecondaries() in the model so that it gets the detector location when an interaction is proposed, and then chooses whether or not to simulate the interaction depending on a given list of allowed detector regions. In addition to the concerns about multithreading and the bias factors, I'm worried about the process disabling that we do to limit the interaction and multithreading. When SampleSecondaries() is called in G4muDarkBremsstrahlungModel, it gets the process manager and sets the process activation to false. At the start of the next event, DBremWatcher then sets it back to true. Do you know if this will work with multithreading? From what I can tell the processManager is thread-local, but I'm not sure if the activation tables they use are a shared variable or not. If they are shared, then one thread producing a brem might turn off the process for the others, or a thread starting an event could turn it on for a thread that needs it disabled. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f56f2d/25571/summary.html Comparison SummarySummary:
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38329/31264
|
Pull request #38329 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f56f2d/26448/summary.html Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
@revering , let us make a backport to 12_4 (it may be run3 MC production release). This backport is straightforward - the same files as in 12_5 may be committed. For 10_6 (Run2 MC production) the backport should be done with care, because modified classes may be different from those of 12_5. It is not possible blindly substitute files but it is needed check classes one by one. |
+1 |
@@ -0,0 +1,40 @@ | |||
#ifndef SIMAPPLICATION_APRIMEPHYSICS_H_ | |||
#define SIMAPPLICATION_APRIMEPHYSICS_H 1_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible multiple include here (SIMAPPLICATION_APRIMEPHYSICS_H_
vs. SIMAPPLICATION_APRIMEPHYSICS_H
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you @forthommel !
I submitted a fix in #38862
Hello, It seems this PR broke Many thanks, |
|
||
G4bool IsApplicable(const G4ParticleDefinition& p) override; | ||
|
||
void PrintInfo() override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, this member function could be removed (and that would fix the G4VECGEOM IB).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a new PR #38949 with PrintInfo() removed to resolve the issue.
PR description:
Implemented physics for dark bremsstrahlung and cross section biasing into SimG4Core/CustomPhysics. Overview of implementation method and motivation available from presentation to SIM group: https://indico.cern.ch/event/1162548/contributions/4882745/attachments/2447856/4194591/Revering_DarkBrem_Sim_22_5_20.pdf
Dark Bremsstrahlung is implemented as an optional process in the CustomPhysics module, and an example _cfi file with brief instructions has been added to SimG4Core/CustomPhysics/DarkBrem_SIM_cfi.py. The new process should have no impact on event generation that does not explicitly call it and include the necessary watcher plugin. A location dependent cross section biasing class is also implemented, and as with the process itself is only instantiated through the DBremWatcher plugin.
PR validation:
A small sample of events was generated locally in CMSSW_12_5_X_2022-06-09-1100 to verify that the cross section biasing was taking place in the correct areas of the detector and was producing events at a reasonable rate. Large samples have been generated in CMSSW_10_2_6 to validate the process itself and verify that the cross section calculations are functional for both the total cross section and the expected kinematics. The kinematic calculations do not have any reliance on external cmssw modules, so the behavior should be identical between the two versions.