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

typedef MCTGen2SimParticleMap::const_iterator G4MCTEvent::genprimary_const_iterator

Definition at line 84 of file G4MCTEvent.hh.

typedef MCTSim2GenParticleMap::const_iterator G4MCTEvent::simprimary_const_iterator

Definition at line 88 of file G4MCTEvent.hh.


Constructor & Destructor Documentation

G4MCTEvent::G4MCTEvent (  ) 

Definition at line 43 of file G4MCTEvent.cc.

References genEvent, and simEvent.

00044   : eventNumber(0)
00046 {
00047   genEvent= new G4MCTGenEvent();  // will be reused.
00048   simEvent= new G4MCTSimEvent();
00049 }

G4MCTEvent::~G4MCTEvent (  )  [virtual]

Definition at line 52 of file G4MCTEvent.cc.

References genEvent, and simEvent.

00054 {
00055   delete genEvent;
00056   delete simEvent;
00057 }

G4MCTEvent::G4MCTEvent ( const G4MCTEvent right  )  [inline]

Definition at line 97 of file G4MCTEvent.hh.

00098 {
00099   *this= right;
00100 }


Member Function Documentation

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

Definition at line 87 of file G4MCTEvent.cc.

References gen2simParticleMap, and sim2genParticleMap.

00090 {
00091   gen2simParticleMap.insert(std::make_pair(const_cast<G4MCTGenParticle&>(genp), 
00092                                            const_cast<G4MCTSimParticle*>(simp)));
00093   sim2genParticleMap.insert(std::make_pair(const_cast<G4MCTSimParticle*>(simp), 
00094                                            const_cast<G4MCTGenParticle&>(genp)));
00095 
00096   return gen2simParticleMap.size();
00097 }

void G4MCTEvent::ClearEvent (  ) 

Definition at line 100 of file G4MCTEvent.cc.

References gen2simParticleMap, genEvent, sim2genParticleMap, and simEvent.

00102 {
00103   gen2simParticleMap.clear();
00104   sim2genParticleMap.clear();
00105 
00106   genEvent-> ClearEvent();
00107   simEvent-> ClearEvent();
00108 }

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

Definition at line 124 of file G4MCTEvent.hh.

References gen2simParticleMap.

00125 { return gen2simParticleMap.begin(); }

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

Definition at line 127 of file G4MCTEvent.hh.

References gen2simParticleMap.

00128 { return gen2simParticleMap.end(); }

int G4MCTEvent::GetEventNumber (  )  const [inline]

Definition at line 116 of file G4MCTEvent.hh.

References eventNumber.

Referenced by G4Pevent::G4Pevent().

00116 { return eventNumber; }

G4MCTGenEvent * G4MCTEvent::GetGenEvent (  )  const [inline]

Definition at line 121 of file G4MCTEvent.hh.

References genEvent.

00121 { return genEvent; }

G4MCTGenParticle G4MCTEvent::GetGenParticle ( const G4MCTSimParticle simpart  )  const

Definition at line 74 of file G4MCTEvent.cc.

00076 {
00077   MCTSim2GenParticleMap::const_iterator 
00078     pos= sim2genParticleMap.find(const_cast<G4MCTSimParticle*>(simpart));
00079   if(pos != sim2genParticleMap.end()) {
00080     return pos-> second;
00081   } else {
00082     return G4MCTGenParticle((void*)0,(void*)0);
00083   }
00084 }

int G4MCTEvent::GetNofPrimaries (  )  const [inline]

Definition at line 118 of file G4MCTEvent.hh.

References gen2simParticleMap.

00119            { return gen2simParticleMap.size(); }

G4MCTSimEvent * G4MCTEvent::GetSimEvent (  )  const [inline]

Definition at line 120 of file G4MCTEvent.hh.

References simEvent.

00120 { return simEvent; }

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

Definition at line 61 of file G4MCTEvent.cc.

00063 {
00064   MCTGen2SimParticleMap::const_iterator pos= gen2simParticleMap.find(genpart);
00065   if(pos != gen2simParticleMap.end()) {
00066     return pos-> second;
00067   } else {
00068     return 0;
00069   }
00070 }

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

Definition at line 102 of file G4MCTEvent.hh.

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

00103 {
00104   eventNumber= right.eventNumber;
00105 
00106   simEvent= right.simEvent; // shallow copy...
00107   genEvent= right.genEvent;
00108 
00109   gen2simParticleMap= right.gen2simParticleMap;
00110   sim2genParticleMap= right.sim2genParticleMap;
00111 
00112   return *this;
00113 }

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

Definition at line 111 of file G4MCTEvent.cc.

References G4endl.

00113 {
00114   ostr << "Event#:" << eventNumber << G4endl;
00115   simEvent-> Print(ostr);
00116 }

void G4MCTEvent::SetEventNumber ( int  n  )  [inline]

Definition at line 115 of file G4MCTEvent.hh.

References eventNumber.

00115 { eventNumber= n; }

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

Definition at line 130 of file G4MCTEvent.hh.

References sim2genParticleMap.

00131 { return sim2genParticleMap.begin(); }

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

Definition at line 133 of file G4MCTEvent.hh.

References sim2genParticleMap.

00134 { return sim2genParticleMap.end(); }


Field Documentation

int G4MCTEvent::eventNumber [protected]

Definition at line 51 of file G4MCTEvent.hh.

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

MCTGen2SimParticleMap G4MCTEvent::gen2simParticleMap [protected]

Definition at line 56 of file G4MCTEvent.hh.

Referenced by AddPrimaryPair(), ClearEvent(), genprimaries_begin(), genprimaries_end(), GetNofPrimaries(), and operator=().

G4MCTGenEvent* G4MCTEvent::genEvent [protected]

Definition at line 52 of file G4MCTEvent.hh.

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

MCTSim2GenParticleMap G4MCTEvent::sim2genParticleMap [protected]

Definition at line 57 of file G4MCTEvent.hh.

Referenced by AddPrimaryPair(), ClearEvent(), operator=(), simprimaries_begin(), and simprimaries_end().

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:
Generated on Mon May 27 17:52:28 2013 for Geant4 by  doxygen 1.4.7