CMS 3D CMS Logo

makeParticle.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FastSimulation/Particle
4 // Class : makeParticle
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Christopher Jones
10 // Created: Mon, 04 Mar 2019 17:15:41 GMT
11 //
12 
13 // system include files
14 
15 // user include files
18 
19 inline RawParticle unchecked_makeParticle(int id, const math::XYZTLorentzVector& p, double mass, double charge) {
20  return RawParticle(id, p, mass, charge);
21 }
22 
24  int id, const math::XYZTLorentzVector& p, const math::XYZTLorentzVector& xStart, double mass, double charge) {
25  return RawParticle(id, p, xStart, mass, charge);
26 }
27 
29  double charge = 0.;
30  double mass = 0.;
31  auto info = table->particle(HepPDT::ParticleID(id));
32  if (info) {
33  charge = info->charge();
34  mass = info->mass().value();
35  }
36 
37  return unchecked_makeParticle(id, p, mass, charge);
38 }
39 
41  int id,
43  const math::XYZTLorentzVector& xStart) {
44  double charge = 0.;
45  double mass = 0.;
46  auto info = table->particle(HepPDT::ParticleID(id));
47  if (info) {
48  charge = info->charge();
49  mass = info->mass().value();
50  }
51  return unchecked_makeParticle(id, p, xStart, mass, charge);
52 }
static const TGPicture * info(bool iBackgroundIsBlack)
HepPDT::ParticleDataTable ParticleDataTable
RawParticle makeParticle(HepPDT::ParticleDataTable const *table, int id, const math::XYZTLorentzVector &p)
Definition: makeParticle.cc:28
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
RawParticle unchecked_makeParticle(int id, const math::XYZTLorentzVector &p, double mass, double charge)
Definition: makeParticle.cc:19