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

Creates a list of all the interactions that can be generated by the SPP thread (generates exclusive inelastic 1 pion reactions proceeding through resonance neutrinoproduction). Concrete implementations of the InteractionListGeneratorI interface. More...

#include <RSPPInteractionListGenerator.h>

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

Public Member Functions

 RSPPInteractionListGenerator ()
 RSPPInteractionListGenerator (string config)
 ~RSPPInteractionListGenerator ()
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 AddFinalStateInfo (Interaction *i, SppChannel_t chan) const
void LoadConfigData (void)

Private Attributes

bool fIsCC
bool fIsNC

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 SPP thread (generates exclusive inelastic 1 pion reactions proceeding through resonance neutrinoproduction). 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 29 of file RSPPInteractionListGenerator.h.

Constructor & Destructor Documentation

◆ RSPPInteractionListGenerator() [1/2]

RSPPInteractionListGenerator::RSPPInteractionListGenerator ( )

Definition at line 19 of file RSPPInteractionListGenerator.cxx.

19 :
20InteractionListGeneratorI("genie::RSPPInteractionListGenerator")
21{
22
23}

References genie::InteractionListGeneratorI::InteractionListGeneratorI().

◆ RSPPInteractionListGenerator() [2/2]

RSPPInteractionListGenerator::RSPPInteractionListGenerator ( string config)

Definition at line 25 of file RSPPInteractionListGenerator.cxx.

25 :
26InteractionListGeneratorI("genie::RSPPInteractionListGenerator", config)
27{
28
29}

References genie::InteractionListGeneratorI::InteractionListGeneratorI().

◆ ~RSPPInteractionListGenerator()

RSPPInteractionListGenerator::~RSPPInteractionListGenerator ( )

Definition at line 31 of file RSPPInteractionListGenerator.cxx.

32{
33
34}

Member Function Documentation

◆ AddFinalStateInfo()

void RSPPInteractionListGenerator::AddFinalStateInfo ( Interaction * i,
SppChannel_t chan ) const
private

Definition at line 157 of file RSPPInteractionListGenerator.cxx.

159{
160 int nproton = 0;
161 int nneutron = 0;
162 int npiplus = 0;
163 int npi0 = 0;
164 int npiminus = 0;
165
166 int nucpdg = SppChannel::FinStateNucleon(sppchan);
167 int pipdg = SppChannel::FinStatePion(sppchan);
168
169 if ( nucpdg == kPdgProton ) nproton = 1;
170 else if ( nucpdg == kPdgNeutron ) nneutron = 1;
171 else {
172 LOG("IntLst", pERROR)
173 << "Final state nucleon not a proton or a neutron! (pdg="
174 << nucpdg <<")";
175 }
176
177 if ( pipdg == kPdgPiP ) npiplus = 1;
178 else if ( pipdg == kPdgPi0 ) npi0 = 1;
179 else if ( pipdg == kPdgPiM ) npiminus = 1;
180 else {
181 LOG("IntLst", pERROR)
182 << "Final state pion not a pi+/pi-/pi0! (pdg=" << pipdg <<")";
183 }
184
185 XclsTag exclusive_tag;
186
187 exclusive_tag.SetNNucleons (nproton, nneutron);
188 exclusive_tag.SetNPions (npiplus, npi0, npiminus);
189
190 interaction->SetExclTag(exclusive_tag);
191}
#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
static int FinStatePion(SppChannel_t channel)
Definition SppChannel.h:157
static int FinStateNucleon(SppChannel_t channel)
Definition SppChannel.h:130
void SetNNucleons(int np, int nn)
Definition XclsTag.cxx:95
void SetNPions(int npi_plus, int npi_0, int npi_minus)
Definition XclsTag.cxx:88
const int kPdgPiM
Definition PDGCodes.h:159
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgPi0
Definition PDGCodes.h:160
const int kPdgNeutron
Definition PDGCodes.h:83
const int kPdgPiP
Definition PDGCodes.h:158

References genie::SppChannel::FinStateNucleon(), genie::SppChannel::FinStatePion(), genie::kPdgNeutron, genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, genie::kPdgProton, LOG, pERROR, genie::Interaction::SetExclTag(), genie::XclsTag::SetNNucleons(), and genie::XclsTag::SetNPions().

Referenced by CreateInteractionList().

◆ Configure() [1/2]

void RSPPInteractionListGenerator::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 193 of file RSPPInteractionListGenerator.cxx.

194{
195 Algorithm::Configure(config);
196 this->LoadConfigData();
197}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

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

◆ Configure() [2/2]

void RSPPInteractionListGenerator::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 199 of file RSPPInteractionListGenerator.cxx.

200{
201 Algorithm::Configure(config);
202 this->LoadConfigData();
203}

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

◆ CreateInteractionList()

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

Implements genie::InteractionListGeneratorI.

Definition at line 36 of file RSPPInteractionListGenerator.cxx.

38{
39 LOG("IntLst", pINFO) << "InitialState = " << init_state.AsString();
40
41 // In the thread generating interactions from the list produced here (SPP),
42 // we can have (for free and nuclear targets):
43 //
44 // neutrino CC:
45 // v p -> l- p pi+
46 // v n -> l- p pi0
47 // v n -> l- n pi+
48 // neutrino NC:
49 // v p -> v p pi0
50 // v p -> v n pi+
51 // v n -> v n pi0
52 // v n -> v p pi-
53 // anti-neutrino CC:
54 // vb n -> l+ n pi-
55 // vb p -> l+ n pi0
56 // vb p -> l+ p pi-
57 // anti-neutrino NC:
58 // vb p -> vb p pi0
59 // vb p -> vb n pi+
60 // vb n -> vb n pi0
61 // vb n -> vb p pi-
62 //
63
64 const int n_nucc_channels = 3;
65 const int n_nunc_channels = 4;
66
67 SppChannel_t nucc_channels[n_nucc_channels] = {kSppNull};
68 SppChannel_t nunc_channels[n_nunc_channels] = {kSppNull};
69
70 int nupdg = init_state.ProbePdg();
71
72 if( pdg::IsNeutrino(nupdg) ) {
73 nucc_channels[0] = kSpp_vp_cc_10100;
74 nucc_channels[1] = kSpp_vn_cc_10010;
75 nucc_channels[2] = kSpp_vn_cc_01100;
76 nunc_channels[0] = kSpp_vp_nc_10010;
77 nunc_channels[1] = kSpp_vp_nc_01100;
78 nunc_channels[2] = kSpp_vn_nc_01010;
79 nunc_channels[3] = kSpp_vn_nc_10001;
80 }
81 else if ( pdg::IsAntiNeutrino(nupdg) ) {
82 nucc_channels[0] = kSpp_vbn_cc_01001;
83 nucc_channels[1] = kSpp_vbp_cc_01010;
84 nucc_channels[2] = kSpp_vbp_cc_10001;
85 nunc_channels[0] = kSpp_vbp_nc_10010;
86 nunc_channels[1] = kSpp_vbp_nc_01100;
87 nunc_channels[2] = kSpp_vbn_nc_01010;
88 nunc_channels[3] = kSpp_vbn_nc_10001;
89 }
90 else {
91 LOG("IntLst", pWARN)
92 << "Can not handle probe! Returning NULL InteractionList "
93 << "for init-state: " << init_state.AsString();
94 return 0;
95 }
96
97 Target * inp_target = init_state.TgtPtr();
98 bool hasP = (inp_target->Z() > 0);
99 bool hasN = (inp_target->N() > 0);
100
101 InteractionList * intlist = new InteractionList;
102
103 if(fIsCC){
104
105 // CC
106 for(int i=0; i<n_nucc_channels; i++) {
107 int struck_nucleon = SppChannel::InitStateNucleon(nucc_channels[i]);
108
109 if( (struck_nucleon == kPdgProton && hasP) ||
110 (struck_nucleon == kPdgNeutron && hasN) ) {
111
112 ProcessInfo proc_info(kScSinglePion, kIntWeakCC);
113 Interaction * interaction = new Interaction(init_state, proc_info);
114
115 Target * target = interaction->InitStatePtr()->TgtPtr();
116
117 target->SetHitNucPdg(struck_nucleon);
118 this->AddFinalStateInfo(interaction, nucc_channels[i]);
119
120 intlist->push_back(interaction);
121 }
122 }//cc channels
123
124 } else if (fIsNC) {
125
126 // NC
127 for(int i=0; i<n_nunc_channels; i++) {
128 int struck_nucleon = SppChannel::InitStateNucleon(nunc_channels[i]);
129
130 if( (struck_nucleon == kPdgProton && hasP) ||
131 (struck_nucleon == kPdgNeutron && hasN) ) {
132
133 ProcessInfo proc_info(kScSinglePion, kIntWeakNC);
134 Interaction * interaction = new Interaction(init_state, proc_info);
135
136 Target * target = interaction->InitStatePtr()->TgtPtr();
137
138 target->SetHitNucPdg(struck_nucleon);
139 this->AddFinalStateInfo(interaction, nunc_channels[i]);
140
141 intlist->push_back(interaction);
142 }
143 }//nc channels
144 }//cc/nc
145
146 if(intlist->size() == 0) {
147 LOG("IntLst", pERROR)
148 << "Returning NULL InteractionList for init-state: "
149 << init_state.AsString();
150 delete intlist;
151 return 0;
152 }
153
154 return intlist;
155}
#define pINFO
Definition Messenger.h:62
#define pWARN
Definition Messenger.h:60
Target * TgtPtr(void) const
InitialState * InitStatePtr(void) const
Definition Interaction.h:74
void AddFinalStateInfo(Interaction *i, SppChannel_t chan) const
static int InitStateNucleon(SppChannel_t channel)
Definition SppChannel.h:103
void SetHitNucPdg(int pdgc)
Definition Target.cxx:171
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
bool IsNeutrino(int pdgc)
Definition PDGUtils.cxx:110
bool IsAntiNeutrino(int pdgc)
Definition PDGUtils.cxx:118
@ kSpp_vp_cc_10100
Definition SppChannel.h:50
@ kSpp_vbn_nc_10001
Definition SppChannel.h:66
@ kSppNull
Definition SppChannel.h:46
@ kSpp_vbp_nc_10010
Definition SppChannel.h:63
@ kSpp_vp_nc_01100
Definition SppChannel.h:55
@ kSpp_vn_nc_01010
Definition SppChannel.h:56
@ kSpp_vbn_cc_01001
Definition SppChannel.h:59
@ kSpp_vn_cc_01100
Definition SppChannel.h:52
@ kSpp_vn_nc_10001
Definition SppChannel.h:57
@ kSpp_vbp_nc_01100
Definition SppChannel.h:64
@ kSpp_vn_cc_10010
Definition SppChannel.h:51
@ kSpp_vbp_cc_01010
Definition SppChannel.h:60
@ kSpp_vbp_cc_10001
Definition SppChannel.h:61
@ kSpp_vbn_nc_01010
Definition SppChannel.h:65
@ kSpp_vp_nc_10010
Definition SppChannel.h:54
enum genie::ESppChannel SppChannel_t
@ kScSinglePion

