LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
MedicalBeam.hh
Go to the documentation of this file.
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: MedicalBeam.hh 66892 2013-01-17 10:57:59Z gunter $
27 // ====================================================================
28 // MedicalBeam.hh
29 //
30 // 2005 Q
31 // ====================================================================
32 #ifndef MEDICAL_BEAM_H
33 #define MEDICAL_BEAM_H
34 
35 #include "globals.hh"
36 #include "G4ThreeVector.hh"
37 #include "G4VUserPrimaryGeneratorAction.hh"
38 
39 class G4ParticleDefinition;
40 
41 // ====================================================================
42 //
43 // class definition
44 //
45 // ====================================================================
46 class MedicalBeam : public G4VUserPrimaryGeneratorAction {
47 public:
48  enum FieldShape{ SQUARE=0, CIRCLE };
49 
50 protected:
51  G4ParticleDefinition* particle;
52  G4double kineticE;
53  G4ThreeVector sourcePosition;
54 
55  G4double SSD; // (SSD= Source Skin Depth)
57  G4double fieldXY[2];
58  G4double fieldR;
59 
60  // local methods...
61  G4ThreeVector GenerateBeamDirection() const;
62 
63 public:
64  MedicalBeam();
65  ~MedicalBeam();
66 
67  // set/get functions...
68  void SetParticleDefinition(G4ParticleDefinition* pd);
69  const G4ParticleDefinition* GetParticleDefinition() const;
70 
71  void SetKineticE(G4double e);
72  G4double GetKineticE() const;
73 
74  void SetSourcePosition(const G4ThreeVector& pos);
75  G4ThreeVector GetSourcePosition() const;
76 
77  void SetFieldShape(FieldShape shape);
78  FieldShape GetFieldShape() const;
79 
80  void SetSSD(G4double ssd);
81  G4double GetSSD() const;
82 
83  void SetFieldXY(G4double fx, G4double fy);
84  G4double GetFieldX() const;
85  G4double GetFieldY() const;
86 
87  void SetFieldR(G4double r);
88  G4double GetFieldR() const;
89 
90  // methods...
91  virtual void GeneratePrimaries(G4Event* anEvent);
92 
93 };
94 
95 // ====================================================================
96 // inline functions
97 // ====================================================================
98 inline void MedicalBeam::SetParticleDefinition(G4ParticleDefinition* pd)
99 { particle= pd; }
100 
101 inline const G4ParticleDefinition* MedicalBeam::GetParticleDefinition() const
102 { return particle; }
103 
104 inline void MedicalBeam::SetKineticE(G4double e)
105 { kineticE= e; }
106 
107 inline G4double MedicalBeam::GetKineticE() const
108 { return kineticE; }
109 
110 inline void MedicalBeam::SetSourcePosition(const G4ThreeVector& pos)
111 { sourcePosition= pos; }
112 
113 inline G4ThreeVector MedicalBeam::GetSourcePosition() const
114 { return sourcePosition; }
115 
117 { fieldShape= shape; }
118 
120 { return fieldShape; }
121 
122 inline void MedicalBeam::SetSSD(G4double ssd)
123 { SSD= ssd; }
124 
125 inline G4double MedicalBeam::GetSSD() const
126 { return SSD; }
127 
128 inline void MedicalBeam::SetFieldXY(G4double fx, G4double fy)
129 { fieldXY[0]= fx; fieldXY[1]= fy; }
130 
131 inline G4double MedicalBeam::GetFieldX() const
132 { return fieldXY[0]; }
133 
134 inline G4double MedicalBeam::GetFieldY() const
135 { return fieldXY[1]; }
136 
137 inline void MedicalBeam::SetFieldR(G4double r)
138 { fieldR= r; }
139 
140 inline G4double MedicalBeam::GetFieldR() const
141 { return fieldR; }
142 
143 #endif
144 
G4ParticleDefinition * particle
Definition: MedicalBeam.hh:51
G4double GetFieldR() const
Definition: MedicalBeam.hh:140
virtual void GeneratePrimaries(G4Event *anEvent)
Definition: MedicalBeam.cc:112
G4double GetKineticE() const
Definition: MedicalBeam.hh:107
void SetFieldShape(FieldShape shape)
Definition: MedicalBeam.hh:116
G4double fieldXY[2]
Definition: MedicalBeam.hh:57
void SetFieldR(G4double r)
Definition: MedicalBeam.hh:137
void SetSourcePosition(const G4ThreeVector &pos)
Definition: MedicalBeam.hh:110
void SetFieldXY(G4double fx, G4double fy)
Definition: MedicalBeam.hh:128
void SetSSD(G4double ssd)
Definition: MedicalBeam.hh:122
G4ThreeVector sourcePosition
Definition: MedicalBeam.hh:53
G4double GetFieldX() const
Definition: MedicalBeam.hh:131
G4double SSD
Definition: MedicalBeam.hh:55
void SetParticleDefinition(G4ParticleDefinition *pd)
Definition: MedicalBeam.hh:98
FieldShape fieldShape
Definition: MedicalBeam.hh:56
G4double GetSSD() const
Definition: MedicalBeam.hh:125
G4double kineticE
Definition: MedicalBeam.hh:52
FieldShape GetFieldShape() const
Definition: MedicalBeam.hh:119
G4ThreeVector GenerateBeamDirection() const
Definition: MedicalBeam.cc:70
G4double fieldR
Definition: MedicalBeam.hh:58
void SetKineticE(G4double e)
Definition: MedicalBeam.hh:104
Float_t e
Definition: plot.C:34
const G4ParticleDefinition * GetParticleDefinition() const
Definition: MedicalBeam.hh:101
G4ThreeVector GetSourcePosition() const
Definition: MedicalBeam.hh:113
G4double GetFieldY() const
Definition: MedicalBeam.hh:134