VMC Examples Version 6.6
Loading...
Searching...
No Matches
PrimaryGenerator.h
Go to the documentation of this file.
1#ifndef GARFIELD_PRIMARY_GENERATOR_H
2#define GARFIELD_PRIMARY_GENERATOR_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2007 - 2016 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 ExGarfield/include/PrimaryGenerator.h
14/// \brief Definition of the ExGarfield::PrimaryGenerator class
15///
16/// Garfield garfieldpp example adapted to Virtual Monte Carlo.
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TVector3.h>
21#include <TVirtualMCApplication.h>
22
23class TVirtualMCStack;
24
25namespace VMC
26{
27namespace ExGarfield
28{
29
30class DetectorConstruction;
31
32/// \ingroup ExGarfield
33/// \brief The primary generator
34///
35/// Garfield garfieldpp example adapted to Virtual Monte Carlo.
36///
37/// \date 28/10/2015
38/// \author I. Hrivnacova; IPN, Orsay
39
41{
42 public:
46 virtual ~PrimaryGenerator();
47
48 // methods
49 virtual void GeneratePrimaries(const TVector3& worldSize);
50
51 // set methods
52 void SetNofPrimaries(Int_t nofPrimaries);
53 void SetVertexPosition(TVector3 position);
54 void SetVertexDirection(TVector3 direction);
55
56 // get methods
57 TVector3 GetVertexPosition() const;
58 TVector3 GetVertexDirection() const;
59
60 private:
61 // methods
62 void GenerateOnePrimary(const TVector3& origin);
63
64 // data members
65 TVirtualMCStack* fStack; ///< VMC stack
66 Int_t fNofPrimaries; ///< Number of primary particles
67 TVector3 fVertexPosition; ///< Vertex position
68 TVector3 fVertexDirection; ///< Vertex direction
69
70 ClassDef(PrimaryGenerator, 1) // PrimaryGenerator
71};
72
73// inline functions
74
75/// Set the number of particles to be generated
76/// \param nofPrimaries The number of particles to be generated
77inline void PrimaryGenerator::SetNofPrimaries(Int_t nofPrimaries)
78{
79 fNofPrimaries = nofPrimaries;
80}
81
82/// Set the Vertex position
83/// \param position The Vertex position
84inline void PrimaryGenerator::SetVertexPosition(TVector3 position)
85{
86 fVertexPosition = position;
87}
88
89/// Set the Vertex direction
90/// \param direction The Vertex direction
91inline void PrimaryGenerator::SetVertexDirection(TVector3 direction)
92{
93 fVertexDirection = direction;
94}
95
96/// Return the Vertex position
98{
99 return fVertexPosition;
100}
101
102/// Return the Vertex direction
104{
105 return fVertexDirection;
106}
107
108} // namespace ExGarfield
109} // namespace VMC
110
111#endif // GARFIELD_PRIMARY_GENERATOR_H
void GenerateOnePrimary(const TVector3 &origin)
TVector3 GetVertexPosition() const
Return the Vertex position.
void SetNofPrimaries(Int_t nofPrimaries)
virtual void GeneratePrimaries(const TVector3 &worldSize)
TVirtualMCStack * fStack
VMC stack.
TVector3 fVertexPosition
Vertex position.
TVector3 GetVertexDirection() const
Return the Vertex direction.
Int_t fNofPrimaries
Number of primary particles.
void SetVertexDirection(TVector3 direction)
void SetVertexPosition(TVector3 position)
TVector3 fVertexDirection
Vertex direction.