Geant4-11
Public Types | Public Member Functions | Protected Attributes
G4MCTEvent Class Reference

#include <G4MCTEvent.hh>

Public Types

using genprimary_const_iterator = MCTGen2SimParticleMap::const_iterator
 
using simprimary_const_iterator = MCTSim2GenParticleMap::const_iterator
 

Public Member Functions

G4int AddPrimaryPair (const G4MCTGenParticle &genp, const G4MCTSimParticle *simp)
 
void ClearEvent ()
 
 G4MCTEvent ()
 
 G4MCTEvent (const G4MCTEvent &right)
 
genprimary_const_iterator genprimaries_begin () const
 
genprimary_const_iterator genprimaries_end () const
 
G4int GetEventNumber () const
 
G4MCTGenEventGetGenEvent () const
 
G4MCTGenParticle GetGenParticle (const G4MCTSimParticle *simpart) const
 
G4int GetNofPrimaries () const
 
G4MCTSimEventGetSimEvent () const
 
G4MCTSimParticleGetSimParticle (const G4MCTGenParticle &genpart) const
 
G4MCTEventoperator= (const G4MCTEvent &right)
 
void Print (std::ostream &ostr=std::cout) const
 
void SetEventNumber (G4int n)
 
simprimary_const_iterator simprimaries_begin () const
 
simprimary_const_iterator simprimaries_end () const
 
virtual ~G4MCTEvent ()
 

Protected Attributes

G4int eventNumber = 0
 
MCTGen2SimParticleMap gen2simParticleMap
 
G4MCTGenEventgenEvent = nullptr
 
MCTSim2GenParticleMap sim2genParticleMap
 
G4MCTSimEventsimEvent = nullptr
 

Detailed Description

Definition at line 46 of file G4MCTEvent.hh.

Member Typedef Documentation

◆ genprimary_const_iterator

using G4MCTEvent::genprimary_const_iterator = MCTGen2SimParticleMap::const_iterator

Definition at line 74 of file G4MCTEvent.hh.

◆ simprimary_const_iterator

using G4MCTEvent::simprimary_const_iterator = MCTSim2GenParticleMap::const_iterator

Definition at line 78 of file G4MCTEvent.hh.

Constructor & Destructor Documentation

◆ G4MCTEvent() [1/2]

G4MCTEvent::G4MCTEvent ( )

Definition at line 38 of file G4MCTEvent.cc.

39{
40 genEvent = new G4MCTGenEvent(); // will be reused.
41 simEvent = new G4MCTSimEvent();
42}
G4MCTGenEvent * genEvent
Definition: G4MCTEvent.hh:85
G4MCTSimEvent * simEvent
Definition: G4MCTEvent.hh:86

References genEvent, and simEvent.

◆ ~G4MCTEvent()

G4MCTEvent::~G4MCTEvent ( )
virtual

Definition at line 45 of file G4MCTEvent.cc.

46{
47 delete genEvent;
48 delete simEvent;
49}

References genEvent, and simEvent.

◆ G4MCTEvent() [2/2]

G4MCTEvent::G4MCTEvent ( const G4MCTEvent right)
inline

Definition at line 97 of file G4MCTEvent.hh.

97{ *this = right; }

Member Function Documentation

◆ AddPrimaryPair()

G4int G4MCTEvent::AddPrimaryPair ( const G4MCTGenParticle genp,
const G4MCTSimParticle simp 
)

Definition at line 82 of file G4MCTEvent.cc.

84{
85 gen2simParticleMap.insert(std::make_pair(
86 const_cast<G4MCTGenParticle&>(genp), const_cast<G4MCTSimParticle*>(simp)));
87 sim2genParticleMap.insert(std::make_pair(
88 const_cast<G4MCTSimParticle*>(simp), const_cast<G4MCTGenParticle&>(genp)));
89
90 return gen2simParticleMap.size();
91}
std::pair< void *, void * > G4MCTGenParticle
MCTSim2GenParticleMap sim2genParticleMap
Definition: G4MCTEvent.hh:90
MCTGen2SimParticleMap gen2simParticleMap
Definition: G4MCTEvent.hh:89

References gen2simParticleMap, and sim2genParticleMap.

◆ ClearEvent()

void G4MCTEvent::ClearEvent ( )

◆ genprimaries_begin()

G4MCTEvent::genprimary_const_iterator G4MCTEvent::genprimaries_begin ( ) const
inline

Definition at line 139 of file G4MCTEvent.hh.

140{
141 return gen2simParticleMap.cbegin();
142}

References gen2simParticleMap.

◆ genprimaries_end()

G4MCTEvent::genprimary_const_iterator G4MCTEvent::genprimaries_end ( ) const
inline

Definition at line 145 of file G4MCTEvent.hh.

146{
147 return gen2simParticleMap.cend();
148}

References gen2simParticleMap.

◆ GetEventNumber()

G4int G4MCTEvent::GetEventNumber ( ) const
inline

Definition at line 117 of file G4MCTEvent.hh.

118{
119 return eventNumber;
120}
G4int eventNumber
Definition: G4MCTEvent.hh:84

References eventNumber.

Referenced by G4Pevent::G4Pevent().

◆ GetGenEvent()

G4MCTGenEvent * G4MCTEvent::GetGenEvent ( ) const
inline

Definition at line 132 of file G4MCTEvent.hh.

133{
134 return genEvent;
135}

References genEvent.

◆ GetGenParticle()

G4MCTGenParticle G4MCTEvent::GetGenParticle ( const G4MCTSimParticle simpart) const

Definition at line 67 of file G4MCTEvent.cc.

69{
70 auto pos = sim2genParticleMap.find(const_cast<G4MCTSimParticle*>(simpart));
71 if(pos != sim2genParticleMap.cend())
72 {
73 return pos->second;
74 }
75 else
76 {
77 return G4MCTGenParticle((void*) 0, (void*) 0);
78 }
79}
static const G4double pos

References pos, and sim2genParticleMap.

◆ GetNofPrimaries()

G4int G4MCTEvent::GetNofPrimaries ( ) const
inline

Definition at line 122 of file G4MCTEvent.hh.

123{
124 return gen2simParticleMap.size();
125}

References gen2simParticleMap.

◆ GetSimEvent()

G4MCTSimEvent * G4MCTEvent::GetSimEvent ( ) const
inline

Definition at line 127 of file G4MCTEvent.hh.

128{
129 return simEvent;
130}

References simEvent.

◆ GetSimParticle()

G4MCTSimParticle * G4MCTEvent::GetSimParticle ( const G4MCTGenParticle genpart) const

Definition at line 52 of file G4MCTEvent.cc.

54{
55 auto pos = gen2simParticleMap.find(genpart);
56 if(pos != gen2simParticleMap.cend())
57 {
58 return pos->second;
59 }
60 else
61 {
62 return nullptr;
63 }
64}

References gen2simParticleMap, and pos.

◆ operator=()

G4MCTEvent & G4MCTEvent::operator= ( const G4MCTEvent right)
inline

Definition at line 99 of file G4MCTEvent.hh.

100{
101 eventNumber = right.eventNumber;
102
103 simEvent = right.simEvent; // shallow copy...
104 genEvent = right.genEvent;
105
108
109 return *this;
110}

References eventNumber, gen2simParticleMap, genEvent, sim2genParticleMap, and simEvent.

◆ Print()

void G4MCTEvent::Print ( std::ostream &  ostr = std::cout) const

Definition at line 104 of file G4MCTEvent.cc.

105{
106 ostr << "Event#:" << eventNumber << G4endl;
107 simEvent->Print(ostr);
108}
#define G4endl
Definition: G4ios.hh:57
void Print(std::ostream &ostr=std::cout) const

References eventNumber, G4endl, G4MCTSimEvent::Print(), and simEvent.

◆ SetEventNumber()

void G4MCTEvent::SetEventNumber ( G4int  n)
inline

Definition at line 112 of file G4MCTEvent.hh.

113{
114 eventNumber = n;
115}

References eventNumber, and CLHEP::detail::n.

◆ simprimaries_begin()

G4MCTEvent::simprimary_const_iterator G4MCTEvent::simprimaries_begin ( ) const
inline

Definition at line 151 of file G4MCTEvent.hh.

152{
153 return sim2genParticleMap.cbegin();
154}

References sim2genParticleMap.

◆ simprimaries_end()

G4MCTEvent::simprimary_const_iterator G4MCTEvent::simprimaries_end ( ) const
inline

Definition at line 157 of file G4MCTEvent.hh.

158{
159 return sim2genParticleMap.cend();
160}

References sim2genParticleMap.

Field Documentation

◆ eventNumber

G4int G4MCTEvent::eventNumber = 0
protected

Definition at line 84 of file G4MCTEvent.hh.

Referenced by GetEventNumber(), operator=(), Print(), and SetEventNumber().

◆ gen2simParticleMap

MCTGen2SimParticleMap G4MCTEvent::gen2simParticleMap
protected

◆ genEvent

G4MCTGenEvent* G4MCTEvent::genEvent = nullptr
protected

Definition at line 85 of file G4MCTEvent.hh.

Referenced by ClearEvent(), G4MCTEvent(), GetGenEvent(), operator=(), and ~G4MCTEvent().

◆ sim2genParticleMap

MCTSim2GenParticleMap G4MCTEvent::sim2genParticleMap
protected

◆ simEvent

G4MCTSimEvent* G4MCTEvent::simEvent = nullptr
protected

Definition at line 86 of file G4MCTEvent.hh.

Referenced by ClearEvent(), G4MCTEvent(), GetSimEvent(), operator=(), Print(), and ~G4MCTEvent().


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