Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // ********************************************************************
27 
28 #ifndef MEDICAL_BEAM_H
29 #define MEDICAL_BEAM_H
30 
31 #include "globals.hh"
32 #include "G4ThreeVector.hh"
34 
36 
38 public:
39  enum FieldShape{ SQUARE=0, CIRCLE };
40 
41  MedicalBeam();
42  ~MedicalBeam();
43 
44  // set/get functions...
47 
48  void SetKineticE(G4double e);
49  G4double GetKineticE() const;
50 
51  void SetSourcePosition(const G4ThreeVector& pos);
53 
54  void SetFieldShape(FieldShape shape);
55  FieldShape GetFieldShape() const;
56 
57  void SetSSD(G4double ssd);
58  G4double GetSSD() const;
59 
60  void SetFieldXY(G4double fx, G4double fy);
61  G4double GetFieldX() const;
62  G4double GetFieldY() const;
63 
64  void SetFieldR(G4double r);
65  G4double GetFieldR() const;
66 
67  // methods...
68  virtual void GeneratePrimaries(G4Event* anEvent);
69 
70 protected:
74 
75  G4double SSD; // (SSD= Source Skin Depth)
77  G4double fieldXY[2];
79 
80  // local methods...
82 };
83 
84 // ====================================================================
86 { particle= pd; }
87 
89 { return particle; }
90 
92 { kineticE= e; }
93 
95 { return kineticE; }
96 
97 inline void MedicalBeam::SetSourcePosition(const G4ThreeVector& pos)
98 { sourcePosition= pos; }
99 
101 { return sourcePosition; }
102 
104 { fieldShape= shape; }
105 
107 { return fieldShape; }
108 
109 inline void MedicalBeam::SetSSD(G4double ssd)
110 { SSD= ssd; }
111 
112 inline G4double MedicalBeam::GetSSD() const
113 { return SSD; }
114 
115 inline void MedicalBeam::SetFieldXY(G4double fx, G4double fy)
116 { fieldXY[0]= fx; fieldXY[1]= fy; }
117 
118 inline G4double MedicalBeam::GetFieldX() const
119 { return fieldXY[0]; }
120 
121 inline G4double MedicalBeam::GetFieldY() const
122 { return fieldXY[1]; }
123 
124 inline void MedicalBeam::SetFieldR(G4double r)
125 { fieldR= r; }
126 
127 inline G4double MedicalBeam::GetFieldR() const
128 { return fieldR; }
129 
130 #endif
131