CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CMSmplIonisationWithDeltaModel Class Reference

#include <CMSmplIonisationWithDeltaModel.h>

Inheritance diagram for CMSmplIonisationWithDeltaModel:

Public Member Functions

 CMSmplIonisationWithDeltaModel (G4double mCharge, const G4String &nam="mplIonisationWithDelta")
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy) override
 
virtual G4double ComputeCrossSectionPerElectron (const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
 
G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) override
 
G4double Dispersion (const G4Material *, const G4DynamicParticle *, G4double tmax, G4double length) override
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *couple) override
 
G4double SampleFluctuations (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmax, G4double length, G4double meanLoss) override
 
void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
 
void SetParticle (const G4ParticleDefinition *p)
 
 ~CMSmplIonisationWithDeltaModel () override
 

Protected Member Functions

G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kinEnergy) override
 

Private Member Functions

G4double ComputeDEDXAhlen (const G4Material *material, G4double bg2, G4double cut)
 

Private Attributes

G4double beta2lim
 
G4double betalim
 
G4double betalow
 
G4double bg2lim
 
G4double chargeSquare
 
G4double dedxlim
 
G4ParticleChangeForLoss * fParticleChange
 
G4double magCharge
 
G4double mass
 
const G4ParticleDefinition * monopole
 
G4int nmpl
 
G4double pi_hbarc2_over_mc2
 
G4ParticleDefinition * theElectron
 
G4double twoln10
 

Static Private Attributes

static std::vector< G4double > * dedx0 = nullptr
 

Detailed Description

Definition at line 29 of file CMSmplIonisationWithDeltaModel.h.

Constructor & Destructor Documentation

CMSmplIonisationWithDeltaModel::CMSmplIonisationWithDeltaModel ( G4double  mCharge,
const G4String &  nam = "mplIonisationWithDelta" 
)
explicit

Definition at line 40 of file CMSmplIonisationWithDeltaModel.cc.

References funct::abs(), chargeSquare, dedxlim, nanoDQM_cff::Electron, fParticleChange, g, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, GeV, hbarc, magCharge, mass, monopole, nmpl, pi, pi_hbarc2_over_mc2, and theElectron.

41  : G4VEmModel(nam),
42  G4VEmFluctuationModel(nam),
43  magCharge(mCharge),
44  twoln10(std::log(100.0)),
45  betalow(0.01),
46  betalim(0.1),
48  bg2lim(beta2lim * (1.0 + beta2lim)) {
49  nmpl = G4lrint(std::abs(magCharge) * 2 * fine_structure_const);
50  if (nmpl > 6) {
51  nmpl = 6;
52  } else if (nmpl < 1) {
53  nmpl = 1;
54  }
55  pi_hbarc2_over_mc2 = pi * hbarc * hbarc / electron_mass_c2;
57  dedxlim = 45. * nmpl * nmpl * GeV * cm2 / g;
58  fParticleChange = nullptr;
60  G4cout << "### Monopole ionisation model with d-electron production, Gmag= " << magCharge / eplus << G4endl;
61  monopole = nullptr;
62  mass = 0.0;
63 }
const double GeV
Definition: MathUtil.h:16
const double hbarc
Definition: MathUtil.h:18
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
const Double_t pi
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CMSmplIonisationWithDeltaModel::~CMSmplIonisationWithDeltaModel ( )
override

Definition at line 67 of file CMSmplIonisationWithDeltaModel.cc.

References dedx0.

67  {
68  if (IsMaster()) {
69  delete dedx0;
70  }
71 }
static std::vector< G4double > * dedx0

Member Function Documentation

G4double CMSmplIonisationWithDeltaModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition *  p,
G4double  kineticEnergy,
G4double  Z,
G4double  A,
G4double  cutEnergy,
G4double  maxEnergy 
)
override

Definition at line 213 of file CMSmplIonisationWithDeltaModel.cc.

References ComputeCrossSectionPerElectron(), and cross().

