CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
StepID Class Reference

#include <G4StepStatistics.h>

Public Member Functions

G4int GetParticlePDGID () const
 
G4String GetProcessName () const
 
G4String GetRegionName () const
 
bool operator< (const StepID &id) const
 
bool operator== (const StepID &id) const
 
bool operator> (const StepID &id) const
 
 StepID (const G4Step *theG4Step)
 

Private Attributes

G4String theG4ProcessName
 
G4String theG4RegionName
 
G4int theParticlePDGID
 

Detailed Description

Definition at line 56 of file G4StepStatistics.h.

Constructor & Destructor Documentation

◆ StepID()

StepID::StepID ( const G4Step *  theG4Step)
inline

Definition at line 67 of file G4StepStatistics.h.

68  : theG4RegionName("UNDEFINED"),
69  theG4ProcessName("UNDEFINED"),
70  theParticlePDGID(theG4Step->GetTrack()->GetDefinition()->GetPDGEncoding()) {
71  std::cout << "Start" << std::endl;
72  if (theG4Step->GetPreStepPoint()->GetPhysicalVolume()) {
73  theG4RegionName = theG4Step->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetName();
74  }
75  std::cout << "Physical Volume" << std::endl;
76  if (theG4Step->GetPreStepPoint()->GetProcessDefinedStep()) {
77  theG4ProcessName = theG4Step->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
78  }
79  std::cout << "Process Name" << std::endl;
80  }

References gather_cfg::cout, theG4ProcessName, and theG4RegionName.

Member Function Documentation

◆ GetParticlePDGID()

G4int StepID::GetParticlePDGID ( ) const
inline

Definition at line 85 of file G4StepStatistics.h.

85 { return theParticlePDGID; }

References theParticlePDGID.

Referenced by operator<(), operator==(), operator>(), and G4StepStatistics::update().

◆ GetProcessName()

G4String StepID::GetProcessName ( ) const
inline

Definition at line 84 of file G4StepStatistics.h.

84 { return theG4ProcessName; }

References theG4ProcessName.

Referenced by operator<(), operator==(), operator>(), and G4StepStatistics::update().

◆ GetRegionName()

G4String StepID::GetRegionName ( ) const
inline

Definition at line 83 of file G4StepStatistics.h.

83 { return theG4RegionName; }

References theG4RegionName.

Referenced by operator<(), operator==(), operator>(), and G4StepStatistics::update().

◆ operator<()

bool StepID::operator< ( const StepID id) const
inline

Definition at line 95 of file G4StepStatistics.h.

95  {
96  if (theParticlePDGID != id.GetParticlePDGID()) {
97  return (theParticlePDGID > id.GetParticlePDGID());
98  } else if (strcmp(theG4RegionName, id.GetRegionName()) != 0) {
99  return strcmp(theG4RegionName, id.GetRegionName()) > 0 ? true : false;
100  } else if (strcmp(theG4ProcessName, id.GetProcessName()) != 0) {
101  return strcmp(theG4ProcessName, id.GetProcessName()) > 0 ? true : false;
102  } else { // The case in which they are all equal!
103  return false;
104  }
105  }

References GetParticlePDGID(), GetProcessName(), GetRegionName(), theG4ProcessName, theG4RegionName, theParticlePDGID, and funct::true.

◆ operator==()

bool StepID::operator== ( const StepID id) const
inline

Definition at line 88 of file G4StepStatistics.h.

88  {
89  return (strcmp(theG4RegionName, id.GetRegionName()) == 0 && strcmp(theG4ProcessName, id.GetProcessName()) == 0 &&
91  ? true
92  : false;
93  }

References GetParticlePDGID(), GetProcessName(), GetRegionName(), theG4ProcessName, theG4RegionName, theParticlePDGID, and funct::true.

◆ operator>()

bool StepID::operator> ( const StepID id) const
inline

Definition at line 107 of file G4StepStatistics.h.

107  {
108  if (theParticlePDGID != id.GetParticlePDGID()) {
109  return (theParticlePDGID < id.GetParticlePDGID());
110  } else if (strcmp(theG4RegionName, id.GetRegionName()) != 0) {
111  return strcmp(theG4RegionName, id.GetRegionName()) < 0 ? true : false;
112  } else if (strcmp(theG4ProcessName, id.GetProcessName()) != 0) {
113  return strcmp(theG4ProcessName, id.GetProcessName()) < 0 ? true : false;
114  } else { // The case in which they are all equal!
115  return false;
116  }
117  }

References GetParticlePDGID(), GetProcessName(), GetRegionName(), theG4ProcessName, theG4RegionName, theParticlePDGID, and funct::true.

Member Data Documentation

◆ theG4ProcessName

G4String StepID::theG4ProcessName
private

Definition at line 61 of file G4StepStatistics.h.

Referenced by GetProcessName(), operator<(), operator==(), operator>(), and StepID().

◆ theG4RegionName

G4String StepID::theG4RegionName
private

Definition at line 59 of file G4StepStatistics.h.

Referenced by GetRegionName(), operator<(), operator==(), operator>(), and StepID().

◆ theParticlePDGID

G4int StepID::theParticlePDGID
private

Definition at line 63 of file G4StepStatistics.h.

Referenced by GetParticlePDGID(), operator<(), operator==(), and operator>().

StepID::GetProcessName
G4String GetProcessName() const
Definition: G4StepStatistics.h:84
gather_cfg.cout
cout
Definition: gather_cfg.py:144
StepID::theG4RegionName
G4String theG4RegionName
Definition: G4StepStatistics.h:59
funct::true
true
Definition: Factorize.h:173
StepID::GetParticlePDGID
G4int GetParticlePDGID() const
Definition: G4StepStatistics.h:85
StepID::GetRegionName
G4String GetRegionName() const
Definition: G4StepStatistics.h:83
StepID::theG4ProcessName
G4String theG4ProcessName
Definition: G4StepStatistics.h:61
StepID::theParticlePDGID
G4int theParticlePDGID
Definition: G4StepStatistics.h:63