CMS 3D CMS Logo

CMSmplIonisation.cc
Go to the documentation of this file.
1 //
2 // -------------------------------------------------------------------
3 //
4 // GEANT4 Class file
5 //
6 //
7 // File name: CMSmplIonisation
8 //
9 // Author: Vladimir Ivanchenko copied from Geant4 10.5p01
10 //
11 // Creation date: 02.03.2019
12 //
13 //
14 // -------------------------------------------------------------------
15 //
16 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
17 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
18 
21 #include "G4PhysicalConstants.hh"
22 #include "G4SystemOfUnits.hh"
23 #include "G4Electron.hh"
24 #include "G4EmParameters.hh"
25 
26 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
27 
28 using namespace std;
29 
30 CMSmplIonisation::CMSmplIonisation(G4double mCharge, const G4String& name)
31  : G4VEnergyLossProcess(name), magneticCharge(mCharge), isInitialised(false) {
32  // By default classical magnetic charge is used
33  if (magneticCharge == 0.0) {
34  magneticCharge = eplus * 0.5 / fine_structure_const;
35  }
36 
37  SetVerboseLevel(0);
38  SetProcessSubType(fIonisation);
39  SetStepFunction(0.2, 1 * mm);
40  SetSecondaryParticle(G4Electron::Electron());
41 }
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44 
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48 
49 G4bool CMSmplIonisation::IsApplicable(const G4ParticleDefinition&) { return true; }
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
52 
53 G4double CMSmplIonisation::MinPrimaryEnergy(const G4ParticleDefinition* mpl, const G4Material*, G4double cut) {
54  G4double x = 0.5 * cut / electron_mass_c2;
55  G4double mass = mpl->GetPDGMass();
56  G4double ratio = electron_mass_c2 / mass;
57  G4double gam = x * ratio + std::sqrt((1. + x) * (1. + x * ratio * ratio));
58  return mass * (gam - 1.0);
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62 
63 void CMSmplIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* p, const G4ParticleDefinition*) {
64  if (isInitialised) {
65  return;
66  }
67 
68  SetBaseParticle(nullptr);
69 
70  // monopole model is responsible both for energy loss and fluctuations
72  ion->SetParticle(p);
73 
74  // define size of dedx and range tables
75  G4EmParameters* param = G4EmParameters::Instance();
76  G4double emin = std::min(param->MinKinEnergy(), ion->LowEnergyLimit());
77  G4double emax = std::max(param->MaxKinEnergy(), ion->HighEnergyLimit());
78  G4int bin = G4lrint(param->NumberOfBinsPerDecade() * std::log10(emax / emin));
79  ion->SetLowEnergyLimit(emin);
80  ion->SetHighEnergyLimit(emax);
81  SetMinKinEnergy(emin);
82  SetMaxKinEnergy(emax);
83  SetDEDXBinning(bin);
84 
85  SetEmModel(ion);
86  AddEmModel(1, ion, ion);
87 
88  isInitialised = true;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
96 
97 void CMSmplIonisation::ProcessDescription(std::ostream& out) const {
98  out << "No description available." << G4endl;
99  G4VEnergyLossProcess::ProcessDescription(out);
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
CMSmplIonisation::ProcessDescription
void ProcessDescription(std::ostream &) const override
Definition: CMSmplIonisation.cc:97
CMSmplIonisation.h
funct::false
false
Definition: Factorize.h:29
CMSmplIonisation::MinPrimaryEnergy
G4double MinPrimaryEnergy(const G4ParticleDefinition *p, const G4Material *, G4double cut) final
Definition: CMSmplIonisation.cc:53
min
T min(T a, T b)
Definition: MathUtil.h:58
CMSmplIonisation::InitialiseEnergyLossProcess
void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *) override
Definition: CMSmplIonisation.cc:63
CMSmplIonisation::IsApplicable
G4bool IsApplicable(const G4ParticleDefinition &p) override
Definition: CMSmplIonisation.cc:49
DDAxes::x
CMSmplIonisationWithDeltaModel
Definition: CMSmplIonisationWithDeltaModel.h:29
CMSmplIonisation::~CMSmplIonisation
~CMSmplIonisation() override
Definition: CMSmplIonisation.cc:45
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
particleFlowDisplacedVertex_cfi.ratio
ratio
Definition: particleFlowDisplacedVertex_cfi.py:93
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CMSmplIonisation::CMSmplIonisation
CMSmplIonisation(G4double mCharge=0.0, const G4String &name="mplIoni")
Definition: CMSmplIonisation.cc:30
CMSmplIonisationWithDeltaModel.h
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
nanoDQM_cff.Electron
Electron
Definition: nanoDQM_cff.py:95
std
Definition: JetResolutionObject.h:76
PA_MinBiasSkim_cff.cut
cut
Definition: PA_MinBiasSkim_cff.py:13
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CMSmplIonisationWithDeltaModel::SetParticle
void SetParticle(const G4ParticleDefinition *p)
Definition: CMSmplIonisationWithDeltaModel.cc:75
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
CMSmplIonisation::magneticCharge
G4double magneticCharge
Definition: CMSmplIonisation.h:55
CMSmplIonisation::isInitialised
G4bool isInitialised
Definition: CMSmplIonisation.h:56
CMSmplIonisation::PrintInfo
void PrintInfo() override
Definition: CMSmplIonisation.cc:93