VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E03
E03b
include
Ex03PrimaryGenerator.h
Go to the documentation of this file.
1
#ifndef EX03_PRIMARY_GENERATOR_H
2
#define EX03_PRIMARY_GENERATOR_H
3
4
//------------------------------------------------
5
// The Virtual Monte Carlo examples
6
// Copyright (C) 2014 - 2018 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 Ex03PrimaryGenerator.h
14
/// \brief Definition of the Ex03PrimaryGenerator class
15
///
16
/// Geant4 ExampleN03 adapted to Virtual Monte Carlo: \n
17
/// Id: ExN03PrimaryGeneratorAction.hh,v 1.5 2002/01/09 17:24:11 ranjard Exp
18
/// GEANT4 tag Name: geant4-05-00
19
///
20
/// \author I. Hrivnacova; IPN, Orsay
21
22
#include <TVirtualMCApplication.h>
23
24
class
TVirtualMCStack
;
25
class
TVector3;
26
27
/// \ingroup E03
28
/// \brief The primary generator
29
///
30
/// \date 06/03/2003
31
/// \author I. Hrivnacova; IPN, Orsay
32
33
class
Ex03PrimaryGenerator
:
public
TObject
34
{
35
public
:
36
/// Predefined primary generators
37
enum
Type
38
{
39
kDefault
,
///< default (e-)
40
kUser
,
///< user defined particle and ion
41
kUserDecay
,
///< particle with user defined decay (K0Short)
42
kAnti
,
///< light anti-nuclei (with Geant4 only)
43
kTestField
,
///< mu+ with a suitable energy to test magnetic field
44
kPion
///< pi- ith a suitable energy to test biasing
45
};
46
47
public
:
48
Ex03PrimaryGenerator
(
TVirtualMCStack
* stack);
49
Ex03PrimaryGenerator
(
50
const
Ex03PrimaryGenerator
& origin,
TVirtualMCStack
* stack);
51
Ex03PrimaryGenerator
();
52
virtual
~Ex03PrimaryGenerator
();
53
54
// methods
55
virtual
void
GeneratePrimaries
(
const
TVector3& worldSize);
56
57
// set methods
58
void
SetIsRandom
(Bool_t isRandomGenerator);
59
void
SetPrimaryType
(
Type
primaryType);
60
void
SetNofPrimaries
(Int_t nofPrimaries);
61
62
// get methods
63
Bool_t
GetUserDecay
()
const
;
64
65
private
:
66
// methods
67
void
GeneratePrimary1
(
const
TVector3& origin);
68
void
GeneratePrimary2
(
const
TVector3& origin);
69
void
GeneratePrimary3
(
const
TVector3& origin);
70
void
GeneratePrimary4
(
const
TVector3& origin);
71
void
GeneratePrimary5
(
const
TVector3& origin);
72
void
GeneratePrimary6
(
const
TVector3& origin);
73
74
// data members
75
TVirtualMCStack
*
fStack
;
///< VMC stack
76
Bool_t
fIsRandom
;
///< Switch to random generator
77
Type
fPrimaryType
;
///< Primary generator selection
78
Int_t
fNofPrimaries
;
///< Number of primary particles
79
80
ClassDef(
Ex03PrimaryGenerator
, 1)
// Ex03PrimaryGenerator
81
};
82
83
// inline functions
84
85
/// Switch on/off the random generator
86
/// \param isRandom If true, the position is randomized
87
inline
void
Ex03PrimaryGenerator::SetIsRandom
(Bool_t isRandom)
88
{
89
fIsRandom
= isRandom;
90
}
91
92
/// Set the primary particle type to be generated
93
/// \param primaryType The primary particle type \see Ex03Primary
94
inline
void
Ex03PrimaryGenerator::SetPrimaryType
(
95
Ex03PrimaryGenerator::Type
primaryType)
96
{
97
fPrimaryType
= primaryType;
98
}
99
100
/// Set the number of particles to be generated
101
/// \param nofPrimaries The number of particles to be generated
102
inline
void
Ex03PrimaryGenerator::SetNofPrimaries
(Int_t nofPrimaries)
103
{
104
fNofPrimaries
= nofPrimaries;
105
}
106
107
/// Return true if particle with user decay is activated
108
inline
Bool_t
Ex03PrimaryGenerator::GetUserDecay
()
const
109
{
110
return
fPrimaryType
==
Ex03PrimaryGenerator::kUserDecay
;
111
}
112
113
#endif
// EX03_PRIMARY_GENERATOR_H
Ex03PrimaryGenerator
The primary generator.
Definition
Ex03PrimaryGenerator.h:34
Ex03PrimaryGenerator::GeneratePrimary1
void GeneratePrimary1(const TVector3 &origin)
Ex03PrimaryGenerator::GeneratePrimary3
void GeneratePrimary3(const TVector3 &origin)
Ex03PrimaryGenerator::fStack
TVirtualMCStack * fStack
VMC stack.
Definition
Ex03PrimaryGenerator.h:75
Ex03PrimaryGenerator::GeneratePrimaries
virtual void GeneratePrimaries(const TVector3 &worldSize)
Ex03PrimaryGenerator::Ex03PrimaryGenerator
Ex03PrimaryGenerator(TVirtualMCStack *stack)
Ex03PrimaryGenerator::SetIsRandom
void SetIsRandom(Bool_t isRandomGenerator)
Ex03PrimaryGenerator::SetNofPrimaries
void SetNofPrimaries(Int_t nofPrimaries)
Ex03PrimaryGenerator::GeneratePrimary2
void GeneratePrimary2(const TVector3 &origin)
Ex03PrimaryGenerator::GetUserDecay
Bool_t GetUserDecay() const
Ex03PrimaryGenerator::GeneratePrimary6
void GeneratePrimary6(const TVector3 &origin)
Ex03PrimaryGenerator::GeneratePrimary5
void GeneratePrimary5(const TVector3 &origin)
Ex03PrimaryGenerator::~Ex03PrimaryGenerator
virtual ~Ex03PrimaryGenerator()
Ex03PrimaryGenerator::fNofPrimaries
Int_t fNofPrimaries
Number of primary particles.
Definition
Ex03PrimaryGenerator.h:78
Ex03PrimaryGenerator::GeneratePrimary4
void GeneratePrimary4(const TVector3 &origin)
Ex03PrimaryGenerator::Type
Type
Predefined primary generators.
Definition
Ex03PrimaryGenerator.h:38
Ex03PrimaryGenerator::kDefault
@ kDefault
default (e-)
Definition
Ex03PrimaryGenerator.h:39
Ex03PrimaryGenerator::kTestField
@ kTestField
mu+ with a suitable energy to test magnetic field
Definition
Ex03PrimaryGenerator.h:43
Ex03PrimaryGenerator::kUserDecay
@ kUserDecay
particle with user defined decay (K0Short)
Definition
Ex03PrimaryGenerator.h:41
Ex03PrimaryGenerator::kUser
@ kUser
user defined particle and ion
Definition
Ex03PrimaryGenerator.h:40
Ex03PrimaryGenerator::kAnti
@ kAnti
light anti-nuclei (with Geant4 only)
Definition
Ex03PrimaryGenerator.h:42
Ex03PrimaryGenerator::kPion
@ kPion
pi- ith a suitable energy to test biasing
Definition
Ex03PrimaryGenerator.h:44
Ex03PrimaryGenerator::SetPrimaryType
void SetPrimaryType(Type primaryType)
Ex03PrimaryGenerator::Ex03PrimaryGenerator
Ex03PrimaryGenerator()
Ex03PrimaryGenerator::Ex03PrimaryGenerator
Ex03PrimaryGenerator(const Ex03PrimaryGenerator &origin, TVirtualMCStack *stack)
Ex03PrimaryGenerator::fPrimaryType
Type fPrimaryType
Primary generator selection.
Definition
Ex03PrimaryGenerator.h:77
Ex03PrimaryGenerator::fIsRandom
Bool_t fIsRandom
Switch to random generator.
Definition
Ex03PrimaryGenerator.h:76
TObject
TVirtualMCStack
Generated on
for VMC Examples by
1.17.0