Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:24

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 /** \addtogroup Geant4GeneratorAction
0014  *
0015  @{
0016    \package Geant4ParticleGun
0017  * \brief Implementation of a particle gun using Geant4Particles.
0018  *
0019  *
0020 @}
0021  */
0022 
0023 #ifndef DDG4_GEANT4PARTICLEGUN_H
0024 #define DDG4_GEANT4PARTICLEGUN_H
0025 
0026 // Framework include files
0027 #include <DDG4/Geant4IsotropeGenerator.h>
0028 
0029 /// Namespace for the AIDA detector description toolkit
0030 namespace dd4hep {
0031 
0032   /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
0033   namespace sim {
0034 
0035     /// Implementation of a particle gun using Geant4Particles.
0036     /**
0037      *  The {\tt{Geant4ParticleGun}} is a tool to shoot a number of
0038      *  particles with identical properties into a given region of the
0039      *  detector to be simulated.
0040      *
0041      *  The particle gun is a input source like any other and participates
0042      *  in the general input stage merging process like any other input
0043      *  e.g. from file. Hence, there may be several particle guns present
0044      *  each generating its own primary vertex. Use the mask property to
0045      *  ensure each gun generates its own, well identified primary vertex.
0046      *
0047      *  There is one 'user lazyness' support though:
0048      *  If there is only one particle gun in use, the property 'Standalone',
0049      *  which by default is set to true invokes the interaction merging and he
0050      *  Geant4 primary generation directly.
0051      *
0052      *  \author  M.Frank
0053      *  \version 1.0
0054      *  \ingroup DD4HEP_SIMULATION
0055      */
0056     class Geant4ParticleGun: public Geant4IsotropeGenerator {
0057     protected:
0058       /// Property: Isotrope particles?
0059       bool m_isotrop;
0060       /// Property: Standalone mode: includes interaction merging and primary generation
0061       bool m_standalone;
0062       /// Property: Enable printout
0063       bool m_print;
0064       /// Shot number in sequence
0065       int m_shotNo;
0066       /// Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = [m_momentumMin, m_momentumMax])
0067       virtual void getParticleDirection(int, ROOT::Math::XYZVector& direction, double& momentum) const;
0068     public:
0069       /// Standard constructor
0070       Geant4ParticleGun(Geant4Context* context, const std::string& name);
0071       /// Default destructor
0072       virtual ~Geant4ParticleGun();
0073       /// Callback to generate primary particles
0074       virtual void operator()(G4Event* event);
0075     };
0076   }    // End namespace sim
0077 }      // End namespace dd4hep
0078 #endif // DDG4_GEANT4PARTICLEGUN_H