Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:41

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // --------------------------------------------------------------
0028 //   GEANT 4 - Underground Dark Matter Detector Advanced Example
0029 //
0030 //      For information related to this code contact: Alex Howard
0031 //      e-mail: alexander.howard@cern.ch
0032 // --------------------------------------------------------------
0033 // Comments
0034 //
0035 //                  Underground Advanced
0036 //               by A. Howard and H. Araujo 
0037 //                    (27th November 2001)
0038 //
0039 // ParticleSource header
0040 // --------------------------------------------------------------
0041 //////////////////////////////////////////////////////////////////////////////
0042 // This particle source is a shortened version of G4GeneralParticleSource by
0043 // C Ferguson, F Lei & P Truscott (University of Southampton / DERA), with
0044 // some minor modifications.
0045 //////////////////////////////////////////////////////////////////////////////
0046 
0047 #ifndef DMXParticleSource_h
0048 #define DMXParticleSource_h 1
0049 
0050 #include "G4VPrimaryGenerator.hh"
0051 #include "G4Navigator.hh"
0052 #include "G4ParticleMomentum.hh"
0053 #include "G4ParticleDefinition.hh"
0054 
0055 #include "DMXParticleSourceMessenger.hh"
0056 
0057 
0058 class DMXParticleSource : public G4VPrimaryGenerator {
0059 
0060    public:
0061      DMXParticleSource (); 
0062      ~DMXParticleSource ();
0063      void GeneratePrimaryVertex(G4Event *evt);
0064 
0065    public:
0066 
0067      // position distribution  
0068      void SetPosDisType(G4String);
0069      void SetPosDisShape(G4String);
0070      void SetCentreCoords(G4ThreeVector);
0071      void SetHalfZ(G4double);
0072      void SetRadius(G4double);
0073      void GeneratePointSource();
0074      void GeneratePointsInVolume();
0075      G4bool IsSourceConfined();
0076      void ConfineSourceToVolume(G4String);
0077   
0078      // angular distribution
0079      void SetAngDistType(G4String);
0080      void SetParticleMomentumDirection(G4ParticleMomentum);
0081      void GenerateIsotropicFlux();
0082 
0083      // energy distribution 
0084      void SetEnergyDisType(G4String);
0085      void SetMonoEnergy(G4double);
0086      void GenerateMonoEnergetic();
0087   inline G4double GetParticleEnergy() {return particle_energy;}
0088 
0089      // verbosity
0090      void SetVerbosity(G4int);
0091   
0092      // particle properties
0093      void SetParticleDefinition(G4ParticleDefinition * aParticleDefinition);
0094      inline void SetParticleCharge(G4double aCharge)
0095         { particle_charge = aCharge; }
0096   
0097    private:
0098 
0099      // position distribution
0100      G4String SourcePosType;
0101      G4String Shape;
0102      G4double halfz;
0103      G4double Radius;
0104      G4ThreeVector CentreCoords;
0105      G4bool Confine;
0106      G4String VolName;
0107      G4String AngDistType;
0108      G4double MinTheta, MaxTheta, MinPhi, MaxPhi;
0109      G4double Phi;
0110      G4String EnergyDisType;
0111      G4double MonoEnergy;
0112 
0113      // particle properties 
0114      G4int                  NumberOfParticlesToBeGenerated;
0115      G4ParticleDefinition*  particle_definition;
0116      G4ParticleMomentum     particle_momentum_direction;
0117      G4double               particle_energy;
0118      G4double               particle_charge;
0119      G4ThreeVector          particle_position;
0120      G4double               particle_time;
0121      G4ThreeVector          particle_polarization;
0122 
0123      // Verbose
0124      G4int verbosityLevel;
0125 
0126    private:
0127   
0128      DMXParticleSourceMessenger *theMessenger;
0129      G4Navigator *gNavigator;
0130 
0131   
0132 };
0133 
0134 
0135 #endif
0136