218  {
219  G4double cross = Z * ComputeCrossSectionPerElectron(p, kineticEnergy, cutEnergy, maxEnergy);
220  return cross;
221 }
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
G4double CMSmplIonisationWithDeltaModel::ComputeCrossSectionPerElectron ( const G4ParticleDefinition *  p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Definition at line 196 of file CMSmplIonisationWithDeltaModel.cc.

References cross(), SiStripPI::max, particleFlowClusterECALTimeSelected_cfi::maxEnergy, MaxSecondaryEnergy(), min(), monopole, nmpl, pi_hbarc2_over_mc2, SetParticle(), and tmax.

Referenced by ComputeCrossSectionPerAtom().

199  {
200  if (!monopole) {
201  SetParticle(p);
202  }
203  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
204  G4double maxEnergy = std::min(tmax, maxKinEnergy);
205  G4double cutEnergy = std::max(LowEnergyLimit(), cut);
206  G4double cross =
207  (cutEnergy < maxEnergy) ? (0.5 / cutEnergy - 0.5 / maxEnergy) * pi_hbarc2_over_mc2 * nmpl * nmpl : 0.0;
208  return cross;
209 }
void SetParticle(const G4ParticleDefinition *p)
T min(T a, T b)
Definition: MathUtil.h:58
static const double tmax[3]
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) override
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
G4double CMSmplIonisationWithDeltaModel::ComputeDEDXAhlen ( const G4Material *  material,
G4double  bg2,
G4double  cut 
)
private

Definition at line 163 of file CMSmplIonisationWithDeltaModel.cc.

References TtFullHadDaughter::B, gen::k, SiStripPI::max, nmpl, pi_hbarc2_over_mc2, twoln10, and x.

Referenced by ComputeDEDXPerVolume().

165  {
166  G4double eDensity = material->GetElectronDensity();
167  G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
168 
169  // Ahlen's formula for nonconductors, [1]p157, f(5.7)
170  G4double dedx = 0.5 * (G4Log(2.0 * electron_mass_c2 * bg2 * cutEnergy / (eexc * eexc)) - 1.0);
171 
172  // Kazama et al. cross-section correction
173  G4double k = 0.406;
174  if (nmpl > 1) {
175  k = 0.346;
176  }
177 
178  // Bloch correction
179  const G4double B[7] = {0.0, 0.248, 0.672, 1.022, 1.243, 1.464, 1.685};
180 
181  dedx += 0.5 * k - B[nmpl];
182 
183  // density effect correction
184  G4double x = G4Log(bg2) / twoln10;
185  dedx -= material->GetIonisation()->DensityCorrection(x);
186 
187  // now compute the total ionization loss
188  dedx *= pi_hbarc2_over_mc2 * eDensity * nmpl * nmpl;
189 
190  dedx = std::max(dedx, 0.0);
191  return dedx;
192 }
static const std::string B
int k[5][pyjets_maxn]
G4double CMSmplIonisationWithDeltaModel::ComputeDEDXPerVolume ( const G4Material *  material,
const G4ParticleDefinition *  p,
G4double  kineticEnergy,
G4double  cutEnergy 
)
override

Definition at line 123 of file CMSmplIonisationWithDeltaModel.cc.

References pfBoostedDoubleSVAK8TagInfos_cfi::beta, betalim, betalow, bg2lim, ComputeDEDXAhlen(), mass, SiStripPI::max, MaxSecondaryEnergy(), min(), monopole, SetParticle(), mathSSE::sqrt(), metsig::tau, and tmax.

