G4PSDoseDeposit Class Reference

#include <G4PSDoseDeposit.hh>

Inheritance diagram for G4PSDoseDeposit:

G4VPrimitiveScorer G4PSDoseDeposit3D G4PSDoseDepositForCylinder3D

Public Member Functions

 G4PSDoseDeposit (G4String name, G4int depth=0)
 G4PSDoseDeposit (G4String name, const G4String &unit, G4int depth=0)
virtual ~G4PSDoseDeposit ()
virtual void Initialize (G4HCofThisEvent *)
virtual void EndOfEvent (G4HCofThisEvent *)
virtual void clear ()
virtual void DrawAll ()
virtual void PrintAll ()
virtual void SetUnit (const G4String &unit)

Protected Member Functions

virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
virtual G4double ComputeVolume (G4Step *, G4int idx)

Detailed Description

Definition at line 46 of file G4PSDoseDeposit.hh.


Constructor & Destructor Documentation

G4PSDoseDeposit::G4PSDoseDeposit ( G4String  name,
G4int  depth = 0 
)

Definition at line 47 of file G4PSDoseDeposit.cc.

References SetUnit().

00048   :G4VPrimitiveScorer(name,depth),HCID(-1)
00049 {
00050     SetUnit("Gy");
00051 }

G4PSDoseDeposit::G4PSDoseDeposit ( G4String  name,
const G4String unit,
G4int  depth = 0 
)

Definition at line 53 of file G4PSDoseDeposit.cc.

References SetUnit().

00055   :G4VPrimitiveScorer(name,depth),HCID(-1)
00056 {
00057     SetUnit(unit);
00058 }

G4PSDoseDeposit::~G4PSDoseDeposit (  )  [virtual]

Definition at line 60 of file G4PSDoseDeposit.cc.

00061 {;}


Member Function Documentation

void G4PSDoseDeposit::clear (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 93 of file G4PSDoseDeposit.cc.

00094 {
00095   EvtMap->clear();
00096 }

G4double G4PSDoseDeposit::ComputeVolume ( G4Step ,
G4int  idx 
) [protected, virtual]

Reimplemented in G4PSDoseDepositForCylinder3D.

Definition at line 121 of file G4PSDoseDeposit.cc.

References G4VSolid::ComputeDimensions(), G4VPVParameterisation::ComputeSolid(), G4endl, G4Exception(), G4VSolid::GetCubicVolume(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetParameterisation(), G4StepPoint::GetPhysicalVolume(), G4Step::GetPreStepPoint(), G4LogicalVolume::GetSolid(), and JustWarning.

Referenced by ProcessHits().

00121                                                                {
00122 
00123   G4VPhysicalVolume* physVol = aStep->GetPreStepPoint()->GetPhysicalVolume();
00124   G4VPVParameterisation* physParam = physVol->GetParameterisation();
00125   G4VSolid* solid = 0;
00126   if(physParam)
00127   { // for parameterized volume
00128     if(idx<0)
00129     {
00130       G4ExceptionDescription ED;
00131       ED << "Incorrect replica number --- GetReplicaNumber : " << idx << G4endl;
00132       G4Exception("G4PSDoseDeposit::ComputeVolume","DetPS0004",JustWarning,ED);
00133     }
00134     solid = physParam->ComputeSolid(idx, physVol);
00135     solid->ComputeDimensions(physParam,idx,physVol);
00136   }
00137   else
00138   { // for ordinary volume
00139     solid = physVol->GetLogicalVolume()->GetSolid();
00140   }
00141   
00142   return solid->GetCubicVolume();
00143 }

void G4PSDoseDeposit::DrawAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 98 of file G4PSDoseDeposit.cc.

00099 {;}

void G4PSDoseDeposit::EndOfEvent ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 90 of file G4PSDoseDeposit.cc.

00091 {;}

void G4PSDoseDeposit::Initialize ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 82 of file G4PSDoseDeposit.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VPrimitiveScorer::GetCollectionID(), G4VPrimitiveScorer::GetMultiFunctionalDetector(), G4VPrimitiveScorer::GetName(), and G4VSensitiveDetector::GetName().

00083 {
00084   EvtMap = new G4THitsMap<G4double>(GetMultiFunctionalDetector()->GetName(),
00085                                     GetName());
00086   if(HCID < 0) {HCID = GetCollectionID(0);}
00087   HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap);
00088 }

void G4PSDoseDeposit::PrintAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 101 of file G4PSDoseDeposit.cc.

References G4VPrimitiveScorer::detector, G4cout, G4endl, G4VPrimitiveScorer::GetName(), G4VSensitiveDetector::GetName(), G4VPrimitiveScorer::GetUnit(), and G4VPrimitiveScorer::GetUnitValue().

00102 {
00103   G4cout << " MultiFunctionalDet  " << detector->GetName() << G4endl;
00104   G4cout << " PrimitiveScorer " << GetName() << G4endl;
00105   G4cout << " Number of entries " << EvtMap->entries() << G4endl;
00106   std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin();
00107   for(; itr != EvtMap->GetMap()->end(); itr++) {
00108     G4cout << "  copy no.: " << itr->first
00109            << "  dose deposit: " 
00110            << *(itr->second)/GetUnitValue()
00111            << " ["<<GetUnit() <<"]"
00112            << G4endl;
00113   }
00114 }

G4bool G4PSDoseDeposit::ProcessHits ( G4Step ,
G4TouchableHistory  
) [protected, virtual]

Implements G4VPrimitiveScorer.

Definition at line 63 of file G4PSDoseDeposit.cc.

References ComputeVolume(), FALSE, G4Material::GetDensity(), G4VPrimitiveScorer::GetIndex(), G4StepPoint::GetMaterial(), G4Step::GetPreStepPoint(), G4Track::GetStep(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4Step::GetTrack(), G4StepPoint::GetWeight(), G4VPrimitiveScorer::indexDepth, and TRUE.

00064 {
00065   G4double edep = aStep->GetTotalEnergyDeposit();
00066   if ( edep == 0. ) return FALSE;
00067 
00068   G4int idx = ((G4TouchableHistory*)
00069                (aStep->GetPreStepPoint()->GetTouchable()))
00070                ->GetReplicaNumber(indexDepth);
00071   G4double cubicVolume = ComputeVolume(aStep, idx);
00072 
00073 
00074   G4double density = aStep->GetTrack()->GetStep()->GetPreStepPoint()->GetMaterial()->GetDensity();
00075   G4double dose    = edep / ( density * cubicVolume );
00076   dose *= aStep->GetPreStepPoint()->GetWeight(); 
00077   G4int  index = GetIndex(aStep);
00078   EvtMap->add(index,dose);  
00079   return TRUE;
00080 }

void G4PSDoseDeposit::SetUnit ( const G4String unit  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 116 of file G4PSDoseDeposit.cc.

References G4VPrimitiveScorer::CheckAndSetUnit().

Referenced by G4PSDoseDeposit(), and G4PSDoseDeposit3D::G4PSDoseDeposit3D().

00117 {
00118         CheckAndSetUnit(unit,"Dose");
00119 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:02 2013 for Geant4 by  doxygen 1.4.7