GENIEGenerator
Loading...
Searching...
No Matches
IBDInteractionListGenerator.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, 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
21using namespace genie;
22
23//___________________________________________________________________________
26 "genie::IBDInteractionListGenerator")
27{
28
29}
30//___________________________________________________________________________
32 string config):
34 "genie::IBDInteractionListGenerator", config)
35{
36
37}
38//___________________________________________________________________________
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{
78 this->LoadConfigData();
79}
80//____________________________________________________________________________
82{
84 this->LoadConfigData();
85}
86//____________________________________________________________________________
88{
89 // (no data to be loaded)
90}
91//____________________________________________________________________________
#define pINFO
Definition Messenger.h:62
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
InteractionList * CreateInteractionList(const InitialState &init) const
Initial State information.
const Target & Tgt(void) const
string AsString(void) const
int ProbePdg(void) const
A vector of Interaction objects.
static Interaction * IBD(int tgt, int nuc, int probe, double E=0)
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition Target.h:40
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
int Pdg(void) const
Definition Target.h:71
bool IsNeutrino(int pdgc)
Definition PDGUtils.cxx:110
bool IsAntiNeutrino(int pdgc)
Definition PDGUtils.cxx:118
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgNeutron
Definition PDGCodes.h:83