References AddFinalStateInfo(), genie::InitialState::AsString(), fIsCC, fIsNC, genie::SppChannel::InitStateNucleon(), genie::Interaction::InitStatePtr(), genie::pdg::IsAntiNeutrino(), genie::pdg::IsNeutrino(), genie::kIntWeakCC, genie::kIntWeakNC, genie::kPdgNeutron, genie::kPdgProton, genie::kScSinglePion, genie::kSpp_vbn_cc_01001, genie::kSpp_vbn_nc_01010, genie::kSpp_vbn_nc_10001, genie::kSpp_vbp_cc_01010, genie::kSpp_vbp_cc_10001, genie::kSpp_vbp_nc_01100, genie::kSpp_vbp_nc_10010, genie::kSpp_vn_cc_01100, genie::kSpp_vn_cc_10010, genie::kSpp_vn_nc_01010, genie::kSpp_vn_nc_10001, genie::kSpp_vp_cc_10100, genie::kSpp_vp_nc_01100, genie::kSpp_vp_nc_10010, genie::kSppNull, LOG, genie::Target::N(), pERROR, pINFO, genie::InitialState::ProbePdg(), pWARN, genie::Target::SetHitNucPdg(), genie::InitialState::TgtPtr(), and genie::Target::Z().

◆ LoadConfigData()

void RSPPInteractionListGenerator::LoadConfigData ( void )
private

Definition at line 205 of file RSPPInteractionListGenerator.cxx.

206{
207 this->GetParamDef("is-CC", fIsCC, false);
208 this->GetParamDef("is-NC", fIsNC, false);
209}
bool GetParamDef(const RgKey &name, T &p, const T &def) const

References fIsCC, fIsNC, and genie::Algorithm::GetParamDef().

Referenced by Configure(), and Configure().

Member Data Documentation

◆ fIsCC

bool genie::RSPPInteractionListGenerator::fIsCC
private

Definition at line 49 of file RSPPInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

◆ fIsNC

bool genie::RSPPInteractionListGenerator::fIsNC
private

Definition at line 50 of file RSPPInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


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