Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
comparator Struct Reference

#include <G4MolecularConfiguration.hh>

Public Member Functions

bool operator() (const G4ElectronOccupancy &occ1, const G4ElectronOccupancy &occ2) const
 

Detailed Description

Definition at line 61 of file G4MolecularConfiguration.hh.

Member Function Documentation

◆ operator()()

bool comparator::operator() ( const G4ElectronOccupancy & occ1,
const G4ElectronOccupancy & occ2 ) const
inline

Definition at line 63 of file G4MolecularConfiguration.hh.

65 {
66 G4int totalOcc1 = occ1.GetTotalOccupancy();
67 G4int totalOcc2 = occ2.GetTotalOccupancy();
68 if (totalOcc1 != totalOcc2)
69 {
70 return totalOcc1 < totalOcc2;
71 }
72
73 G4int occupancy1 = -1;
74 G4int occupancy2 = -1;
75 const G4int sizeOrbit = occ1.GetSizeOfOrbit();
76 for (G4int i = 0; i < sizeOrbit; i++)
77 {
78 occupancy1 = occ1.GetOccupancy(i);
79 occupancy2 = occ2.GetOccupancy(i);
80
81 if (occupancy1 != occupancy2)
82 {
83 return occupancy1 < occupancy2;
84 }
85 }
86
87 return false;
88 }
int G4int
Definition G4Types.hh:85
G4int GetOccupancy(G4int orbit) const

The documentation for this struct was generated from the following file: