CMS 3D CMS Logo

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