GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IBDInteractionListGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6 
7  Author: Corey Reed <cjreed \at nikhef.nl>
8  Nikhef
9 
10  For the class documentation see the corresponding header file.
11 */
12 //____________________________________________________________________________
13 
20 
21 using namespace genie;
22 
23 //___________________________________________________________________________
26  "genie::IBDInteractionListGenerator")
27 {
28 
29 }
30 //___________________________________________________________________________
32  string config):
34  "genie::IBDInteractionListGenerator", config)
35 {
36 
37 }
38 //___________________________________________________________________________
40 {
41 
42 }
43 //___________________________________________________________________________
45  const InitialState & init_state) const
46 {
47  LOG("IBD", pINFO) << "InitialState = " << init_state.AsString();
48 
49  const int nupdg = init_state.ProbePdg();
50  const bool isnu = pdg::IsNeutrino (nupdg);
51  const bool isnubar = pdg::IsAntiNeutrino (nupdg);
52 
53  const Target& target = init_state.Tgt();
54  const int tgtpdg = target.Pdg();
55  const bool hasP = (target.Z() > 0);
56  const bool hasN = (target.N() > 0);
57 
58  InteractionList * intlist = 0;
59 
60  if (isnu && hasN) {
61  intlist = new InteractionList;
62  intlist->push_back( Interaction::IBD(tgtpdg,kPdgNeutron, nupdg,0) );
63  } else if (isnubar && hasP) {
64  intlist = new InteractionList;
65  intlist->push_back( Interaction::IBD(tgtpdg,kPdgProton,nupdg,0) );
66  } else {
67  LOG("IBD", pWARN)
68  << "Returning NULL InteractionList for init-state: "
69  << init_state.AsString();
70  }
71 
72  return intlist;
73 }
74 //____________________________________________________________________________
76 {
77  Algorithm::Configure(config);
78  this->LoadConfigData();
79 }
80 //____________________________________________________________________________
82 {
83  Algorithm::Configure(config);
84  this->LoadConfigData();
85 }
86 //____________________________________________________________________________
88 {
89  // (no data to be loaded)
90 }
91 //____________________________________________________________________________
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
int Pdg(void) const
Definition: Target.h:71
static Interaction * IBD(int tgt, int nuc, int probe, double E=0)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:118
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
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
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
A vector of Interaction objects.
const int kPdgProton
Definition: PDGCodes.h:81
const Target & Tgt(void) const
Definition: InitialState.h:66
const int kPdgNeutron
Definition: PDGCodes.h:83
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
InteractionList * CreateInteractionList(const InitialState &init) const
Initial State information.
Definition: InitialState.h:48