source: trunk/source/geometry/magneticfield/test/NTST/include/NTSTGunGenerator.hh@ 1202

Last change on this file since 1202 was 1199, checked in by garnier, 16 years ago

nvx fichiers dans CVS

File size: 5.0 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// $Id: NTSTGunGenerator.hh,v 1.4 2006/12/12 10:21:16 japost Exp $
27// GEANT4 tag $Name: HEAD $
28//
29//
30
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33
34#ifndef NTSTGunGenerator_h
35#define NTSTGunGenerator_h 1
36
37#include "G4VPrimaryGenerator.hh"
38#include "G4ThreeVector.hh"
39#include "globals.hh"
40#include "Randomize.hh"
41
42class G4Event;
43class NTSTGunMessenger;
44class G4ParticleDefinition;
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47
48class NTSTGunGenerator : public G4VPrimaryGenerator
49{
50public:
51 NTSTGunGenerator();
52 virtual ~NTSTGunGenerator();
53 virtual void GeneratePrimaryVertex(G4Event* evt);
54
55public:
56 virtual void SetParticleDefinition (G4ParticleDefinition* pDef)
57 {particle_definition = pDef;}
58 virtual void SetPlow (const G4double m) { Plow = m; }
59 virtual void SetPhigh (const G4double m) { Phigh = m; }
60 virtual void SetCoslow (const G4double m) { Coslow = m; }
61 virtual void SetCoshigh (const G4double m) { Coshigh = m; }
62 virtual void SetPhilow (const G4double m) { Philow = m; }
63 virtual void SetPhihigh (const G4double m) { Phihigh = m; }
64 virtual void SetMeanVertex (const G4ThreeVector v) { MeanVertex = v;}
65 virtual void SetRmsVertex (const G4ThreeVector v) { RmsVertex = v;}
66 virtual void SetPolarization(const G4ThreeVector v) { Polarization= v;}
67 virtual void SetT0 (const G4double t) { T0=t; }
68 virtual void SetNumberOfParticles (const G4int n) { N=n; }
69
70public:
71 virtual G4ParticleDefinition* GetParticleDefinition()
72 {return particle_definition;}
73 virtual const G4ThreeVector& GetMeanVertex() const {return MeanVertex;}
74 virtual const G4ThreeVector& GetRmsVertex() const {return RmsVertex;}
75 virtual const G4ThreeVector& GetPolarization() const {return Polarization;}
76 virtual const G4double GetPlow() const {return Plow;}
77 virtual const G4double GetPhigh() const {return Phigh;}
78 virtual const G4double GetCoslow() const {return Coslow;}
79 virtual const G4double GetCoshigh() const {return Coshigh;}
80 virtual const G4double GetPhilow() const {return Philow; }
81 virtual const G4double GetPhihigh() const {return Phihigh;}
82 virtual const G4double GetT0() const {return T0;}
83 virtual const G4int GetNumberOfParticles() const {return N;}
84
85protected:
86 inline G4double Gauss(){
87 return CLHEP::RandGauss::shoot();
88 }
89
90private:
91 G4ParticleDefinition* particle_definition;
92 G4ThreeVector MeanVertex;
93 G4ThreeVector RmsVertex;
94 G4ThreeVector Polarization;
95 G4double Plow;
96 G4double Phigh;
97 G4double Coslow;
98 G4double Coshigh;
99 G4double Philow;
100 G4double Phihigh;
101 G4double T0;
102 G4int N;
103
104 G4ThreeVector dMeanVertex;
105 G4ThreeVector dRmsVertex;
106 G4ThreeVector dPolarization;
107 G4double dPlow;
108 G4double dPhigh;
109 G4double dCoslow;
110 G4double dCoshigh;
111 G4double dPhilow;
112 G4double dPhihigh;
113 G4double dT0;
114 G4int dN;
115
116 NTSTGunMessenger* messenger;
117};
118
119#endif
120
121
Note: See TracBrowser for help on using the repository browser.