CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
G4TrackToParticleID Class Reference

#include <G4TrackToParticleID.h>

Static Public Member Functions

static int particleID (const G4Track *)
 

Detailed Description

Converts G4Track to particle ID. For PDG Particles it is the obvious number; for alpha, triton and deuteron the CMS convention is used

Definition at line 11 of file G4TrackToParticleID.h.

Member Function Documentation

int G4TrackToParticleID::particleID ( const G4Track *  g4trk)
static

Definition at line 7 of file G4TrackToParticleID.cc.

Referenced by Bcm1fSD::createHit(), PltSD::createHit(), TkAccumulatingSensitiveDetector::createHit(), MuonSensitiveDetector::createHit(), and TrackWithHistory::TrackWithHistory().

8 {
9  int particleID_ = g4trk->GetDefinition()->GetPDGEncoding();
10  if (0 == particleID_) {
11  edm::LogWarning("SimG4CoreNotification")
12  << "G4TrackToParticleID: unknown code for track Id = " << g4trk->GetTrackID();
13  particleID_ = -99;
14  }
15  return particleID_;
16 }