LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
HepevtInputAction_service.hh
Go to the documentation of this file.
1 //
2 // __ __ __ __ __
3 // ____ ______/ /_____ _/ // / / /_/ /__
4 // / __ `/ ___/ __/ __ `/ // /_/ __/ //_/
5 // / /_/ / / / /_/ /_/ /__ __/ /_/ ,<
6 // \__,_/_/ \__/\__, / /_/ \__/_/|_|
7 // /____/
8 //
9 // artg4tk: art based Geant 4 Toolkit
10 //
11 //=============================================================================
12 // This file provides the implementation for an action object that produces
13 // the primary particles using a pythia generated Hepevt event as input
14 // ParticleGunActionService.hh: art wrapper for G4ParticleGun
15 // To use this, all you need to do is put it in the services section
16 // of the configuration file, like this:
17 //
18 // services: {
19 // ...
20 // user: {
21 // HepevtInputAction: {
22 // name: "HepevtInput"
23 // FileName: "pythia_event.data"
24 // }
25 // . ..
26 // }
27 // }
28 // Authors: Tasha Arvanitis, Adam Lyon
29 // Date: August 2012
30 //=============================================================================
31 
32 #ifndef artg4tk_pluginActions_myparticleGun_HepevtInputAction_service_hh
33 #define artg4tk_pluginActions_myparticleGun_HepevtInputAction_service_hh
34 
35 // framework Includes:
37 #include "fhiclcpp/fwd.h"
38 
39 // Get the artg4tk base class
41 
42 // Geant 4 includes:
43 #include "Geant4/G4VPrimaryGenerator.hh"
44 class G4Event;
45 
46 namespace artg4tk {
47 
49  public:
51  void initialize() override;
52 
53  // To generate primaries, we need to overload the GeneratePrimaries
54  // method.
55  void generatePrimaries(G4Event* anEvent) override;
56 
57  private:
58  std::unique_ptr<G4VPrimaryGenerator> HEPEvt_{nullptr};
59  std::string fileName_; // name of hepevt input file
60  };
61 } // namespace artg4tk
62 
64 
65 #endif /* artg4tk_pluginActions_myparticleGun_HepevtInputAction_service_hh */
void generatePrimaries(G4Event *anEvent) override
std::unique_ptr< G4VPrimaryGenerator > HEPEvt_
HepevtInputActionService(fhicl::ParameterSet const &)
#define DECLARE_ART_SERVICE(svc, scope)