GENIEGenerator
Loading...
Searching...
No Matches
HybridXSecAlgorithm.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::HybridXSecAlgorithm
5
6\brief Defines an XSecAlgorithmI that delegates the actual calculation
7 to one or more sub-algorithms (each of which is itself an XSecAlgorithmI)
8 based on the input interaction. The choice of sub-algorithms is configurable
9 via XML.
10
11 The current use case is to allow GENIE to simultaneously use the
12 SuSAv2 quasielastic cross section model for complex targets and the
13 Llewellyn-Smith model for free nucleons.
14
15 Is a concrete implementation of the XSecAlgorithmI interface.
16
17\author Steven Gardiner <gardiner \at fnal.gov>
18 Fermi National Acclerator Laboratory
19
20\created November 4, 2019
21
22\cpright Copyright (c) 2003-2025, The GENIE Collaboration
23 For the full text of the license visit http://copyright.genie-mc.org
24 or see $GENIE/LICENSE
25*/
26//____________________________________________________________________________
27
28#ifndef _HYBRID_XSEC_ALG_H_
29#define _HYBRID_XSEC_ALG_H_
30
32
33namespace genie {
34
36
37public:
38
40 HybridXSecAlgorithm(string config);
41 virtual ~HybridXSecAlgorithm();
42
43 // XSecAlgorithmI interface implementation
44 double XSec(const Interaction* i, KinePhaseSpace_t k) const;
45 double Integral(const Interaction* i) const;
46 bool ValidProcess(const Interaction* i) const;
47
48 // override the Algorithm::Configure methods to load configuration
49 // data to private data members
50 void Configure (const Registry & config);
51 void Configure (string config);
52
53private:
54
55 /// Load algorithm configuration
56 void LoadConfig (void);
57
58 /// Retrieve a pointer to the appropriate cross section algorithm
59 /// using the map. If no suitable algorithm was found, return a
60 /// null pointer.
61 const XSecAlgorithmI* ChooseXSecAlg(const Interaction& interaction) const;
62
63 /// Map specifying the managed cross section algorithms. Keys are strings
64 /// generated with Interaction::AsString() (identical to those used for
65 /// splines). Values are pointers to the corresponding cross section
66 /// algorithms.
67 mutable std::map<string, const XSecAlgorithmI*> fXSecAlgMap;
68
69 /// Optional XSecAlgorithmI to use by default
71};
72
73} // genie namespace
74#endif // _HYBRID_XSEC_ALG_H_
void LoadConfig(void)
Load algorithm configuration.
void Configure(string config)
const XSecAlgorithmI * ChooseXSecAlg(const Interaction &interaction) const
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
void Configure(const Registry &config)
const XSecAlgorithmI * fDefaultXSecAlg
Optional XSecAlgorithmI to use by default.
std::map< string, const XSecAlgorithmI * > fXSecAlgMap
double Integral(const Interaction *i) const
Summary information for an interaction.
Definition Interaction.h:56
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
enum genie::EKinePhaseSpace KinePhaseSpace_t