Public Member Functions | Private Member Functions | Private Attributes | List of all members
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:
genie::InteractionListGeneratorI genie::Algorithm

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. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
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. More...
 

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)
 
- 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. More...
 
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. More...
 
int GetParamVectKeys (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 More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< boolfOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

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 <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

May 13, 2005

Copyright (c) 2003-2020, 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::RSPPInteractionListGenerator ( )

Definition at line 19 of file RSPPInteractionListGenerator.cxx.

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

Definition at line 25 of file RSPPInteractionListGenerator.cxx.

25  :
26 InteractionListGeneratorI("genie::RSPPInteractionListGenerator", config)
27 {
28 
29 }
static Config * config
Definition: config.cpp:1054
RSPPInteractionListGenerator::~RSPPInteractionListGenerator ( )

Definition at line 31 of file RSPPInteractionListGenerator.cxx.

32 {
33 
34 }

Member Function Documentation

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 }
void SetNPions(int npi_plus, int npi_0, int npi_minus)
Definition: XclsTag.cxx:88
#define pERROR
Definition: Messenger.h:59
static int FinStateNucleon(SppChannel_t channel)
Definition: SppChannel.h:119
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
static int FinStatePion(SppChannel_t channel)
Definition: SppChannel.h:146
void SetNNucleons(int np, int nn)
Definition: XclsTag.cxx:95
const int kPdgPiM
Definition: PDGCodes.h:159
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
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
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 {
202  this->LoadConfigData();
203 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
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(kScResonant, 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(kScResonant, 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 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
#define pERROR
Definition: Messenger.h:59
enum genie::ESppChannel SppChannel_t
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
static int InitStateNucleon(SppChannel_t channel)
Definition: SppChannel.h:92
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
void AddFinalStateInfo(Interaction *i, SppChannel_t chan) const
#define pWARN
Definition: Messenger.h:60
int N(void) const
Definition: Target.h:69
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:171
Target * TgtPtr(void) const
Definition: InitialState.h:67
A vector of Interaction objects.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
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

Member Data Documentation

bool genie::RSPPInteractionListGenerator::fIsCC
private

Definition at line 49 of file RSPPInteractionListGenerator.h.

bool genie::RSPPInteractionListGenerator::fIsNC
private

Definition at line 50 of file RSPPInteractionListGenerator.h.


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