GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MECInteractionListGenerator.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  Costas Andreopoulos <c.andreopoulos \at cern.ch>
7  University of Liverpool
8 */
9 //____________________________________________________________________________
10 
18 
19 using namespace genie;
20 
21 //___________________________________________________________________________
23 InteractionListGeneratorI("genie::MECInteractionListGenerator")
24 {
25 
26 }
27 //___________________________________________________________________________
29 InteractionListGeneratorI("genie::MECInteractionListGenerator", config)
30 {
31 
32 }
33 //___________________________________________________________________________
35 {
36 
37 }
38 //___________________________________________________________________________
41  const InitialState & init_state) const
42 {
43  LOG("IntLst", pINFO) << "InitialState = " << init_state.AsString();
44 
45  int nupdg = init_state.ProbePdg();
46  int tgtpdg = init_state.Tgt().Pdg();
47 
48  const Target & target = init_state.Tgt();
49 
50  if(target.A() < 4) return 0;
51 
52  InteractionList * intlist = new InteractionList;
53 
54  if(!fSetDiNucleonCode&&fIsCC) {
55  LOG("IntLst", pWARN) << "fIsCC(val) = " << fIsCC;
56  Interaction * interaction = Interaction::MECCC(tgtpdg, nupdg, 0.0);
57  intlist->push_back(interaction);
58  }
59 
61  LOG("IntLst", pWARN) << "fIsCC(val) = " << fIsCC;
62  Interaction * interaction = Interaction::MECEM(tgtpdg, nupdg, 0.0);
63  intlist->push_back(interaction);
64  }
65 
66  const int nc = 3;
67  const int nucleon_cluster[nc] = {
69 
70  for(int ic = 0; ic < nc; ic++) {
71  int ncpdg = nucleon_cluster[ic];
73  bool allowed = false;
74  LOG("IntLst", pWARN) << "fIsCC(emp) = " << fIsCC;
75  if(pdg::IsNeutrino(nupdg)) {
76  // neutrino CC => final state primary lepton is -1
77  // therefore the nucleon-cluster charge needs to be incremented by +1.
78  if(ncpdg == kPdgClusterNN || ncpdg == kPdgClusterNP) {
79  allowed = true;
80  }
81  }
82  else
83  if(pdg::IsAntiNeutrino(nupdg)) {
84  // anti-neutrino CC => final state primary lepton is +1
85  // therefore the nucleon-cluster charge needs to be incremented by -1.
86  if(ncpdg == kPdgClusterNP || ncpdg == kPdgClusterPP) {
87  allowed = true;
88  }
89  }
90  if(allowed) {
91  Interaction * interaction =
92  Interaction::MECCC(tgtpdg,ncpdg,nupdg,0);
93  intlist->push_back(interaction);
94  }
95  }//CC?
96  else
97  if(fIsNC)
98  {
99  LOG("IntLst", pWARN) << "fIsNC = " << fIsNC;
100  Interaction * interaction =
101  Interaction::MECNC(tgtpdg,ncpdg,nupdg,0);
102  intlist->push_back(interaction);
103  }//NC?
104  else
106  LOG("IntLst", pWARN) << "fIsEM = " << fIsEM << " ncpdg = " << ncpdg;
107  Interaction * interaction =
108  Interaction::MECEM(tgtpdg,ncpdg,nupdg,0);
109  intlist->push_back(interaction);
110  }//EM?
111  }
112  return intlist;
113 
114 }
115 //___________________________________________________________________________
117 {
118  Algorithm::Configure(config);
119  this->LoadConfigData();
120 }
121 //____________________________________________________________________________
123 {
124  Algorithm::Configure(config);
125  this->LoadConfigData();
126 }
127 //____________________________________________________________________________
129 {
130  GetParamDef( "is-CC", fIsCC, false ) ;
131  GetParamDef( "is-NC", fIsNC, false ) ;
132  GetParamDef( "is-EM", fIsEM, false ) ;
133 
134  GetParam( "SetDiNucleonCode", fSetDiNucleonCode ) ;
135  GetParam( "SetDiNucleonCodeEM", fSetDiNucleonCodeEM ) ;
136 
137 }
138 //____________________________________________________________________________
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
InteractionList * CreateInteractionList(const InitialState &init) const
int A(void) const
Definition: Target.h:70
const int kPdgClusterNP
Definition: PDGCodes.h:215
int Pdg(void) const
Definition: Target.h:71
static Interaction * MECNC(int tgt, int nuccluster, int probe, double E=0)
const int kPdgClusterNN
Definition: PDGCodes.h:214
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 Interaction * MECEM(int tgt, int nuccluster, int probe, double E=0)
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
#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.
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
Definition: InitialState.h:66
static Interaction * MECCC(int tgt, int nuccluster, int probe, double E=0)
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
const int kPdgClusterPP
Definition: PDGCodes.h:216