GENIEGenerator
Loading...
Searching...
No Matches
genie::DMELInteractionListGenerator Class Reference

#include <DMELInteractionListGenerator.h>

Inheritance diagram for genie::DMELInteractionListGenerator:
[legend]
Collaboration diagram for genie::DMELInteractionListGenerator:
[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.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
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.

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

Detailed Description

Definition at line 30 of file DMELInteractionListGenerator.h.

Constructor & Destructor Documentation

◆ DMELInteractionListGenerator() [1/2]

DMELInteractionListGenerator::DMELInteractionListGenerator ( )

Definition at line 25 of file DMELInteractionListGenerator.cxx.

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

References genie::InteractionListGeneratorI::InteractionListGeneratorI().

◆ DMELInteractionListGenerator() [2/2]

DMELInteractionListGenerator::DMELInteractionListGenerator ( string config)

Definition at line 31 of file DMELInteractionListGenerator.cxx.

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

References genie::InteractionListGeneratorI::InteractionListGeneratorI().

◆ ~DMELInteractionListGenerator()

DMELInteractionListGenerator::~DMELInteractionListGenerator ( )

Definition at line 37 of file DMELInteractionListGenerator.cxx.

38{
39
40}

Member Function Documentation

◆ Configure() [1/2]

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.

109{
110 Algorithm::Configure(config);
111 this->LoadConfigData();
112}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

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

◆ Configure() [2/2]

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.

115{
116 Algorithm::Configure(config);
117 this->LoadConfigData();
118}

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

◆ CreateInteractionList()

InteractionList * DMELInteractionListGenerator::CreateInteractionList ( const InitialState & init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 42 of file DMELInteractionListGenerator.cxx.

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}
#define pINFO
Definition Messenger.h:62
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60
InteractionList * CreateInteractionListDM(const InitialState &init) const

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

◆ CreateInteractionListDM()

InteractionList * DMELInteractionListGenerator::CreateInteractionListDM ( const InitialState & init) const
private

Definition at line 59 of file DMELInteractionListGenerator.cxx.

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
79 ProcessInfo proc_info(kScDarkMatterElastic, kIntDarkMatter);
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}
Target * TgtPtr(void) const
InitialState * InitStatePtr(void) const
Definition Interaction.h:74
void SetHitNucPdg(int pdgc)
Definition Target.cxx:171
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
bool IsAntiDarkMatter(int pdgc)
Definition PDGUtils.cxx:133
bool IsDarkMatter(int pdgc)
Definition PDGUtils.cxx:127
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgNeutron
Definition PDGCodes.h:83
@ kScDarkMatterElastic

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().

◆ LoadConfigData()

void DMELInteractionListGenerator::LoadConfigData ( void )
private

Definition at line 120 of file DMELInteractionListGenerator.cxx.

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

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

Referenced by Configure(), and Configure().

Member Data Documentation

◆ fIsDM

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: