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

#include <G4MoleculeReactionCounter.hh>

Inheritance diagram for G4MoleculeReactionCounterIndex:

Public Member Functions

 G4MoleculeReactionCounterIndex ()
 G4MoleculeReactionCounterIndex (const G4DNAMolecularReactionData *reaction)
 ~G4MoleculeReactionCounterIndex () override=default
G4bool operator< (G4VMoleculeReactionCounterIndex const &other) const override
G4bool operator== (G4VMoleculeReactionCounterIndex const &other) const override
G4String FormattedReactionString (const G4DNAMolecularReactionData *reactionData) const
G4String GetInfo () const override
const G4DNAMolecularReactionDataGetReactionData () const override
Public Member Functions inherited from G4VMoleculeReactionCounter::G4VMoleculeReactionCounterIndex
virtual ~G4VMoleculeReactionCounterIndex ()=default
virtual G4bool operator< (G4VMoleculeReactionCounterIndex const &) const =0
virtual G4bool operator== (G4VMoleculeReactionCounterIndex const &) const =0

Public Attributes

const G4DNAMolecularReactionDataReactionData

Detailed Description

Definition at line 37 of file G4MoleculeReactionCounter.hh.

Constructor & Destructor Documentation

◆ G4MoleculeReactionCounterIndex() [1/2]

G4MoleculeReactionCounterIndex::G4MoleculeReactionCounterIndex ( )
inline

Definition at line 41 of file G4MoleculeReactionCounter.hh.

41: ReactionData(nullptr) {}
const G4DNAMolecularReactionData * ReactionData

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

◆ G4MoleculeReactionCounterIndex() [2/2]

G4MoleculeReactionCounterIndex::G4MoleculeReactionCounterIndex ( const G4DNAMolecularReactionData * reaction)
inlineexplicit

Definition at line 42 of file G4MoleculeReactionCounter.hh.

42: ReactionData(reaction) {}

◆ ~G4MoleculeReactionCounterIndex()

G4MoleculeReactionCounterIndex::~G4MoleculeReactionCounterIndex ( )
overridedefault

Member Function Documentation

◆ FormattedReactionString()

G4String G4MoleculeReactionCounterIndex::FormattedReactionString ( const G4DNAMolecularReactionData * reactionData) const

Definition at line 32 of file G4MoleculeReactionCounter.cc.

33{
34 const G4MolecularConfiguration* reactant1 = reactionData->GetReactant1();
35 const G4MolecularConfiguration* reactant2 = reactionData->GetReactant2();
36
37 const std::vector<const G4MolecularConfiguration*>* products = reactionData->GetProducts();
38
39 G4String reactionLhs = "";
40 if (reactant1 != nullptr) {
41 reactionLhs += reactant1->GetUserID();
42 if (reactant2 != nullptr) reactionLhs += " + ";
43 }
44 if (reactant2 != nullptr) reactionLhs += reactant2->GetUserID();
45
46 G4String reactionRhs = "";
47 for (auto it = products->cbegin(); it != products->cend(); ++it) {
48 if (*it != nullptr) {
49 if (it != products->cbegin() && reactionRhs.size() > 0) reactionRhs += " + ";
50 reactionRhs += (*it)->GetUserID();
51 }
52 }
53
54 G4String reactionString = reactionLhs + " -> " + reactionRhs;
55
56 return reactionString;
57}
const ReactionProducts * GetProducts() const
const G4String & GetUserID() const

Referenced by GetInfo().

◆ GetInfo()

G4String G4MoleculeReactionCounterIndex::GetInfo ( ) const
inlineoverridevirtual

Implements G4VMoleculeReactionCounter::G4VMoleculeReactionCounterIndex.

Definition at line 55 of file G4MoleculeReactionCounter.hh.

56 {
57 G4String null = "This reaction data is null";
58 if (ReactionData == nullptr)
59 return null;
60 else
62 }
G4String FormattedReactionString(const G4DNAMolecularReactionData *reactionData) const

◆ GetReactionData()

const G4DNAMolecularReactionData * G4MoleculeReactionCounterIndex::GetReactionData ( ) const
inlineoverridevirtual

◆ operator<()

G4bool G4MoleculeReactionCounterIndex::operator< ( G4VMoleculeReactionCounterIndex const & other) const
inlineoverride

Definition at line 45 of file G4MoleculeReactionCounter.hh.

46 {
47 return std::less{}(ReactionData, static_cast<const G4MoleculeReactionCounterIndex&>(other).ReactionData);
48 }

◆ operator==()

G4bool G4MoleculeReactionCounterIndex::operator== ( G4VMoleculeReactionCounterIndex const & other) const
inlineoverride

Definition at line 49 of file G4MoleculeReactionCounter.hh.

50 {
51 return std::equal_to{}(ReactionData, static_cast<const G4MoleculeReactionCounterIndex&>(other).ReactionData);
52 }

Member Data Documentation

◆ ReactionData

const G4DNAMolecularReactionData* G4MoleculeReactionCounterIndex::ReactionData

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