CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
fastsim::MuonBremsstrahlung Class Reference

Implementation of Bremsstrahlung from mu+/mu- in the tracker layers based on a Petrukhin Model (nuclear screening correction). More...

Inheritance diagram for fastsim::MuonBremsstrahlung:
fastsim::InteractionModel

Public Member Functions

void interact (Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< Particle > > &secondaries, const RandomEngineAndDistribution &random) override
 Perform the interaction. More...
 
 MuonBremsstrahlung (const std::string &name, const edm::ParameterSet &cfg)
 Constructor. More...
 
 ~MuonBremsstrahlung () override
 Default destructor. More...
 
- Public Member Functions inherited from fastsim::InteractionModel
const std::string getName ()
 Return (unique) name of this interaction. More...
 
 InteractionModel (std::string name)
 Constructor. More...
 
virtual void registerProducts (edm::ProducerBase &producer) const
 In case interaction produces and stores content in the event (e.g. TrackerSimHits). More...
 
virtual void storeProducts (edm::Event &iEvent)
 In case interaction produces and stores content in the event (e.g. TrackerSimHits). More...
 
virtual ~InteractionModel ()
 Default destructor. More...
 

Private Member Functions

math::XYZTLorentzVector brem (Particle &particle, double xmin, const RandomEngineAndDistribution &random) const
 Compute Brem photon energy and angles, if any. More...
 
double gbteth (const double ener, const double partm, const double efrac, const RandomEngineAndDistribution &random) const
 A universal angular distribution. More...
 

Static Private Member Functions

static double PetrukhinFunc (double *x, double *p)
 Petrukhin Function: Returns cross section using nuclear-electron screening correction from G4 style. More...
 

Private Attributes

double A_
 Atomic weight of material (usually silicon A=28.0855) More...
 
double density_
 Density of material (usually silicon rho=2.329) More...
 
double minPhotonEnergy_
 Cut on minimum energy of bremsstrahlung photons. More...
 
double minPhotonEnergyFraction_
 Cut on minimum fraction of particle's energy which has to be carried by photon. More...
 
TF1 * Petrfunc
 The Petrukhin Function. More...
 
double radLenInCm_
 Radiation length of material (usually silicon X0=9.360) More...
 
double Z_
 Atomic number of material (usually silicon Z=14) More...
 

Detailed Description

Implementation of Bremsstrahlung from mu+/mu- in the tracker layers based on a Petrukhin Model (nuclear screening correction).

Computes the number, energy and angles of Bremsstrahlung photons emitted by muons and modifies mu+/mu- particle accordingly.

Definition at line 42 of file MuonBremsstrahlung.cc.

Constructor & Destructor Documentation

fastsim::MuonBremsstrahlung::MuonBremsstrahlung ( const std::string &  name,
const edm::ParameterSet cfg 
)

Constructor.

Definition at line 98 of file MuonBremsstrahlung.cc.

References A_, density_, edm::ParameterSet::getParameter(), minPhotonEnergy_, minPhotonEnergyFraction_, radLenInCm_, and Z_.

100 {
101  // Set the minimal photon energy for a Brem from mu+/-
102  minPhotonEnergy_ = cfg.getParameter<double>("minPhotonEnergy");
103  minPhotonEnergyFraction_ = cfg.getParameter<double>("minPhotonEnergyFraction");
104  // Material properties
105  A_ = cfg.getParameter<double>("A");
106  Z_ = cfg.getParameter<double>("Z");
107  density_ = cfg.getParameter<double>("density");
108  radLenInCm_ = cfg.getParameter<double>("radLen");
109 }
T getParameter(std::string const &) const
double minPhotonEnergyFraction_
Cut on minimum fraction of particle&#39;s energy which has to be carried by photon.
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
Base class for any interaction model between a particle and a tracker layer.
double density_
Density of material (usually silicon rho=2.329)
double minPhotonEnergy_
Cut on minimum energy of bremsstrahlung photons.
double A_
Atomic weight of material (usually silicon A=28.0855)
double Z_
Atomic number of material (usually silicon Z=14)
fastsim::MuonBremsstrahlung::~MuonBremsstrahlung ( )
inlineoverride

