GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
COHInteractionListGenerator.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 
17 
18 using namespace genie;
19 
20 //___________________________________________________________________________
22 InteractionListGeneratorI("genie::COHInteractionListGenerator")
23 {
24 
25 }
26 //___________________________________________________________________________
28 InteractionListGeneratorI("genie::COHInteractionListGenerator", config)
29 {
30 
31 }
32 //___________________________________________________________________________
34 {
35 
36 }
37 //___________________________________________________________________________
39  const InitialState & init_state) const
40 {
41  LOG("IntLst", pINFO)
42  << "InitialState = " << init_state.AsString();
43 
44  InteractionType_t inttype;
45  if (fIsCC) inttype = kIntWeakCC;
46  else if (fIsNC) inttype = kIntWeakNC;
47  else {
48  // shouldn't happen... warn
49  LOG("IntLst", pWARN)
50  << "Unknown InteractionType! Returning NULL InteractionList "
51  << "for init-state: " << init_state.AsString();
52  return 0;
53  }
54 
55  int probe_pdg = init_state.ProbePdg();
56  bool isnu = pdg::IsNeutrino(probe_pdg) || pdg::IsAntiNeutrino(probe_pdg);
57  if( !isnu) {
58  // shouldn't happen... warn
59  LOG("IntLst", pWARN)
60  << "Can not handle probe! Returning NULL InteractionList "
61  << "for init-state: " << init_state.AsString();
62  return 0;
63  }
64  const Target & target = init_state.Tgt();
65  if(!target.IsNucleus()) {
66  // happens as this code is also indiscriminately both for free-nucleon and
67  // nuclear targets - don't warn
68  LOG("IntLst", pINFO)
69  << "Not a nuclear target! Returning NULL InteractionList "
70  << "for init-state: " << init_state.AsString();
71  return 0;
72  }
73 
74  InteractionList * intlist = new InteractionList;
75 
76  ProcessInfo proc_info(kScCoherentProduction, inttype);
77  Interaction * interaction = new Interaction(init_state, proc_info);
78 
79  if ( fPionProduction ) {
80 
81  if(fIsCC) {
82  if(pdg::IsNeutrino(probe_pdg)) {
83  // v A -> l- A pi+
84  interaction->ExclTagPtr()->SetNPions(1,0,0);
85  } else {
86  // vbar A -> l+ A pi-
87  interaction->ExclTagPtr()->SetNPions(0,0,1);
88  }
89  }
90  else {
91  // v A -> v A pi0
92  interaction->ExclTagPtr()->SetNPions(0,1,0);
93  }
94 
95  }
96 
97  if ( fGammaProduction ) {
98  interaction->ExclTagPtr()->SetNSingleGammas(1);
99  }
100 
101  intlist->push_back(interaction);
102 
103  return intlist;
104 }
105 //___________________________________________________________________________
107 {
108  Algorithm::Configure(config);
109  this->LoadConfigData();
110 }
111 //____________________________________________________________________________
113 {
114  Algorithm::Configure(config);
115  this->LoadConfigData();
116 }
117 //____________________________________________________________________________
119 {
120  GetParamDef( "is-CC", fIsCC, false ) ;
121  GetParamDef( "is-NC", fIsNC, false ) ;
122 
123  GetParamDef( "has-PION", fPionProduction, false ) ;
124  GetParamDef( "has-RHO", fRhoProduction, false ) ;
125  GetParamDef( "has-GAMMA", fGammaProduction, false ) ;
126 
127 
128 }
129 //____________________________________________________________________________
void SetNPions(int npi_plus, int npi_0, int npi_minus)
Definition: XclsTag.cxx:88
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
bool IsNucleus(void) const
Definition: Target.cxx:272
void SetNSingleGammas(int ng)
Definition: XclsTag.h:83
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
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: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
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
InteractionList * CreateInteractionList(const InitialState &init) const
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
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...
enum genie::EInteractionType InteractionType_t
Initial State information.
Definition: InitialState.h:48