DISInteractionListGenerator.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 - May 13, 2005
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 DIS package from its previous location (EVGModules).
15  @ Sep 21, 2009 - CA
16  Generate interaction lists for charge lepton scattering.
17 
18 */
19 //____________________________________________________________________________
20 
27 
28 using namespace genie;
29 
30 //___________________________________________________________________________
32 InteractionListGeneratorI("genie::DISInteractionListGenerator")
33 {
34 
35 }
36 //___________________________________________________________________________
38 InteractionListGeneratorI("genie::DISInteractionListGenerator", 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  InteractionType_t inttype;
55  if (fIsCC) inttype = kIntWeakCC;
56  else if (fIsNC) inttype = kIntWeakNC;
57  else if (fIsEM) inttype = kIntEM;
58  else {
59  LOG("IntLst", pWARN)
60  << "Unknown InteractionType! Returning NULL InteractionList "
61  << "for init-state: " << init_state.AsString();
62  return 0;
63  }
64 
65  int ppdg = init_state.ProbePdg();
66  if( !pdg::IsLepton(ppdg) ) {
67  LOG("IntLst", pWARN)
68  << "Can not handle probe! Returning NULL InteractionList "
69  << "for init-state: " << init_state.AsString();
70  return 0;
71  }
72 
73  bool hasP = (init_state.Tgt().Z() > 0);
74  bool hasN = (init_state.Tgt().N() > 0);
75 
76  InteractionList * intlist = new InteractionList;
77 
78  int nuclpdg[2] = { kPdgProton, kPdgNeutron };
79 
80  for(int inucl=0; inucl<2; inucl++) {
81 
82  int struck_nucleon = nuclpdg[inucl];
83 
84  if( (struck_nucleon == kPdgProton && hasP) ||
85  (struck_nucleon == kPdgNeutron && hasN) ) {
86 
87  ProcessInfo proc_info(kScDeepInelastic, inttype);
88 
89  Interaction * interaction = new Interaction(init_state, proc_info);
90  Target * target = interaction->InitStatePtr()->TgtPtr();
91  target->SetHitNucPdg(struck_nucleon);
92 
93  if(fIsCharm) {
94  XclsTag exclusive_tag;
95  exclusive_tag.SetCharm();
96  interaction->SetExclTag(exclusive_tag);
97  }
98 
99  if(fSetHitQuark) {
100  // Add interactions for all possible hit (valence or sea) quarks
101 
102  multimap<int,bool> hq = this->GetHitQuarks(interaction);
103  multimap<int,bool>::const_iterator hqi = hq.begin();
104 
105  for( ; hqi != hq.end(); ++hqi) {
106 
107  int quark_code = hqi->first;
108  bool from_sea = hqi->second;
109 
110  target->SetHitQrkPdg(quark_code);
111  target->SetHitSeaQrk(from_sea);
112 
113  Interaction * intq = new Interaction(*interaction);
114  intlist->push_back(intq);
115  }
116  delete interaction;
117  }
118  else {
119  intlist->push_back(interaction);
120  }//set hit quark?
121 
122  }//current N exists in nuclear target
123  }//N
124 
125  if(intlist->size() == 0) {
126  LOG("IntLst", pERROR)
127  << "Returning NULL InteractionList for init-state: "
128  << init_state.AsString();
129  delete intlist;
130  return 0;
131  }
132  return intlist;
133 }
134 //___________________________________________________________________________
136 {
137  Algorithm::Configure(config);
138  this->LoadConfigData();
139 }
140 //____________________________________________________________________________
142 {
143  Algorithm::Configure(config);
144  this->LoadConfigData();
145 }
146 //____________________________________________________________________________
148 {
149  GetParamDef( "is-CC", fIsCC, false ) ;
150  GetParamDef( "is-NC", fIsNC, false ) ;
151  GetParamDef( "is-EM", fIsEM, false ) ;
152  GetParamDef( "is-Charm", fIsCharm, false ) ;
153  GetParamDef( "set-hit-quark", fSetHitQuark, false ) ;
154 
155 }
156 //____________________________________________________________________________
158  const Interaction * interaction) const
159 {
160 // Set (PDG code, from-sea flag) for all possible hit quarks for the input
161 // interaction
162 
163  multimap<int,bool> hq;
164 
165  const ProcessInfo & proc = interaction->ProcInfo();
166 
167  if(proc.IsWeakNC() || proc.IsEM()) {
168  //
169  // NC - includes both v+N, vbar+N
170  //
171  if(!fIsCharm) {
172  hq.insert(pair<int,bool>(kPdgUQuark, false));
173  hq.insert(pair<int,bool>(kPdgUQuark, true ));
174  hq.insert(pair<int,bool>(kPdgAntiUQuark, true ));
175  hq.insert(pair<int,bool>(kPdgDQuark, false));
176  hq.insert(pair<int,bool>(kPdgDQuark, true ));
177  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
178  hq.insert(pair<int,bool>(kPdgSQuark, true ));
179  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
180  }
181 
182  } else if (proc.IsWeakCC()) {
183  //
184  // CC - only I=-1/2 quarks for v+N & I=1/2 quarks for vbar+N
185  //
186  int ppdg = interaction->InitState().ProbePdg();
187 
188  if (pdg::IsNeutrino(ppdg)){
189  if(!fIsCharm) { hq.insert(pair<int,bool>(kPdgAntiUQuark, true )); }
190  hq.insert(pair<int,bool>(kPdgDQuark, false));
191  hq.insert(pair<int,bool>(kPdgDQuark, true ));
192  hq.insert(pair<int,bool>(kPdgSQuark, true ));
193  }
194  else if (pdg::IsAntiNeutrino(ppdg)){
195  if(!fIsCharm) { hq.insert(pair<int,bool>(kPdgUQuark, false)); }
196  if(!fIsCharm) { hq.insert(pair<int,bool>(kPdgUQuark, true )); }
197  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
198  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
199  }
200  }//CC or NC
201 
202  return hq;
203 }
204 //____________________________________________________________________________
205 
bool IsWeakCC(void) const
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
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
const int kPdgUQuark
Definition: PDGCodes.h:42
void SetHitQrkPdg(int pdgc)
Definition: Target.cxx:201
Definition: config.py:1
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:37
const int kPdgSQuark
Definition: PDGCodes.h:46
void SetCharm(int charm_pdgc=0)
Definition: XclsTag.cxx:68
Summary information for an interaction.
Definition: Interaction.h:56
const int kPdgAntiUQuark
Definition: PDGCodes.h:43
bool IsWeakNC(void) const
#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
const int kPdgAntiDQuark
Definition: PDGCodes.h:45
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
const int kPdgDQuark
Definition: PDGCodes.h:44
int Z(void) const
Definition: Target.h:69
#define pINFO
Definition: Messenger.h:63
#define pWARN
Definition: Messenger.h:61
bool IsEM(void) const
const int kPdgAntiSQuark
Definition: PDGCodes.h:47
void SetExclTag(const XclsTag &xcls)
int N(void) const
Definition: Target.h:70
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
InteractionList * CreateInteractionList(const InitialState &init) const
A vector of Interaction objects.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
multimap< int, bool > GetHitQuarks(const Interaction *interaction) const
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
void SetHitSeaQrk(bool tf)
Definition: Target.cxx:212
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...
enum genie::EInteractionType InteractionType_t
bool IsLepton(int pdgc)
Definition: PDGUtils.cxx:84
Initial State information.
Definition: InitialState.h:49