G4PSTermination Class Reference

#include <G4PSTermination.hh>

Inheritance diagram for G4PSTermination:

G4VPrimitiveScorer G4PSTermination3D

Public Member Functions

 G4PSTermination (G4String name, G4int depth=0)
virtual ~G4PSTermination ()
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 47 of file G4PSTermination.hh.


Constructor & Destructor Documentation

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

Definition at line 43 of file G4PSTermination.cc.

References SetUnit().

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

G4PSTermination::~G4PSTermination (  )  [virtual]

Definition at line 49 of file G4PSTermination.cc.

00050 {;}


Member Function Documentation

void G4PSTermination::clear (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 73 of file G4PSTermination.cc.

00073                            {
00074   EvtMap->clear();
00075 }

void G4PSTermination::DrawAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 77 of file G4PSTermination.cc.

00078 {;}

void G4PSTermination::EndOfEvent ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 70 of file G4PSTermination.cc.

00071 {;}

void G4PSTermination::Initialize ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 63 of file G4PSTermination.cc.

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

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

void G4PSTermination::PrintAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 80 of file G4PSTermination.cc.

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

00081 {
00082   G4cout << " MultiFunctionalDet  " << detector->GetName() << G4endl;
00083   G4cout << " PrimitiveScorer " << GetName() << G4endl;
00084   G4cout << " Number of entries " << EvtMap->entries() << G4endl;
00085   std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin();
00086   for(; itr != EvtMap->GetMap()->end(); itr++) {
00087     G4cout << "  copy no.: " << itr->first
00088            << "  terminations: " << *(itr->second)
00089            << G4endl;
00090   }
00091 }

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

Implements G4VPrimitiveScorer.

Definition at line 52 of file G4PSTermination.cc.

References FALSE, fStopAndKill, G4VPrimitiveScorer::GetIndex(), G4Step::GetPreStepPoint(), G4Step::GetTrack(), G4Track::GetTrackStatus(), G4StepPoint::GetWeight(), and TRUE.

00053 {
00054   if ( aStep->GetTrack()->GetTrackStatus() != fStopAndKill ) return FALSE;
00055 
00056   G4int  index = GetIndex(aStep);
00057   G4double val = 1.0;
00058   if(weighted) val *= aStep->GetPreStepPoint()->GetWeight();
00059   EvtMap->add(index,val);  
00060   return TRUE;
00061 }

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

Reimplemented from G4VPrimitiveScorer.

Definition at line 93 of file G4PSTermination.cc.

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

Referenced by G4PSTermination().

00094 {
00095   if (unit == "" ){
00096     unitName = unit;
00097     unitValue = 1.0;
00098   }else{
00099       G4String msg = "Invalid unit ["+unit+"] (Current  unit is [" +GetUnit()+"] ) for " + GetName();
00100       G4Exception("G4PSTermination::SetUnit","DetPS0017",JustWarning,msg);
00101   }
00102 
00103 }

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

Definition at line 59 of file G4PSTermination.hh.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

00059 { 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