DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geant4ParticleGun.h
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 #ifndef DD4HEP_DDG4_GEANT4PARTICLEGUN_H
16 #define DD4HEP_DDG4_GEANT4PARTICLEGUN_H
17 
18 // Framework include files
20 
22 namespace DD4hep {
23 
25  namespace Simulation {
26 
28 
49  protected:
51  bool m_isotrop;
55  bool m_print;
57  int m_shotNo;
59  virtual void getParticleDirection(int, ROOT::Math::XYZVector& direction, double& momentum) const {
60  direction = m_direction;
61  momentum = m_energy;
62  }
63  public:
65  Geant4ParticleGun(Geant4Context* context, const std::string& name);
67  virtual ~Geant4ParticleGun();
69  virtual void operator()(G4Event* event);
70  };
71  } // End namespace Simulation
72 } // End namespace DD4hep
73 #endif /* DD4HEP_DDG4_GEANT4PARTICLEGUN_H */
Generate particles isotrop in space around origine (0,0,0)
ROOT::Math::XYZVector m_direction
Property: Shooting direction of the gun.
virtual void getParticleDirection(int, ROOT::Math::XYZVector &direction, double &momentum) const
Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = m_energy) ...
bool m_standalone
Property: Standalone mode: includes interaction merging and primary generation.
bool m_print
Property: Enable printout.
bool m_isotrop
Property: Isotrope particles?
int m_shotNo
Shot number in sequence.
virtual void operator()(G4Event *event)
Callback to generate primary particles.
Geant4Context * context() const
Access the context.
Definition: Geant4Action.h:261
const std::string & name() const
Access name of the action.
Definition: Geant4Action.h:271
double m_energy
Property: Particle energy.
Generic context to extend user, run and event information.
Geant4ParticleGun(Geant4Context *context, const std::string &name)
Standard constructor.
virtual ~Geant4ParticleGun()
Default destructor.
Implementation of a particle gun using Geant4Particles.