ProcessInfo.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 
9  Changes required to implement the GENIE Boosted Dark Matter module
10  were installed by Josh Berger (Univ. of Wisconsin)
11 
12  Changes required to implement the GENIE Dark Neutrino module
13  were installed by Iker de Icaza (Univ. of Sussex)
14 */
15 //____________________________________________________________________________
16 
17 #include <sstream>
18 
20 
21 using std::ostringstream;
22 using std::endl;
23 
24 using namespace genie;
25 
27 
28 //____________________________________________________________________________
29 namespace genie {
30  ostream & operator << (ostream & stream, const ProcessInfo & proc)
31  {
32  proc.Print(stream);
33  return stream;
34  }
35 }
36 //____________________________________________________________________________
38 TObject()
39 {
40  this->Reset();
41 }
42 //____________________________________________________________________________
44  ScatteringType_t sc_type, InteractionType_t int_type) :
45 TObject(),
46 fScatteringType(sc_type),
47 fInteractionType(int_type)
48 {
49 
50 }
51 //____________________________________________________________________________
53 TObject()
54 {
55  this->Copy(proc);
56 }
57 //____________________________________________________________________________
59 {
60 
61 }
62 //____________________________________________________________________________
64 {
67 }
68 //____________________________________________________________________________
70 {
71  return (fScatteringType == kScQuasiElastic);
72 }
73 //____________________________________________________________________________
75 {
77 }
78 //____________________________________________________________________________
79 bool ProcessInfo::IsSingleKaon(void) const
80 {
81  return (fScatteringType == kScSingleKaon);
82 }
83 //____________________________________________________________________________
85 {
87 }
88 //____________________________________________________________________________
90 {
92 }
93 //____________________________________________________________________________
94 bool ProcessInfo::IsResonant(void) const
95 {
96  return (fScatteringType == kScResonant);
97 }
98 //____________________________________________________________________________
100 {
102 }
103 //____________________________________________________________________________
105 {
107 }
108 //____________________________________________________________________________
110 {
114 }
115 //____________________________________________________________________________
117 {
119 }
120 //____________________________________________________________________________
122 {
124 }
125 //____________________________________________________________________________
127 {
129 }
130 //____________________________________________________________________________
132 {
134 }
135 //____________________________________________________________________________
137 {
138  return (fInteractionType == kIntDarkNC);
139 }
140 //____________________________________________________________________________
142 {
144 }
145 //____________________________________________________________________________
147 {
149 }
150 //____________________________________________________________________________
151 bool ProcessInfo::IsAMNuGamma(void) const
152 {
153  return (fScatteringType == kScAMNuGamma);
154 }
155 //____________________________________________________________________________
156 bool ProcessInfo::IsMEC(void) const
157 {
158  return (fScatteringType == kScMEC);
159 }
160 //____________________________________________________________________________
162 {
163  return (fScatteringType == kScDiffractive);
164 }
165 
166 //____________________________________________________________________________
167 bool ProcessInfo::IsKnown (void) const
168 {
169  return (fScatteringType > kScNull);
170 }
171 
172 //____________________________________________________________________________
173 bool ProcessInfo::IsEM(void) const
174 {
175  return (fInteractionType == kIntEM);
176 }
177 //____________________________________________________________________________
178 bool ProcessInfo::IsWeak(void) const
179 {
180  return ( this->IsWeakCC() || this->IsWeakNC() || this->IsWeakMix());
181 }
182 //____________________________________________________________________________
183 bool ProcessInfo::IsWeakCC(void) const
184 {
185  return (fInteractionType == kIntWeakCC);
186 }
187 //____________________________________________________________________________
188 bool ProcessInfo::IsWeakNC(void) const
189 {
190  return (fInteractionType == kIntWeakNC);
191 }
192 //____________________________________________________________________________
194 {
195  return (fInteractionType == kIntDarkMatter);
196 }
197 //____________________________________________________________________________
198 bool ProcessInfo::IsWeakMix(void) const
199 {
200  return (fInteractionType == kIntWeakMix);
201 }
202 //____________________________________________________________________________
204 {
205  return fInteractionType;
206 }
207 //____________________________________________________________________________
209 {
210  return fScatteringType;
211 }
212 //____________________________________________________________________________
213 string ProcessInfo::AsString(void) const
214 {
215  ostringstream stream;
216 
217  stream << "<"
218  << this->ScatteringTypeAsString()
219  << " - "
220  << this->InteractionTypeAsString()
221  << ">";
222 
223  return stream.str();
224 }
225 //____________________________________________________________________________
227 {
228  string scattering_type = ScatteringType::AsString(fScatteringType);
229  return scattering_type;
230 }
231 //____________________________________________________________________________
233 {
234  string interaction_type = InteractionType::AsString(fInteractionType);
235  return interaction_type;
236 }
237 //____________________________________________________________________________
239 {
240  fScatteringType = sc_type;
241  fInteractionType = int_type;
242 }
243 //____________________________________________________________________________
244 bool ProcessInfo::Compare(const ProcessInfo & proc) const
245 {
246  return (
249  );
250 }
251 //____________________________________________________________________________
252 void ProcessInfo::Copy(const ProcessInfo & proc)
253 {
256 }
257 //____________________________________________________________________________
258 void ProcessInfo::Print(ostream & stream) const
259 {
260  stream << "[-] [Process-Info] " << endl
261  << " |--> Interaction : " << this->InteractionTypeAsString() << endl
262  << " |--> Scattering : " << this->ScatteringTypeAsString() << endl;
263 }
264 //____________________________________________________________________________
265 bool ProcessInfo::operator == (const ProcessInfo & proc) const
266 {
267  return this->Compare(proc);
268 }
269 //___________________________________________________________________________
271 {
272  this->Copy(proc);
273  return (*this);
274 }
275 //____________________________________________________________________________
bool IsResonant(void) const
Definition: ProcessInfo.cxx:94
ScatteringType_t fScatteringType
scattering type (QEL, RES, DIS, ...)
Definition: ProcessInfo.h:110
bool IsWeak(void) const
bool IsWeakMix(void) const
bool IsWeakCC(void) const
bool Compare(const ProcessInfo &proc) const
InteractionType_t InteractionTypeId(void) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
bool IsDarkMatterElectronElastic(void) const
string ScatteringTypeAsString(void) const
bool IsDarkNeutralCurrent(void) const
void Print(ostream &stream) const
bool IsInverseMuDecay(void) const
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:69
bool IsElectronScattering(void) const
ClassImp(ProcessInfo) namespace genie
Definition: ProcessInfo.cxx:26
bool IsInverseBetaDecay(void) const
bool IsDiffractive(void) const
bool IsCoherentProduction(void) const
Definition: ProcessInfo.cxx:99
bool IsIMDAnnihilation(void) const
InteractionType_t fInteractionType
interaction type (Weak CC/NC, E/M, ...)
Definition: ProcessInfo.h:111
void Set(ScatteringType_t sc_type, InteractionType_t int_type)
bool IsKnown(void) const
bool IsSingleKaon(void) const
Definition: ProcessInfo.cxx:79
ProcessInfo & operator=(const ProcessInfo &proc)
bool IsWeakNC(void) const
bool IsCoherentElastic(void) const
bool IsNuElectronElastic(void) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
bool IsAMNuGamma(void) const
string AsString(void) const
string InteractionTypeAsString(void) const
bool IsDarkMatterElastic(void) const
Definition: ProcessInfo.cxx:74
ScatteringType_t ScatteringTypeId(void) const
static string AsString(ScatteringType_t type)
bool IsMEC(void) const
bool IsEM(void) const
static string AsString(InteractionType_t type)
bool IsDeepInelastic(void) const
Definition: ProcessInfo.cxx:84
enum genie::EScatteringType ScatteringType_t
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
bool IsDarkMatter(void) const
bool operator==(const ProcessInfo &proc) const
bool IsGlashowResonance(void) const
bool IsDarkMatterDeepInelastic(void) const
Definition: ProcessInfo.cxx:89
enum genie::EInteractionType InteractionType_t
void Copy(const ProcessInfo &proc)
QTextStream & endl(QTextStream &s)