CMS 3D CMS Logo

Public Member Functions

G4TrackToParticleID Class Reference

#include <G4TrackToParticleID.h>

List of all members.

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.

{}
G4TrackToParticleID::~G4TrackToParticleID ( )

Definition at line 24 of file G4TrackToParticleID.cc.

{}

Member Function Documentation

int G4TrackToParticleID::particleID ( const G4Track *  g4trk)

Definition at line 11 of file G4TrackToParticleID.cc.

References LogDebug.

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

{
    int particleID_ = g4trk->GetDefinition()->GetPDGEncoding();
#ifdef DebugLog
    if ( particleID_ > 1000000000 ) {
      LogDebug("SimG4CoreNotification") << "G4TrackToParticleID ion code = " << particleID_ ;
    }
#endif
    if (particleID_ != 0) return particleID_;
    edm::LogWarning("SimG4CoreNotification") << "G4TrackToParticleID: unknown code for track Id = " << g4trk->GetTrackID();
    return -99;
}