Member Function Documentation

math::XYZTLorentzVector fastsim::MuonBremsstrahlung::brem ( fastsim::Particle particle,
double  xmin,
const RandomEngineAndDistribution random 
) const
private

Compute Brem photon energy and angles, if any.

Parameters
particleThe particle that interacts with the matter.
xminMinimum fraction of the particle's energy that has to be converted to a photon.
randomThe Random Engine.
Returns
Momentum 4-vector of a bremsstrahlung photon.

Definition at line 209 of file MuonBremsstrahlung.cc.

References funct::cos(), RandomEngineAndDistribution::flatShoot(), gbteth(), M_PI, fastsim::Particle::momentum(), fastsim::Constants::muMass, Petrfunc, random, funct::sin(), and theta().

Referenced by interact(), and ~MuonBremsstrahlung().

212 {
213  // This is a simple version of a Muon Brem using Petrukhin model.
214  // Ref: http://pdg.lbl.gov/2008/AtomicNuclearProperties/adndt.pdf
215  double xp = Petrfunc->GetRandom();
216 
217  // Have photon energy. Now generate angles with respect to the z axis
218  // defined by the incoming particle's momentum.
219 
220  // Isotropic in phi
221  const double phi = random.flatShoot() * 2. * M_PI;
222  // theta from universal distribution
223  const double theta = gbteth(particle.momentum().E(), fastsim::Constants::muMass, xp, random)
224  * fastsim::Constants::muMass / particle.momentum().E();
225 
226  // Make momentum components
227  double stheta = std::sin(theta);
228  double ctheta = std::cos(theta);
229  double sphi = std::sin(phi);
230  double cphi = std::cos(phi);
231 
232  return xp * particle.momentum().E() * math::XYZTLorentzVector(stheta*cphi, stheta*sphi, ctheta, 1.);
233 }
double flatShoot(double xmin=0.0, double xmax=1.0) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static double constexpr muMass
Muon mass [GeV].
Definition: Constants.h:18
TRandom random
Definition: MVATrainer.cc:138
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TF1 * Petrfunc
The Petrukhin Function.
#define M_PI
double gbteth(const double ener, const double partm, const double efrac, const RandomEngineAndDistribution &random) const
A universal angular distribution.
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:145
double fastsim::MuonBremsstrahlung::gbteth ( const double  ener,
const double  partm,
const double  efrac,
const RandomEngineAndDistribution random 
) const
private

A universal angular distribution.

Parameters
ener
partm
efrac
randomThe Random Engine.
Returns
Theta from universal distribution

Definition at line 236 of file MuonBremsstrahlung.cc.

References pfBoostedDoubleSVAK8TagInfos_cfi::beta, edmIntegrityCheck::d, RandomEngineAndDistribution::flatShoot(), cmsBatch::log, M_PI, and Z_.

Referenced by brem(), and ~MuonBremsstrahlung().

240 {
241  // Details on implementation here
242  // http://www.dnp.fmph.uniba.sk/cernlib/asdoc/geant_html3/node299.html#GBTETH
243  // http://svn.cern.ch/guest/AliRoot/tags/v3-07-03/GEANT321/gphys/gbteth.F
244 
245  const double alfa = 0.625;
246 
247  const double d = 0.13*(0.8+1.3/Z_)*(100.0+(1.0/ener))*(1.0+efrac);
248  const double w1 = 9.0/(9.0+d);
249  const double umax = ener*M_PI/partm;
250  double u;
251 
252  do
253  {
254  double beta = (random.flatShoot()<=w1) ? alfa : 3.0*alfa;
255  u = -std::log(random.flatShoot()*random.flatShoot())/beta;
256  }while (u >= umax);
257 
258  return u;
259 }
double flatShoot(double xmin=0.0, double xmax=1.0) const
#define M_PI
double Z_
Atomic number of material (usually silicon Z=14)
void fastsim::MuonBremsstrahlung::interact ( fastsim::Particle particle,
const SimplifiedGeometry layer,
std::vector< std::unique_ptr< Particle > > &  secondaries,
const RandomEngineAndDistribution random 
)
overridevirtual

