File indexing completed on 2023-03-17 11:00:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "FastSimulation/Particle/interface/makeParticle.h"
0017 #include "CommonTools/BaseParticlePropagator/interface/RawParticle.h"
0018
0019 inline RawParticle unchecked_makeParticle(int id, const math::XYZTLorentzVector& p, double mass, double charge) {
0020 return RawParticle(id, p, mass, charge);
0021 }
0022
0023 inline RawParticle unchecked_makeParticle(
0024 int id, const math::XYZTLorentzVector& p, const math::XYZTLorentzVector& xStart, double mass, double charge) {
0025 return RawParticle(id, p, xStart, mass, charge);
0026 }
0027
0028 RawParticle makeParticle(HepPDT::ParticleDataTable const* table, int id, const math::XYZTLorentzVector& p) {
0029 double charge = 0.;
0030 double mass = 0.;
0031 auto info = table->particle(HepPDT::ParticleID(id));
0032 if (info) {
0033 charge = info->charge();
0034 mass = info->mass().value();
0035 }
0036
0037 return unchecked_makeParticle(id, p, mass, charge);
0038 }
0039
0040 RawParticle makeParticle(HepPDT::ParticleDataTable const* table,
0041 int id,
0042 const math::XYZTLorentzVector& p,
0043 const math::XYZTLorentzVector& xStart) {
0044 double charge = 0.;
0045 double mass = 0.;
0046 auto info = table->particle(HepPDT::ParticleID(id));
0047 if (info) {
0048 charge = info->charge();
0049 mass = info->mass().value();
0050 }
0051 return unchecked_makeParticle(id, p, xStart, mass, charge);
0052 }