G4PSEnergyDeposit Class Reference

#include <G4PSEnergyDeposit.hh>

Inheritance diagram for G4PSEnergyDeposit:

G4VPrimitiveScorer G4PSEnergyDeposit3D

Public Member Functions

 G4PSEnergyDeposit (G4String name, G4int depth=0)
 G4PSEnergyDeposit (G4String name, const G4String &unit, G4int depth=0)
virtual ~G4PSEnergyDeposit ()
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 *)

Detailed Description

Definition at line 45 of file G4PSEnergyDeposit.hh.


Constructor & Destructor Documentation

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

Definition at line 41 of file G4PSEnergyDeposit.cc.

References SetUnit().

00042   :G4VPrimitiveScorer(name,depth),HCID(-1) 
00043 {
00044   SetUnit("MeV");
00045 }

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

Definition at line 47 of file G4PSEnergyDeposit.cc.

References SetUnit().

00049   :G4VPrimitiveScorer(name,depth),HCID(-1)
00050 {
00051   SetUnit(unit);
00052 }

G4PSEnergyDeposit::~G4PSEnergyDeposit (  )  [virtual]

Definition at line 54 of file G4PSEnergyDeposit.cc.

00055 {;}


Member Function Documentation

void G4PSEnergyDeposit::clear (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 78 of file G4PSEnergyDeposit.cc.

00079 {
00080   EvtMap->clear();
00081 }

void G4PSEnergyDeposit::DrawAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 83 of file G4PSEnergyDeposit.cc.

00084 {;}

void G4PSEnergyDeposit::EndOfEvent ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 75 of file G4PSEnergyDeposit.cc.

00076 {;}

void G4PSEnergyDeposit::Initialize ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 67 of file G4PSEnergyDeposit.cc.

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

00068 {
00069   EvtMap = new G4THitsMap<G4double>(GetMultiFunctionalDetector()->GetName(),
00070                                     GetName());
00071   if(HCID < 0) {HCID = GetCollectionID(0);}
00072   HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap);
00073 }

void G4PSEnergyDeposit::PrintAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 86 of file G4PSEnergyDeposit.cc.

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

00087 {
00088   G4cout << " MultiFunctionalDet  " << detector->GetName() << G4endl;
00089   G4cout << " PrimitiveScorer " << GetName() << G4endl;
00090   G4cout << " Number of entries " << EvtMap->entries() << G4endl;
00091   std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin();
00092   for(; itr != EvtMap->GetMap()->end(); itr++) {
00093     G4cout << "  copy no.: " << itr->first
00094            << "  energy deposit: " 
00095            << *(itr->second)/GetUnitValue()
00096            << " [" << GetUnit()<<"]"
00097            << G4endl;
00098   }
00099 }

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

Implements G4VPrimitiveScorer.

Definition at line 57 of file G4PSEnergyDeposit.cc.

References FALSE, G4VPrimitiveScorer::GetIndex(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetWeight(), and TRUE.

00058 {
00059   G4double edep = aStep->GetTotalEnergyDeposit();
00060   if ( edep == 0. ) return FALSE;
00061   edep *= aStep->GetPreStepPoint()->GetWeight(); // (Particle Weight)
00062   G4int  index = GetIndex(aStep);
00063   EvtMap->add(index,edep);  
00064   return TRUE;
00065 }

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

Reimplemented from G4VPrimitiveScorer.

Definition at line 101 of file G4PSEnergyDeposit.cc.

References G4VPrimitiveScorer::CheckAndSetUnit().

Referenced by G4PSEnergyDeposit(), G4PSEnergyDeposit3D::G4PSEnergyDeposit3D(), and G4ScoreQuantityMessenger::SetNewValue().

00102 {
00103         CheckAndSetUnit(unit,"Energy");
00104 }


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