Perform the interaction.

Parameters
particleThe particle that interacts with the matter.
layerThe detector layer that interacts with the particle.
secondariesParticles that are produced in the interaction (if any).
randomThe Random Engine.

Implements fastsim::InteractionModel.

Definition at line 112 of file MuonBremsstrahlung.cc.

References A_, funct::abs(), brem(), density_, SoftLeptonByDistance_cfi::distance, fastsim::SimplifiedGeometry::getThickness(), mps_fire::i, SiStripPI::max, minPhotonEnergy_, minPhotonEnergyFraction_, fastsim::Particle::momentum(), fastsim::Constants::NA, fastsim::Particle::pdgId(), Petrfunc, PetrukhinFunc(), RandomEngineAndDistribution::poissonShoot(), fastsim::Particle::position(), radLenInCm_, theta(), TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, and Z_.

Referenced by ~MuonBremsstrahlung().

116 {
117  // only consider muons
118  if(std::abs(particle.pdgId())!=13)
119  {
120  return;
121  }
122 
123  double radLengths = layer.getThickness(particle.position(),particle.momentum());
124  //
125  // no material
126  //
127  if(radLengths < 1E-10)
128  {
129  return;
130  }
131 
132  // Protection : Just stop the electron if more than 1 radiation lengths.
133  // This case corresponds to an electron entering the layer parallel to
134  // the layer axis - no reliable simulation can be done in that case...
135  if(radLengths > 4.)
136  {
137  particle.momentum().SetXYZT(0.,0.,0.,0.);
138  return;
139  }
140 
141  // muon must have more energy than minimum photon energy
142  if(particle.momentum().E() - particle.momentum().mass() < minPhotonEnergy_)
143  {
144  return;
145  }
146 
147  // Min fraction of muon's energy transferred to the photon
149  // Hard brem probability with a photon Energy above threshold.
150  if(xmin >=1. || xmin <=0.)
151  {
152  return;
153  }
154 
155  // Max fraction of muon's energy transferred to the photon
156  double xmax = 1.;
157 
158  // create TF1 using a free C function
159  Petrfunc = new TF1("Petrfunc", PetrukhinFunc, xmin, xmax, 3);
160  // Setting parameters
161  Petrfunc->SetParameters(particle.momentum().E(), A_, Z_);
162  // d = distance for several materials
163  // X0 = radLen
164  // d = radLengths * X0 (for tracker, yoke, ECAL and HCAL)
165  double distance = radLengths * radLenInCm_;
166 
167  // Integration
168  // Fixed previous version which used Petrfunc->Integral(0.,1.) -> does not make sense
169  double bremProba = density_ * distance * (fastsim::Constants::NA / A_) * (Petrfunc->Integral(xmin, xmax));
170  if(bremProba < 1E-10)
171  {
172  return;
173  }
174 
175 
176  // Number of photons to be radiated.
177  unsigned int nPhotons = random.poissonShoot(bremProba);
178  if(nPhotons == 0)
179  {
180  return;
181  }
182 
183  //Rotate to the lab frame
184  double theta = particle.momentum().Theta();
185  double phi = particle.momentum().Phi();
186 
187  // Energy of these photons
188  for(unsigned int i=0; i<nPhotons; ++i)
189  {
190  // Throw momentum of the photon
191  math::XYZTLorentzVector photonMom = brem(particle, xmin, random);
192 
193  // Check that there is enough energy left.
194  if(particle.momentum().E() - particle.momentum().mass() < photonMom.E()) break;
195 
196  // Rotate to the lab frame
197  photonMom = ROOT::Math::RotationZ(phi) * (ROOT::Math::RotationY(theta) * photonMom);
198 
199  // Add a photon
200  secondaries.emplace_back(new fastsim::Particle(22, particle.position(), photonMom));
201 
202  // Update the original e+/-
203  particle.momentum() -= photonMom;
204  }
205 }
static double constexpr NA
Avogadro&#39;s number.
Definition: Constants.h:20
const math::XYZTLorentzVector & position() const
Return position of the particle.
Definition: Particle.h:142
Geom::Theta< T > theta() const
double minPhotonEnergyFraction_
Cut on minimum fraction of particle&#39;s energy which has to be carried by photon.
int pdgId() const
Return pdgId of the particle.
Definition: Particle.h:136
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double density_
Density of material (usually silicon rho=2.329)
double minPhotonEnergy_
Cut on minimum energy of bremsstrahlung photons.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TF1 * Petrfunc
The Petrukhin Function.
static double PetrukhinFunc(double *x, double *p)
Petrukhin Function: Returns cross section using nuclear-electron screening correction from G4 style...
unsigned int poissonShoot(double mean) const
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:145
double A_
Atomic weight of material (usually silicon A=28.0855)
double Z_
Atomic number of material (usually silicon Z=14)
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
Definition: Particle.h:19
math::XYZTLorentzVector brem(Particle &particle, double xmin, const RandomEngineAndDistribution &random) const
Compute Brem photon energy and angles, if any.
double fastsim::MuonBremsstrahlung::PetrukhinFunc ( double *  x,
double *  p 
)
staticprivate

