CMS 3D CMS Logo

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

#include <G4TrackToParticleID.h>

Public Member Functions

 G4TrackToParticleID ()
 
int particleID (const G4Track *)
 
 ~G4TrackToParticleID ()
 

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.

Constructor & Destructor Documentation

G4TrackToParticleID::G4TrackToParticleID ( )

Definition at line 9 of file G4TrackToParticleID.cc.

9 {}
G4TrackToParticleID::~G4TrackToParticleID ( )

Definition at line 24 of file G4TrackToParticleID.cc.

24 {}

Member Function Documentation

int G4TrackToParticleID::particleID ( const G4Track *  g4trk)

Definition at line 11 of file G4TrackToParticleID.cc.

References LogDebug.

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

12 {
13  int particleID_ = g4trk->GetDefinition()->GetPDGEncoding();
14 #ifdef DebugLog
15  if ( particleID_ > 1000000000 ) {
16  LogDebug("SimG4CoreNotification") << "G4TrackToParticleID ion code = " << particleID_ ;
17  }
18 #endif
19  if (particleID_ != 0) return particleID_;
20  edm::LogWarning("SimG4CoreNotification") << "G4TrackToParticleID: unknown code for track Id = " << g4trk->GetTrackID();
21  return -99;
22 }
#define LogDebug(id)