#include <VisExamples/VisG4ExN02/src/VisG4ExampleSD.h>
Public Member Functions | |
virtual void | Initialize (G4HCofThisEvent *HCE) |
virtual bool | ProcessHits (G4Step *step, G4TouchableHistory *) |
VisG4ExampleSD (const std::string &name) | |
Private Attributes | |
VisG4ExampleHitsCollection * | m_hits |
Definition at line 16 of file VisG4ExampleSD.h.
VisG4ExampleSD::VisG4ExampleSD | ( | const std::string & | name | ) |
Definition at line 20 of file VisG4ExampleSD.cc.
00021 : G4VSensitiveDetector (name) 00022 { collectionName.insert ("trackerCollection"); }
void VisG4ExampleSD::Initialize | ( | G4HCofThisEvent * | HCE | ) | [virtual] |
Definition at line 25 of file VisG4ExampleSD.cc.
References m_hits.
00026 { 00027 static int HCID = G4SDManager::GetSDMpointer ()->GetCollectionID (collectionName [0]); 00028 m_hits = new VisG4ExampleHitsCollection (SensitiveDetectorName, collectionName [0]); 00029 HCE->AddHitsCollection (HCID, m_hits); 00030 }
bool VisG4ExampleSD::ProcessHits | ( | G4Step * | step, | |
G4TouchableHistory * | ||||
) | [virtual] |
Definition at line 33 of file VisG4ExampleSD.cc.
References m_hits, VisG4ExampleHit::setChamber(), VisG4ExampleHit::setEnergy(), VisG4ExampleHit::setPosition(), and VisG4ExampleHit::setTrackId().
00034 { 00035 if (! step->GetTotalEnergyDeposit ()) 00036 return false; 00037 00038 VisG4ExampleHit *hit = new VisG4ExampleHit; 00039 hit->setTrackId (step->GetTrack ()->GetTrackID ()); 00040 hit->setChamber (step->GetPreStepPoint ()->GetTouchable () 00041 ->GetReplicaNumber ()); 00042 hit->setEnergy (step->GetTotalEnergyDeposit ()); 00043 hit->setPosition (step->GetPostStepPoint ()->GetPosition ()); 00044 00045 m_hits->insert (hit); 00046 return true; 00047 }
VisG4ExampleHitsCollection* VisG4ExampleSD::m_hits [private] |