COHInteractionListGenerator.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 - December 19, 2005
9 
10  For the class documentation see the corresponding header file.
11 
12  Important revisions after version 2.0.0 :
13  @ Feb 09, 2009 - CA
14  Moved into the new Coherent package from its previous location (EVGModules
15  package)
16 
17 */
18 //____________________________________________________________________________
19 
26 
27 using namespace genie;
28 
29 //___________________________________________________________________________
31 InteractionListGeneratorI("genie::COHInteractionListGenerator")
32 {
33 
34 }
35 //___________________________________________________________________________
37 InteractionListGeneratorI("genie::COHInteractionListGenerator", config)
38 {
39 
40 }
41 //___________________________________________________________________________
43 {
44 
45 }
46 //___________________________________________________________________________
48  const InitialState & init_state) const
49 {
50  LOG("IntLst", pINFO)
51  << "InitialState = " << init_state.AsString();
52 
53  InteractionType_t inttype;
54  if (fIsCC) inttype = kIntWeakCC;
55  else if (fIsNC) inttype = kIntWeakNC;
56  else {
57  // shouldn't happen... warn
58  LOG("IntLst", pWARN)
59  << "Unknown InteractionType! Returning NULL InteractionList "
60  << "for init-state: " << init_state.AsString();
61  return 0;
62  }
63 
64  int probe_pdg = init_state.ProbePdg();
65  bool isnu = pdg::IsNeutrino(probe_pdg) || pdg::IsAntiNeutrino(probe_pdg);
66  if( !isnu) {
67  // shouldn't happen... warn
68  LOG("IntLst", pWARN)
69  << "Can not handle probe! Returning NULL InteractionList "
70  << "for init-state: " << init_state.AsString();
71  return 0;
72  }
73  const Target & target = init_state.Tgt();
74  if(!target.IsNucleus()) {
75  // happens as this code is also indiscriminately both for free-nucleon and
76  // nuclear targets - don't warn
77  LOG("IntLst", pINFO)
78  << "Not a nuclear target! Returning NULL InteractionList "
79  << "for init-state: " << init_state.AsString();
80  return 0;
81  }
82 
83  InteractionList * intlist = new InteractionList;
84 
85  ProcessInfo proc_info(kScCoherent, inttype);
86  Interaction * interaction = new Interaction(init_state, proc_info);
87 
88  if(fIsCC) {
89  if(pdg::IsNeutrino(probe_pdg)) {
90  // v A -> l- A pi+
91  interaction->ExclTagPtr()->SetNPions(1,0,0);
92  } else {
93  // vbar A -> l+ A pi-
94  interaction->ExclTagPtr()->SetNPions(0,0,1);
95  }
96  }
97  else {
98  // v A -> v A pi0
99  interaction->ExclTagPtr()->SetNPions(0,1,0);
100  }
101 
102  intlist->push_back(interaction);
103 
104  return intlist;
105 }
106 //___________________________________________________________________________
108 {
109  Algorithm::Configure(config);
110  this->LoadConfigData();
111 }
112 //____________________________________________________________________________
114 {
115  Algorithm::Configure(config);
116  this->LoadConfigData();
117 }
118 //____________________________________________________________________________
120 {
121  GetParamDef( "is-CC", fIsCC, false ) ;
122  GetParamDef( "is-NC", fIsNC, false ) ;
123 }
124 //____________________________________________________________________________
125 
void SetNPions(int npi_plus, int npi_0, int npi_minus)
Definition: XclsTag.cxx:97
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 ...
bool IsNucleus(void) const
Definition: Target.cxx:289
Definition: config.py:1
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
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
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
#define pWARN
Definition: Messenger.h:61
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:66
A vector of Interaction objects.
bool GetParamDef(const RgKey &name, T &p, const T &def) const
const Target & Tgt(void) const
Definition: InitialState.h:67
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:49