G4PSPopulation Class Reference

#include <G4PSPopulation.hh>

Inheritance diagram for G4PSPopulation:

G4VPrimitiveScorer G4PSPopulation3D

Public Member Functions

 G4PSPopulation (G4String name, G4int depth=0)
virtual ~G4PSPopulation ()
void Weighted (G4bool flg=true)
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 49 of file G4PSPopulation.hh.


Constructor & Destructor Documentation

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

Definition at line 42 of file G4PSPopulation.cc.

References SetUnit().

00043   :G4VPrimitiveScorer(name,depth),HCID(-1),weighted(false)
00044 {
00045     SetUnit("");
00046 }

G4PSPopulation::~G4PSPopulation (  )  [virtual]

Definition at line 48 of file G4PSPopulation.cc.

00049 {;}


Member Function Documentation

void G4PSPopulation::clear (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 77 of file G4PSPopulation.cc.

00077                           {
00078   EvtMap->clear();
00079   fCellTrackLogger.clear();
00080 }

void G4PSPopulation::DrawAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 82 of file G4PSPopulation.cc.

00083 {;}

void G4PSPopulation::EndOfEvent ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 72 of file G4PSPopulation.cc.

00073 {
00074   fCellTrackLogger.clear();
00075 }

void G4PSPopulation::Initialize ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 65 of file G4PSPopulation.cc.

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

00066 {
00067   EvtMap = new G4THitsMap<G4double>(detector->GetName(),GetName());
00068   if(HCID < 0) {HCID = GetCollectionID(0);}
00069   HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap);
00070 }

void G4PSPopulation::PrintAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 85 of file G4PSPopulation.cc.

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

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

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

Implements G4VPrimitiveScorer.

Definition at line 51 of file G4PSPopulation.cc.

References G4TrackLogger::FirstEnterance(), G4VPrimitiveScorer::GetIndex(), G4Step::GetPreStepPoint(), G4Step::GetTrack(), G4Track::GetTrackID(), G4StepPoint::GetWeight(), and TRUE.

00052 {
00053 
00054   G4int index = GetIndex(aStep);
00055   G4TrackLogger& tlog = fCellTrackLogger[index];
00056   if (tlog.FirstEnterance(aStep->GetTrack()->GetTrackID())) {
00057       G4double val = 1.0;
00058       if(weighted) val *= aStep->GetPreStepPoint()->GetWeight();
00059       EvtMap->add(index,val);  
00060   }
00061 
00062   return TRUE;
00063 }

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

Reimplemented from G4VPrimitiveScorer.

Definition at line 99 of file G4PSPopulation.cc.

References G4Exception(), G4VPrimitiveScorer::GetName(), G4VPrimitiveScorer::GetUnit(), JustWarning, G4VPrimitiveScorer::unitName, and G4VPrimitiveScorer::unitValue.

Referenced by G4PSPopulation().

00100 {
00101   if (unit == "" ){
00102     unitName = unit;
00103     unitValue = 1.0;
00104   }else{
00105       G4String msg = "Invalid unit ["+unit+"] (Current  unit is [" +GetUnit()+"] ) for " + GetName();
00106     G4Exception("G4PSPopulation::SetUnit","DetPS0014",JustWarning,msg);
00107   }
00108 
00109 }

void G4PSPopulation::Weighted ( G4bool  flg = true  )  [inline]

Definition at line 61 of file G4PSPopulation.hh.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

00061 { weighted = flg; }


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