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

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

#include <DMDISInteractionListGenerator.h>

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

Public Member Functions

 DMDISInteractionListGenerator ()
 
 DMDISInteractionListGenerator (string config)
 
 ~DMDISInteractionListGenerator ()
 
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 fIsDM
 
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 DMDIS EventGenerator.

Author
Joshua Berger <jberger physics.wisc.edu University of Wisconsin-Madison Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
September 1, 2017
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 36 of file DMDISInteractionListGenerator.h.

Constructor & Destructor Documentation

DMDISInteractionListGenerator::DMDISInteractionListGenerator ( )

Definition at line 26 of file DMDISInteractionListGenerator.cxx.

26  :
27 InteractionListGeneratorI("genie::DMDISInteractionListGenerator")
28 {
29 
30 }
DMDISInteractionListGenerator::DMDISInteractionListGenerator ( string  config)

Definition at line 32 of file DMDISInteractionListGenerator.cxx.

32  :
33 InteractionListGeneratorI("genie::DMDISInteractionListGenerator", config)
34 {
35 
36 }
DMDISInteractionListGenerator::~DMDISInteractionListGenerator ( )

Definition at line 38 of file DMDISInteractionListGenerator.cxx.

39 {
40 
41 }

Member Function Documentation

void DMDISInteractionListGenerator::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 129 of file DMDISInteractionListGenerator.cxx.

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

130 {
131  Algorithm::Configure(config);
132  this->LoadConfigData();
133 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void DMDISInteractionListGenerator::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 135 of file DMDISInteractionListGenerator.cxx.

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

136 {
137  Algorithm::Configure(config);
138  this->LoadConfigData();
139 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * DMDISInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 43 of file DMDISInteractionListGenerator.cxx.

References genie::InitialState::AsString(), fIsCharm, fIsDM, fSetHitQuark, GetHitQuarks(), genie::Interaction::InitStatePtr(), genie::pdg::IsDarkMatter(), genie::kIntDarkMatter, genie::kPdgNeutron, genie::kPdgProton, genie::kScDarkMatterDeepInelastic, 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().

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

Definition at line 149 of file DMDISInteractionListGenerator.cxx.

References fIsCharm, genie::kPdgAntiDQuark, genie::kPdgAntiSQuark, genie::kPdgAntiUQuark, genie::kPdgDQuark, genie::kPdgSQuark, genie::kPdgUQuark, and genie::Interaction::ProcInfo().

Referenced by CreateInteractionList().

151 {
152 // Set (PDG code, from-sea flag) for all possible hit quarks for the input
153 // interaction
154 
155  multimap<int,bool> hq;
156 
157  const ProcessInfo & proc = interaction->ProcInfo();
158 
159  if(!fIsCharm) {
160  hq.insert(pair<int,bool>(kPdgUQuark, false));
161  hq.insert(pair<int,bool>(kPdgUQuark, true ));
162  hq.insert(pair<int,bool>(kPdgAntiUQuark, true ));
163  hq.insert(pair<int,bool>(kPdgDQuark, false));
164  hq.insert(pair<int,bool>(kPdgDQuark, true ));
165  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
166  hq.insert(pair<int,bool>(kPdgSQuark, true ));
167  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
168  }
169 
170  return hq;
171 }
const int kPdgUQuark
Definition: PDGCodes.h:42
const int kPdgSQuark
Definition: PDGCodes.h:46
const int kPdgAntiUQuark
Definition: PDGCodes.h:43
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
const int kPdgDQuark
Definition: PDGCodes.h:44
const int kPdgAntiSQuark
Definition: PDGCodes.h:47
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
void DMDISInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 141 of file DMDISInteractionListGenerator.cxx.

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

Referenced by Configure().

142 {
143  GetParamDef( "is-DM", fIsDM, false ) ;
144  GetParamDef( "is-Charm", fIsCharm, false ) ;
145  GetParamDef( "set-hit-quark", fSetHitQuark, false ) ;
146 
147 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const

Member Data Documentation

bool genie::DMDISInteractionListGenerator::fIsCharm
private
bool genie::DMDISInteractionListGenerator::fIsDM
private

Definition at line 57 of file DMDISInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().

bool genie::DMDISInteractionListGenerator::fSetHitQuark
private

Definition at line 58 of file DMDISInteractionListGenerator.h.

Referenced by CreateInteractionList(), and LoadConfigData().


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