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 
20 inline RawParticle unchecked_makeParticle(int id, const math::XYZTLorentzVector& p, double mass, double charge) {
21  return RawParticle(id,p,mass, charge);
22 }
23 
24 inline RawParticle unchecked_makeParticle(int id, const math::XYZTLorentzVector& p, const math::XYZTLorentzVector& xStart, double mass, double charge) {
25  return RawParticle(id,p, xStart, mass, charge);
26 }
27 
28 
30  double charge =0.;
31  double mass = 0.;
32  auto info = table->particle(HepPDT::ParticleID(id));
33  if ( info ) {
34  charge = info->charge();
35  mass = info->mass().value();
36  }
37 
38  return unchecked_makeParticle(id,p,mass, charge);
39 }
40 
42  double charge =0.;
43  double mass = 0.;
44  auto info = table->particle(HepPDT::ParticleID(id));
45  if ( info ) {
46  charge = info->charge();
47  mass = info->mass().value();
48  }
49  return unchecked_makeParticle(id, p, xStart, mass, charge);
50 }
51 
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:29
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:20