LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PrimaryEventAction_service.hh
Go to the documentation of this file.
1 // PPrimaryEventAction is the service that injects particles into
2 // the simulation.
3 // To use this action, all you need to do is put it in the services section
4 // of the configuration file, like this:
5 //
6 // services: {
7 // ...
8 // user: {
9 // PPrimaryEventAction: {}
10 // ...
11 // }
12 // }
13 
14 // Expected parameters:
15 // - name (string): A name describing the action service.
16 // Default is 'exampleParticleGun'
17 
18 // - use_HEP_event (bool): A flag; if true, the primaries will be taken from
19 // an input file called 'pythia_event.data'. If false, primaries will
20 // be generated by a particle gun.
21 // Default is true.
22 
23 // Authors: Tasha Arvanitis, Adam Lyon
24 // Date: August 2012
25 
26 #ifndef artg4tk_pluginActions_PrimaryEvent_PrimaryEventAction_service_hh
27 #define artg4tk_pluginActions_PrimaryEvent_PrimaryEventAction_service_hh
28 
29 #include "fhiclcpp/fwd.h"
31 
33 
34 #include "Geant4/G4ThreeVector.hh"
35 class G4Event;
36 
37 namespace artg4tk {
38 
40  public:
42 
43  private:
44  void addG4Particle(G4Event* event,
45  int pdgId,
46  const G4ThreeVector& pos,
47  double time,
48  double energy,
49  const G4ThreeVector& mom);
50 
51  // To generate primaries, we need to overload the GeneratePrimaries
52  // method.
53 
54  void generatePrimaries(G4Event* anEvent) override;
55  };
56 } // namespace artg4tk
57 
59 
60 #endif /* artg4tk_pluginActions_PrimaryEvent_PrimaryEventAction_service_hh */
PrimaryEventActionService(fhicl::ParameterSet const &)
void generatePrimaries(G4Event *anEvent) override
#define DECLARE_ART_SERVICE(svc, scope)
double energy
Definition: plottest35.C:25
void addG4Particle(G4Event *event, int pdgId, const G4ThreeVector &pos, double time, double energy, const G4ThreeVector &mom)
Event finding and building.