Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNAEventSet Class Reference

#include <G4DNAEventSet.hh>

+ Inheritance diagram for G4DNAEventSet:

Public Types

using Index = G4VDNAMesh::Index
 
using EventSet = std::set< std::unique_ptr< Event >, comparatorEventSet >
 
using EventMap = std::unordered_map< Index, EventSet::iterator, G4VDNAMesh::hashFunc >
 

Public Member Functions

 G4DNAEventSet ()
 
virtual ~G4DNAEventSet ()
 
void CreateEvent (const G4double &time, const Index &index, Event::ReactionData *pReactionData)
 
void CreateEvent (const G4double &time, const Index &index, std::unique_ptr< Event::JumpingData > jum)
 
void AddEvent (std::unique_ptr< Event > pEvent)
 
void RemoveEventSet ()
 
void RemoveEventOfVoxel (const Index &key)
 
EventSet::iterator end ()
 
EventSet::iterator begin ()
 
EventSet::reverse_iterator rend ()
 
EventSet::reverse_iterator rbegin ()
 
EventSet::const_iterator end () const
 
EventSet::const_iterator begin () const
 
size_t size ()
 
G4bool Empty ()
 
void RemoveEvent (EventSet::iterator iter)
 
void PrintEventSet ()
 
- Public Member Functions inherited from IEventSet
 IEventSet ()=default
 
 ~IEventSet ()=default
 

Detailed Description

Definition at line 78 of file G4DNAEventSet.hh.

Member Typedef Documentation

◆ EventMap

using G4DNAEventSet::EventMap = std::unordered_map<Index, EventSet::iterator,G4VDNAMesh::hashFunc>

Definition at line 83 of file G4DNAEventSet.hh.

◆ EventSet

using G4DNAEventSet::EventSet = std::set<std::unique_ptr<Event>, comparatorEventSet>

Definition at line 82 of file G4DNAEventSet.hh.

◆ Index

Definition at line 81 of file G4DNAEventSet.hh.

Constructor & Destructor Documentation

◆ G4DNAEventSet()

G4DNAEventSet::G4DNAEventSet ( )

Definition at line 71 of file G4DNAEventSet.cc.

72 : fEventSet(comparatorEventSet())
73{}

◆ ~G4DNAEventSet()

G4DNAEventSet::~G4DNAEventSet ( )
virtual

Definition at line 116 of file G4DNAEventSet.cc.

116{ RemoveEventSet(); }
void RemoveEventSet()

Member Function Documentation

◆ AddEvent()

void G4DNAEventSet::AddEvent ( std::unique_ptr< Event pEvent)

Definition at line 105 of file G4DNAEventSet.cc.

106{
107 // idea is no 2 events in one key (or index)
108 auto key = pEvent->GetIndex();
110 auto it = fEventSet.emplace(std::move(pEvent));
111 fEventMap[key] = std::get<0>(it);
112}
void RemoveEventOfVoxel(const Index &key)

Referenced by CreateEvent().

◆ begin() [1/2]

EventSet::iterator G4DNAEventSet::begin ( )
inline

Definition at line 101 of file G4DNAEventSet.hh.

101{ return fEventSet.begin(); }

◆ begin() [2/2]

EventSet::const_iterator G4DNAEventSet::begin ( ) const
inline

Definition at line 106 of file G4DNAEventSet.hh.

106{ return fEventSet.begin(); }

◆ CreateEvent() [1/2]

void G4DNAEventSet::CreateEvent ( const G4double time,
const Index index,
Event::ReactionData pReactionData 
)

Definition at line 75 of file G4DNAEventSet.cc.

77{
78 auto pEvent = std::make_unique<Event>(time, index, pReactionData);
79 AddEvent(std::move(pEvent));
80}
void AddEvent(std::unique_ptr< Event > pEvent)

Referenced by G4DNAGillespieDirectMethod::CreateEvent().

◆ CreateEvent() [2/2]

void G4DNAEventSet::CreateEvent ( const G4double time,
const Index index,
std::unique_ptr< Event::JumpingData jum 
)

Definition at line 82 of file G4DNAEventSet.cc.

84{
85 auto pEvent = std::make_unique<Event>(time, index, std::move(jum));
86 AddEvent(std::move(pEvent));
87}

◆ Empty()

G4bool G4DNAEventSet::Empty ( )
inline

Definition at line 108 of file G4DNAEventSet.hh.

108{ return fEventSet.empty(); }

◆ end() [1/2]

EventSet::iterator G4DNAEventSet::end ( )
inline

Definition at line 100 of file G4DNAEventSet.hh.

100{ return fEventSet.end(); }

◆ end() [2/2]

EventSet::const_iterator G4DNAEventSet::end ( ) const
inline

Definition at line 105 of file G4DNAEventSet.hh.

105{ return fEventSet.end(); }

◆ PrintEventSet()

void G4DNAEventSet::PrintEventSet ( )

Definition at line 118 of file G4DNAEventSet.cc.

119{
120 G4cout<<G4endl;
121 G4cout << "*****************************************************" << G4endl;
122 G4cout << "G4DNAEventSet::PrintEventSet() of : "<< this->size()<<" events "<< G4endl;
123 for(const auto& it : fEventSet)
124 {
125 (*it).PrintEvent();
126 }
127 G4cout << "End PrintEventSet()" << G4endl;
128 G4cout << "*****************************************************" << G4endl;
129 G4cout << G4endl;
130}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ rbegin()

EventSet::reverse_iterator G4DNAEventSet::rbegin ( )
inline

Definition at line 104 of file G4DNAEventSet.hh.

104{ return fEventSet.rbegin(); }

◆ RemoveEvent()

void G4DNAEventSet::RemoveEvent ( EventSet::iterator  iter)

Definition at line 99 of file G4DNAEventSet.cc.

100{
101 auto index = (*iter)->GetIndex();
102 RemoveEventOfVoxel(index);
103}

◆ RemoveEventOfVoxel()

void G4DNAEventSet::RemoveEventOfVoxel ( const Index key)

Definition at line 89 of file G4DNAEventSet.cc.

90{
91 auto it = fEventMap.find(key);
92 if(it != fEventMap.end())
93 {
94 fEventSet.erase(it->second);
95 fEventMap.erase(it);
96 }
97}

Referenced by AddEvent(), and RemoveEvent().

◆ RemoveEventSet()

void G4DNAEventSet::RemoveEventSet ( )
inline

Definition at line 93 of file G4DNAEventSet.hh.

94 {
95 fEventSet.clear();
96 fEventMap.clear();
97 }

Referenced by ~G4DNAEventSet().

◆ rend()

EventSet::reverse_iterator G4DNAEventSet::rend ( )
inline

Definition at line 103 of file G4DNAEventSet.hh.

103{ return fEventSet.rend(); }

◆ size()

size_t G4DNAEventSet::size ( )
inline

Definition at line 107 of file G4DNAEventSet.hh.

107{ return fEventSet.size(); }

Referenced by PrintEventSet().


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