CMS 3D CMS Logo

List of all members | Static Public Member Functions
G4TrackToParticleID Class Reference

#include <G4TrackToParticleID.h>

Static Public Member Functions

static bool isGammaElectronPositron (int pdgCode)
 
static bool isGammaElectronPositron (const G4Track *)
 
static bool isMuon (int pdgCode)
 
static bool isMuon (const G4Track *)
 
static bool isStableHadron (int pdgCode)
 
static bool isStableHadronIon (const G4Track *)
 
static int particleID (const G4Track *)
 
static int particleID (const G4PrimaryParticle *, const int id)
 

Detailed Description

Definition at line 7 of file G4TrackToParticleID.h.

Member Function Documentation

◆ isGammaElectronPositron() [1/2]

bool G4TrackToParticleID::isGammaElectronPositron ( int  pdgCode)
static

◆ isGammaElectronPositron() [2/2]

bool G4TrackToParticleID::isGammaElectronPositron ( const G4Track *  g4trk)
static

Definition at line 32 of file G4TrackToParticleID.cc.

References funct::abs().

32  {
33  int pdg = std::abs(g4trk->GetDefinition()->GetPDGEncoding());
34  return (pdg == 11 || pdg == 22);
35 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isMuon() [1/2]

bool G4TrackToParticleID::isMuon ( int  pdgCode)
static

Definition at line 37 of file G4TrackToParticleID.cc.

References funct::abs().

Referenced by HCalSD::getEnergyDeposit(), and HCalSD::getFromLibrary().

37 { return (std::abs(pdgCode) == 13); }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isMuon() [2/2]

bool G4TrackToParticleID::isMuon ( const G4Track *  g4trk)
static

Definition at line 39 of file G4TrackToParticleID.cc.

References funct::abs().

39  {
40  return (std::abs(g4trk->GetDefinition()->GetPDGEncoding()) == 13);
41 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isStableHadron()

bool G4TrackToParticleID::isStableHadron ( int  pdgCode)
static

Definition at line 43 of file G4TrackToParticleID.cc.

References funct::abs().

Referenced by HFShowerLibrary::fillHits().

43  {
44  // pi+-, p, pbar, n, nbar, KL, K+-, light ions and anti-ions
45  int pdg = std::abs(pdgCode);
46  return (pdg == 211 || pdg == 2212 || pdg == 2112 || pdg == 130 || pdg == 321 || pdg == 1000010020 ||
47  pdg == 1000010030 || pdg == 1000020030 || pdg == 1000020040);
48 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isStableHadronIon()

bool G4TrackToParticleID::isStableHadronIon ( const G4Track *  g4trk)
static

Definition at line 50 of file G4TrackToParticleID.cc.

References funct::abs().

Referenced by CastorSD::getEnergyDeposit(), CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), and CastorShowerLibrary::getShowerHits().

50  {
51  // pi+-, p, pbar, n, nbar, KL, K+-, light ion and anti-ion, generic ion
52  int pdg = std::abs(g4trk->GetDefinition()->GetPDGEncoding());
53  return (pdg == 211 || pdg == 2212 || pdg == 2112 || pdg == 130 || pdg == 321 || pdg == 1000010020 ||
54  pdg == 1000010030 || pdg == 1000020030 || pdg == 1000020040 || g4trk->GetDefinition()->IsGeneralIon());
55 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ particleID() [1/2]

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

Definition at line 8 of file G4TrackToParticleID.cc.

References dileptonTrigSettings_cff::pdg.

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

8  {
9  int pdg = g4trk->GetDefinition()->GetPDGEncoding();
10  if (0 == pdg) {
11  edm::LogWarning("SimG4CoreNotification")
12  << "G4TrackToParticleID: unknown code 0 for trackId=" << g4trk->GetTrackID();
13  pdg = -99;
14  }
15  return pdg;
16 }
Log< level::Warning, false > LogWarning

◆ particleID() [2/2]

int G4TrackToParticleID::particleID ( const G4PrimaryParticle *  ptr,
const int  id 
)
static

Definition at line 18 of file G4TrackToParticleID.cc.

References EcalPhiSymFlatTableProducers_cfi::id, and dileptonTrigSettings_cff::pdg.

18  {
19  int pdg = ptr->GetPDGcode();
20  if (0 == pdg) {
21  edm::LogWarning("SimG4CoreNotification") << "G4TrackToParticleID: unknown code 0 for trackId=" << id;
22  pdg = -99;
23  }
24  return pdg;
25 }
Log< level::Warning, false > LogWarning