GENIEGenerator
Loading...
Searching...
No Matches
genie::RESInteractionListGenerator Class Reference

Creates a list of all the interactions that can be generated by the RES thread (generates semi-inclusive resonance reactions). Concrete implementations of the InteractionListGeneratorI interface. More...

#include <RESInteractionListGenerator.h>

Inheritance diagram for genie::RESInteractionListGenerator:
[legend]
Collaboration diagram for genie::RESInteractionListGenerator:
[legend]

Public Member Functions

 RESInteractionListGenerator ()
 RESInteractionListGenerator (string config)
 ~RESInteractionListGenerator ()
InteractionListCreateInteractionList (const InitialState &init) const
void Configure (const Registry &config)
void Configure (string config)
Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
virtual void FindConfig (void)
virtual const RegistryGetConfig (void) const
RegistryGetOwnedConfig (void)
virtual const AlgIdId (void) const
 Get algorithm ID.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
virtual void SetId (string name, string config)
const AlgorithmSubAlg (const RgKey &registry_key) const
void AdoptConfig (void)
void AdoptSubstructure (void)
virtual void Print (ostream &stream) const
 Print algorithm info.

Private Member Functions

void LoadConfigData (void)

Private Attributes

bool fIsCC
bool fIsNC
bool fIsEM
BaryonResList fResList

Additional Inherited Members

Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
static string BuildParamVectSizeKey (const std::string &comm_name)
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
static string BuildParamMatRowSizeKey (const std::string &comm_name)
static string BuildParamMatColSizeKey (const std::string &comm_name)
Protected Member Functions inherited from genie::InteractionListGeneratorI
 InteractionListGeneratorI ()
 InteractionListGeneratorI (string name)
 InteractionListGeneratorI (string name, string config)
 ~InteractionListGeneratorI ()
Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 Algorithm (string name)
 Algorithm (string name, string config)
void Initialize (void)
void DeleteConfig (void)
void DeleteSubstructure (void)
RegistryExtractLocalConfig (const Registry &in) const
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.
template<class T>
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
template<class T>
bool GetParamDef (const RgKey &name, T &p, const T &def) const
template<class T>
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters.
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
template<class T>
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters.
template<class T>
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

Detailed Description

Creates a list of all the interactions that can be generated by the RES thread (generates semi-inclusive resonance reactions). Concrete implementations of the InteractionListGeneratorI interface.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n May 13, 2005
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 28 of file RESInteractionListGenerator.h.

Constructor & Destructor Documentation

◆ RESInteractionListGenerator() [1/2]

RESInteractionListGenerator::RESInteractionListGenerator ( )

Definition at line 23 of file RESInteractionListGenerator.cxx.

23 :
24InteractionListGeneratorI("genie::RESInteractionListGenerator")
25{
26
27}

References genie::InteractionListGeneratorI::InteractionListGeneratorI().

◆ RESInteractionListGenerator() [2/2]

RESInteractionListGenerator::RESInteractionListGenerator ( string config)

Definition at line 29 of file RESInteractionListGenerator.cxx.

29 :
30InteractionListGeneratorI("genie::RESInteractionListGenerator", config)
31{
32
33}

References genie::InteractionListGeneratorI::InteractionListGeneratorI().

◆ ~RESInteractionListGenerator()

RESInteractionListGenerator::~RESInteractionListGenerator ( )

Definition at line 35 of file RESInteractionListGenerator.cxx.

36{
37
38}

Member Function Documentation

◆ Configure() [1/2]

void RESInteractionListGenerator::Configure ( const Registry & config)
virtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 142 of file RESInteractionListGenerator.cxx.

143{
144 Algorithm::Configure(config);
145 this->LoadConfigData();
146}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

References genie::Algorithm::Configure(), and LoadConfigData().

◆ Configure() [2/2]

