MECInteractionListGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2019, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9 
10  For the class documentation see the corresponding header file.
11 
12  Important revisions after version 2.0.0 :
13  @ Sep 22, 2008 - CA
14  This interction list generator was first added in version 2.5.1 as part of
15  the new event generation thread handling MEC interactions.
16 */
17 //____________________________________________________________________________
18 
26 
27 using namespace genie;
28 
29 //___________________________________________________________________________
31 InteractionListGeneratorI("genie::MECInteractionListGenerator")
32 {
33 
34 }
35 //___________________________________________________________________________
37 InteractionListGeneratorI("genie::MECInteractionListGenerator", config)
38 {
39 
40 }
41 //___________________________________________________________________________
43 {
44 
45 }
46 //___________________________________________________________________________
49  const InitialState & init_state) const
50 {
51  LOG("IntLst", pINFO) << "InitialState = " << init_state.AsString();
52 
53  int nupdg = init_state.ProbePdg();
54  int tgtpdg = init_state.Tgt().Pdg();
55 
56  const Target & target = init_state.Tgt();
57 
58  if(target.A() < 4) return 0;
59 
60  InteractionList * intlist = new InteractionList;
61 
62  if(!fSetDiNucleonCode&&fIsCC) {
63  LOG("IntLst", pINFO) << "fIsCC(val) = " << fIsCC;
64  Interaction * interaction = Interaction::MECCC(tgtpdg, nupdg, 0.0);
65  intlist->push_back(interaction);
66  }
67 
68  const int nc = 3;
69  const int nucleon_cluster[nc] = {
71 
72  for(int ic = 0; ic < nc; ic++) {
73  int ncpdg = nucleon_cluster[ic];
75  bool allowed = false;
76  LOG("IntLst", pINFO) << "fIsCC(emp) = " << fIsCC;
77  if(pdg::IsNeutrino(nupdg)) {
78  // neutrino CC => final state primary lepton is -1
79  // therefore the nucleon-cluster charge needs to be incremented by +1.
80  if(ncpdg == kPdgClusterNN || ncpdg == kPdgClusterNP) {
81  allowed = true;
82  }
83  }
84  else
85  if(pdg::IsAntiNeutrino(nupdg)) {
86  // anti-neutrino CC => final state primary lepton is +1
87  // therefore the nucleon-cluster charge needs to be incremented by -1.
88  if(ncpdg == kPdgClusterNP || ncpdg == kPdgClusterPP) {
89  allowed = true;
90  }
91  }
92  if(allowed) {
93  Interaction * interaction =
94  Interaction::MECCC(tgtpdg,ncpdg,nupdg,0);
95  intlist->push_back(interaction);
96  }
97  }//CC?
98  else
99  if(fIsNC)
100  {
101  LOG("IntLst", pINFO) << "fIsNC = " << fIsNC;
102  Interaction * interaction =
103  Interaction::MECNC(tgtpdg,ncpdg,nupdg,0);
104  intlist->push_back(interaction);
105  }//NC?
106  else
107  if(fIsEM) {
108  LOG("IntLst", pINFO) << "fIsEM = " << fIsEM << " ncpdg = " << ncpdg;
109  Interaction * interaction =
110  Interaction::MECEM(tgtpdg,ncpdg,nupdg,0);
111  intlist->push_back(interaction);
112  }//EM?
113  }
114  return intlist;
115 
116 }
117 //___________________________________________________________________________
119 {
120  Algorithm::Configure(config);
121  this->LoadConfigData();
122 }
123 //____________________________________________________________________________
125 {
126  Algorithm::Configure(config);
127  this->LoadConfigData();
128 }
129 //____________________________________________________________________________
131 {
132  GetParamDef( "is-CC", fIsCC, false ) ;
133  GetParamDef( "is-NC", fIsNC, false ) ;
134  GetParamDef( "is-EM", fIsEM, false ) ;
135 
136  GetParam( "SetDiNucleonCode", fSetDiNucleonCode ) ;
137 
138 }
139 //____________________________________________________________________________
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:108
const XML_Char * target
Definition: expat.h:268
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
InteractionList * CreateInteractionList(const InitialState &init) const
int A(void) const
Definition: Target.h:71
const int kPdgClusterNP
Definition: PDGCodes.h:192
int Pdg(void) const
Definition: Target.h:72
Definition: config.py:1
static Interaction * MECNC(int tgt, int nuccluster, int probe, double E=0)
const int kPdgClusterNN
Definition: PDGCodes.h:191
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:97
static Interaction * MECEM(int tgt, int nuccluster, int probe, double E=0)
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:116
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
int ProbePdg(void) const
Definition: InitialState.h:65
string AsString(void) const
#define pINFO
Definition: Messenger.h:63
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
enum BeamMode nc
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:67
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:49
const int kPdgClusterPP
Definition: PDGCodes.h:193