VMC Examples Version 6.6
Loading...
Searching...
No Matches
A01PrimaryGenerator.h
Go to the documentation of this file.
1#ifndef A01_PRIMARY_GENERATOR_H
2#define A01_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 A01PrimaryGenerator.h
14/// \brief Definition of the A01PrimaryGenerator class
15///
16/// Geant4 example A01 adapted to Virtual Monte Carlo: \n
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TVirtualMCApplication.h>
21
22class TVirtualMCStack;
23class TVector3;
24
26
27/// \ingroup A01
28/// \brief The primary generator
29///
30/// \date 12/05/2012
31/// \author I. Hrivnacova; IPN, Orsay
32
34{
35 public:
38 const A01PrimaryGenerator& origin, TVirtualMCStack* stack);
40 virtual ~A01PrimaryGenerator();
41
42 // methods
43 virtual void GeneratePrimaries();
44
45 // set methods
46 void SetNofPrimaries(Int_t nofPrimaries);
47 void SetMomentum(Double_t val) { fMomentum = val; }
48 void SetSigmaMomentum(Double_t val) { fSigmaMomentum = val; }
49 void SetSigmaAngle(Double_t val) { fSigmaAngle = val; }
50 void SetRandomize(Bool_t val) { fRandomizePrimary = val; }
51
52 // get methods
53 Double_t GetMomentum() const { return fMomentum; }
54 Double_t GetSigmaMomentum() const { return fSigmaMomentum; }
55 Double_t GetSigmaAngle() const { return fSigmaAngle; }
56 Bool_t GetRandomize() const { return fRandomizePrimary; }
57
58 private:
59 // methods
60 // void GeneratePrimary();
61
62 // data members
63 TVirtualMCStack* fStack; ///< VMC stack
64 Int_t fNofPrimaries; ///< Number of primary particles
65 Int_t fDefaultParticle; ///< Default particle PDG
66 Double_t fMomentum; ///< Default particle momentum
67 Double_t fSigmaMomentum; ///< The sigma of particle momentum
68 Double_t fSigmaAngle; ///< The sigma of particle direction
69 Bool_t fRandomizePrimary; ///< Option to randomize primary particle type
70
71 ClassDef(A01PrimaryGenerator, 1) // A01PrimaryGenerator
72};
73
74// inline functions
75
76/// Set the number of particles to be generated
77/// \param nofPrimaries The number of particles to be generated
78inline void A01PrimaryGenerator::SetNofPrimaries(Int_t nofPrimaries)
79{
80 fNofPrimaries = nofPrimaries;
81}
82
83#endif // A01_PRIMARY_GENERATOR_H
The detector construction (defined via Geant4)
The primary generator.
Double_t GetSigmaMomentum() const
void SetNofPrimaries(Int_t nofPrimaries)
Bool_t GetRandomize() const
Double_t GetMomentum() const
void SetRandomize(Bool_t val)
void SetSigmaAngle(Double_t val)
TVirtualMCStack * fStack
VMC stack.
Int_t fNofPrimaries
Number of primary particles.
Double_t fMomentum
Default particle momentum.
Double_t fSigmaAngle
The sigma of particle direction.
Double_t fSigmaMomentum
The sigma of particle momentum.
Bool_t fRandomizePrimary
Option to randomize primary particle type.
Int_t fDefaultParticle
Default particle PDG.
void SetSigmaMomentum(Double_t val)
Double_t GetSigmaAngle() const
virtual void GeneratePrimaries()
void SetMomentum(Double_t val)