CMS 3D CMS Logo

PrimaryTransformer.cc
Go to the documentation of this file.
2 
3 #include "G4ParticleDefinition.hh"
4 
5 PrimaryTransformer::PrimaryTransformer() : G4PrimaryTransformer() { unknownParticleDefined = false; }
6 
8 
9 G4ParticleDefinition* PrimaryTransformer::GetDefinition(G4PrimaryParticle* pp) {
10  G4ParticleDefinition* partDef = pp->GetG4code();
11  if (!partDef)
12  partDef = particleTable->FindParticle(pp->GetPDGcode());
13  if (unknownParticleDefined && ((!partDef) || partDef->IsShortLived()))
14  partDef = unknown;
15  return partDef;
16 }
G4ParticleDefinition * GetDefinition(G4PrimaryParticle *pp) override
~PrimaryTransformer() override