Petrukhin Function: Returns cross section using nuclear-electron screening correction from G4 style.

Definition at line 262 of file MuonBremsstrahlung.cc.

References patCaloMETCorrections_cff::A, alpha, TtFullHadDaughter::B, DEFINE_EDM_PLUGIN, delta, triggerObjects_cff::Dn, f, funct::pow(), and DOFs::Z.

Referenced by interact(), and ~MuonBremsstrahlung().

262  {
263 
264  // Function independent variable
265  double nu = x[0]; // fraction of muon's energy transferred to the photon
266 
267  // Parameters
268  double E=p[0]; // Muon Energy (in GeV)
269  double A=p[1]; // Atomic weight
270  double Z=p[2]; // Atomic number
271 
272  /*
274  // Function of Muom Brem using nuclear screening correction
275  // Ref: http://pdg.lbl.gov/2008/AtomicNuclearProperties/adndt.pdf
276  // http://geant4.cern.ch/G4UsersDocuments/UsersGuides/PhysicsReferenceManual/html/node48.html
277 
278  // Physical constants
279  double B = 182.7;
280  double ee = sqrt(2.7181) ; // sqrt(e)
281  double ZZ= pow( Z,-1./3.); // Z^-1/3
283  double emass = 0.0005109990615; // electron mass (GeV/c^2)
284  double mumass = 0.105658367;//mu mass (GeV/c^2)
285 
286  double re = 2.817940285e-13;// Classical electron radius (Units: cm)
287  double alpha = 1./137.03599976; // fine structure constant
288  double Dn = 1.54* (pow(A,0.27));
289  double constant = pow((2.0 * Z * emass/mumass * re ),2.0);
291 
292  double delta = (mumass * mumass * nu) /(2.* E * (1.- nu));
293 
294  double Delta_n = TMath::Log(Dn / (1.+ delta *( Dn * ee -2.)/ mumass)); //nuclear screening correction
295 
296  double Phi = TMath::Log((B * mumass * ZZ / emass)/ (1.+ delta * ee * B * ZZ / emass)) - Delta_n;//phi(delta)
297 
298  // Diff. Cross Section for Muon Brem from a screened nuclear (Equation 16: REF: LBNL-44742)
299  double f = alpha * constant *(4./3.-4./3.*nu + nu*nu)*Phi/nu;
300  */
301 
303  // Function for Muon Brem Xsec from G4
305 
306  // Physical constants
307  double B = 183.;
308  double Bl = 1429.;
309  double ee = 1.64872 ; // sqrt(e)
310  double Z13 = pow(Z, -1./3.); // Z^-1/3
311  double Z23 = pow(Z, -2./3.); // Z^-2/3
312 
313  // Original values of paper
314  double emass = 0.0005109990615; // electron mass (GeV/c^2)
315  double mumass = 0.105658367; // muon mass (GeV/c^2)
316  // double re = 2.817940285e-13; // Classical electron radius (Units: cm)
317  double alpha = 0.00729735; // 1./137.03599976; // fine structure constant
318  double constant = 1.85736e-30; // pow( ( emass / mumass * re ) , 2.0);
319 
320  // Use nomenclature from reference -> Follow those formula step by step
321  if(nu * E >= E - mumass) return 0;
322 
323  double Dn = 1.54 * (pow(A,0.27));
324  double Dnl = pow(Dn, (1. - 1./Z));
325 
326  double delta = (mumass * mumass * nu) / (2.* E * (1.- nu));
327 
328  double Phi_n = TMath::Log(B * Z13 *(mumass + delta * ( Dnl * ee - 2))
329  / (Dnl * (emass + delta * ee * B * Z13)));
330  if(Phi_n < 0) Phi_n = 0;
331 
332  double Phi_e = TMath::Log((Bl * Z23 * mumass)
333  / (1.+ delta * mumass / (emass*emass * ee))
334  / (emass + delta *ee * Bl * Z23));
335  if(Phi_e < 0 || nu * E >= E / (1. + (mumass * mumass / (2. * emass * E)))) Phi_e = 0;
336 
337 
338  // Diff. Cross Section for Muon Brem from G4 (without NA/A factor)
339  double f = 16./3. * alpha * constant * Z * (Z * Phi_n + Phi_e) * (1./nu) * (1. - nu + 0.75 * nu * nu) ;
340 
341  return f;
342 }
dbl * delta
Definition: mlp_gen.cc:36
float alpha
Definition: AMPTWrapper.h:95
double f[11][100]
static const std::string B
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

