Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
GarfieldPhysics.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// $Id: GarfieldPhysics.hh 9999996 2015-12-11 14:47:43Z dpfeiffe $
27//
28/// \file GarfieldPhysics.hh
29/// \brief Definition of the GarfieldPhysics class
30
31#ifndef GarfieldPhysics_h
32#define GarfieldPhysics_h 1
33
34#include <map>
35#include <vector>
36#include <iostream>
37
38#include "Sensor.hh"
39#include "AvalancheMC.hh"
42#include "TrackHeed.hh"
43#include "TrackSimple.hh"
44#include "MediumMagboltz.hh"
45#include "GeometryRoot.hh"
46#include "GeometrySimple.hh"
47#include "SolidTube.hh"
48
49typedef std::pair<double, double> EnergyRange_MeV;
50typedef std::map< const std::string, EnergyRange_MeV> MapParticlesEnergy;
51
53public:
54 GarfieldParticle(std::string particleName, double ekin_eV,double time, double x_cm,double y_cm,double z_cm, double dx,double dy,double dz):fParticleName(particleName), fEkin_MeV(ekin_eV/1000000), fTime(time), fx_mm(10*x_cm),fy_mm(10*y_cm), fz_mm(10*z_cm), fdx(dx), fdy(dy), fdz(dz){}
56
57 std::string getParticleName(){return fParticleName;}
58 double getX_mm() {return fx_mm;}
59 double getY_mm(){return fy_mm;}
60 double getZ_mm(){return fz_mm;}
61 double getEkin_MeV(){return fEkin_MeV;}
62 double getTime(){return fTime;}
63 double getDX(){return fdx;}
64 double getDY(){return fdy;}
65 double getDZ(){return fdz;}
66
67
68private:
69 std::string fParticleName;
70 double fEkin_MeV, fTime, fx_mm,fy_mm,fz_mm,fdx,fdy,fdz;
71
72
73};
74
75
77public:
79 static void Dispose();
80
81 void InitializePhysics();
82 void CreateGeometry();
83
84 void DoIt(std::string particleName, double ekin_MeV,double time,
85 double x_cm, double y_cm, double z_cm, double dx, double dy, double dz);
86
87 void AddParticleName(const std::string particleName, double ekin_min_MeV, double ekin_max_MeV, std::string program);
88 bool FindParticleName(const std::string name, std::string program = "garfield");
89 bool FindParticleNameEnergy(std::string name, double ekin_MeV, std::string program = "garfield");
90 double GetMinEnergyMeVParticle(std::string name, std::string program = "garfield");
91 double GetMaxEnergyMeVParticle(std::string name, std::string program = "garfield");
92 void SetIonizationModel(std::string model, bool useDefaults=true);
93 std::string GetIonizationModel();
94 std::vector<GarfieldParticle*>* GetSecondaryParticles();
96 inline void EnableCreateSecondariesInGeant4(bool flag) {createSecondariesInGeant4 = flag;};
97 inline bool GetCreateSecondariesInGeant4() {return createSecondariesInGeant4;};
98 inline double GetEnergyDeposit_MeV() {return fEnergyDeposit/1000000;};
99 inline double GetAvalancheSize() {return fAvalancheSize;};
100 inline double GetGain() {return fGain;};
101 inline void Clear() {fEnergyDeposit=0;fAvalancheSize=0;fGain=0;nsum=0;}
102
103private:
106
107 std::string fIonizationModel;
108
109 static GarfieldPhysics* fGarfieldPhysics;
110 MapParticlesEnergy* fMapParticlesEnergyGeant4;
111 MapParticlesEnergy* fMapParticlesEnergyGarfield;
112 TGeoManager* fGeoManager;
113 Garfield::MediumMagboltz* fMediumMagboltz;
114 Garfield::Sensor* fSensor;
115 Garfield::AvalancheMC* fDrift;
117 Garfield::TrackHeed* fTrackHeed;
118 Garfield::GeometryRoot* fGeometryRoot;
119 Garfield::GeometrySimple* fGeometrySimple;
120 Garfield::ComponentAnalyticField* fComponentAnalyticField;
121 Garfield::SolidTube* fTube;
122
123 std::vector<GarfieldParticle*>* fSecondaryParticles;
124
125 bool createSecondariesInGeant4;
126 double fEnergyDeposit;
127 double fAvalancheSize;
128 double fGain;
129 int nsum;
130
131
132};
133#endif /* GARFIELDMODELCONFIG_HH_ */
std::map< const std::string, EnergyRange_MeV > MapParticlesEnergy
std::pair< double, double > EnergyRange_MeV
std::string getParticleName()
GarfieldParticle(std::string particleName, double ekin_eV, double time, double x_cm, double y_cm, double z_cm, double dx, double dy, double dz)
static void Dispose()
double GetMaxEnergyMeVParticle(std::string name, std::string program="garfield")
bool GetCreateSecondariesInGeant4()
void DeleteSecondaryParticles()
static GarfieldPhysics * GetInstance()
std::vector< GarfieldParticle * > * GetSecondaryParticles()
void SetIonizationModel(std::string model, bool useDefaults=true)
double GetMinEnergyMeVParticle(std::string name, std::string program="garfield")
void AddParticleName(const std::string particleName, double ekin_min_MeV, double ekin_max_MeV, std::string program)
std::string GetIonizationModel()
double GetEnergyDeposit_MeV()
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)
bool FindParticleNameEnergy(std::string name, double ekin_MeV, std::string program="garfield")
void EnableCreateSecondariesInGeant4(bool flag)
double GetAvalancheSize()
bool FindParticleName(const std::string name, std::string program="garfield")
Calculate electron drift lines and avalanches using microscopic tracking.
Use a geometry defined using the ROOT TGeo package.
Definition: GeometryRoot.hh:15
"Native" geometry, using simple shapes.
Cylindrical tube.
Definition: SolidTube.hh:10
Generate tracks using Heed++.
Definition: TrackHeed.hh:37