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 41 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.

43  : G4VEmModel(nam),G4VEmFluctuationModel(nam),
44  magCharge(mCharge),
45  twoln10(std::log(100.0)),
46  betalow(0.01),
47  betalim(0.1),
49  bg2lim(beta2lim*(1.0 + beta2lim))
50 {
51  nmpl = G4lrint(std::abs(magCharge) * 2 * fine_structure_const);
52  if(nmpl > 6) { nmpl = 6; }
53  else if(nmpl < 1) { nmpl = 1; }
54  pi_hbarc2_over_mc2 = pi * hbarc * hbarc / electron_mass_c2;
56  dedxlim = 45.*nmpl*nmpl*GeV*cm2/g;
57  fParticleChange = nullptr;
59  G4cout << "### Monopole ionisation model with d-electron production, Gmag= "
60  << 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.

68 {
69  if(IsMaster()) { delete dedx0; }
70 }
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 221 of file CMSmplIonisationWithDeltaModel.cc.

References ComputeCrossSectionPerElectron(), and cross().

227 {
228  G4double cross =
229  Z*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
230  return cross;
231 }
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 203 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().

208 {
209  if(!monopole) { SetParticle(p); }
210  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
211  G4double maxEnergy = std::min(tmax, maxKinEnergy);
212  G4double cutEnergy = std::max(LowEnergyLimit(), cut);
213  G4double cross = (cutEnergy < maxEnergy)
214  ? (0.5/cutEnergy - 0.5/maxEnergy)*pi_hbarc2_over_mc2 * nmpl * nmpl : 0.0;
215  return cross;
216 }
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 169 of file CMSmplIonisationWithDeltaModel.cc.

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

Referenced by ComputeDEDXPerVolume().

172 {
173  G4double eDensity = material->GetElectronDensity();
174  G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
175 
176  // Ahlen's formula for nonconductors, [1]p157, f(5.7)
177  G4double dedx =
178  0.5*(G4Log(2.0*electron_mass_c2*bg2*cutEnergy/(eexc*eexc)) -1.0);
179 
180  // Kazama et al. cross-section correction
181  G4double k = 0.406;
182  if(nmpl > 1) { k = 0.346; }
183 
184  // Bloch correction
185  const G4double B[7] = { 0.0, 0.248, 0.672, 1.022, 1.243, 1.464, 1.685};
186 
187  dedx += 0.5 * k - B[nmpl];
188 
189  // density effect correction
190  G4double x = G4Log(bg2)/twoln10;
191  dedx -= material->GetIonisation()->DensityCorrection(x);
192 
193  // now compute the total ionization loss
194  dedx *= pi_hbarc2_over_mc2 * eDensity * nmpl * nmpl;
195 
196  dedx = std::max(dedx, 0.0);
197  return dedx;
198 }
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 128 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.

132 {
133  if(!monopole) { SetParticle(p); }
134  G4double tmax = MaxSecondaryEnergy(p,kineticEnergy);
135  G4double cutEnergy = std::min(tmax, maxEnergy);
136  cutEnergy = std::max(LowEnergyLimit(), cutEnergy);
137  G4double tau = kineticEnergy / mass;
138  G4double gam = tau + 1.0;
139  G4double bg2 = tau * (tau + 2.0);
140  G4double beta2 = bg2 / (gam * gam);
141  G4double beta = sqrt(beta2);
142 
143  // low-energy asymptotic formula
144  G4double dedx = (*dedx0)[CurrentCouple()->GetIndex()]*beta;
145 
146  // above asymptotic
147  if(beta > betalow) {
148 
149  // high energy
150  if(beta >= betalim) {
151  dedx = ComputeDEDXAhlen(material, bg2, cutEnergy);
152 
153  } else {
154  G4double dedx1 = (*dedx0)[CurrentCouple()->GetIndex()]*betalow;
155  G4double dedx2 = ComputeDEDXAhlen(material, bg2lim, cutEnergy);
156 
157  // extrapolation between two formula
158  G4double kapa2 = beta - betalow;
159  G4double kapa1 = betalim - beta;
160  dedx = (kapa1*dedx1 + kapa2*dedx2)/(kapa1 + kapa2);
161  }
162  }
163  return dedx;
164 }
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 325 of file CMSmplIonisationWithDeltaModel.cc.

References chargeSquare, mass, and metsig::tau.

Referenced by SampleFluctuations().

329 {
330  G4double siga = 0.0;
331  G4double tau = dp->GetKineticEnergy()/mass;
332  if(tau > 0.0) {
333  G4double electronDensity = material->GetElectronDensity();
334  G4double gam = tau + 1.0;
335  G4double invbeta2 = (gam*gam)/(tau * (tau+2.0));
336  siga = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
337  * electronDensity * chargeSquare;
338  }
339  return siga;
340 }
static const double tmax[3]
void CMSmplIonisationWithDeltaModel::Initialise ( const G4ParticleDefinition *  p,
const G4DataVector &   
)
override

Definition at line 89 of file CMSmplIonisationWithDeltaModel.cc.

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

91 {
92  if(!monopole) { SetParticle(p); }
93  if(!fParticleChange) { fParticleChange = GetParticleChangeForLoss(); }
94  if(IsMaster()) {
95  if(!dedx0) { dedx0 = new std::vector<G4double>; }
96  G4ProductionCutsTable* theCoupleTable=
97  G4ProductionCutsTable::GetProductionCutsTable();
98  G4int numOfCouples = theCoupleTable->GetTableSize();
99  G4int n = dedx0->size();
100  if(n < numOfCouples) { dedx0->resize(numOfCouples); }
101  G4Pow* g4calc = G4Pow::GetInstance();
102 
103  // initialise vector
104  for(G4int i=0; i<numOfCouples; ++i) {
105 
106  const G4Material* material =
107  theCoupleTable->GetMaterialCutsCouple(i)->GetMaterial();
108  G4double eDensity = material->GetElectronDensity();
109  G4double vF = electron_Compton_length*g4calc->A13(3.*pi*pi*eDensity);
110  (*dedx0)[i] = pi_hbarc2_over_mc2*eDensity*nmpl*nmpl*
111  (G4Log(2*vF/fine_structure_const) - 0.5)/vF;
112  }
113  }
114 }
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 345 of file CMSmplIonisationWithDeltaModel.cc.

References mass, and metsig::tau.

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

347 {
348  G4double tau = kinEnergy/mass;
349  return 2.0*electron_mass_c2*tau*(tau + 2.);
350 }
G4double CMSmplIonisationWithDeltaModel::MinEnergyCut ( const G4ParticleDefinition *  ,
const G4MaterialCutsCouple *  couple 
)
override

Definition at line 119 of file CMSmplIonisationWithDeltaModel.cc.

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

Definition at line 294 of file CMSmplIonisationWithDeltaModel.cc.

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

300 {
301  G4double siga = Dispersion(couple->GetMaterial(),dp,tmax,length);
302  G4double loss = meanLoss;
303  siga = sqrt(siga);
304  G4double twomeanLoss = meanLoss + meanLoss;
305 
306  if(twomeanLoss < siga) {
307  G4double x;
308  do {
309  loss = twomeanLoss*G4UniformRand();
310  x = (loss - meanLoss)/siga;
311  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
312  } while (1.0 - 0.5*x*x < G4UniformRand());
313  } else {
314  do {
315  loss = G4RandGauss::shoot(meanLoss,siga);
316  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
317  } while (0.0 > loss || loss > twomeanLoss);
318  }
319  return loss;
320 }
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 236 of file CMSmplIonisationWithDeltaModel.cc.

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

241 {
242  G4double kineticEnergy = dp->GetKineticEnergy();
243  G4double tmax = MaxSecondaryEnergy(dp->GetDefinition(),kineticEnergy);
244 
245  G4double maxKinEnergy = std::min(maxEnergy,tmax);
246  if(minKinEnergy >= maxKinEnergy) { return; }
247 
248  //G4cout << "CMSmplIonisationWithDeltaModel::SampleSecondaries: E(GeV)= "
249  // << kineticEnergy/GeV << " M(GeV)= " << mass/GeV
250  // << " tmin(MeV)= " << minKinEnergy/MeV << G4endl;
251 
252  G4double totEnergy = kineticEnergy + mass;
253  G4double etot2 = totEnergy*totEnergy;
254  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/etot2;
255 
256  // sampling without nuclear size effect
257  G4double q = G4UniformRand();
258  G4double deltaKinEnergy = minKinEnergy*maxKinEnergy
259  /(minKinEnergy*(1.0 - q) + maxKinEnergy*q);
260 
261  // delta-electron is produced
262  G4double totMomentum = totEnergy*sqrt(beta2);
263  G4double deltaMomentum =
264  sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
265  G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
266  (deltaMomentum * totMomentum);
267  cost = std::min(cost, 1.0);
268 
269  G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
270 
271  G4double phi = twopi * G4UniformRand() ;
272 
273  G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost);
274  const G4ThreeVector& direction = dp->GetMomentumDirection();
275  deltaDirection.rotateUz(direction);
276 
277  // create G4DynamicParticle object for delta ray
278  G4DynamicParticle* delta =
279  new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
280 
281  vdp->push_back(delta);
282 
283  // Change kinematics of primary particle
284  kineticEnergy -= deltaKinEnergy;
285  G4ThreeVector finalP = direction*totMomentum - deltaDirection*deltaMomentum;
286  finalP = finalP.unit();
287 
288  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
289  fParticleChange->SetProposedMomentumDirection(finalP);
290 }
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 74 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 =
79  std::min(LowEnergyLimit(),0.1*mass*(1./sqrt(1. - betalow*betalow) - 1.));
80  G4double emax =
81  std::max(HighEnergyLimit(),10*mass*(1./sqrt(1. - beta2lim) - 1.));
82  SetLowEnergyLimit(emin);
83  SetHighEnergyLimit(emax);
84 }
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 102 of file CMSmplIonisationWithDeltaModel.h.

Referenced by SetParticle().

G4double CMSmplIonisationWithDeltaModel::betalim
private

Definition at line 101 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXPerVolume().

G4double CMSmplIonisationWithDeltaModel::betalow
private

Definition at line 100 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXPerVolume(), and SetParticle().

G4double CMSmplIonisationWithDeltaModel::bg2lim
private

Definition at line 103 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXPerVolume().

G4double CMSmplIonisationWithDeltaModel::chargeSquare
private

Definition at line 104 of file CMSmplIonisationWithDeltaModel.h.

Referenced by CMSmplIonisationWithDeltaModel(), and Dispersion().

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

Definition at line 105 of file CMSmplIonisationWithDeltaModel.h.

Referenced by CMSmplIonisationWithDeltaModel().

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

Definition at line 98 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 99 of file CMSmplIonisationWithDeltaModel.h.

Referenced by ComputeDEDXAhlen().