Smaller changes
[u/mrichter/AliRoot.git] / AliGeant4 / AliGunParticle.h
1 // $Id$
2 // Category: event
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class AliGunParticle
7 // --------------------
8 // Data type class that stores properties of a gun particle.
9 // Used in AliParticleGun.
10
11 #ifndef ALI_GUN_PARTICLE_H
12 #define ALI_GUN_PARTICLE_H
13
14 #include <G4ParticleMomentum.hh>
15 #include <G4ThreeVector.hh>
16 #include <globals.hh>
17
18 class G4ParticleDefinition;
19
20 class AliGunParticle
21 {
22   public:
23     AliGunParticle();
24     AliGunParticle(G4ParticleDefinition* particleDef,
25                    G4ParticleMomentum momentum, 
26                    G4ThreeVector position,
27                    G4double time, 
28                    G4ThreeVector polarization );
29     AliGunParticle(G4ParticleDefinition* particleDef, 
30                    G4ParticleMomentum momentumDir, 
31                    G4double kinEnergy,
32                    G4ThreeVector position,
33                    G4double time, 
34                    G4ThreeVector polarization );
35     AliGunParticle(const AliGunParticle& right);
36     ~AliGunParticle();     
37
38     // operators
39     AliGunParticle& operator=(const AliGunParticle& right);
40     G4int operator==(const AliGunParticle& right) const;
41     G4int operator!=(const AliGunParticle& right) const;
42
43     // methods
44     void Print() const;  
45
46     // set methods
47     void SetParticleDefinition(G4ParticleDefinition* particleDef);
48     void SetMomentum(G4ParticleMomentum  momentum);
49     void SetPosition(G4ThreeVector position);
50     void SetTime(G4double time);
51     void SetPolarization(G4ThreeVector polarization);
52     void SetMomentumDirection(G4ParticleMomentum  momentumDir);
53     void SetKineticEnergy(G4double kinEnergy);
54       
55     // get methods  
56     G4ParticleDefinition* GetParticleDefinition() const;
57     G4ParticleMomentum GetMomentum() const;
58     G4ThreeVector GetPosition() const;
59     G4double GetTime() const;
60     G4ThreeVector GetPolarization() const;
61     G4ParticleMomentum GetMomentumDirection() const;
62     G4double GetKineticEnergy() const;
63                          
64   private:
65     // data members
66     G4ParticleDefinition*  fParticleDefinition; //G4ParticleDefinition
67     G4ParticleMomentum     fParticleMomentum;   //G4ParticleMomentum
68     G4ThreeVector          fPosition;           //position
69     G4double               fTime;               //time
70     G4ThreeVector          fPolarization;       //polarization
71 };
72
73 // inline methods
74
75 inline void AliGunParticle::SetParticleDefinition(G4ParticleDefinition* particleDef)
76 { fParticleDefinition = particleDef; }
77
78 inline void AliGunParticle::SetMomentum(G4ParticleMomentum  momentum)
79 { fParticleMomentum = momentum; }
80
81 inline void AliGunParticle::SetPosition(G4ThreeVector position)
82 { fPosition = position; }
83
84 inline void AliGunParticle::SetTime(G4double time)
85 { fTime = time; }
86
87 inline void AliGunParticle::SetPolarization(G4ThreeVector polarization)
88 { fPolarization = polarization; }
89
90 inline void AliGunParticle::SetMomentumDirection(G4ParticleMomentum  momentumDir)
91 { fParticleMomentum = fParticleMomentum.mag()*momentumDir.unit(); }
92
93 inline G4ParticleDefinition* AliGunParticle::GetParticleDefinition() const
94 { return fParticleDefinition; }
95
96 inline G4ParticleMomentum AliGunParticle::GetMomentum() const
97 { return fParticleMomentum; }
98
99 inline G4ThreeVector AliGunParticle::GetPosition() const
100 { return fPosition; }
101
102 inline G4double AliGunParticle::GetTime() const
103 { return fTime; }
104
105 inline G4ThreeVector AliGunParticle::GetPolarization() const
106 { return fPolarization; }
107
108 inline G4ParticleMomentum AliGunParticle::GetMomentumDirection() const
109 { return fParticleMomentum.unit(); }
110
111 #endif //ALI_GUN_PARTICLE_H   
112    
113