VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex06PrimaryGenerator.h
Go to the documentation of this file.
1#ifndef EX06_PRIMARY_GENERATOR_H
2#define EX06_PRIMARY_GENERATOR_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2007 - 2014 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
13/// \file Ex06PrimaryGenerator.h
14/// \brief Definition of the Ex06PrimaryGenerator class
15///
16/// Geant4 ExampleN06 adapted to Virtual Monte Carlo \n
17/// Id: ExN06PrimaryGeneratorAction.hh,v 1.4 2003/01/23 15:34:23 maire Exp \n
18/// GEANT4 tag Name: geant4-07-00-cand-01
19///
20/// \author I. Hrivnacova; IPN, Orsay
21
22#include <TVirtualMCApplication.h>
23
24class TVirtualMCStack;
25class TVector3;
26
27/// \ingroup E06
28/// \brief The primary generator
29///
30/// \date 16/05/2005
31/// \author I. Hrivnacova; IPN, Orsay
32
34{
35 public:
38 const Ex06PrimaryGenerator& origin, TVirtualMCStack* stack);
40 virtual ~Ex06PrimaryGenerator();
41
42 // methods
43 void GeneratePrimaries();
44
45 // set methods
46 void SetParticle(Int_t pdg);
47 void SetKinEnergy(Double_t kinEnergy);
48 void SetDirection(Double_t dirX, Double_t dirY, Double_t dirZ);
49 void SetOptPhotonPolar(Double_t angle);
50 void SetNofPrimaries(Int_t nofPrimaries);
51
52 private:
53 // methods
54 void GeneratePrimary();
55
56 // data members
57 TVirtualMCStack* fStack; ///< VMC stack
58 Int_t fPdg; ///< Particle PDG encoding
59 Double_t fKinEnergy; ///< Particle kinetic energy
60 Double_t fDirX; ///< Particle direction - x component
61 Double_t fDirY; ///< Particle direction - y component
62 Double_t fDirZ; ///< Particle direction - z component
63 Double_t fPolAngle; ///< Particle polarization angle
64 Int_t fNofPrimaries; ///< Number of primary particles
65
66 ClassDef(Ex06PrimaryGenerator, 1) // Ex06PrimaryGenerator
67};
68
69// inline functions
70
71/// Set particle type
72/// \param pdg The new particle PDG encoding
73inline void Ex06PrimaryGenerator::SetParticle(Int_t pdg) { fPdg = pdg; }
74
75/// Set kinetic energy
76/// \param kinEnergy The new particle kinetic energy (in GeV)
77inline void Ex06PrimaryGenerator::SetKinEnergy(Double_t kinEnergy)
78{
79 fKinEnergy = kinEnergy;
80}
81
82/// Set photon polarization
83/// \param angle The new polarization angle (in degrees)
84inline void Ex06PrimaryGenerator::SetOptPhotonPolar(Double_t angle)
85{
86 fPolAngle = angle;
87}
88
89/// Set the number of particles to be generated
90/// \param nofPrimaries The number of particles to be generated
91inline void Ex06PrimaryGenerator::SetNofPrimaries(Int_t nofPrimaries)
92{
93 fNofPrimaries = nofPrimaries;
94}
95
96#endif // EX06_PRIMARY_GENERATOR_H
The primary generator.
Double_t fDirY
Particle direction - y component.
void SetKinEnergy(Double_t kinEnergy)
void SetNofPrimaries(Int_t nofPrimaries)
Double_t fDirZ
Particle direction - z component.
void SetDirection(Double_t dirX, Double_t dirY, Double_t dirZ)
TVirtualMCStack * fStack
VMC stack.
void SetOptPhotonPolar(Double_t angle)
Double_t fPolAngle
Particle polarization angle.
Int_t fNofPrimaries
Number of primary particles.
Int_t fPdg
Particle PDG encoding.
Double_t fKinEnergy
Particle kinetic energy.
Double_t fDirX
Particle direction - x component.