126  {
127  if (!monopole) {
128  SetParticle(p);
129  }
130  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
131  G4double cutEnergy = std::min(tmax, maxEnergy);
132  cutEnergy = std::max(LowEnergyLimit(), cutEnergy);
133  G4double tau = kineticEnergy / mass;
134  G4double gam = tau + 1.0;
135  G4double bg2 = tau * (tau + 2.0);
136  G4double beta2 = bg2 / (gam * gam);
137  G4double beta = sqrt(beta2);
138 
139  // low-energy asymptotic formula
140  G4double dedx = (*dedx0)[CurrentCouple()->GetIndex()] * beta;
141 
142  // above asymptotic
143  if (beta > betalow) {
144  // high energy
145  if (beta >= betalim) {
146  dedx = ComputeDEDXAhlen(material, bg2, cutEnergy);
147 
148  } else {
149  G4double dedx1 = (*dedx0)[CurrentCouple()->GetIndex()] * betalow;
150  G4double dedx2 = ComputeDEDXAhlen(material, bg2lim, cutEnergy);
151 
152  // extrapolation between two formula
153  G4double kapa2 = beta - betalow;
154  G4double kapa1 = betalim - beta;
155  dedx = (kapa1 * dedx1 + kapa2 * dedx2) / (kapa1 + kapa2);
156  }
157  }
158  return dedx;
159 }
G4double ComputeDEDXAhlen(const G4Material *material, G4double bg2, G4double cut)
void SetParticle(const G4ParticleDefinition *p)
T sqrt(T t)
Definition: SSEVec.h:18
T min(T a, T b)
Definition: MathUtil.h:58
static const double tmax[3]
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) override
G4double CMSmplIonisationWithDeltaModel::Dispersion ( const G4Material *  material,
const G4DynamicParticle *  dp,
G4double  tmax,
G4double  length 
)
override

Definition at line 308 of file CMSmplIonisationWithDeltaModel.cc.

References chargeSquare, mass, and metsig::tau.

Referenced by SampleFluctuations().

311  {
312  G4double siga = 0.0;
313  G4double tau = dp->GetKineticEnergy() / mass;
314  if (tau > 0.0) {
315  G4double electronDensity = material->GetElectronDensity();
316  G4double gam = tau + 1.0;
317  G4double invbeta2 = (gam * gam) / (tau * (tau + 2.0));
318  siga = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length * electronDensity * chargeSquare;
319  }
320  return siga;
321 }
static const double tmax[3]
void CMSmplIonisationWithDeltaModel::Initialise ( const G4ParticleDefinition *  p,
const G4DataVector &   
)
override

Definition at line 86 of file CMSmplIonisationWithDeltaModel.cc.

References dedx0, fParticleChange, mps_fire::i, monopole, gen::n, nmpl, pi, pi_hbarc2_over_mc2, and SetParticle().

86  {
87  if (!monopole) {
88  SetParticle(p);
89  }
90  if (!fParticleChange) {
91  fParticleChange = GetParticleChangeForLoss();
92  }
93  if (IsMaster()) {
94  if (!dedx0) {
95  dedx0 = new std::vector<G4double>;
96  }
97  G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
98  G4int numOfCouples = theCoupleTable->GetTableSize();
99  G4int n = dedx0->size();
100  if (n < numOfCouples) {
101  dedx0->resize(numOfCouples);
102  }
103  G4Pow* g4calc = G4Pow::GetInstance();
104 
105  // initialise vector
106  for (G4int i = 0; i < numOfCouples; ++i) {
107  const G4Material* material = theCoupleTable->GetMaterialCutsCouple(i)->GetMaterial();
108  G4double eDensity = material->GetElectronDensity();
109  G4double vF2 = 2 * electron_Compton_length * g4calc->A13(3. * pi * pi * eDensity);
110  (*dedx0)[i] = pi_hbarc2_over_mc2 * eDensity * nmpl * nmpl * (G4Log(vF2 / fine_structure_const) - 0.5) / vF2;
111  }
112  }
113 }
static std::vector< G4double > * dedx0
const Double_t pi
void SetParticle(const G4ParticleDefinition *p)
G4double CMSmplIonisationWithDeltaModel::MaxSecondaryEnergy ( const G4ParticleDefinition *  ,
G4double  kinEnergy 
)
overrideprotected

Definition at line 325 of file CMSmplIonisationWithDeltaModel.cc.

References mass, and metsig::tau.