void RESInteractionListGenerator::Configure ( string config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 148 of file RESInteractionListGenerator.cxx.

149{
150 Algorithm::Configure(config);
151 this->LoadConfigData();
152}

References genie::Algorithm::Configure(), and LoadConfigData().

◆ CreateInteractionList()

InteractionList * RESInteractionListGenerator::CreateInteractionList ( const InitialState & init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 40 of file RESInteractionListGenerator.cxx.

42{
43 LOG("IntLst", pINFO) << "InitialState = " << init_state.AsString();
44
45 // In the thread generating interactions from the list produced here (RES),
46 // we simulate (for free and nuclear targets) semi-inclusive resonance
47 // interactions: v + N -> v(l) + R -> v(l) + X
48 // Specifically, the RES thread generates:
49 //
50 // CC:
51 // nu + p (A) -> l- R (A), for all resonances with Q=+2
52 // nu + n (A) -> l- R (A), for all resonances with Q=+1
53 // \bar{nu} + p (A) -> l+ R (A), for all resonances with Q= 0
54 // \bar{nu} + n (A) -> l+ R (A), for all resonances with Q=-1
55 // NC:
56 // nu + p (A) -> nu R (A), for all resonances with Q=+1
57 // nu + n (A) -> nu R (A), for all resonances with Q= 0
58 // \bar{nu} + p (A) -> \bar{nu} R (A), for all resonances with Q=+1
59 // \bar{nu} + n (A) -> \bar{nu} R (A), for all resonances with Q= 0
60 //
61 // and then the resonance R should be allowed to decay to get the full
62 // hadronic final state X. All decay channels kinematically accessible
63 // to the (off the mass-shell produced) resonance can be allowed.
64
65 // specify the requested interaction type
66 InteractionType_t inttype;
67 if (fIsCC) inttype = kIntWeakCC;
68 else if (fIsNC) inttype = kIntWeakNC;
69 else if (fIsEM) inttype = kIntEM;
70 else {
71 LOG("IntLst", pWARN)
72 << "Unknown InteractionType! Returning NULL InteractionList "
73 << "for init-state: " << init_state.AsString();
74 return 0;
75 }
76
77 // create a process information object
78 ProcessInfo proc_info(kScResonant, inttype);
79
80 // learn whether the input nuclear or free target has avail. p and n
81 const Target & inp_target = init_state.Tgt();
82 bool hasP = (inp_target.Z() > 0);
83 bool hasN = (inp_target.N() > 0);
84
85 // possible hit nucleons
86 const int hit_nucleon[2] = {kPdgProton, kPdgNeutron};
87
88 // create an interaction list
89 InteractionList * intlist = new InteractionList;
90
91 // loop over all baryon resonances considered in current MC job
92 unsigned int nres = fResList.NResonances();
93 for(unsigned int ires = 0; ires < nres; ires++) {
94
95 //get current resonance
96 Resonance_t res = fResList.ResonanceId(ires);
97
98 // loop over hit nucleons
99 for(int i=0; i<2; i++) {
100
101 // proceed only if the hit nucleon exists in the current init state
102 if(hit_nucleon[i]==kPdgProton && !hasP) continue;
103 if(hit_nucleon[i]==kPdgNeutron && !hasN) continue;
104
105 // proceed only if the current resonance conserves charge
106 // (the only problematic case is when the RES charge has to be +2
107 // because then only Delta resonances are possible)
108 bool skip_res = proc_info.IsWeakCC() &&
109 pdg::IsNeutrino(init_state.ProbePdg()) &&
110 (hit_nucleon[i]==kPdgProton) &&
111 (!utils::res::IsDelta(res));
112 if(skip_res) continue;
113
114 // create an interaction
115 Interaction * interaction = new Interaction(init_state, proc_info);
116
117 // add the struck nucleon
118 Target * target = interaction->InitStatePtr()->TgtPtr();
119 target->SetHitNucPdg(hit_nucleon[i]);
120
121 // add the baryon resonance in the exclusive tag
122 XclsTag * xcls = interaction->ExclTagPtr();
123 xcls->SetResonance(res);
124
125 // add the interaction at the interaction list
126 intlist->push_back(interaction);
127
128 }//hit nucleons
129 } //resonances
130
131 if(intlist->size() == 0) {
132 LOG("IntLst", pERROR)
133 << "Returning NULL InteractionList for init-state: "
134 << init_state.AsString();
135 delete intlist;
136 return 0;
137 }
138
139 return intlist;
140}
#define pINFO
Definition Messenger.h:62
#define pERROR
Definition Messenger.h:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60
Target * TgtPtr(void) const
InitialState * InitStatePtr(void) const
Definition Interaction.h:74
XclsTag * ExclTagPtr(void) const
Definition Interaction.h:77
void SetHitNucPdg(int pdgc)
Definition Target.cxx:171
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
void SetResonance(Resonance_t res)
Definition XclsTag.cxx:128
bool IsNeutrino(int pdgc)
Definition PDGUtils.cxx:110
bool IsDelta(Resonance_t res)
is it a Delta resonance?
const int kPdgProton
Definition PDGCodes.h:81
enum genie::EInteractionType InteractionType_t
const int kPdgNeutron
Definition PDGCodes.h:83
enum genie::EResonance Resonance_t

References genie::InitialState::AsString(), genie::Interaction::ExclTagPtr(), fIsCC, fIsEM, fIsNC, fResList, genie::Interaction::InitStatePtr(), genie::utils::res::IsDelta(), genie::pdg::IsNeutrino(), genie::ProcessInfo::IsWeakCC(), genie::kIntEM, genie::kIntWeakCC, genie::kIntWeakNC, genie::kPdgNeutron, genie::kPdgProton, genie::kScResonant, LOG, genie::Target::N(), pERROR, pINFO, genie::InitialState::ProbePdg(), pWARN, genie::Target::SetHitNucPdg(), genie::XclsTag::SetResonance(), genie::InitialState::Tgt(), genie::InitialState::TgtPtr(), and genie::Target::Z().

◆ LoadConfigData()

void RESInteractionListGenerator::LoadConfigData ( void )
private

Definition at line 154 of file RESInteractionListGenerator.cxx.

155{
156 string resonances = "";
157 this->GetParam("ResonanceNameList", resonances);
158 SLOG("IntLst", pDEBUG) << "Resonance list: " << resonances;
159
160 fResList.Clear();
161 fResList.DecodeFromNameList(resonances);
162 LOG("IntLst", pDEBUG) << fResList;
163
164 this->GetParamDef("is-CC", fIsCC, false);
165 this->GetParamDef("is-NC", fIsNC, false);
166 this->GetParamDef("is-EM", fIsEM, false);
167}
#define pDEBUG
Definition Messenger.h:63
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition Messenger.h:84
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
bool GetParamDef(const RgKey &name, T &p, const T &def) const

References fIsCC, fIsEM, fIsNC, fResList, genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), LOG, pDEBUG, and SLOG.

Referenced by Configure(), and Configure().

Member Data Documentation

◆ fIsCC

bool genie::RESInteractionListGenerator::fIsCC
private

Definition at line 47 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

◆ fIsEM

bool genie::RESInteractionListGenerator::fIsEM
private

Definition at line 49 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

◆ fIsNC

bool genie::RESInteractionListGenerator::fIsNC
private

Definition at line 48 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

◆ fResList

BaryonResList genie::RESInteractionListGenerator::fResList
private

Definition at line 50 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


The documentation for this class was generated from the following files: