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

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

#include <HEDISInteractionListGenerator.h>

Inheritance diagram for genie::HEDISInteractionListGenerator:
genie::InteractionListGeneratorI genie::Algorithm

Public Member Functions

 HEDISInteractionListGenerator ()
 
 HEDISInteractionListGenerator (string config)
 
 ~HEDISInteractionListGenerator ()
 
InteractionListCreateInteractionList (const InitialState &init) const
 
InteractionListCreateHEDISlist (vector< InitialState > vinit, vector< InteractionType_t > vinttype) 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

multimap< int, boolGetHitQuarks (const Interaction *interaction) const
 
vector< int > GetFinalQuarks (const Interaction *interaction) const
 
void LoadConfigData (void)
 

Private Attributes

bool fIsCC
 
bool fIsNC
 

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

Author
Alfonso Garcia <alfonsog nikhef.nl> NIKHEF

August 28, 2019

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

Definition at line 35 of file HEDISInteractionListGenerator.h.

Constructor & Destructor Documentation

HEDISInteractionListGenerator::HEDISInteractionListGenerator ( )

Definition at line 24 of file HEDISInteractionListGenerator.cxx.

24  :
25 InteractionListGeneratorI("genie::HEDISInteractionListGenerator")
26 {
27 
28 }
HEDISInteractionListGenerator::HEDISInteractionListGenerator ( string  config)

Definition at line 30 of file HEDISInteractionListGenerator.cxx.

30  :
31 InteractionListGeneratorI("genie::HEDISInteractionListGenerator", config)
32 {
33 
34 }
static Config * config
Definition: config.cpp:1054
HEDISInteractionListGenerator::~HEDISInteractionListGenerator ( )

Definition at line 36 of file HEDISInteractionListGenerator.cxx.

37 {
38 
39 }

Member Function Documentation

void HEDISInteractionListGenerator::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 211 of file HEDISInteractionListGenerator.cxx.

212 {
213  Algorithm::Configure(config);
214  this->LoadConfigData();
215 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void HEDISInteractionListGenerator::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 217 of file HEDISInteractionListGenerator.cxx.

218 {
220  this->LoadConfigData();
221 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
InteractionList * HEDISInteractionListGenerator::CreateHEDISlist ( vector< InitialState vinit,
vector< InteractionType_t vinttype 
) const

Definition at line 80 of file HEDISInteractionListGenerator.cxx.

82 {
83 
84  InteractionList * intlist = new InteractionList;
85 
87  for( ; init != vinit.end(); ++init) {
88 
90  if (init->Tgt().Z()>0) nucl.push_back(kPdgProton);
91  if (init->Tgt().A()-init->Tgt().Z()>0) nucl.push_back(kPdgNeutron);
92 
93  vector<int>::const_iterator inucl = nucl.begin();
94  for( ; inucl != nucl.end(); ++inucl) {
95 
96  vector<InteractionType_t>::const_iterator inttype = vinttype.begin();
97  for( ; inttype != vinttype.end(); ++inttype) {
98 
99  ProcessInfo proc(kScDeepInelastic,*inttype);
100  Interaction * interaction = new Interaction(*init, proc);
101  interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(*inucl);
102  multimap<int,bool> hq = this->GetHitQuarks(interaction);
103  multimap<int,bool>::const_iterator hqi = hq.begin();
104  for( ; hqi != hq.end(); ++hqi) {
105  int quark_code = hqi->first;
106  bool from_sea = hqi->second;
107  interaction->InitStatePtr()->TgtPtr()->SetHitQrkPdg(quark_code);
108  interaction->InitStatePtr()->TgtPtr()->SetHitSeaQrk(from_sea);
109  vector<int> fq = this->GetFinalQuarks(interaction);
110  vector<int>::const_iterator fqi = fq.begin();
111  for( ; fqi != fq.end(); ++fqi) {
112  XclsTag exclusive_tag;
113  exclusive_tag.SetFinalQuark (*fqi);
114  interaction->SetExclTag(exclusive_tag);
115  Interaction * intq = new Interaction(*interaction);
116  intlist->push_back(intq);
117  }
118  }
119  delete interaction;
120  }
121  }
122  }
123 
124  return intlist;
125 
126 }
void SetHitQrkPdg(int pdgc)
Definition: Target.cxx:184
intermediate_table::const_iterator const_iterator
init
Definition: train.py:42
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
Summary information for an interaction.
Definition: Interaction.h:56
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
vector< int > GetFinalQuarks(const Interaction *interaction) const
multimap< int, bool > GetHitQuarks(const Interaction *interaction) const
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
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
const int kPdgProton
Definition: PDGCodes.h:81
void SetHitSeaQrk(bool tf)
Definition: Target.cxx:195
void SetFinalQuark(int finalquark_pdgc=0)
Definition: XclsTag.cxx:138
const int kPdgNeutron
Definition: PDGCodes.h:83
InteractionList * HEDISInteractionListGenerator::CreateInteractionList ( const InitialState init) const
virtual

Implements genie::InteractionListGeneratorI.

Definition at line 41 of file HEDISInteractionListGenerator.cxx.

43 {
44  LOG("IntLst", pINFO)
45  << "InitialState = " << init_state.AsString();
46 
47  vector<InteractionType_t> inttype;
48  if (fIsCC) inttype.push_back(kIntWeakCC);
49  else if (fIsNC) inttype.push_back(kIntWeakNC);
50  else {
51  LOG("IntLst", pWARN)
52  << "Unknown InteractionType! Returning NULL InteractionList "
53  << "for init-state: " << init_state.AsString();
54  return 0;
55  }
56 
57  int ppdg = init_state.ProbePdg();
58  if( !pdg::IsLepton(ppdg) ) {
59  LOG("IntLst", pWARN)
60  << "Can not handle probe! Returning NULL InteractionList "
61  << "for init-state: " << init_state.AsString();
62  return 0;
63  }
64 
65  vector<InitialState> init;
66  init.push_back(init_state);
67  InteractionList * intlist = this->CreateHEDISlist(init,inttype);
68 
69  if(intlist->size() == 0) {
70  LOG("IntLst", pERROR)
71  << "Returning NULL InteractionList for init-state: "
72  << init_state.AsString();
73  delete intlist;
74  return 0;
75  }
76  return intlist;
77 
78 }
#define pERROR
Definition: Messenger.h:59
init
Definition: train.py:42
#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
InteractionList * CreateHEDISlist(vector< InitialState > vinit, vector< InteractionType_t > vinttype) const
#define pWARN
Definition: Messenger.h:60
A vector of Interaction objects.
bool IsLepton(int pdgc)
Definition: PDGUtils.cxx:83
vector< int > HEDISInteractionListGenerator::GetFinalQuarks ( const Interaction interaction) const
private

Definition at line 182 of file HEDISInteractionListGenerator.cxx.

184 {
185 
186  const ProcessInfo & proc = interaction->ProcInfo();
187  int hitquark = interaction->InitState().Tgt().HitQrkPdg();
188 
189  vector<int> fq;
190  if(proc.IsWeakCC()) {
191  int abshq = TMath::Abs(hitquark);
192  int sign = hitquark/abshq;
193  if (abshq==kPdgUQuark || abshq==kPdgCQuark) {
194  fq.push_back(sign*kPdgDQuark);
195  fq.push_back(sign*kPdgSQuark);
196  fq.push_back(sign*kPdgBQuark);
197  }
198  else if (abshq==kPdgDQuark || abshq==kPdgSQuark || abshq==kPdgBQuark) {
199  fq.push_back(sign*kPdgUQuark);
200  fq.push_back(sign*kPdgCQuark);
201  fq.push_back(sign*kPdgTQuark);
202  }
203  }
204  else if (proc.IsWeakNC()) {
205  fq.push_back(hitquark);
206  }
207 
208  return fq;
209 }
bool IsWeakCC(void) const
const int kPdgBQuark
Definition: PDGCodes.h:50
int HitQrkPdg(void) const
Definition: Target.cxx:242
const int kPdgUQuark
Definition: PDGCodes.h:42
const int kPdgSQuark
Definition: PDGCodes.h:46
const int kPdgCQuark
Definition: PDGCodes.h:48
bool IsWeakNC(void) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
const int kPdgDQuark
Definition: PDGCodes.h:44
const int kPdgTQuark
Definition: PDGCodes.h:52
int sign(double val)
Definition: UtilFunc.cxx:104
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
const Target & Tgt(void) const
Definition: InitialState.h:66
multimap< int, bool > HEDISInteractionListGenerator::GetHitQuarks ( const Interaction interaction) const
private

Definition at line 128 of file HEDISInteractionListGenerator.cxx.

130 {
131 // Set (PDG code, from-sea flag) for all possible hit and final quarks for the
132 // input interaction
133 
134  multimap<int,bool> hq;
135 
136  const ProcessInfo & proc = interaction->ProcInfo();
137 
138  if(proc.IsWeakNC()) {
139  //
140  // NC - includes both v+N, vbar+N
141  //
142  hq.insert(pair<int,bool>(kPdgDQuark, false));
143  hq.insert(pair<int,bool>(kPdgUQuark, false));
144  hq.insert(pair<int,bool>(kPdgDQuark, true ));
145  hq.insert(pair<int,bool>(kPdgUQuark, true ));
146  hq.insert(pair<int,bool>(kPdgSQuark, true ));
147  hq.insert(pair<int,bool>(kPdgCQuark, true ));
148  hq.insert(pair<int,bool>(kPdgBQuark, true ));
149  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
150  hq.insert(pair<int,bool>(kPdgAntiUQuark, true ));
151  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
152  hq.insert(pair<int,bool>(kPdgAntiCQuark, true ));
153  hq.insert(pair<int,bool>(kPdgAntiBQuark, true ));
154 
155  } else if (proc.IsWeakCC()) {
156  //
157  // CC - only I=-1/2 quarks for v+N & I=1/2 quarks for vbar+N
158  //
159  int ppdg = interaction->InitState().ProbePdg();
160 
161  if (pdg::IsNeutrino(ppdg)){
162  hq.insert(pair<int,bool>(kPdgDQuark, false));
163  hq.insert(pair<int,bool>(kPdgDQuark, true ));
164  hq.insert(pair<int,bool>(kPdgSQuark, true ));
165  hq.insert(pair<int,bool>(kPdgBQuark, true ));
166  hq.insert(pair<int,bool>(kPdgAntiUQuark, true ));
167  hq.insert(pair<int,bool>(kPdgAntiCQuark, true ));
168  }
169  else if (pdg::IsAntiNeutrino(ppdg)){
170  hq.insert(pair<int,bool>(kPdgUQuark, false));
171  hq.insert(pair<int,bool>(kPdgUQuark, true ));
172  hq.insert(pair<int,bool>(kPdgCQuark, true ));
173  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
174  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
175  hq.insert(pair<int,bool>(kPdgAntiBQuark, true ));
176  }
177  }//CC or NC
178 
179  return hq;
180 }
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
const int kPdgBQuark
Definition: PDGCodes.h:50
const int kPdgUQuark
Definition: PDGCodes.h:42
const int kPdgSQuark
Definition: PDGCodes.h:46
const int kPdgCQuark
Definition: PDGCodes.h:48
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:115
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
int ProbePdg(void) const
Definition: InitialState.h:64
const int kPdgDQuark
Definition: PDGCodes.h:44
const int kPdgAntiSQuark
Definition: PDGCodes.h:47
const int kPdgAntiCQuark
Definition: PDGCodes.h:49
const int kPdgAntiBQuark
Definition: PDGCodes.h:51
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
void HEDISInteractionListGenerator::LoadConfigData ( void  )
private

Definition at line 223 of file HEDISInteractionListGenerator.cxx.

224 {
225 
226  GetParamDef("is-CC", fIsCC, false ) ;
227  GetParamDef("is-NC", fIsNC, false ) ;
228 
229 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const

Member Data Documentation

bool genie::HEDISInteractionListGenerator::fIsCC
private

Definition at line 60 of file HEDISInteractionListGenerator.h.

bool genie::HEDISInteractionListGenerator::fIsNC
private

Definition at line 61 of file HEDISInteractionListGenerator.h.


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