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

#include <DMELInteractionListGenerator.h>

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

Public Member Functions

 DMELInteractionListGenerator ()
 
 DMELInteractionListGenerator (string config)
 
 ~DMELInteractionListGenerator ()
 
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)
 
InteractionListCreateInteractionListDM (const InitialState &init) const
 

Private Attributes

bool fIsDM
 

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

Definition at line 30 of file DMELInteractionListGenerator.h.

Constructor & Destructor Documentation

DMELInteractionListGenerator::DMELInteractionListGenerator ( )

Definition at line 25 of file DMELInteractionListGenerator.cxx.

25  :
26 InteractionListGeneratorI("genie::DMELInteractionListGenerator")
27 {
28 
29 }
DMELInteractionListGenerator::DMELInteractionListGenerator ( string  config)

Definition at line 31 of file DMELInteractionListGenerator.cxx.

31  :
32 InteractionListGeneratorI("genie::DMELInteractionListGenerator", config)
33 {
34 
35 }
DMELInteractionListGenerator::~DMELInteractionListGenerator ( )

Definition at line 37 of file DMELInteractionListGenerator.cxx.

38 {
39 
40 }

Member Function Documentation

void DMELInteractionListGenerator::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 108 of file DMELInteractionListGenerator.cxx.

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

109 {
110  Algorithm::Configure(config);
111  this->LoadConfigData();
112 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void DMELInteractionListGenerator::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 114 of file DMELInteractionListGenerator.cxx.

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

115 {
116  Algorithm::Configure(config);
117  this->LoadConfigData();
118 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * DMELInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 42 of file DMELInteractionListGenerator.cxx.

References genie::InitialState::AsString(), CreateInteractionListDM(), fIsDM, LOG, pINFO, and pWARN.

44 {
45  LOG("IntLst", pINFO)
46  << "InitialState = " << init_state.AsString();
47 
48  if (fIsDM)
49  return this->CreateInteractionListDM(init_state);
50  else {
51  LOG("IntLst", pWARN)
52  << "Unknown InteractionType! Returning NULL InteractionList "
53  << "for init-state: " << init_state.AsString();
54  return 0;
55  }
56  return 0;
57 }
InteractionList * CreateInteractionListDM(const InitialState &init) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
InteractionList * DMELInteractionListGenerator::CreateInteractionListDM ( const InitialState init) const
private

Definition at line 59 of file DMELInteractionListGenerator.cxx.

References genie::InitialState::AsString(), genie::Interaction::InitStatePtr(), genie::pdg::IsAntiDarkMatter(), genie::pdg::IsDarkMatter(), genie::kIntDarkMatter, genie::kPdgNeutron, genie::kPdgProton, genie::kScDarkMatterElastic, LOG, genie::Target::N(), pINFO, genie::InitialState::ProbePdg(), pWARN, genie::Target::SetHitNucPdg(), genie::InitialState::TgtPtr(), and genie::Target::Z().

Referenced by CreateInteractionList().

61 {
62  InteractionList * intlist = new InteractionList;
63 
64  int nuclpdg[2] = { kPdgProton, kPdgNeutron };
65 
66  int dmpdg = init_state.ProbePdg();
67  bool isdm = pdg::IsDarkMatter(dmpdg) || pdg::IsAntiDarkMatter(dmpdg);
68 
69  if(!isdm) {
70  LOG("IntLst", pWARN)
71  << "Can not handle probe! Returning NULL InteractionList "
72  << "for init-state: " << init_state.AsString();
73  delete intlist;
74  return 0;
75  }
76 
77  for(int i=0; i<2; i++) {
78 
80  Interaction * interaction = new Interaction(init_state, proc_info);
81 
82  Target * target = interaction->InitStatePtr()->TgtPtr();
83  bool hasP = (target->Z() > 0);
84  bool hasN = (target->N() > 0);
85 
86  if(nuclpdg[i] == kPdgProton && !hasP) {
87  delete interaction;
88  continue;
89  }
90  if(nuclpdg[i] == kPdgNeutron && !hasN) {
91  delete interaction;
92  continue;
93  }
94  target->SetHitNucPdg(nuclpdg[i]);
95  intlist->push_back(interaction);
96  }
97 
98  if(intlist->size() == 0) {
99  LOG("IntLst", pINFO)
100  << "Returning NULL InteractionList for init-state: "
101  << init_state.AsString();
102  delete intlist;
103  return 0;
104  }
105  return intlist;
106 }
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:127
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
bool IsAntiDarkMatter(int pdgc)
Definition: PDGUtils.cxx:133
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
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 DMELInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 120 of file DMELInteractionListGenerator.cxx.

References fIsDM, and genie::Algorithm::GetParamDef().

Referenced by Configure().

121 {
122  GetParamDef( "is-DM", fIsDM, false );
123 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const

Member Data Documentation

bool genie::DMELInteractionListGenerator::fIsDM
private

Definition at line 51 of file DMELInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


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