source: trunk/examples/extended/parallel/MPI/exMPI02/include/MedicalBeam.hh

Last change on this file was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

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