CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/SimG4Core/Notification/src/G4TrackToParticleID.cc

Go to the documentation of this file.
00001 #include "SimG4Core/Notification/interface/G4TrackToParticleID.h"
00002 
00003 #include "G4Track.hh"
00004 
00005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00006 
00007 //#define DebugLog
00008 
00009 G4TrackToParticleID::G4TrackToParticleID() {}
00010 
00011 int G4TrackToParticleID::particleID(const G4Track * g4trk)
00012 {
00013     int particleID_ = g4trk->GetDefinition()->GetPDGEncoding();
00014 #ifdef DebugLog
00015     if ( particleID_ > 1000000000 ) {
00016       LogDebug("SimG4CoreNotification") << "G4TrackToParticleID ion code = " << particleID_ ;
00017     }
00018 #endif
00019     if (particleID_ != 0) return particleID_;
00020     edm::LogWarning("SimG4CoreNotification") << "G4TrackToParticleID: unknown code for track Id = " << g4trk->GetTrackID();
00021     return -99;
00022 }
00023 
00024 G4TrackToParticleID::~G4TrackToParticleID() {}