QELInteractionListGenerator.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  @ Mar 03, 2009 - CA
14  Moved into the new QEL package from its previous location (EVGModules)
15  @ Sep 15, 2009 - CA
16  Generate interaction lists for charged lepton scattering too.
17 
18 */
19 //____________________________________________________________________________
20 
27 
28 using namespace genie;
29 
30 //___________________________________________________________________________
32 InteractionListGeneratorI("genie::QELInteractionListGenerator")
33 {
34 
35 }
36 //___________________________________________________________________________
38 InteractionListGeneratorI("genie::QELInteractionListGenerator", config)
39 {
40 
41 }
42 //___________________________________________________________________________
44 {
45 
46 }
47 //___________________________________________________________________________
49  const InitialState & init_state) const
50 {
51  LOG("IntLst", pINFO)
52  << "InitialState = " << init_state.AsString();
53 
54  if (fIsCC && !fIsCharm && !fIsStrange)
55  return this->CreateInteractionListCC(init_state);
56  else
57  if (fIsNC && !fIsCharm && !fIsStrange)
58  return this->CreateInteractionListNC(init_state);
59  else
60  if (fIsEM)
61  return this->CreateInteractionListEM(init_state);
62  else
63  if (fIsCC && fIsCharm)
64  return this->CreateInteractionListCharmCC(init_state);
65  else
66  if (fIsCC && fIsStrange)
67  return this->CreateInteractionListStrangeCC(init_state);
68  else {
69  LOG("IntLst", pWARN)
70  << "Unknown InteractionType! Returning NULL InteractionList "
71  << "for init-state: " << init_state.AsString();
72  return 0;
73  }
74  return 0;
75 }
76 //___________________________________________________________________________
78  const InitialState & init_state) const
79 {
80  InteractionList * intlist = new InteractionList;
81 
83  Interaction * interaction = new Interaction(init_state, proc_info);
84 
85  int nupdg = init_state.ProbePdg();
86  bool isnu = pdg::IsNeutrino (nupdg);
87  bool isnubar = pdg::IsAntiNeutrino (nupdg);
88 
89  Target * target = interaction->InitStatePtr()->TgtPtr();
90  bool hasP = (target->Z() > 0);
91  bool hasN = (target->N() > 0);
92 
93  if(!isnu && !isnubar) {
94  LOG("IntLst", pWARN)
95  << "Can not handle probe! Returning NULL InteractionList "
96  << "for init-state: " << init_state.AsString();
97  delete intlist;
98  return 0;
99  }
100 
101  if (isnu && hasN) {
102  target->SetHitNucPdg(kPdgNeutron);
103  intlist->push_back(interaction);
104 
105  } else if (isnubar && hasP) {
106  target->SetHitNucPdg(kPdgProton);
107  intlist->push_back(interaction);
108 
109  } else {
110  LOG("IntLst", pINFO)
111  << "Returning NULL InteractionList for init-state: "
112  << init_state.AsString();
113  delete interaction;
114  delete intlist;
115  return 0;
116  }
117  return intlist;
118 }
119 //___________________________________________________________________________
121  const InitialState & init_state) const
122 {
123  InteractionList * intlist = new InteractionList;
124 
125  int nuclpdg[2] = { kPdgProton, kPdgNeutron };
126 
127  int nupdg = init_state.ProbePdg();
128  bool isnu = pdg::IsNeutrino (nupdg);
129  bool isnubar = pdg::IsAntiNeutrino (nupdg);
130 
131  if(!isnu && !isnubar) {
132  LOG("IntLst", pWARN)
133  << "Can not handle probe! Returning NULL InteractionList "
134  << "for init-state: " << init_state.AsString();
135  delete intlist;
136  return 0;
137  }
138 
139  for(int i=0; i<2; i++) {
140 
142  Interaction * interaction = new Interaction(init_state, proc_info);
143 
144  Target * target = interaction->InitStatePtr()->TgtPtr();
145  bool hasP = (target->Z() > 0);
146  bool hasN = (target->N() > 0);
147 
148  if(nuclpdg[i] == kPdgProton && !hasP) {
149  delete interaction;
150  continue;
151  }
152  if(nuclpdg[i] == kPdgNeutron && !hasN) {
153  delete interaction;
154  continue;
155  }
156  target->SetHitNucPdg(nuclpdg[i]);
157  intlist->push_back(interaction);
158  }
159 
160  if(intlist->size() == 0) {
161  LOG("IntLst", pINFO)
162  << "Returning NULL InteractionList for init-state: "
163  << init_state.AsString();
164  delete intlist;
165  return 0;
166  }
167  return intlist;
168 }
169 //___________________________________________________________________________
171  const InitialState & init_state) const
172 {
173  InteractionList * intlist = new InteractionList;
174 
175  int tgtpdg = init_state.Tgt().Pdg();
176  int ppdg = init_state.ProbePdg();
177 
178  bool ischgl = pdg::IsChargedLepton(ppdg);
179  if(!ischgl) {
180  LOG("IntLst", pWARN)
181  << "Can not handle probe! Returning NULL InteractionList "
182  << "for init-state: " << init_state.AsString();
183  delete intlist;
184  return 0;
185  }
186 
187  bool hasP = (init_state.Tgt().Z() > 0);
188  if(hasP) {
189  Interaction * interaction = Interaction::QELEM(tgtpdg,kPdgProton,ppdg);
190  intlist->push_back(interaction);
191  }
192  bool hasN = (init_state.Tgt().N() > 0);
193  if(hasN) {
194  Interaction * interaction = Interaction::QELEM(tgtpdg,kPdgNeutron,ppdg);
195  intlist->push_back(interaction);
196  }
197 
198  if(intlist->size() == 0) {
199  delete intlist;
200  return 0;
201  }
202 
203  return intlist;
204 }
205 //___________________________________________________________________________
208  const InitialState & init_state) const
209 {
210  // vl + n --> l- + Lambda_{c}^{+} (2285)
211  // vl + n --> l- + Sigma_{c}^{+} (2455)
212  // vl + p --> l- + Sigma_{c}^{++} (2455)
213 
214  int nupdg = init_state.ProbePdg();
215  bool isnu = pdg::IsNeutrino(nupdg);
216  if(!isnu) {
217  LOG("IntLst", pINFO)
218  << "Returning NULL InteractionList for init-state: "
219  << init_state.AsString();
220  return 0;
221  }
222 
223  const int nch = 3;
224  int nuclpdg [nch] = { kPdgNeutron, kPdgNeutron, kPdgProton };
225  int charmpdg[nch] = { kPdgLambdaPc, kPdgSigmaPc, kPdgSigmaPPc };
226 
227  InteractionList * intlist = new InteractionList;
228 
229  for(int i=0; i<nch; i++) {
230 
232  Interaction * interaction = new Interaction(init_state, proc_info);
233 
234  Target * target = interaction->InitStatePtr()->TgtPtr();
235  bool hasP = (target->Z() > 0);
236  bool hasN = (target->N() > 0);
237 
238  XclsTag * xcls = interaction->ExclTagPtr();
239 
240  if(nuclpdg[i] == kPdgProton && !hasP) {
241  delete interaction;
242  continue;
243  }
244  if(nuclpdg[i] == kPdgNeutron && !hasN) {
245  delete interaction;
246  continue;
247  }
248  target->SetHitNucPdg(nuclpdg[i]);
249  xcls->SetCharm(charmpdg[i]);
250 
251  intlist->push_back(interaction);
252  }
253  return intlist;
254 }
255 //___________________________________________________________________________
258  const InitialState & init_state) const
259 {
260  // v + n --> mu+ + Sigma^{-}
261  // v + p --> mu+ + Lambda^{0}
262  // v + p --> mu+ + Sigma^{0}
263 
264  int nupdg = init_state.ProbePdg();
265  bool isnu = pdg::IsNeutrino(nupdg);
266  if(isnu) {
267  LOG("IntLst", pERROR)
268  << "Returning NULL InteractionList for init-state: "
269  << init_state.AsString();
270  return 0;
271  }
272 
273  const int nch = 3;
274  int nuclpdg [nch] = { kPdgNeutron, kPdgProton, kPdgProton };
275  int strangepdg[nch] = { kPdgSigmaM , kPdgLambda, kPdgSigma0 };
276 
277  InteractionList * intlist = new InteractionList;
278 
279  for(int i=0; i<nch; i++) {
280 
282  Interaction * interaction = new Interaction(init_state, proc_info);
283 
284  Target * target = interaction->InitStatePtr()->TgtPtr();
285  bool hasP = (target->Z() > 0);
286  bool hasN = (target->N() > 0);
287 
288  XclsTag * xcls = interaction->ExclTagPtr();
289 
290  if(nuclpdg[i] == kPdgProton && !hasP) {
291  delete interaction;
292  continue;
293  }
294  if(nuclpdg[i] == kPdgNeutron && !hasN) {
295  delete interaction;
296  continue;
297  }
298  target->SetHitNucPdg(nuclpdg[i]);
299  xcls->SetStrange(strangepdg[i]);
300 
301  intlist->push_back(interaction);
302  }
303  return intlist;
304 }
305 //____________________________________________________________________________
307 {
308  Algorithm::Configure(config);
309  this->LoadConfigData();
310 }
311 //____________________________________________________________________________
313 {
314  Algorithm::Configure(config);
315  this->LoadConfigData();
316 }
317 //____________________________________________________________________________
319 {
320  GetParamDef( "is-CC", fIsCC, false ) ;
321  GetParamDef( "is-NC", fIsNC, false ) ;
322  GetParamDef( "is-EM", fIsEM, false ) ;
323  GetParamDef( "is-Charm", fIsCharm, false ) ;
324  GetParamDef( "is-Strange", fIsStrange, false ) ;
325 }
326 //____________________________________________________________________________
327 
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
#define pERROR
Definition: Messenger.h:60
const int kPdgLambda
Definition: PDGCodes.h:69
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
InteractionList * CreateInteractionListCharmCC(const InitialState &init) const
int Pdg(void) const
Definition: Target.h:72
const int kPdgSigma0
Definition: PDGCodes.h:72
bool IsChargedLepton(int pdgc)
Definition: PDGUtils.cxx:99
Definition: config.py:1
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:37
const int kPdgSigmaPPc
Definition: PDGCodes.h:86
void SetCharm(int charm_pdgc=0)
Definition: XclsTag.cxx:68
InteractionList * CreateInteractionList(const InitialState &init) const
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
void SetStrange(int strange_pdgc=0)
Definition: XclsTag.cxx:85
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
const int kPdgLambdaPc
Definition: PDGCodes.h:83
InteractionList * CreateInteractionListNC(const InitialState &init) const
string AsString(void) const
int Z(void) const
Definition: Target.h:69
#define pINFO
Definition: Messenger.h:63
#define pWARN
Definition: Messenger.h:61
const int kPdgSigmaM
Definition: PDGCodes.h:73
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
InteractionList * CreateInteractionListStrangeCC(const InitialState &init) const
int N(void) const
Definition: Target.h:70
const int kPdgSigmaPc
Definition: PDGCodes.h:85
static Interaction * QELEM(int tgt, int nuc, int probe, double E=0)
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:188
Target * TgtPtr(void) const
Definition: InitialState.h:68
A vector of Interaction objects.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const int kPdgProton
Definition: PDGCodes.h:65
bool GetParamDef(const RgKey &name, T &p, const T &def) const
const Target & Tgt(void) const
Definition: InitialState.h:67
const int kPdgNeutron
Definition: PDGCodes.h:67
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
InteractionList * CreateInteractionListEM(const InitialState &init) const
InteractionList * CreateInteractionListCC(const InitialState &init) const
Initial State information.
Definition: InitialState.h:49