LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
"
30
#include "
art/Framework/Services/Registry/ServiceDeclarationMacros.h
"
31
32
#include "
artg4tk/actionBase/PrimaryGeneratorActionBase.hh
"
33
34
#include "Geant4/G4ThreeVector.hh"
35
class
G4Event;
36
37
namespace
artg4tk
{
38
39
class
PrimaryEventActionService
:
public
artg4tk::PrimaryGeneratorActionBase
{
40
public
:
41
PrimaryEventActionService
(
fhicl::ParameterSet
const
&);
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
58
DECLARE_ART_SERVICE
(
artg4tk::PrimaryEventActionService
, LEGACY)
59
60
#endif
/* artg4tk_pluginActions_PrimaryEvent_PrimaryEventAction_service_hh */
artg4tk::PrimaryEventActionService::PrimaryEventActionService
PrimaryEventActionService(fhicl::ParameterSet const &)
Definition:
PrimaryEventAction.cc:17
PrimaryGeneratorActionBase.hh
artg4tk::PrimaryEventActionService
Definition:
PrimaryEventAction_service.hh:39
artg4tk::PrimaryEventActionService::generatePrimaries
void generatePrimaries(G4Event *anEvent) override
Definition:
PrimaryEventAction.cc:24
ServiceDeclarationMacros.h
DECLARE_ART_SERVICE
#define DECLARE_ART_SERVICE(svc, scope)
Definition:
ServiceDeclarationMacros.h:77
energy
double energy
Definition:
plottest35.C:25
artg4tk
Definition:
ActionBase.hh:12
artg4tk::PrimaryGeneratorActionBase
Definition:
PrimaryGeneratorActionBase.hh:24
artg4tk::PrimaryEventActionService::addG4Particle
void addG4Particle(G4Event *event, int pdgId, const G4ThreeVector &pos, double time, double energy, const G4ThreeVector &mom)
Definition:
PrimaryEventAction.cc:47
event
Event finding and building.
Definition:
EventCheater_module.cc:32
fwd.h
fhicl::ParameterSet
Definition:
ParameterSet.h:36
artg4tk
v12_00_03
source
artg4tk
pluginActions
PrimaryEvent
PrimaryEventAction_service.hh
Generated on Thu May 2 2024 20:59:30 for LArSoft by
1.8.11