Referenced by ComputeCrossSectionPerElectron(), ComputeDEDXPerVolume(), and SampleSecondaries().

325  {
326  G4double tau = kinEnergy / mass;
327  return 2.0 * electron_mass_c2 * tau * (tau + 2.);
328 }
G4double CMSmplIonisationWithDeltaModel::MinEnergyCut ( const G4ParticleDefinition *  ,
const G4MaterialCutsCouple *  couple 
)
override

Definition at line 117 of file CMSmplIonisationWithDeltaModel.cc.

117  {
118  return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
119 }
G4double CMSmplIonisationWithDeltaModel::SampleFluctuations ( const G4MaterialCutsCouple *  couple,
const G4DynamicParticle *  dp,
G4double  tmax,
G4double  length,
G4double  meanLoss 
)
override

Definition at line 280 of file CMSmplIonisationWithDeltaModel.cc.

References Dispersion(), mathSSE::sqrt(), tmax, and x.

284  {
285  G4double siga = Dispersion(couple->GetMaterial(), dp, tmax, length);
286  G4double loss = meanLoss;
287  siga = sqrt(siga);
288  G4double twomeanLoss = meanLoss + meanLoss;
289 
290  if (twomeanLoss < siga) {
291  G4double x;
292  do {
293  loss = twomeanLoss * G4UniformRand();
294  x = (loss - meanLoss) / siga;
295  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
296  } while (1.0 - 0.5 * x * x < G4UniformRand());
297  } else {
298  do {
299  loss = G4RandGauss::shoot(meanLoss, siga);
300  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
301  } while (0.0 > loss || loss > twomeanLoss);
302  }
303  return loss;
304 }
T sqrt(T t)
Definition: SSEVec.h:18
static const double tmax[3]
G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double tmax, G4double length) override
void CMSmplIonisationWithDeltaModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  vdp,
const G4MaterialCutsCouple *  ,
const G4DynamicParticle *  dp,
G4double  tmin,
G4double  maxEnergy 
)
override

Definition at line 225 of file CMSmplIonisationWithDeltaModel.cc.

References funct::cos(), delta, fParticleChange, mass, MaxSecondaryEnergy(), min(), phi, lumiQueryAPI::q, funct::sin(), mathSSE::sqrt(), theElectron, and tmax.

229  {
230  G4double kineticEnergy = dp->GetKineticEnergy();
231  G4double tmax = MaxSecondaryEnergy(dp->GetDefinition(), kineticEnergy);
232 
233  G4double maxKinEnergy = std::min(maxEnergy, tmax);
234  if (minKinEnergy >= maxKinEnergy) {
235  return;
236  }
237 
238  //G4cout << "CMSmplIonisationWithDeltaModel::SampleSecondaries: E(GeV)= "
239  // << kineticEnergy/GeV << " M(GeV)= " << mass/GeV
240  // << " tmin(MeV)= " << minKinEnergy/MeV << G4endl;
241 
242  G4double totEnergy = kineticEnergy + mass;
243  G4double etot2 = totEnergy * totEnergy;
244  G4double beta2 = kineticEnergy * (kineticEnergy + 2.0 * mass) / etot2;
245 
246  // sampling without nuclear size effect
247  G4double q = G4UniformRand();
248  G4double deltaKinEnergy = minKinEnergy * maxKinEnergy / (minKinEnergy * (1.0 - q) + maxKinEnergy * q);
249 
250  // delta-electron is produced
251  G4double totMomentum = totEnergy * sqrt(beta2);
252  G4double deltaMomentum = sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0 * electron_mass_c2));
253  G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) / (deltaMomentum * totMomentum);
254  cost = std::min(cost, 1.0);
255 
256  G4double sint = sqrt((1.0 - cost) * (1.0 + cost));
257 
258  G4double phi = twopi * G4UniformRand();
259 
260  G4ThreeVector deltaDirection(sint * cos(phi), sint * sin(phi), cost);
261  const G4ThreeVector& direction = dp->GetMomentumDirection();
262  deltaDirection.rotateUz(direction);
263 
264  // create G4DynamicParticle object for delta ray
265  G4DynamicParticle* delta = new G4DynamicParticle(theElectron, deltaDirection, deltaKinEnergy);
266 
267  vdp->push_back(delta);
268 
269  // Change kinematics of primary particle
270  kineticEnergy -= deltaKinEnergy;
271  G4ThreeVector finalP = direction * totMomentum - deltaDirection * deltaMomentum;
272  finalP = finalP.unit();
273 
274  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
275  fParticleChange->SetProposedMomentumDirection(finalP);
276 }
dbl * delta
Definition: mlp_gen.cc:36
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T min(T a, T b)
Definition: MathUtil.h:58
static const double tmax[3]
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) override
void CMSmplIonisationWithDeltaModel::SetParticle ( const G4ParticleDefinition *  p)

