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::MECInteractionListGenerator Class Reference

Concrete implementations of the InteractionListGeneratorI interface. Generates a list of all the interactions that can be generated by the MEC EventGenerator. More...

#include <MECInteractionListGenerator.h>

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

Public Member Functions

 MECInteractionListGenerator ()
 
 MECInteractionListGenerator (string config)
 
 ~MECInteractionListGenerator ()
 
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
 
bool fSetDiNucleonCode
 
bool fSetDiNucleonCodeEM
 

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. Generates a list of all the interactions that can be generated by the MEC EventGenerator.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
Sep 22, 2008
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 MECInteractionListGenerator.h.

Constructor & Destructor Documentation

MECInteractionListGenerator::MECInteractionListGenerator ( )

Definition at line 22 of file MECInteractionListGenerator.cxx.

22  :
23 InteractionListGeneratorI("genie::MECInteractionListGenerator")
24 {
25 
26 }
MECInteractionListGenerator::MECInteractionListGenerator ( string  config)

Definition at line 28 of file MECInteractionListGenerator.cxx.

28  :
29 InteractionListGeneratorI("genie::MECInteractionListGenerator", config)
30 {
31 
32 }
MECInteractionListGenerator::~MECInteractionListGenerator ( )

Definition at line 34 of file MECInteractionListGenerator.cxx.

35 {
36 
37 }

Member Function Documentation

void MECInteractionListGenerator::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 116 of file MECInteractionListGenerator.cxx.

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

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

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

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

Implements genie::InteractionListGeneratorI.

Definition at line 40 of file MECInteractionListGenerator.cxx.

References genie::Target::A(), genie::InitialState::AsString(), fIsCC, fIsEM, fIsNC, fSetDiNucleonCode, fSetDiNucleonCodeEM, genie::pdg::IsAntiNeutrino(), genie::pdg::IsNeutrino(), genie::kPdgClusterNN, genie::kPdgClusterNP, genie::kPdgClusterPP, LOG, genie::Interaction::MECCC(), genie::Interaction::MECEM(), genie::Interaction::MECNC(), genie::Target::Pdg(), pINFO, genie::InitialState::ProbePdg(), pWARN, and genie::InitialState::Tgt().

42 {
43  LOG("IntLst", pINFO) << "InitialState = " << init_state.AsString();
44 
45  int nupdg = init_state.ProbePdg();
46  int tgtpdg = init_state.Tgt().Pdg();
47 
48  const Target & target = init_state.Tgt();
49 
50  if(target.A() < 4) return 0;
51 
52  InteractionList * intlist = new InteractionList;
53 
54  if(!fSetDiNucleonCode&&fIsCC) {
55  LOG("IntLst", pWARN) << "fIsCC(val) = " << fIsCC;
56  Interaction * interaction = Interaction::MECCC(tgtpdg, nupdg, 0.0);
57  intlist->push_back(interaction);
58  }
59 
61  LOG("IntLst", pWARN) << "fIsCC(val) = " << fIsCC;
62  Interaction * interaction = Interaction::MECEM(tgtpdg, nupdg, 0.0);
63  intlist->push_back(interaction);
64  }
65 
66  const int nc = 3;
67  const int nucleon_cluster[nc] = {
69 
70  for(int ic = 0; ic < nc; ic++) {
71  int ncpdg = nucleon_cluster[ic];
73  bool allowed = false;
74  LOG("IntLst", pWARN) << "fIsCC(emp) = " << fIsCC;
75  if(pdg::IsNeutrino(nupdg)) {
76  // neutrino CC => final state primary lepton is -1
77  // therefore the nucleon-cluster charge needs to be incremented by +1.
78  if(ncpdg == kPdgClusterNN || ncpdg == kPdgClusterNP) {
79  allowed = true;
80  }
81  }
82  else
83  if(pdg::IsAntiNeutrino(nupdg)) {
84  // anti-neutrino CC => final state primary lepton is +1
85  // therefore the nucleon-cluster charge needs to be incremented by -1.
86  if(ncpdg == kPdgClusterNP || ncpdg == kPdgClusterPP) {
87  allowed = true;
88  }
89  }
90  if(allowed) {
91  Interaction * interaction =
92  Interaction::MECCC(tgtpdg,ncpdg,nupdg,0);
93  intlist->push_back(interaction);
94  }
95  }//CC?
96  else
97  if(fIsNC)
98  {
99  LOG("IntLst", pWARN) << "fIsNC = " << fIsNC;
100  Interaction * interaction =
101  Interaction::MECNC(tgtpdg,ncpdg,nupdg,0);
102  intlist->push_back(interaction);
103  }//NC?
104  else
106  LOG("IntLst", pWARN) << "fIsEM = " << fIsEM << " ncpdg = " << ncpdg;
107  Interaction * interaction =
108  Interaction::MECEM(tgtpdg,ncpdg,nupdg,0);
109  intlist->push_back(interaction);
110  }//EM?
111  }
112  return intlist;
113 
114 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
int A(void) const
Definition: Target.h:70
const int kPdgClusterNP
Definition: PDGCodes.h:215
static Interaction * MECNC(int tgt, int nuccluster, int probe, double E=0)
const int kPdgClusterNN
Definition: PDGCodes.h:214
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 Interaction * MECEM(int tgt, int nuccluster, int probe, double E=0)
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:118
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
A vector of Interaction objects.
static Interaction * MECCC(int tgt, int nuccluster, int probe, double E=0)
const int kPdgClusterPP
Definition: PDGCodes.h:216
void MECInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 128 of file MECInteractionListGenerator.cxx.

References fIsCC, fIsEM, fIsNC, fSetDiNucleonCode, fSetDiNucleonCodeEM, genie::Algorithm::GetParam(), and genie::Algorithm::GetParamDef().

Referenced by Configure().

129 {
130  GetParamDef( "is-CC", fIsCC, false ) ;
131  GetParamDef( "is-NC", fIsNC, false ) ;
132  GetParamDef( "is-EM", fIsEM, false ) ;
133 
134  GetParam( "SetDiNucleonCode", fSetDiNucleonCode ) ;
135  GetParam( "SetDiNucleonCodeEM", fSetDiNucleonCodeEM ) ;
136 
137 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const

Member Data Documentation

bool genie::MECInteractionListGenerator::fIsCC
private

Definition at line 46 of file MECInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::MECInteractionListGenerator::fIsEM
private

Definition at line 48 of file MECInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::MECInteractionListGenerator::fIsNC
private

Definition at line 47 of file MECInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::MECInteractionListGenerator::fSetDiNucleonCode
private

Definition at line 49 of file MECInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::MECInteractionListGenerator::fSetDiNucleonCodeEM
private

Definition at line 50 of file MECInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


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