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

#include <G4MCTEvent.hh>

Public Types

typedef MCTGen2SimParticleMap::const_iterator genprimary_const_iterator
 
typedef MCTSim2GenParticleMap::const_iterator simprimary_const_iterator
 

Public Member Functions

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

Protected Attributes

int eventNumber
 
G4MCTGenEventgenEvent
 
G4MCTSimEventsimEvent
 
MCTGen2SimParticleMap gen2simParticleMap
 
MCTSim2GenParticleMap sim2genParticleMap
 

Detailed Description

Definition at line 49 of file G4MCTEvent.hh.

Member Typedef Documentation

◆ genprimary_const_iterator

typedef MCTGen2SimParticleMap::const_iterator G4MCTEvent::genprimary_const_iterator

Definition at line 84 of file G4MCTEvent.hh.

◆ simprimary_const_iterator

typedef MCTSim2GenParticleMap::const_iterator G4MCTEvent::simprimary_const_iterator

Definition at line 88 of file G4MCTEvent.hh.

Constructor & Destructor Documentation

◆ G4MCTEvent() [1/2]

G4MCTEvent::G4MCTEvent ( )

Definition at line 43 of file G4MCTEvent.cc.

44 : eventNumber(0)
45////////////////////
46{
47 genEvent= new G4MCTGenEvent(); // will be reused.
49}
G4MCTGenEvent * genEvent
Definition: G4MCTEvent.hh:52
int eventNumber
Definition: G4MCTEvent.hh:51
G4MCTSimEvent * simEvent
Definition: G4MCTEvent.hh:53

◆ ~G4MCTEvent()

G4MCTEvent::~G4MCTEvent ( )
virtual

Definition at line 52 of file G4MCTEvent.cc.

54{
55 delete genEvent;
56 delete simEvent;
57}

◆ G4MCTEvent() [2/2]

G4MCTEvent::G4MCTEvent ( const G4MCTEvent right)
inline

Definition at line 97 of file G4MCTEvent.hh.

98{
99 *this= right;
100}

Member Function Documentation

◆ AddPrimaryPair()

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

Definition at line 87 of file G4MCTEvent.cc.

90{
91 gen2simParticleMap.insert(std::make_pair(const_cast<G4MCTGenParticle&>(genp),
92 const_cast<G4MCTSimParticle*>(simp)));
93 sim2genParticleMap.insert(std::make_pair(const_cast<G4MCTSimParticle*>(simp),
94 const_cast<G4MCTGenParticle&>(genp)));
95
96 return gen2simParticleMap.size();
97}
std::pair< void *, void * > G4MCTGenParticle
MCTSim2GenParticleMap sim2genParticleMap
Definition: G4MCTEvent.hh:57
MCTGen2SimParticleMap gen2simParticleMap
Definition: G4MCTEvent.hh:56

◆ ClearEvent()

void G4MCTEvent::ClearEvent ( )

Definition at line 100 of file G4MCTEvent.cc.

102{
103 gen2simParticleMap.clear();
104 sim2genParticleMap.clear();
105
108}
void ClearEvent()
Definition: G4MCTEvent.cc:100

Referenced by ClearEvent().

◆ genprimaries_begin()

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

Definition at line 124 of file G4MCTEvent.hh.

125{ return gen2simParticleMap.begin(); }

◆ genprimaries_end()

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

Definition at line 127 of file G4MCTEvent.hh.

128{ return gen2simParticleMap.end(); }

◆ GetEventNumber()

int G4MCTEvent::GetEventNumber ( ) const
inline

Definition at line 116 of file G4MCTEvent.hh.

116{ return eventNumber; }

Referenced by G4Pevent::G4Pevent().

◆ GetGenEvent()

G4MCTGenEvent * G4MCTEvent::GetGenEvent ( ) const
inline

Definition at line 121 of file G4MCTEvent.hh.

121{ return genEvent; }

◆ GetGenParticle()

G4MCTGenParticle G4MCTEvent::GetGenParticle ( const G4MCTSimParticle simpart) const

Definition at line 73 of file G4MCTEvent.cc.

76{
77 MCTSim2GenParticleMap::const_iterator
78 pos= sim2genParticleMap.find(const_cast<G4MCTSimParticle*>(simpart));
79 if(pos != sim2genParticleMap.end()) {
80 return pos-> second;
81 } else {
82 return G4MCTGenParticle((void*)0,(void*)0);
83 }
84}

◆ GetNofPrimaries()

int G4MCTEvent::GetNofPrimaries ( ) const
inline

Definition at line 118 of file G4MCTEvent.hh.

119 { return gen2simParticleMap.size(); }

◆ GetSimEvent()

G4MCTSimEvent * G4MCTEvent::GetSimEvent ( ) const
inline

Definition at line 120 of file G4MCTEvent.hh.

120{ return simEvent; }

◆ GetSimParticle()

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

Definition at line 60 of file G4MCTEvent.cc.

63{
64 MCTGen2SimParticleMap::const_iterator pos= gen2simParticleMap.find(genpart);
65 if(pos != gen2simParticleMap.end()) {
66 return pos-> second;
67 } else {
68 return 0;
69 }
70}

◆ operator=()

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

Definition at line 102 of file G4MCTEvent.hh.

103{
105
106 simEvent= right.simEvent; // shallow copy...
107 genEvent= right.genEvent;
108
111
112 return *this;
113}

◆ Print()

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

Definition at line 111 of file G4MCTEvent.cc.

113{
114 ostr << "Event#:" << eventNumber << G4endl;
115 simEvent-> Print(ostr);
116}
#define G4endl
Definition: G4ios.hh:52
void Print(std::ostream &ostr=std::cout) const
Definition: G4MCTEvent.cc:111

◆ SetEventNumber()

void G4MCTEvent::SetEventNumber ( int  n)
inline

Definition at line 115 of file G4MCTEvent.hh.

◆ simprimaries_begin()

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

Definition at line 130 of file G4MCTEvent.hh.

131{ return sim2genParticleMap.begin(); }

◆ simprimaries_end()

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

Definition at line 133 of file G4MCTEvent.hh.

134{ return sim2genParticleMap.end(); }

Member Data Documentation

◆ eventNumber

int G4MCTEvent::eventNumber
protected

Definition at line 51 of file G4MCTEvent.hh.

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

◆ gen2simParticleMap

MCTGen2SimParticleMap G4MCTEvent::gen2simParticleMap
protected

◆ genEvent

G4MCTGenEvent* G4MCTEvent::genEvent
protected

Definition at line 52 of file G4MCTEvent.hh.

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

◆ sim2genParticleMap

MCTSim2GenParticleMap G4MCTEvent::sim2genParticleMap
protected

◆ simEvent

G4MCTSimEvent* G4MCTEvent::simEvent
protected

Definition at line 53 of file G4MCTEvent.hh.

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


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