Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::QELInteractionListGenerator Class Reference

Concrete implementations of the InteractionListGeneratorI interface. Generates a list of all the Interaction (= event summary) objects that can be generated by the QEL EventGenerator. More...

#include <QELInteractionListGenerator.h>

Inheritance diagram for genie::QELInteractionListGenerator:
genie::InteractionListGeneratorI genie::Algorithm

Public Member Functions

 QELInteractionListGenerator ()
 
 QELInteractionListGenerator (string config)
 
 ~QELInteractionListGenerator ()
 
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)
 
InteractionListCreateInteractionListCC (const InitialState &init) const
 
InteractionListCreateInteractionListNC (const InitialState &init) const
 
InteractionListCreateInteractionListEM (const InitialState &init) const
 
InteractionListCreateInteractionListCharmCC (const InitialState &init) const
 
InteractionListCreateInteractionListStrangeCC (const InitialState &init) const
 

Private Attributes

bool fIsCC
 
bool fIsNC
 
bool fIsEM
 
bool fIsCharm
 
bool fIsStrange
 

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)
 
- 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
 
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< boolfOwnerships
 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 Interaction (= event summary) objects that can be generated by the QEL EventGenerator.

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

May 13, 2005

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 27 of file QELInteractionListGenerator.h.

Constructor & Destructor Documentation

QELInteractionListGenerator::QELInteractionListGenerator ( )

Definition at line 21 of file QELInteractionListGenerator.cxx.

21  :
22 InteractionListGeneratorI("genie::QELInteractionListGenerator")
23 {
24 
25 }
QELInteractionListGenerator::QELInteractionListGenerator ( string  config)

Definition at line 27 of file QELInteractionListGenerator.cxx.

27  :
28 InteractionListGeneratorI("genie::QELInteractionListGenerator", config)
29 {
30 
31 }
static Config * config
Definition: config.cpp:1054
QELInteractionListGenerator::~QELInteractionListGenerator ( )

Definition at line 33 of file QELInteractionListGenerator.cxx.

34 {
35 
36 }

Member Function Documentation

void QELInteractionListGenerator::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 296 of file QELInteractionListGenerator.cxx.

