musrShieldSD Class Reference

#include <musrShieldSD.hh>

List of all members.

Public Member Functions

 musrShieldSD (G4String)
 The Shield sensitive detector.
 ~musrShieldSD ()
void Initialize (G4HCofThisEvent *)
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
void EndOfEvent (G4HCofThisEvent *)


Detailed Description

Definition at line 14 of file musrShieldSD.hh.


Constructor & Destructor Documentation

musrShieldSD::musrShieldSD G4String  name  ) 
 

The Shield sensitive detector.

This object collects the information of a particle's interaction with this part of the geometry

Definition at line 17 of file musrShieldSD.cc.

00018 :G4VSensitiveDetector(name)
00019 {
00020   G4String HCname;
00021   collectionName.insert(HCname="shieldCollection");
00022 }

musrShieldSD::~musrShieldSD  ) 
 

Definition at line 26 of file musrShieldSD.cc.

00026 { }


Member Function Documentation

void musrShieldSD::EndOfEvent G4HCofThisEvent *   ) 
 

Definition at line 71 of file musrShieldSD.cc.

00072 {
00073   if (verboseLevel>0) { 
00074      G4int NbHits = shieldCollection->entries();
00075      G4cout << "\n-------->Hits Collection: in this event they are " << NbHits 
00076             << " hits: " << G4endl;
00077      for (G4int i=0;i<NbHits;i++) (*shieldCollection)[i]->Print();
00078     } 
00079 }

void musrShieldSD::Initialize G4HCofThisEvent *   ) 
 

Definition at line 30 of file musrShieldSD.cc.

00031 {
00032   shieldCollection = new musrShieldHitsCollection
00033                           (SensitiveDetectorName,collectionName[0]); 
00034   static G4int HCID = -1;
00035   if(HCID<0)
00036   { HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
00037   HCE->AddHitsCollection( HCID, shieldCollection ); 
00038 }

G4bool musrShieldSD::ProcessHits G4Step *  aStep,
G4TouchableHistory * 
 

Collect the information regarding the interaction of a particle and the sensitive detector.

Definition at line 42 of file musrShieldSD.cc.

References musrShieldHit::Draw(), musrShieldHit::Print(), musrShieldHit::SetEdep(), musrShieldHit::SetLogVolName(), musrShieldHit::SetParticleName(), musrShieldHit::SetPol(), musrShieldHit::SetPos(), and musrShieldHit::SetTrackID().

00043 {
00048   G4double edep = aStep->GetTotalEnergyDeposit();
00049 
00050   if(edep==0.) return false;
00051 
00052   musrShieldHit* newHit = new musrShieldHit();
00053   newHit->SetParticleName (aStep->GetTrack()->GetDefinition()->GetParticleName());
00054   newHit->SetTrackID  (aStep->GetTrack()->GetTrackID());
00055   newHit->SetEdep     (edep);
00056   newHit->SetPos      (aStep->GetPostStepPoint()->GetPosition());
00057   newHit->SetPol      (aStep->GetTrack()->GetPolarization());
00058   newHit->SetLogVolName (aStep->GetTrack()->GetVolume()->GetLogicalVolume()->GetName());
00059   shieldCollection->insert( newHit );
00060   
00061   newHit->Print();
00062   newHit->Draw();
00063 
00064 
00065 
00066   return true;
00067 }


The documentation for this class was generated from the following files:
Generated on Mon Mar 27 12:19:54 2006 for MUSR by  doxygen 1.4.6