Definition at line 75 of file CMSmplIonisationWithDeltaModel.cc.

References beta2lim, betalow, mass, SiStripPI::max, min(), monopole, AlCaHLTBitMon_ParallelJobs::p, and mathSSE::sqrt().

Referenced by ComputeCrossSectionPerElectron(), ComputeDEDXPerVolume(), Initialise(), and CMSmplIonisation::InitialiseEnergyLossProcess().

75  {
76  monopole = p;
77  mass = monopole->GetPDGMass();
78  G4double emin = std::min(LowEnergyLimit(), 0.1 * mass * (1. / sqrt(1. - betalow * betalow) - 1.));
79  G4double emax = std::max(HighEnergyLimit(), 10 * mass * (1. / sqrt(1. - beta2lim) - 1.));
80  SetLowEnergyLimit(emin);
81  SetHighEnergyLimit(emax);
82 }
T sqrt(T t)
Definition: SSEVec.h:18
T min(T a, T b)
Definition: MathUtil.h:58

Member Data Documentation

G4double CMSmplIonisationWithDeltaModel::beta2lim
private

Definition at line 87 of file CMSmplIonisationWithDeltaModel.h.

Referenced by SetParticle().

G4double CMSmplIonisationWithDeltaModel::betalim
private

Definition at line 86 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXPerVolume().

G4double CMSmplIonisationWithDeltaModel::betalow
private

Definition at line 85 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXPerVolume(), and SetParticle().

G4double CMSmplIonisationWithDeltaModel::bg2lim
private

Definition at line 88 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXPerVolume().

G4double CMSmplIonisationWithDeltaModel::chargeSquare
private

Definition at line 89 of file CMSmplIonisationWithDeltaModel.h.

Referenced by CMSmplIonisationWithDeltaModel(), and Dispersion().

std::vector< G4double > * CMSmplIonisationWithDeltaModel::dedx0 = nullptr
staticprivate

Definition at line 94 of file CMSmplIonisationWithDeltaModel.h.

Referenced by Initialise(), and ~CMSmplIonisationWithDeltaModel().

G4double CMSmplIonisationWithDeltaModel::dedxlim
private

Definition at line 90 of file CMSmplIonisationWithDeltaModel.h.

Referenced by CMSmplIonisationWithDeltaModel().

G4ParticleChangeForLoss* CMSmplIonisationWithDeltaModel::fParticleChange
private
G4double CMSmplIonisationWithDeltaModel::magCharge
private

Definition at line 83 of file CMSmplIonisationWithDeltaModel.h.

Referenced by CMSmplIonisationWithDeltaModel().

G4double CMSmplIonisationWithDeltaModel::mass
private
const G4ParticleDefinition* CMSmplIonisationWithDeltaModel::monopole
private
G4int CMSmplIonisationWithDeltaModel::nmpl
private
G4double CMSmplIonisationWithDeltaModel::pi_hbarc2_over_mc2
private
G4ParticleDefinition* CMSmplIonisationWithDeltaModel::theElectron
private
G4double CMSmplIonisationWithDeltaModel::twoln10
private

Definition at line 84 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXAhlen().