GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::SKInteractionListGenerator Class Reference

Concrete implementations of the InteractionListGeneratorI interface. Creates a list of all the interactions that can be generated by the single-Kaon generator. More...

#include <SKInteractionListGenerator.h>

Inheritance diagram for genie::SKInteractionListGenerator:
Inheritance graph
[legend]
Collaboration diagram for genie::SKInteractionListGenerator:
Collaboration graph
[legend]

Public Member Functions

 SKInteractionListGenerator ()
 
 SKInteractionListGenerator (string config)
 
 ~SKInteractionListGenerator ()
 
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 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. 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
 
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. More...
 
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 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< bool > fOwnerships
 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

Concrete implementations of the InteractionListGeneratorI interface. Creates a list of all the interactions that can be generated by the single-Kaon generator.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
March 20, 2014
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 27 of file SKInteractionListGenerator.h.

Constructor & Destructor Documentation

SKInteractionListGenerator::SKInteractionListGenerator ( )

Definition at line 24 of file SKInteractionListGenerator.cxx.

24  :
25 InteractionListGeneratorI("genie::SKInteractionListGenerator")
26 {
27 
28 }
SKInteractionListGenerator::SKInteractionListGenerator ( string  config)

Definition at line 30 of file SKInteractionListGenerator.cxx.

30  :
31 InteractionListGeneratorI("genie::SKInteractionListGenerator", config)
32 {
33 
34 }
SKInteractionListGenerator::~SKInteractionListGenerator ( )

Definition at line 36 of file SKInteractionListGenerator.cxx.

37 {
38 
39 }

Member Function Documentation

void SKInteractionListGenerator::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 118 of file SKInteractionListGenerator.cxx.

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

119 {
120  Algorithm::Configure(config);
121  this->LoadConfigData();
122 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void SKInteractionListGenerator::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 124 of file SKInteractionListGenerator.cxx.

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

125 {
126  Algorithm::Configure(config);
127  this->LoadConfigData();
128 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * SKInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 41 of file SKInteractionListGenerator.cxx.

References genie::InitialState::AsString(), genie::Interaction::ExclTagPtr(), fIsCC, fIsNC, genie::Interaction::InitStatePtr(), genie::pdg::IsNeutrino(), genie::kIntWeakCC, genie::kPdgK0, genie::kPdgKM, genie::kPdgKP, genie::kPdgNeutron, genie::kPdgProton, genie::kScSingleKaon, LOG, genie::Target::N(), pINFO, genie::InitialState::ProbePdg(), pWARN, genie::Target::SetHitNucPdg(), genie::XclsTag::SetNNeutrons(), genie::XclsTag::SetNProtons(), genie::XclsTag::SetStrange(), genie::InitialState::TgtPtr(), and genie::Target::Z().

43 {
44  LOG("IntLst", pINFO)
45  << "InitialState = " << init_state.AsString();
46 
47  if (fIsNC) {
48  // deltaS = deltaQ and deltaS = 1 for this process -- no NC
49  LOG("IntLst", pWARN)
50  << "Interaction type is NC for deltaS = 1 process! Returning NULL InteractionList "
51  << "for init-state: " << init_state.AsString();
52  return 0;
53  }
54  else if (!fIsCC) {
55  // shouldn't happen... warn
56  LOG("IntLst", pWARN)
57  << "Unknown InteractionType! Returning NULL InteractionList "
58  << "for init-state: " << init_state.AsString();
59  return 0;
60  }
61 
62  int probe_pdg = init_state.ProbePdg();
63  bool isnu = pdg::IsNeutrino(probe_pdg);
64  if( !isnu ) {
65  // shouldn't happen... warn
66  LOG("IntLst", pWARN)
67  << "Can not handle probe! Returning NULL InteractionList "
68  << "for init-state: " << init_state.AsString();
69  return 0;
70  }
71 
72  InteractionList * intlist = new InteractionList;
73 
74  const int nch = 3;
75  int inuclpdg[nch] = {0}; // hit nucleon pdg
76  int fnuclpdg[nch] = {0}; // FS nucleon pdg
77  int kaonpdg[nch] = {0}; // FS kaon pdg
78  if( pdg::IsNeutrino(probe_pdg) ) {
79  inuclpdg[0] = kPdgProton; inuclpdg[1] = kPdgNeutron; inuclpdg[2] = kPdgNeutron;
80  fnuclpdg[0] = kPdgProton; fnuclpdg[1] = kPdgNeutron; fnuclpdg[2] = kPdgProton;
81  kaonpdg[0] = kPdgKP; kaonpdg[1] = kPdgKP; kaonpdg[2] = kPdgK0;
82  } else {
83  inuclpdg[0] = kPdgProton; inuclpdg[1] = kPdgNeutron; inuclpdg[2] = kPdgProton;
84  fnuclpdg[0] = kPdgProton; fnuclpdg[1] = kPdgNeutron; fnuclpdg[2] = kPdgNeutron;
85  kaonpdg[0] = kPdgKM; kaonpdg[1] = kPdgKM; kaonpdg[2] = kPdgK0;
86  }
87 
88  for(int i=0; i<nch; i++) {
89 
91  Interaction * interaction = new Interaction(init_state, proc_info);
92 
93  Target * target = interaction->InitStatePtr()->TgtPtr();
94  bool hasP = (target->Z() > 0);
95  bool hasN = (target->N() > 0);
96 
97  XclsTag * xcls = interaction->ExclTagPtr();
98 
99  if(inuclpdg[i] == kPdgProton && !hasP) {
100  delete interaction;
101  continue;
102  }
103  if(inuclpdg[i] == kPdgNeutron && !hasN) {
104  delete interaction;
105  continue;
106  }
107  target->SetHitNucPdg(inuclpdg[i]);
108  xcls->SetStrange(kaonpdg[i]);
109  if( fnuclpdg[i] == kPdgProton ) xcls->SetNProtons(1);
110  else xcls->SetNNeutrons(1);
111 
112  intlist->push_back(interaction);
113  }
114 
115  return intlist;
116 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
const int kPdgK0
Definition: PDGCodes.h:174
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
const int kPdgKM
Definition: PDGCodes.h:173
void SetStrange(int strange_pdgc=0)
Definition: XclsTag.cxx:76
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
const int kPdgKP
Definition: PDGCodes.h:172
void SetNNeutrons(int nn)
Definition: XclsTag.h:82
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
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 SetNProtons(int np)
Definition: XclsTag.h:81
void SKInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 130 of file SKInteractionListGenerator.cxx.

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

Referenced by Configure().

131 {
132  this->GetParamDef("is-CC", fIsCC, false);
133  this->GetParamDef("is-NC", fIsNC, false);
134 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const

Member Data Documentation

bool genie::SKInteractionListGenerator::fIsCC
private

Definition at line 47 of file SKInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::SKInteractionListGenerator::fIsNC
private

Definition at line 48 of file SKInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


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