GENIEGenerator
Loading...
Searching...
No Matches
GEVGDriver.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::GEVGDriver
5
6\brief GENIE Event Generation Driver.
7 A minimalist user interface object for generating neutrino interactions.
8 Each such object is configured for a given initial state and it drives all
9 relevant GENIE neutrino interaction physics simulation code for that state.
10 To set-up MC jobs involving a multitude of possible initial states,
11 including arbitrarily complex neutrino flux and detector geometry
12 descriptions, see the GMCJDriver object.
13
14\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
15 University of Liverpool
16
17\created August 06, 2004
18
19\cpright Copyright (c) 2003-2025, The GENIE Collaboration
20 For the full text of the license visit http://copyright.genie-mc.org
21*/
22//____________________________________________________________________________
23
24#ifndef _GEVG_DRIVER_H_
25#define _GEVG_DRIVER_H_
26
27#include <ostream>
28#include <string>
29
30#include <TLorentzVector.h>
31#include <TBits.h>
32
34
35using std::ostream;
36using std::string;
37
38namespace genie {
39
40class GEVGDriver;
41class EventRecord;
43class EventGeneratorI;
46class InteractionList;
47class Interaction;
48class InitialState;
49class Target;
50class Spline;
51
52ostream & operator << (ostream & stream, const GEVGDriver & driver);
53
55
56public :
57 GEVGDriver();
59
60 // Driver options:
61 // - Set before calling Configure()
62 void UseSplines (void);
63 void SetEventGeneratorList(string listname);
64 // - Set before GenerateEvent()
65 void SetUnphysEventMask(const TBits & mask);
66
67 // Configure the driver
68 void Configure (int nu_pdgc, int Z, int A);
69 void Configure (const InitialState & init_state);
70
71 // Generate single event
72 EventRecord * GenerateEvent (const TLorentzVector & nu4p);
73
74 // Get the list of all interactions that can be simulated for the specified
75 // initial state (depends on which event generation threads were loaded into
76 // the event generation driver driver)
77 const InteractionList * Interactions(void) const;
78
79 // Get event generator thread list
80 const EventGeneratorList * EventGenerators (void) const { return fEvGenList; }
81
82 // Get the event generator that is responsible for generating the input event
83 const EventGeneratorI * FindGenerator(const Interaction * interaction) const;
84
85 // Cross section splines for input interaction and for the sum of all
86 // simulated interactions for the specified initial state
87 const Spline * XSecSumSpline (void) const { return fXSecSumSpl; }
88 const Spline * XSecSpline (const Interaction * interaction) const;
89
90 // Instruct the driver to create all the splines it needs
91 void CreateSplines (int nknots=-1, double emax=-1, bool inLogE=true);
92
93 // Methods used for building the 'total' cross section spline
94 double XSecSum (const TLorentzVector & nup4);
95 void CreateXSecSumSpline (int nk, double Emin, double Emax, bool inlogE=true);
96
97 // Get validity range (combined validity range of loaded evg threads)
98 Range1D_t ValidEnergyRange (void) const;
99
100 // Reset, Print etc
101 void Reset (void);
102 void Print (ostream & stream) const;
103
104 friend ostream & operator << (ostream & stream, const GEVGDriver & driver);
105
106private:
107
108 // Private initialization, configuration & input validation methods
109 void Init (void);
110 void CleanUp (void);
111 void BuildInitialState (const InitialState & init_state);
112 void BuildGeneratorList (void);
114 void BuildInteractionSelector (void);
115 void AssertIsValidInitState (void) const;
116
117 // Private data members
118 InitialState * fInitState; ///< initial state information for driver instance
119 EventRecord * fCurrentRecord; ///< ptr to the event record being processed
120 EventGeneratorList * fEvGenList; ///< all Event Generators available at this job
121 InteractionSelectorI * fIntSelector; ///< interaction selector
122 InteractionGeneratorMap * fIntGenMap; ///< interaction -> generator assosiative container
123 TBits * fUnphysEventMask; ///< controls whether unphysical events are returned
124 bool fUseSplines; ///< controls whether xsecs are computed or interpolated
125 Spline * fXSecSumSpl; ///< sum{xsec(all interactions | this init state)}
126 unsigned int fNRecLevel; ///< recursive mode depth counter
127 string fEventGenList; ///< list of event generators loaded by this driver (what used to be the $GEVGL setting)
128};
129
130} // genie namespace
131
132#endif // _GENIE_H_
Defines the EventGeneratorI interface.
A vector of EventGeneratorI objects.
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition EventRecord.h:37
GENIE Event Generation Driver. A minimalist user interface object for generating neutrino interaction...
Definition GEVGDriver.h:54
void AssertIsValidInitState(void) const
const Spline * XSecSpline(const Interaction *interaction) const
void SetUnphysEventMask(const TBits &mask)
void Configure(int nu_pdgc, int Z, int A)
const EventGeneratorList * EventGenerators(void) const
Definition GEVGDriver.h:80
string fEventGenList
list of event generators loaded by this driver (what used to be the $GEVGL setting)
Definition GEVGDriver.h:127
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition GEVGDriver.h:120
void CreateSplines(int nknots=-1, double emax=-1, bool inLogE=true)
InitialState * fInitState
initial state information for driver instance
Definition GEVGDriver.h:118
const Spline * XSecSumSpline(void) const
Definition GEVGDriver.h:87
void BuildGeneratorList(void)
TBits * fUnphysEventMask
controls whether unphysical events are returned
Definition GEVGDriver.h:123
const InteractionList * Interactions(void) const
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition GEVGDriver.h:124
friend ostream & operator<<(ostream &stream, const GEVGDriver &driver)
double XSecSum(const TLorentzVector &nup4)
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition GEVGDriver.h:122
Spline * fXSecSumSpl
sum{xsec(all interactions | this init state)}
Definition GEVGDriver.h:125
EventRecord * GenerateEvent(const TLorentzVector &nu4p)
EventRecord * fCurrentRecord
ptr to the event record being processed
Definition GEVGDriver.h:119
void CreateXSecSumSpline(int nk, double Emin, double Emax, bool inlogE=true)
void BuildInteractionGeneratorMap(void)
unsigned int fNRecLevel
recursive mode depth counter
Definition GEVGDriver.h:126
void BuildInteractionSelector(void)
void BuildInitialState(const InitialState &init_state)
void UseSplines(void)
InteractionSelectorI * fIntSelector
interaction selector
Definition GEVGDriver.h:121
void SetEventGeneratorList(string listname)
Range1D_t ValidEnergyRange(void) const
void Print(ostream &stream) const
const EventGeneratorI * FindGenerator(const Interaction *interaction) const
Initial State information.
An Interaction -> EventGeneratorI associative container. The container is being built for the loaded ...
A vector of Interaction objects.
Defines the InteractionSelectorI interface to be implemented by algorithms selecting interactions to ...
Summary information for an interaction.
Definition Interaction.h:56
A simple [min,max] interval for doubles.
Definition Range1.h:43
A numeric analysis tool class for interpolating 1-D functions.
Definition Spline.h:58
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition Target.h:40
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)