297 {
298  Algorithm::Configure(config);
299  this->LoadConfigData();
300 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void QELInteractionListGenerator::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 302 of file QELInteractionListGenerator.cxx.

303 {
305  this->LoadConfigData();
306 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * QELInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 38 of file QELInteractionListGenerator.cxx.

40 {
41  LOG("IntLst", pINFO)
42  << "InitialState = " << init_state.AsString();
43 
44  if (fIsCC && !fIsCharm && !fIsStrange)
45  return this->CreateInteractionListCC(init_state);
46  else
47  if (fIsNC && !fIsCharm && !fIsStrange)
48  return this->CreateInteractionListNC(init_state);
49  else
50  if (fIsEM)
51  return this->CreateInteractionListEM(init_state);
52  else
53  if (fIsCC && fIsCharm)
54  return this->CreateInteractionListCharmCC(init_state);
55  else
56  if (fIsCC && fIsStrange)
57  return this->CreateInteractionListStrangeCC(init_state);
58  else {
59  LOG("IntLst", pWARN)
60  << "Unknown InteractionType! Returning NULL InteractionList "
61  << "for init-state: " << init_state.AsString();
62  return 0;
63  }
64  return 0;
65 }
InteractionList * CreateInteractionListCharmCC(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
InteractionList * CreateInteractionListNC(const InitialState &init) const
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
InteractionList * CreateInteractionListStrangeCC(const InitialState &init) const
InteractionList * CreateInteractionListEM(const InitialState &init) const
InteractionList * CreateInteractionListCC(const InitialState &init) const
InteractionList * QELInteractionListGenerator::CreateInteractionListCC ( const InitialState init) const
private

Definition at line 67 of file QELInteractionListGenerator.cxx.

69 {
70  InteractionList * intlist = new InteractionList;
71 
73  Interaction * interaction = new Interaction(init_state, proc_info);
74 
75  int nupdg = init_state.ProbePdg();
76  bool isnu = pdg::IsNeutrino (nupdg);
77  bool isnubar = pdg::IsAntiNeutrino (nupdg);
78 
79  Target * target = interaction->InitStatePtr()->TgtPtr();
80  bool hasP = (target->Z() > 0);
81  bool hasN = (target->N() > 0);
82 
83  if(!isnu && !isnubar) {
84  LOG("IntLst", pWARN)
85  << "Can not handle probe! Returning NULL InteractionList "
86  << "for init-state: " << init_state.AsString();
87  delete intlist;
88  return 0;
89  }
90 
91  if (isnu && hasN) {
92  target->SetHitNucPdg(kPdgNeutron);
93  intlist->push_back(interaction);
94 
95  } else if (isnubar && hasP) {
96  target->SetHitNucPdg(kPdgProton);
97  intlist->push_back(interaction);
98 
99  } else {
100  LOG("IntLst", pINFO)
101  << "Returning NULL InteractionList for init-state: "
102  << init_state.AsString();
103  delete interaction;
104  delete intlist;
105  return 0;
106  }
107  return intlist;
108 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
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
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
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
InteractionList * QELInteractionListGenerator::CreateInteractionListCharmCC ( const InitialState init) const
private

Definition at line 197 of file QELInteractionListGenerator.cxx.

199 {
200  // vl + n --> l- + Lambda_{c}^{+} (2285)
201  // vl + n --> l- + Sigma_{c}^{+} (2455)
202  // vl + p --> l- + Sigma_{c}^{++} (2455)
203 
204  int nupdg = init_state.ProbePdg();
205  bool isnu = pdg::IsNeutrino(nupdg);
206  if(!isnu) {
207  LOG("IntLst", pINFO)
208  << "Returning NULL InteractionList for init-state: "
209  << init_state.AsString();
210  return 0;
211  }
212 
213  const int nch = 3;
214  int nuclpdg [nch] = { kPdgNeutron, kPdgNeutron, kPdgProton };
215  int charmpdg[nch] = { kPdgLambdaPc, kPdgSigmaPc, kPdgSigmaPPc };
216 
217  InteractionList * intlist = new InteractionList;
218 
219  for(int i=0; i<nch; i++) {
220 
222  Interaction * interaction = new Interaction(init_state, proc_info);
223 
224  Target * target = interaction->InitStatePtr()->TgtPtr();
225  bool hasP = (target->Z() > 0);
226  bool hasN = (target->N() > 0);
227 
228  XclsTag * xcls = interaction->ExclTagPtr();
229 
230  if(nuclpdg[i] == kPdgProton && !hasP) {
231  delete interaction;
232  continue;
233  }
234  if(nuclpdg[i] == kPdgNeutron && !hasN) {
235  delete interaction;
236  continue;
237  }
238  target->SetHitNucPdg(nuclpdg[i]);
239  xcls->SetCharm(charmpdg[i]);
240 
241  intlist->push_back(interaction);
242  }
243  return intlist;
244 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
const int kPdgSigmaPPc
Definition: PDGCodes.h:102
void SetCharm(int charm_pdgc=0)
Definition: XclsTag.cxx:59
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
const int kPdgLambdaPc
Definition: PDGCodes.h:99
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
int N(void) const
Definition: Target.h:69
const int kPdgSigmaPc
Definition: PDGCodes.h:101
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
InteractionList * QELInteractionListGenerator::CreateInteractionListEM ( const InitialState init) const
private

Definition at line 160 of file QELInteractionListGenerator.cxx.

162 {
163  InteractionList * intlist = new InteractionList;
164 
165  int tgtpdg = init_state.Tgt().Pdg();
166  int ppdg = init_state.ProbePdg();
167 
168  bool ischgl = pdg::IsChargedLepton(ppdg);
169  if(!ischgl) {
170  LOG("IntLst", pWARN)
171  << "Can not handle probe! Returning NULL InteractionList "
172  << "for init-state: " << init_state.AsString();
173  delete intlist;
174  return 0;
175  }
176 
177  bool hasP = (init_state.Tgt().Z() > 0);
178  if(hasP) {
180  intlist->push_back(interaction);
181  }
182  bool hasN = (init_state.Tgt().N() > 0);
183  if(hasN) {
184  Interaction * interaction = Interaction::QELEM(tgtpdg,kPdgNeutron,ppdg);
185  intlist->push_back(interaction);
186  }
187 
188  if(intlist->size() == 0) {
189  delete intlist;
190  return 0;
191  }
192 
193  return intlist;
194 }
bool IsChargedLepton(int pdgc)
Definition: PDGUtils.cxx:98
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
#define pWARN
Definition: Messenger.h:60
static Interaction * QELEM(int tgt, int nuc, int probe, double E=0)
A vector of Interaction objects.
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
InteractionList * QELInteractionListGenerator::CreateInteractionListNC ( const InitialState init) const
private

Definition at line 110 of file QELInteractionListGenerator.cxx.

112 {
113  InteractionList * intlist = new InteractionList;
114 
115  int nuclpdg[2] = { kPdgProton, kPdgNeutron };
116 
117  int nupdg = init_state.ProbePdg();
118  bool isnu = pdg::IsNeutrino (nupdg);
119  bool isnubar = pdg::IsAntiNeutrino (nupdg);
120 
121  if(!isnu && !isnubar) {
122  LOG("IntLst", pWARN)
123  << "Can not handle probe! Returning NULL InteractionList "
124  << "for init-state: " << init_state.AsString();
125  delete intlist;
126  return 0;
127  }
128 
129  for(int i=0; i<2; i++) {
130 
132  Interaction * interaction = new Interaction(init_state, proc_info);
133 
134  Target * target = interaction->InitStatePtr()->TgtPtr();
135  bool hasP = (target->Z() > 0);
136  bool hasN = (target->N() > 0);
137 
138  if(nuclpdg[i] == kPdgProton && !hasP) {
139  delete interaction;
140  continue;
141  }
142  if(nuclpdg[i] == kPdgNeutron && !hasN) {
143  delete interaction;
144  continue;
145  }
146  target->SetHitNucPdg(nuclpdg[i]);
147  intlist->push_back(interaction);
148  }
149 
150  if(intlist->size() == 0) {
151  LOG("IntLst", pINFO)
152  << "Returning NULL InteractionList for init-state: "
153  << init_state.AsString();
154  delete intlist;
155  return 0;
156  }
157  return intlist;
158 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
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
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
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
InteractionList * QELInteractionListGenerator::CreateInteractionListStrangeCC ( const InitialState init) const
private

Definition at line 247 of file QELInteractionListGenerator.cxx.

249 {
250  // v + n --> mu+ + Sigma^{-}
251  // v + p --> mu+ + Lambda^{0}
252  // v + p --> mu+ + Sigma^{0}
253 
254  int nupdg = init_state.ProbePdg();
255  bool isnu = pdg::IsNeutrino(nupdg);
256  if(isnu) {
257  LOG("IntLst", pERROR)
258  << "Returning NULL InteractionList for init-state: "
259  << init_state.AsString();
260  return 0;
261  }
262 
263  const int nch = 3;
264  int nuclpdg [nch] = { kPdgNeutron, kPdgProton, kPdgProton };
265  int strangepdg[nch] = { kPdgSigmaM , kPdgLambda, kPdgSigma0 };
266 
267  InteractionList * intlist = new InteractionList;
268 
269  for(int i=0; i<nch; i++) {
270 
272  Interaction * interaction = new Interaction(init_state, proc_info);
273 
274  Target * target = interaction->InitStatePtr()->TgtPtr();
275  bool hasP = (target->Z() > 0);
276  bool hasN = (target->N() > 0);
277 
278  XclsTag * xcls = interaction->ExclTagPtr();
279 
280  if(nuclpdg[i] == kPdgProton && !hasP) {
281  delete interaction;
282  continue;
283  }
284  if(nuclpdg[i] == kPdgNeutron && !hasN) {
285  delete interaction;
286  continue;
287  }
288  target->SetHitNucPdg(nuclpdg[i]);
289  xcls->SetStrange(strangepdg[i]);
290 
291  intlist->push_back(interaction);
292  }
293  return intlist;
294 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
#define pERROR
Definition: Messenger.h:59
const int kPdgLambda
Definition: PDGCodes.h:85
const int kPdgSigma0
Definition: PDGCodes.h:88
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
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
int Z(void) const
Definition: Target.h:68
const int kPdgSigmaM
Definition: PDGCodes.h:89
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 QELInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 308 of file QELInteractionListGenerator.cxx.

309 {
310  GetParamDef( "is-CC", fIsCC, false ) ;
311  GetParamDef( "is-NC", fIsNC, false ) ;
312  GetParamDef( "is-EM", fIsEM, false ) ;
313  GetParamDef( "is-Charm", fIsCharm, false ) ;
314  GetParamDef( "is-Strange", fIsStrange, false ) ;
315 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const

Member Data Documentation

bool genie::QELInteractionListGenerator::fIsCC
private

Definition at line 52 of file QELInteractionListGenerator.h.

bool genie::QELInteractionListGenerator::fIsCharm
private

Definition at line 55 of file QELInteractionListGenerator.h.

bool genie::QELInteractionListGenerator::fIsEM
private

Definition at line 54 of file QELInteractionListGenerator.h.

bool genie::QELInteractionListGenerator::fIsNC
private

Definition at line 53 of file QELInteractionListGenerator.h.

bool genie::QELInteractionListGenerator::fIsStrange
private

Definition at line 56 of file QELInteractionListGenerator.h.


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