CMS 3D CMS Logo

VisG4ExampleSD Class Reference

#include <VisExamples/VisG4ExN02/src/VisG4ExampleSD.h>

List of all members.

Public Member Functions

virtual void Initialize (G4HCofThisEvent *HCE)
virtual bool ProcessHits (G4Step *step, G4TouchableHistory *)
 VisG4ExampleSD (const std::string &name)

Private Attributes

VisG4ExampleHitsCollectionm_hits


Detailed Description

Definition at line 16 of file VisG4ExampleSD.h.


Constructor & Destructor Documentation

VisG4ExampleSD::VisG4ExampleSD ( const std::string &  name  ) 

Definition at line 20 of file VisG4ExampleSD.cc.

00021     : G4VSensitiveDetector (name)
00022 { collectionName.insert ("trackerCollection"); }


Member Function Documentation

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 }


Member Data Documentation

VisG4ExampleHitsCollection* VisG4ExampleSD::m_hits [private]

Definition at line 28 of file VisG4ExampleSD.h.

Referenced by Initialize(), and ProcessHits().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:24 2009 for CMSSW by  doxygen 1.5.4