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

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

#include <DISInteractionListGenerator.h>

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

Public Member Functions

 DISInteractionListGenerator ()
 
 DISInteractionListGenerator (string config)
 
 ~DISInteractionListGenerator ()
 
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)
 
multimap< int, bool > GetHitQuarks (const Interaction *interaction) const
 

Private Attributes

bool fIsCC
 
bool fIsNC
 
bool fIsEM
 
bool fSetHitQuark
 
bool fIsCharm
 

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. Generate a list of all the Interaction (= event summary) objects that can be generated by the DIS EventGenerator.

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 33 of file DISInteractionListGenerator.h.

Constructor & Destructor Documentation

DISInteractionListGenerator::DISInteractionListGenerator ( )

Definition at line 21 of file DISInteractionListGenerator.cxx.

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

Definition at line 27 of file DISInteractionListGenerator.cxx.

27  :
28 InteractionListGeneratorI("genie::DISInteractionListGenerator", config)
29 {
30 
31 }
DISInteractionListGenerator::~DISInteractionListGenerator ( )

Definition at line 33 of file DISInteractionListGenerator.cxx.

34 {
35 
36 }

Member Function Documentation

void DISInteractionListGenerator::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 125 of file DISInteractionListGenerator.cxx.

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

126 {
127  Algorithm::Configure(config);
128  this->LoadConfigData();
129 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void DISInteractionListGenerator::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 131 of file DISInteractionListGenerator.cxx.

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

132 {
133  Algorithm::Configure(config);
134  this->LoadConfigData();
135 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * DISInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 38 of file DISInteractionListGenerator.cxx.

References genie::InitialState::AsString(), fIsCC, fIsCharm, fIsEM, fIsNC, fSetHitQuark, GetHitQuarks(), genie::Interaction::InitStatePtr(), genie::pdg::IsLepton(), genie::kIntEM, genie::kIntWeakCC, genie::kIntWeakNC, genie::kPdgNeutron, genie::kPdgProton, genie::kScDeepInelastic, LOG, genie::Target::N(), pERROR, pINFO, genie::InitialState::ProbePdg(), pWARN, genie::XclsTag::SetCharm(), genie::Interaction::SetExclTag(), genie::Target::SetHitNucPdg(), genie::Target::SetHitQrkPdg(), genie::Target::SetHitSeaQrk(), genie::InitialState::Tgt(), genie::InitialState::TgtPtr(), and genie::Target::Z().

40 {
41  LOG("IntLst", pINFO)
42  << "InitialState = " << init_state.AsString();
43 
44  InteractionType_t inttype;
45  if (fIsCC) inttype = kIntWeakCC;
46  else if (fIsNC) inttype = kIntWeakNC;
47  else if (fIsEM) inttype = kIntEM;
48  else {
49  LOG("IntLst", pWARN)
50  << "Unknown InteractionType! Returning NULL InteractionList "
51  << "for init-state: " << init_state.AsString();
52  return 0;
53  }
54 
55  int ppdg = init_state.ProbePdg();
56  if( !pdg::IsLepton(ppdg) ) {
57  LOG("IntLst", pWARN)
58  << "Can not handle probe! Returning NULL InteractionList "
59  << "for init-state: " << init_state.AsString();
60  return 0;
61  }
62 
63  bool hasP = (init_state.Tgt().Z() > 0);
64  bool hasN = (init_state.Tgt().N() > 0);
65 
66  InteractionList * intlist = new InteractionList;
67 
68  int nuclpdg[2] = { kPdgProton, kPdgNeutron };
69 
70  for(int inucl=0; inucl<2; inucl++) {
71 
72  int struck_nucleon = nuclpdg[inucl];
73 
74  if( (struck_nucleon == kPdgProton && hasP) ||
75  (struck_nucleon == kPdgNeutron && hasN) ) {
76 
77  ProcessInfo proc_info(kScDeepInelastic, inttype);
78 
79  Interaction * interaction = new Interaction(init_state, proc_info);
80  Target * target = interaction->InitStatePtr()->TgtPtr();
81  target->SetHitNucPdg(struck_nucleon);
82 
83  if(fIsCharm) {
84  XclsTag exclusive_tag;
85  exclusive_tag.SetCharm();
86  interaction->SetExclTag(exclusive_tag);
87  }
88 
89  if(fSetHitQuark) {
90  // Add interactions for all possible hit (valence or sea) quarks
91 
92  multimap<int,bool> hq = this->GetHitQuarks(interaction);
93  multimap<int,bool>::const_iterator hqi = hq.begin();
94 
95  for( ; hqi != hq.end(); ++hqi) {
96 
97  int quark_code = hqi->first;
98  bool from_sea = hqi->second;
99 
100  target->SetHitQrkPdg(quark_code);
101  target->SetHitSeaQrk(from_sea);
102 
103  Interaction * intq = new Interaction(*interaction);
104  intlist->push_back(intq);
105  }
106  delete interaction;
107  }
108  else {
109  intlist->push_back(interaction);
110  }//set hit quark?
111 
112  }//current N exists in nuclear target
113  }//N
114 
115  if(intlist->size() == 0) {
116  LOG("IntLst", pERROR)
117  << "Returning NULL InteractionList for init-state: "
118  << init_state.AsString();
119  delete intlist;
120  return 0;
121  }
122  return intlist;
123 }
#define pERROR
Definition: Messenger.h:59
void SetHitQrkPdg(int pdgc)
Definition: Target.cxx:184
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
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
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
void SetExclTag(const XclsTag &xcls)
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
multimap< int, bool > GetHitQuarks(const Interaction *interaction) const
const int kPdgProton
Definition: PDGCodes.h:81
void SetHitSeaQrk(bool tf)
Definition: Target.cxx:195
const int kPdgNeutron
Definition: PDGCodes.h:83
enum genie::EInteractionType InteractionType_t
bool IsLepton(int pdgc)
Definition: PDGUtils.cxx:86
multimap< int, bool > DISInteractionListGenerator::GetHitQuarks ( const Interaction interaction) const
private

Definition at line 147 of file DISInteractionListGenerator.cxx.

References fIsCharm, genie::Interaction::InitState(), genie::pdg::IsAntiNeutrino(), genie::ProcessInfo::IsEM(), genie::pdg::IsNeutrino(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), genie::kPdgAntiDQuark, genie::kPdgAntiSQuark, genie::kPdgAntiUQuark, genie::kPdgDQuark, genie::kPdgSQuark, genie::kPdgUQuark, genie::InitialState::ProbePdg(), and genie::Interaction::ProcInfo().

Referenced by CreateInteractionList().

149 {
150 // Set (PDG code, from-sea flag) for all possible hit quarks for the input
151 // interaction
152 
153  multimap<int,bool> hq;
154 
155  const ProcessInfo & proc = interaction->ProcInfo();
156 
157  if(proc.IsWeakNC() || proc.IsEM()) {
158  //
159  // NC - includes both v+N, vbar+N
160  //
161  if(!fIsCharm) {
162  hq.insert(pair<int,bool>(kPdgUQuark, false));
163  hq.insert(pair<int,bool>(kPdgUQuark, true ));
164  hq.insert(pair<int,bool>(kPdgAntiUQuark, true ));
165  hq.insert(pair<int,bool>(kPdgDQuark, false));
166  hq.insert(pair<int,bool>(kPdgDQuark, true ));
167  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
168  hq.insert(pair<int,bool>(kPdgSQuark, true ));
169  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
170  }
171 
172  } else if (proc.IsWeakCC()) {
173  //
174  // CC - only I=-1/2 quarks for v+N & I=1/2 quarks for vbar+N
175  //
176  int ppdg = interaction->InitState().ProbePdg();
177 
178  if (pdg::IsNeutrino(ppdg)){
179  if(!fIsCharm) { hq.insert(pair<int,bool>(kPdgAntiUQuark, true )); }
180  hq.insert(pair<int,bool>(kPdgDQuark, false));
181  hq.insert(pair<int,bool>(kPdgDQuark, true ));
182  hq.insert(pair<int,bool>(kPdgSQuark, true ));
183  }
184  else if (pdg::IsAntiNeutrino(ppdg)){
185  if(!fIsCharm) { hq.insert(pair<int,bool>(kPdgUQuark, false)); }
186  if(!fIsCharm) { hq.insert(pair<int,bool>(kPdgUQuark, true )); }
187  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
188  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
189  }
190  }//CC or NC
191 
192  return hq;
193 }
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
const int kPdgUQuark
Definition: PDGCodes.h:42
const int kPdgSQuark
Definition: PDGCodes.h:46
const int kPdgAntiUQuark
Definition: PDGCodes.h:43
bool IsWeakNC(void) const
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:118
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
int ProbePdg(void) const
Definition: InitialState.h:64
const int kPdgDQuark
Definition: PDGCodes.h:44
bool IsEM(void) const
const int kPdgAntiSQuark
Definition: PDGCodes.h:47
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
void DISInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 137 of file DISInteractionListGenerator.cxx.

References fIsCC, fIsCharm, fIsEM, fIsNC, fSetHitQuark, and genie::Algorithm::GetParamDef().

Referenced by Configure().

138 {
139  GetParamDef( "is-CC", fIsCC, false ) ;
140  GetParamDef( "is-NC", fIsNC, false ) ;
141  GetParamDef( "is-EM", fIsEM, false ) ;
142  GetParamDef( "is-Charm", fIsCharm, false ) ;
143  GetParamDef( "set-hit-quark", fSetHitQuark, false ) ;
144 
145 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const

Member Data Documentation

bool genie::DISInteractionListGenerator::fIsCC
private

Definition at line 54 of file DISInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::DISInteractionListGenerator::fIsCharm
private
bool genie::DISInteractionListGenerator::fIsEM
private

Definition at line 56 of file DISInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::DISInteractionListGenerator::fIsNC
private

Definition at line 55 of file DISInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::DISInteractionListGenerator::fSetHitQuark
private

Definition at line 57 of file DISInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


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