Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:21:50

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  *
0029  *       Filename:  CexmcPrimaryGeneratorAction.hh
0030  *
0031  *    Description:  primary particle position, direction, energy etc.
0032  *
0033  *        Version:  1.0
0034  *        Created:  11.10.2009 14:54:27
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
0040  *
0041  * =============================================================================
0042  */
0043 
0044 #ifndef CEXMC_PRIMARY_GENERATOR_ACTION_HH
0045 #define CEXMC_PRIMARY_GENERATOR_ACTION_HH
0046 
0047 #include <G4VUserPrimaryGeneratorAction.hh>
0048 #include "CexmcException.hh"
0049 
0050 class  G4Event;
0051 class  CexmcParticleGun;
0052 class  CexmcPhysicsManager;
0053 class  CexmcPrimaryGeneratorActionMessenger;
0054 
0055 
0056 class  CexmcPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
0057 {
0058     public:
0059         explicit CexmcPrimaryGeneratorAction(
0060                                         CexmcPhysicsManager *  physicsManager );
0061 
0062         ~CexmcPrimaryGeneratorAction();
0063 
0064     public:
0065         void      GeneratePrimaries( G4Event *  event );
0066 
0067     public:
0068         void      SetFwhmPosX( G4double  value, G4bool  fromMessenger = true );
0069 
0070         void      SetFwhmPosY( G4double  value, G4bool  fromMessenger = true );
0071 
0072         void      SetFwhmDirX( G4double  value, G4bool  fromMessenger = true );
0073 
0074         void      SetFwhmDirY( G4double  value, G4bool  fromMessenger = true );
0075 
0076         void      SetFwhmMomentumAmp( G4double  value,
0077                                       G4bool  fromMessenger = true );
0078 
0079         G4double  GetFwhmPosX( void ) const;
0080 
0081         G4double  GetFwhmPosY( void ) const;
0082 
0083         G4double  GetFwhmDirX( void ) const;
0084 
0085         G4double  GetFwhmDirY( void ) const;
0086 
0087         G4double  GetFwhmMomentumAmp( void ) const;
0088 
0089     public:
0090         CexmcParticleGun *  GetParticleGun( void );
0091 
0092     private:
0093         CexmcParticleGun *  particleGun;
0094 
0095         G4double            fwhmPosX;
0096 
0097         G4double            fwhmPosY;
0098 
0099         G4double            fwhmDirX;
0100 
0101         G4double            fwhmDirY;
0102 
0103         G4double            fwhmMomentumAmp;
0104 
0105     private:
0106         CexmcPrimaryGeneratorActionMessenger *  messenger;
0107 };
0108 
0109 
0110 inline void  CexmcPrimaryGeneratorAction::SetFwhmPosX( G4double  value,
0111                                                        G4bool  fromMessenger )
0112 {
0113     if ( fromMessenger )
0114         ThrowExceptionIfProjectIsRead( CexmcCmdIsNotAllowed );
0115 
0116     fwhmPosX = value;
0117 }
0118 
0119 
0120 inline void  CexmcPrimaryGeneratorAction::SetFwhmPosY( G4double  value,
0121                                                        G4bool  fromMessenger )
0122 {
0123     if ( fromMessenger )
0124         ThrowExceptionIfProjectIsRead( CexmcCmdIsNotAllowed );
0125 
0126     fwhmPosY = value;
0127 }
0128 
0129 
0130 inline void  CexmcPrimaryGeneratorAction::SetFwhmDirX( G4double  value,
0131                                                        G4bool  fromMessenger )
0132 {
0133     if ( fromMessenger )
0134         ThrowExceptionIfProjectIsRead( CexmcCmdIsNotAllowed );
0135 
0136     fwhmDirX = value;
0137 }
0138 
0139 
0140 inline void  CexmcPrimaryGeneratorAction::SetFwhmDirY( G4double  value,
0141                                                        G4bool  fromMessenger )
0142 {
0143     if ( fromMessenger )
0144         ThrowExceptionIfProjectIsRead( CexmcCmdIsNotAllowed );
0145 
0146     fwhmDirY = value;
0147 }
0148 
0149 
0150 inline void  CexmcPrimaryGeneratorAction::SetFwhmMomentumAmp( G4double  value,
0151                                                         G4bool  fromMessenger )
0152 {
0153     if ( fromMessenger )
0154         ThrowExceptionIfProjectIsRead( CexmcCmdIsNotAllowed );
0155 
0156     fwhmMomentumAmp = value;
0157 }
0158 
0159 
0160 inline G4double  CexmcPrimaryGeneratorAction::GetFwhmPosX( void ) const
0161 {
0162     return fwhmPosX;
0163 }
0164 
0165 
0166 inline G4double  CexmcPrimaryGeneratorAction::GetFwhmPosY( void ) const
0167 {
0168     return fwhmPosY;
0169 }
0170 
0171 
0172 inline G4double  CexmcPrimaryGeneratorAction::GetFwhmDirX( void ) const
0173 {
0174     return fwhmDirX;
0175 }
0176 
0177 
0178 inline G4double  CexmcPrimaryGeneratorAction::GetFwhmDirY( void ) const
0179 {
0180     return fwhmDirY;
0181 }
0182 
0183 
0184 inline G4double  CexmcPrimaryGeneratorAction::GetFwhmMomentumAmp( void ) const
0185 {
0186     return fwhmMomentumAmp;
0187 }
0188 
0189 
0190 #endif
0191