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::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:
Inheritance graph
[legend]
Collaboration diagram for genie::RESInteractionListGenerator:
Collaboration graph
[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. 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
 
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. 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

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 cern.ch> University of Liverpool
Created:
May 13, 2005
License:
Copyright (c) 2003-2024, 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::RESInteractionListGenerator ( )

Definition at line 23 of file RESInteractionListGenerator.cxx.

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

Definition at line 29 of file RESInteractionListGenerator.cxx.

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

Definition at line 35 of file RESInteractionListGenerator.cxx.

36 {
37 
38 }

Member Function Documentation

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.

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

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

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

149 {
150  Algorithm::Configure(config);
151  this->LoadConfigData();
152 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * RESInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 40 of file RESInteractionListGenerator.cxx.

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(), genie::BaryonResList::NResonances(), pERROR, pINFO, genie::InitialState::ProbePdg(), pWARN, genie::BaryonResList::ResonanceId(), genie::Target::SetHitNucPdg(), genie::XclsTag::SetResonance(), genie::InitialState::Tgt(), genie::InitialState::TgtPtr(), and genie::Target::Z().

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 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
#define pERROR
Definition: Messenger.h:59
enum genie::EResonance Resonance_t
unsigned int NResonances(void) const
void SetResonance(Resonance_t res)
Definition: XclsTag.cxx:128
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
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
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
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
enum genie::EInteractionType InteractionType_t
Resonance_t ResonanceId(unsigned int ires) const
void RESInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 154 of file RESInteractionListGenerator.cxx.

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

Referenced by Configure().

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 }
void DecodeFromNameList(string list, string delimiter=",")
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
#define pDEBUG
Definition: Messenger.h:63

Member Data Documentation

bool genie::RESInteractionListGenerator::fIsCC
private

Definition at line 47 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::RESInteractionListGenerator::fIsEM
private

Definition at line 49 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::RESInteractionListGenerator::fIsNC
private

Definition at line 48 of file RESInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

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: