COHDNuInteractionListGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Author: Iker de Icaza <i.de-icaza-astiz \at sussex.ac.uk>
7  University of Sussex
8 
9  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
10  University of Liverpool & STFC Rutherford Appleton Laboratory
11 */
12 //____________________________________________________________________________
13 
20 
21 using namespace genie;
22 
23 //___________________________________________________________________________
25 InteractionListGeneratorI("genie::COHDNuInteractionListGenerator")
26 {
27 
28 }
29 //___________________________________________________________________________
31 InteractionListGeneratorI("genie::COHDNuInteractionListGenerator", config)
32 {
33 
34 }
35 //___________________________________________________________________________
37 {
38 
39 }
40 //___________________________________________________________________________
42  const InitialState & init_state) const
43 {
44  LOG("IntLst", pINFO)
45  << "InitialState = " << init_state.AsString();
46 
47  int probe_pdg = init_state.ProbePdg();
48  bool isnu = pdg::IsNeutrino(probe_pdg) || pdg::IsAntiNeutrino(probe_pdg);
49  if( !isnu) {
50  // shouldn't happen... warn
51  LOG("IntLst", pWARN)
52  << "Can not handle probe! Returning NULL InteractionList "
53  << "for init-state: " << init_state.AsString();
54  return 0;
55  }
56  const Target & target = init_state.Tgt();
57  if(!target.IsNucleus()) {
58  // happens as this code is also indiscriminately both for free-nucleon and
59  // nuclear targets - don't warn
60  LOG("IntLst", pINFO)
61  << "Not a nuclear target! Returning NULL InteractionList "
62  << "for init-state: " << init_state.AsString();
63  return 0;
64  }
65 
66  InteractionList * intlist = new InteractionList;
67 
69  Interaction * interaction = new Interaction( init_state, proc_info);
70 
71  intlist->push_back(interaction);
72 
73  return intlist;
74 }
75 //___________________________________________________________________________
77 {
78  Algorithm::Configure(config);
79  this->LoadConfigData();
80 }
81 //____________________________________________________________________________
83 {
84  Algorithm::Configure(config);
85  this->LoadConfigData();
86 }
87 //____________________________________________________________________________
89 {
90 
91 }
92 //____________________________________________________________________________
InteractionList * CreateInteractionList(const InitialState &init) const
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
bool IsNucleus(void) const
Definition: Target.cxx:272
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
static Config * config
Definition: config.cpp:1054
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
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
int ProbePdg(void) const
Definition: InitialState.h:64
string AsString(void) const
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
A vector of Interaction objects.
const Target & Tgt(void) const
Definition: InitialState.h:66
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
Initial State information.
Definition: InitialState.h:48