GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EventLibraryInterface.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::evtlib::EventLibraryInterface
5 
6 \brief Reads pre-generated events produced by an external generator.
7  On an event-by-event basis, it can accept GENIE input specifying
8  the neutrino and target IDs and neutrino energy and, therefore,
9  it can re-use the upstream GENIE flux and geometry tools.
10 
11 \author
12 
13 \created February 28, 2020
14 
15 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
16  For the full text of the license visit http://copyright.genie-mc.org
17 */
18 //____________________________________________________________________________
19 
20 #ifndef _EVENT_LIBRARY_INTERFACE_H_
21 #define _EVENT_LIBRARY_INTERFACE_H_
22 
23 #include "Tools/EvtLib/Key.h"
24 class IEvtLibRecordList;
25 
28 
29 #include "TVector3.h"
30 #include "TFile.h"
31 
32 #include <map>
33 
34 namespace genie {
35 
36 class Interaction;
37 
38 namespace evtlib {
39 
40 class IEvtLibRecordList;
41 class EvtLibRecord;
42 
44 
45 public:
47  EventLibraryInterface(string config);
49 
50  // implement the EventRecordVisitorI interface
51  void ProcessEventRecord (GHepRecord * event) const override ;
52 
53  // overload the Algorithm::Configure() methods to load private data
54  // members from configuration options
55  void Configure(const Registry & config) override ;
56  void Configure(string config) override ;
57 
58  protected:
59 
60  const EvtLibRecord* GetRecord(const Interaction* interaction) const;
61 
62  void LoadRecords();
63  void Cleanup();
64 
65  void FillKinematics( const GHepRecord &,
66  genie::Kinematics & kine,
67  int primary_lep_id ) const ;
68 
69 private:
70 
71  std::map<Key, const IEvtLibRecordList*> fRecords;
72  TFile* fRecordFile;
73 };
74 
75 } // evtlib namespace
76 } // genie namespace
77 
78 #endif // _EVENT_LIBRARY_INTERFACE_H_
std::map< Key, const IEvtLibRecordList * > fRecords
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
void Configure(const Registry &config) override
Reads pre-generated events produced by an external generator. On an event-by-event basis...
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
Summary information for an interaction.
Definition: Interaction.h:56
void ProcessEventRecord(GHepRecord *event) const override
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
const EvtLibRecord * GetRecord(const Interaction *interaction) const
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
void FillKinematics(const GHepRecord &, genie::Kinematics &kine, int primary_lep_id) const