DMDISInteractionListGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3 
4  Copyright (c) 2003-2019, The GENIE Collaboration
5  For the full text of the license visit http://copyright.genie-mc.org
6  or see $GENIE/LICENSE
7 
8  Author: Joshua Berger <jberger \at physics.wisc.edu>
9  University of Wisconsin-Madison
10 
11  Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
12  University of Liverpool & STFC Rutherford Appleton Lab
13 */
14 //____________________________________________________________________________
15 
22 
23 using namespace genie;
24 
25 //___________________________________________________________________________
27 InteractionListGeneratorI("genie::DMDISInteractionListGenerator")
28 {
29 
30 }
31 //___________________________________________________________________________
33 InteractionListGeneratorI("genie::DMDISInteractionListGenerator", config)
34 {
35 
36 }
37 //___________________________________________________________________________
39 {
40 
41 }
42 //___________________________________________________________________________
44  const InitialState & init_state) const
45 {
46  LOG("IntLst", pINFO)
47  << "InitialState = " << init_state.AsString();
48 
49  InteractionType_t inttype;
50  // Only accept DM scattering here
51  if (fIsDM) inttype = kIntDarkMatter;
52  else {
53  LOG("IntLst", pWARN)
54  << "Unknown InteractionType! Returning NULL InteractionList "
55  << "for init-state: " << init_state.AsString();
56  return 0;
57  }
58 
59  int ppdg = init_state.ProbePdg();
60  if( !pdg::IsDarkMatter(ppdg)) {
61  LOG("IntLst", pWARN)
62  << "Can not handle probe! Returning NULL InteractionList "
63  << "for init-state: " << init_state.AsString();
64  return 0;
65  }
66 
67  bool hasP = (init_state.Tgt().Z() > 0);
68  bool hasN = (init_state.Tgt().N() > 0);
69 
70  InteractionList * intlist = new InteractionList;
71 
72  int nuclpdg[2] = { kPdgProton, kPdgNeutron };
73 
74  for(int inucl=0; inucl<2; inucl++) {
75 
76  int struck_nucleon = nuclpdg[inucl];
77 
78  if( (struck_nucleon == kPdgProton && hasP) ||
79  (struck_nucleon == kPdgNeutron && hasN) ) {
80 
81  ProcessInfo proc_info(kScDarkMatterDeepInelastic, inttype);
82 
83  Interaction * interaction = new Interaction(init_state, proc_info);
84  Target * target = interaction->InitStatePtr()->TgtPtr();
85  target->SetHitNucPdg(struck_nucleon);
86 
87  if(fIsCharm) {
88  XclsTag exclusive_tag;
89  exclusive_tag.SetCharm();
90  interaction->SetExclTag(exclusive_tag);
91  }
92 
93  if(fSetHitQuark) {
94  // Add interactions for all possible hit (valence or sea) quarks
95 
96  multimap<int,bool> hq = this->GetHitQuarks(interaction);
97  multimap<int,bool>::const_iterator hqi = hq.begin();
98 
99  for( ; hqi != hq.end(); ++hqi) {
100 
101  int quark_code = hqi->first;
102  bool from_sea = hqi->second;
103 
104  target->SetHitQrkPdg(quark_code);
105  target->SetHitSeaQrk(from_sea);
106 
107  Interaction * intq = new Interaction(*interaction);
108  intlist->push_back(intq);
109  }
110  delete interaction;
111  }
112  else {
113  intlist->push_back(interaction);
114  }//set hit quark?
115 
116  }//current N exists in nuclear target
117  }//N
118 
119  if(intlist->size() == 0) {
120  LOG("IntLst", pERROR)
121  << "Returning NULL InteractionList for init-state: "
122  << init_state.AsString();
123  delete intlist;
124  return 0;
125  }
126  return intlist;
127 }
128 //___________________________________________________________________________
130 {
131  Algorithm::Configure(config);
132  this->LoadConfigData();
133 }
134 //____________________________________________________________________________
136 {
137  Algorithm::Configure(config);
138  this->LoadConfigData();
139 }
140 //____________________________________________________________________________
142 {
143  GetParamDef( "is-DM", fIsDM, false ) ;
144  GetParamDef( "is-Charm", fIsCharm, false ) ;
145  GetParamDef( "set-hit-quark", fSetHitQuark, false ) ;
146 
147 }
148 //____________________________________________________________________________
150  const Interaction * interaction) const
151 {
152 // Set (PDG code, from-sea flag) for all possible hit quarks for the input
153 // interaction
154 
155  multimap<int,bool> hq;
156 
157  const ProcessInfo & proc = interaction->ProcInfo();
158 
159  if(!fIsCharm) {
160  hq.insert(pair<int,bool>(kPdgUQuark, false));
161  hq.insert(pair<int,bool>(kPdgUQuark, true ));
162  hq.insert(pair<int,bool>(kPdgAntiUQuark, true ));
163  hq.insert(pair<int,bool>(kPdgDQuark, false));
164  hq.insert(pair<int,bool>(kPdgDQuark, true ));
165  hq.insert(pair<int,bool>(kPdgAntiDQuark, true ));
166  hq.insert(pair<int,bool>(kPdgSQuark, true ));
167  hq.insert(pair<int,bool>(kPdgAntiSQuark, true ));
168  }
169 
170  return hq;
171 }
172 //____________________________________________________________________________
173 
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
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:125
Definition: config.py:1
InteractionList * CreateInteractionList(const InitialState &init) const
multimap< int, bool > GetHitQuarks(const Interaction *interaction) const
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
#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
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
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
A vector of Interaction objects.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
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
Initial State information.
Definition: InitialState.h:49