Setting the SecondNucleonEmitter at run-time and enabling SRC in CC-QEL interactions#18
Open
CarlosNeutrino wants to merge 2 commits into
Open
Conversation
…nNucleonoEmitter algorithm
There was a problem hiding this comment.
Pull request overview
This PR updates SRC second-nucleon emission configuration so the SecondNucleonEmitter is selected at run time based on the globally configured nuclear model, and enables second-nucleon emission handling in CC-QEL event generation.
Changes:
- Add runtime selection logic for
SecondNucleonEmissionIbased onGlobalParameterListnuclear model and new per-model mapping strings in config. - Invoke
SecondNucleonEmitterinQELEventGeneratorbefore building the remnant nucleus, so the remnant accounts for an emitted second nucleon. - Update
FermiMover.xmlandQELEventGenerator.xmlto provideNuclearModels/SecondNucleonEmittersmapping lists.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Physics/QuasiElastic/EventGen/QELEventGenerator.h | Adds SecondNucleonEmissionI pointer and per-nuclear-model emitter map. |
| src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx | Selects emitter from global nuclear model and runs it during QEL event processing. |
| src/Physics/NuclearState/FermiMover.h | Adds per-nuclear-model emitter map member. |
| src/Physics/NuclearState/FermiMover.cxx | Selects emitter from global nuclear model using new config mapping. |
| config/QELEventGenerator.xml | Adds NuclearModels / SecondNucleonEmitters mapping parameters. |
| config/FermiMover.xml | Adds NuclearModels / SecondNucleonEmitters mapping parameters (and NuclearModel alg entry). |
Comments suppressed due to low confidence (1)
src/Physics/QuasiElastic/EventGen/QELEventGenerator.h:28
- This header now uses std::unordered_map but does not include <unordered_map>, which can cause compile failures depending on include order. Add the missing standard header explicitly.
#include "Physics/NuclearState/NuclearModelI.h"
#include "Physics/NuclearState/SecondNucleonEmissionI.h"
#include "Framework/Algorithm/AlgFactory.h"
#include "Physics/Common/KineGeneratorWithCache.h"
#include "Physics/QuasiElastic/XSection/QELUtils.h"
#include "Framework/Utils/Range1.h"
#include "Framework/Conventions/Controls.h"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24
to
+30
| #include "Framework/Interaction/Target.h" | ||
| #include "Physics/NuclearState/SRCNuclearRecoil.h" | ||
| #include "Physics/NuclearState/SecondNucleonEmissionI.h" | ||
| #include "Framework/Algorithm/AlgFactory.h" |
| const SecondNucleonEmissionI * emitter = | ||
| dynamic_cast<const SecondNucleonEmissionI *>(alg); | ||
| if (!emitter) { | ||
| LOG("FermiMover", pWARN) |
Comment on lines
+372
to
+384
| // Now resolve fSecondEmitter for the currently configured nuclear model | ||
| fSecondEmitter = 0; | ||
| auto it = fFermiMoverMap.find(nucl_model_name); | ||
| if(it != fFermiMoverMap.end()) { | ||
| fSecondEmitter = it->second; | ||
| LOG("FermiMover", pINFO) | ||
| << "Selected " << fSecondEmitter->Id().Name() | ||
| << " as SecondNucleonEmitter for nuclear model " << nucl_model_name; | ||
| }else{ | ||
| LOG("FermiMover", pWARN) | ||
| << "No SecondNucleonEmitter for nuclear model " | ||
| << nucl_model_name << " -- SRC recoil disabled"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This Pull Request changes the way the SecondNucleonEmitter for SRC is configured. It adds the SecondNucleonEmitter in CC-QEL events (not configured before, as QELEventGenerator does not use FermiMover):
- config/FermiMover.xml and config/QELEventGenerator.xml include two new strings ("NuclearModels" and "SecondNucleonEmitters") that read the NuclearModel along with the corresponding SecondNucleonEmitter
- FermiMover.cxx and QELEventGenerator.cxx LoadConfig() reads the strings and sets the correct SecondNucleonEmitter.
- The globally configured NuclearModel is read from the GlobalParameterList.
Development
Notes for reviewers