VMC Examples Version 6.6
Loading...
Searching...
No Matches
GarfieldPhysics.h
Go to the documentation of this file.
1#ifndef GARFIELDMODELCONFIG_HH_
2#define GARFIELDMODELCONFIG_HH_
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/GarfieldPhysics.h
14/// \brief Definition of the GarfieldPhysics class
15///
16/// Garfield garfieldpp example adapted to Virtual Monte Carlo.
17/// This class is imported from garfieldpp example with no modification
18/// in the code.
19///
20/// \date 28/10/2015
21/// \author D. Pheiffer, CERN
22
23/*
24 * GarfieldPhysics.hh
25 *
26 * Created on: Jul 17, 2014
27 * Author: dpfeiffe
28 */
29
30#include <iostream>
31#include <map>
32#include <vector>
33
34#include "AvalancheMC.hh"
35#include "AvalancheMicroscopic.hh"
36#include "ComponentAnalyticField.hh"
37#include "GeometryRoot.hh"
38#include "GeometrySimple.hh"
39#include "MediumMagboltz.hh"
40#include "Sensor.hh"
41#include "SolidTube.hh"
42#include "TrackHeed.hh"
43#include "TrackSimple.hh"
44
45typedef std::pair<double, double> EnergyRange_MeV;
46typedef std::map<const std::string, EnergyRange_MeV> MapParticlesEnergy;
47
49{
50 public:
51 GarfieldParticle(std::string particleName, double ekin_eV, double time,
52 double x_cm, double y_cm, double z_cm, double dx, double dy, double dz)
53 : fParticleName(particleName),
54 fEkin_MeV(ekin_eV / 1000000),
55 fTime(time),
56 fx_mm(10 * x_cm),
57 fy_mm(10 * y_cm),
58 fz_mm(10 * z_cm),
59 fdx(dx),
60 fdy(dy),
61 fdz(dz)
62 {}
64
65 std::string getParticleName() { return fParticleName; }
66 double getX_mm() { return fx_mm; }
67 double getY_mm() { return fy_mm; }
68 double getZ_mm() { return fz_mm; }
69 double getEkin_MeV() { return fEkin_MeV; }
70 double getTime() { return fTime; }
71 double getDX() { return fdx; }
72 double getDY() { return fdy; }
73 double getDZ() { return fdz; }
74
75 private:
76 std::string fParticleName;
78};
79
81{
82 public:
84 static void Dispose();
85
86 void InitializePhysics();
87 void CreateGeometry();
88
89 void DoIt(std::string particleName, double ekin_MeV, double time, double x_cm,
90 double y_cm, double z_cm, double dx, double dy, double dz);
91
92 void AddParticleName(
93 const std::string particleName, double ekin_min_keV, double ekin_max_keV);
94 bool FindParticleName(const std::string name);
95 bool FindParticleNameEnergy(std::string name, double ekin_keV);
96 void SetIonizationModel(std::string model, bool useDefaults = true);
97 std::string GetIonizationModel();
98 std::vector<GarfieldParticle*>* GetSecondaryParticles();
100 inline void EnableCreateSecondariesInGeant4(bool flag)
101 {
103 };
105 {
107 };
108 inline double GetEnergyDeposit_MeV() { return fEnergyDeposit / 1000000; };
109 inline double GetAvalancheSize() { return fAvalancheSize; };
110 inline double GetGain() { return fGain; };
111 inline void Clear()
112 {
113 fEnergyDeposit = 0;
114 fAvalancheSize = 0;
115 fGain = 0;
116 nsum = 0;
117 }
118
119 private:
122
123 std::string fIonizationModel;
124
127 TGeoManager* fGeoManager;
128 Garfield::MediumMagboltz* fMediumMagboltz;
129 Garfield::Sensor* fSensor;
130 Garfield::AvalancheMC* fDrift;
131 Garfield::AvalancheMicroscopic* fAvalanche;
132 Garfield::TrackHeed* fTrackHeed;
133 Garfield::GeometryRoot* fGeometryRoot;
134 Garfield::GeometrySimple* fGeometrySimple;
135 Garfield::ComponentAnalyticField* fComponentAnalyticField;
136 Garfield::SolidTube* fTube;
137
138 std::vector<GarfieldParticle*>* fSecondaryParticles;
139
143 double fGain;
144 int nsum;
145};
146#endif /* GARFIELDMODELCONFIG_HH_ */
std::pair< double, double > EnergyRange_MeV
std::map< const std::string, EnergyRange_MeV > MapParticlesEnergy
std::string getParticleName()
std::string fParticleName
GarfieldParticle(std::string particleName, double ekin_eV, double time, double x_cm, double y_cm, double z_cm, double dx, double dy, double dz)
std::vector< GarfieldParticle * > * fSecondaryParticles
static void Dispose()
bool GetCreateSecondariesInGeant4()
Garfield::AvalancheMC * fDrift
static GarfieldPhysics * GetInstance()
Garfield::AvalancheMicroscopic * fAvalanche
TGeoManager * fGeoManager
std::vector< GarfieldParticle * > * GetSecondaryParticles()
void SetIonizationModel(std::string model, bool useDefaults=true)
Garfield::Sensor * fSensor
Garfield::GeometrySimple * fGeometrySimple
Garfield::TrackHeed * fTrackHeed
MapParticlesEnergy * fMapParticlesEnergy
Garfield::GeometryRoot * fGeometryRoot
std::string fIonizationModel
std::string GetIonizationModel()
double GetEnergyDeposit_MeV()
bool FindParticleNameEnergy(std::string name, double ekin_keV)
void DoIt(std::string particleName, double ekin_MeV, double time, double x_cm, double y_cm, double z_cm, double dx, double dy, double dz)
Garfield::SolidTube * fTube
void EnableCreateSecondariesInGeant4(bool flag)
void AddParticleName(const std::string particleName, double ekin_min_keV, double ekin_max_keV)
static GarfieldPhysics * fGarfieldPhysics
Garfield::MediumMagboltz * fMediumMagboltz
double GetAvalancheSize()
Garfield::ComponentAnalyticField * fComponentAnalyticField
bool FindParticleName(const std::string name)