VMC Examples
Version 6.6
Loading...
Searching...
No Matches
examples
ExGarfield
geant4
src
FastSimulation.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2007 - 2016 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
10
/// \file ExGarfield/geant4/src/FastSimulation.cxx
11
/// \brief Implementation of the ExGarfield::FastSimulation class
12
///
13
/// Garfield garfieldpp example adapted to Virtual Monte Carlo.
14
///
15
/// \date 28/10/2015
16
/// \author I. Hrivnacova; IPN, Orsay
17
18
#include "
FastSimulation.h
"
19
#include "
GarfieldG4FastSimulationModel.h
"
20
#include "
GarfieldMessenger.h
"
21
//#include "GarfieldPhysics.h"
22
23
#include <Random.hh>
24
25
#include <G4FastSimulationManager.hh>
26
#include <G4Material.hh>
27
#include <G4NistManager.hh>
28
#include <G4RegionStore.hh>
29
#include <GFlashHitMaker.hh>
30
#include <GFlashHomoShowerParameterisation.hh>
31
#include <GFlashParticleBounds.hh>
32
#include <GFlashShowerModel.hh>
33
#include <Randomize.hh>
34
35
#include <Riostream.h>
36
37
using namespace
std;
38
39
namespace
VMC
40
{
41
namespace
ExGarfield
42
{
43
44
//_____________________________________________________________________________
45
FastSimulation::FastSimulation
() :
TG4VUserFastSimulation
(), fMessenger(0)
46
{
47
/// Standard constructor
48
49
cout <<
"FastSimulation::FastSimulation"
<< endl;
50
51
// Choose the Random engine
52
G4Random::setTheEngine(
new
CLHEP::RanecuEngine);
53
G4Random::setTheSeed(1);
54
// Set seed to Garfield random engine
55
::Garfield::randomEngine.Seed(1);
56
57
// Construct the Garfield messenger which defines the Garfield physics
58
// specific command
59
fMessenger
=
new
GarfieldMessenger
();
60
61
/*
62
// In the following calls users can select the particles and regions
63
// which the fast simulation model(s) will be applied to.
64
// The setting is an alternative to the setting via UI commands
65
// in physics.in macro.
66
67
// Create fast simulation model configuration.
68
// This will generate UI commands which can be used to set particles
69
// and regions where the model will be applied
70
SetModel("garfieldModel");
71
72
// In the following calls users can select the particles and regions
73
// which the fast simulation model(s) will be applied to.
74
// The setting can be done also interactively via UI commands.
75
SetModelParticles("garfieldModel", "all");
76
SetModelRegions("garfieldModel", "AirB");
77
78
// Enable GarfieldModel for different particle types and energy ranges
79
double minEnergy_keV = 100;
80
double maxEnergy_keV = 1e+12;
81
82
//GarfieldPhysics* garfieldPhysics = GarfieldPhysics::GetInstance();
83
//garfieldPhysics->AddParticleName("e-", minEnergy_keV, maxEnergy_keV);
84
//garfieldPhysics->AddParticleName("e+", minEnergy_keV, maxEnergy_keV);
85
86
//garfieldPhysics->AddParticleName("mu-", minEnergy_keV, maxEnergy_keV);
87
garfieldPhysics->AddParticleName("mu+", minEnergy_keV, maxEnergy_keV);
88
89
//garfieldPhysics->AddParticleName("pi-", minEnergy_keV, maxEnergy_keV);
90
//garfieldPhysics->AddParticleName("pi+", minEnergy_keV, maxEnergy_keV);
91
//garfieldPhysics->AddParticleName("kaon-", minEnergy_keV, maxEnergy_keV);
92
//garfieldPhysics->AddParticleName("kaon+", minEnergy_keV, maxEnergy_keV);
93
//garfieldPhysics->AddParticleName("proton", minEnergy_keV, maxEnergy_keV);
94
//garfieldPhysics->AddParticleName("anti_proton", minEnergy_keV,
95
maxEnergy_keV);
96
//garfieldPhysics->AddParticleName("deuteron", minEnergy_keV,
97
maxEnergy_keV);
98
//garfieldPhysics->AddParticleName("alpha", minEnergy_keV, maxEnergy_keV);
99
100
//garfieldPhysics->EnableCreateSecondariesInGeant4(false);
101
*/
102
}
103
104
//_____________________________________________________________________________
105
FastSimulation::~FastSimulation
()
106
{
107
/// Destructor
108
109
// can't we just delete the instance ??
110
GarfieldPhysics::Dispose
();
111
112
delete
fMessenger
;
113
}
114
115
//
116
// protected methods
117
//
118
119
//_____________________________________________________________________________
120
void
FastSimulation::Construct
()
121
{
122
/// This function must be overriden in user class and users should create
123
/// the simulation models and register them to VMC framework
124
125
G4cout <<
"Construct Garfield model."
<< G4endl;
126
127
// Create the fast simulation model
128
GarfieldG4FastSimulationModel
* garfieldModel =
129
new
GarfieldG4FastSimulationModel
(
"garfieldModel"
);
130
131
// Register the model in the VMC framework
132
Register(garfieldModel);
133
134
G4cout <<
"end construct Garfield model."
<< G4endl;
135
//
136
// end Initializing shower model
137
}
138
139
}
// namespace ExGarfield
140
}
// namespace VMC
FastSimulation.h
Definition of the ExGarfield::FastSimulation class.
GarfieldG4FastSimulationModel.h
Definition of the GarfieldG4FastSimulationModel class.
GarfieldMessenger.h
Definition of the GarfieldMessengerclass.
GarfieldG4FastSimulationModel
Definition
GarfieldG4FastSimulationModel.h:37
GarfieldMessenger
Definition
GarfieldMessenger.h:32
GarfieldPhysics::Dispose
static void Dispose()
Definition
GarfieldPhysics.cxx:40
TG4VUserFastSimulation
VMC::ExGarfield::FastSimulation::Construct
virtual void Construct()
Definition
FastSimulation.cxx:120
VMC::ExGarfield::FastSimulation::FastSimulation
FastSimulation()
Definition
FastSimulation.cxx:45
VMC::ExGarfield::FastSimulation::~FastSimulation
virtual ~FastSimulation()
Definition
FastSimulation.cxx:105
VMC::ExGarfield::FastSimulation::fMessenger
GarfieldMessenger * fMessenger
Definition
FastSimulation.h:45
VMC
Definition
FastSimulation.h:26
Generated on Thu Oct 17 2024 08:29:51 for VMC Examples by
1.12.0