double fastsim::MuonBremsstrahlung::A_
private

Atomic weight of material (usually silicon A=28.0855)

Definition at line 93 of file MuonBremsstrahlung.cc.

Referenced by interact(), and MuonBremsstrahlung().

double fastsim::MuonBremsstrahlung::density_
private

Density of material (usually silicon rho=2.329)

Definition at line 91 of file MuonBremsstrahlung.cc.

Referenced by interact(), and MuonBremsstrahlung().

double fastsim::MuonBremsstrahlung::minPhotonEnergy_
private

Cut on minimum energy of bremsstrahlung photons.

Definition at line 89 of file MuonBremsstrahlung.cc.

Referenced by interact(), and MuonBremsstrahlung().

double fastsim::MuonBremsstrahlung::minPhotonEnergyFraction_
private

Cut on minimum fraction of particle's energy which has to be carried by photon.

Definition at line 90 of file MuonBremsstrahlung.cc.

Referenced by interact(), and MuonBremsstrahlung().

TF1* fastsim::MuonBremsstrahlung::Petrfunc
private

The Petrukhin Function.

Definition at line 88 of file MuonBremsstrahlung.cc.

Referenced by brem(), and interact().

double fastsim::MuonBremsstrahlung::radLenInCm_
private

Radiation length of material (usually silicon X0=9.360)

Definition at line 92 of file MuonBremsstrahlung.cc.

Referenced by interact(), and MuonBremsstrahlung().

double fastsim::MuonBremsstrahlung::Z_
private

Atomic number of material (usually silicon Z=14)

Definition at line 94 of file MuonBremsstrahlung.cc.

Referenced by gbteth(), interact(), and MuonBremsstrahlung().