Garfield++ 4.0
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/// \file GarfieldPhysics.hh
27/// \brief Definition of the GarfieldPhysics class
28/// \author D. Pfeiffer
29//
30#ifndef GarfieldPhysics_h
31#define GarfieldPhysics_h 1
32
33#include <iostream>
34#include <map>
35#include <vector>
36
39#include "Garfield/Sensor.hh"
40#include "Garfield/TrackHeed.hh"
41
42typedef std::pair<double, double> EnergyRange_MeV;
43typedef std::map<const std::string, EnergyRange_MeV> MapParticlesEnergy;
44
46 public:
47 GarfieldParticle(std::string particleName, double ekin_eV, double time,
48 double x_cm, double y_cm, double z_cm, double dx, double dy,
49 double dz)
50 : fParticleName(particleName),
51 fEkin_MeV(ekin_eV / 1000000),
52 fTime(time),
53 fx_mm(10 * x_cm),
54 fy_mm(10 * y_cm),
55 fz_mm(10 * z_cm),
56 fdx(dx),
57 fdy(dy),
58 fdz(dz) {}
60
61 std::string getParticleName() { return fParticleName; }
62 double getX_mm() { return fx_mm; }
63 double getY_mm() { return fy_mm; }
64 double getZ_mm() { return fz_mm; }
65 double getEkin_MeV() { return fEkin_MeV; }
66 double getTime() { return fTime; }
67 double getDX() { return fdx; }
68 double getDY() { return fdy; }
69 double getDZ() { return fdz; }
70
71 private:
72 std::string fParticleName;
73 double fEkin_MeV, fTime, fx_mm, fy_mm, fz_mm, fdx, fdy, fdz;
74};
75
77 public:
79 static void Dispose();
80
81 void InitializePhysics();
82
83 void DoIt(std::string particleName, double ekin_MeV, double time, double x_cm,
84 double y_cm, double z_cm, double dx, double dy, double dz);
85
86 void AddParticleName(const std::string particleName, double ekin_min_MeV,
87 double ekin_max_MeV, std::string program);
88 bool FindParticleName(const std::string name,
89 std::string program = "garfield");
90 bool FindParticleNameEnergy(std::string name, double ekin_MeV,
91 std::string program = "garfield");
92 double GetMinEnergyMeVParticle(std::string name,
93 std::string program = "garfield");
94 double GetMaxEnergyMeVParticle(std::string name,
95 std::string program = "garfield");
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 createSecondariesInGeant4 = flag;
102 }
104 return createSecondariesInGeant4;
105 }
106 inline double GetEnergyDeposit_MeV() { return fEnergyDeposit / 1000000; }
107 inline double GetAvalancheSize() { return fAvalancheSize; }
108 inline double GetGain() { return fGain; }
109 inline void Clear() {
110 fEnergyDeposit = 0;
111 fAvalancheSize = 0;
112 fGain = 0;
113 nsum = 0;
114 }
115
116 private:
119
120 std::string fIonizationModel;
121
122 static GarfieldPhysics* fGarfieldPhysics;
123 MapParticlesEnergy fMapParticlesEnergyGeant4;
124 MapParticlesEnergy fMapParticlesEnergyGarfield;
125 Garfield::MediumMagboltz* fMediumMagboltz;
126 Garfield::Sensor* fSensor;
127 Garfield::TrackHeed* fTrackHeed;
128 Garfield::ComponentAnalyticField* fComponentAnalyticField;
129
130 std::vector<GarfieldParticle*>* fSecondaryParticles;
131
132 bool createSecondariesInGeant4;
133 double fEnergyDeposit;
134 double fAvalancheSize;
135 double fGain;
136 int nsum;
137};
138#endif /* GARFIELDMODELCONFIG_HH_ */
std::pair< double, double > EnergyRange_MeV
std::map< const std::string, EnergyRange_MeV > MapParticlesEnergy
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")
Generate tracks using Heed++.
Definition: TrackHeed.hh:35