#include <G4PSNofCollision.hh>
Inheritance diagram for G4PSNofCollision:
Public Member Functions | |
G4PSNofCollision (G4String name, G4int depth=0) | |
virtual | ~G4PSNofCollision () |
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 *) |
Definition at line 47 of file G4PSNofCollision.hh.
Definition at line 42 of file G4PSNofCollision.cc.
References SetUnit().
00043 :G4VPrimitiveScorer(name,depth),HCID(-1),weighted(false) 00044 { 00045 SetUnit(""); 00046 }
G4PSNofCollision::~G4PSNofCollision | ( | ) | [virtual] |
void G4PSNofCollision::clear | ( | ) | [virtual] |
void G4PSNofCollision::DrawAll | ( | ) | [virtual] |
void G4PSNofCollision::EndOfEvent | ( | G4HCofThisEvent * | ) | [virtual] |
void G4PSNofCollision::Initialize | ( | G4HCofThisEvent * | ) | [virtual] |
Reimplemented from G4VPrimitiveScorer.
Definition at line 62 of file G4PSNofCollision.cc.
References G4HCofThisEvent::AddHitsCollection(), G4VPrimitiveScorer::detector, G4VPrimitiveScorer::GetCollectionID(), G4VPrimitiveScorer::GetName(), and G4VSensitiveDetector::GetName().
00063 { 00064 EvtMap = new G4THitsMap<G4double>(detector->GetName(),GetName()); 00065 if(HCID < 0) {HCID = GetCollectionID(0);} 00066 HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap); 00067 }
void G4PSNofCollision::PrintAll | ( | ) | [virtual] |
Reimplemented from G4VPrimitiveScorer.
Definition at line 79 of file G4PSNofCollision.cc.
References G4VPrimitiveScorer::detector, G4cout, G4endl, G4VPrimitiveScorer::GetName(), G4VSensitiveDetector::GetName(), and G4VPrimitiveScorer::GetUnitValue().
00080 { 00081 G4cout << " MultiFunctionalDet " << detector->GetName() << G4endl; 00082 G4cout << " PrimitiveScorer " << GetName() << G4endl; 00083 G4cout << " Number of entries " << EvtMap->entries() << G4endl; 00084 std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin(); 00085 for(; itr != EvtMap->GetMap()->end(); itr++) { 00086 G4cout << " copy no.: " << itr->first 00087 << " collisions: " << *(itr->second)/GetUnitValue() 00088 << " [collision] " 00089 << G4endl; 00090 } 00091 }
G4bool G4PSNofCollision::ProcessHits | ( | G4Step * | , | |
G4TouchableHistory * | ||||
) | [protected, virtual] |
Implements G4VPrimitiveScorer.
Definition at line 51 of file G4PSNofCollision.cc.
References fGeomBoundary, G4VPrimitiveScorer::GetIndex(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetStepStatus(), G4StepPoint::GetWeight(), and TRUE.
00052 { 00053 if ( aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary ) return TRUE; 00054 00055 G4int index = GetIndex(aStep); 00056 G4double val = 1.0; 00057 if(weighted) val *= aStep->GetPreStepPoint()->GetWeight(); 00058 EvtMap->add(index,val); 00059 return TRUE; 00060 }
void G4PSNofCollision::SetUnit | ( | const G4String & | unit | ) | [virtual] |
Reimplemented from G4VPrimitiveScorer.
Definition at line 94 of file G4PSNofCollision.cc.
References G4Exception(), G4VPrimitiveScorer::GetName(), G4VPrimitiveScorer::GetUnit(), JustWarning, G4VPrimitiveScorer::unitName, and G4VPrimitiveScorer::unitValue.
Referenced by G4PSNofCollision().
00095 { 00096 if (unit == "" ){ 00097 unitName = unit; 00098 unitValue = 1.0; 00099 }else{ 00100 G4String msg = "Invalid unit ["+unit+"] (Current unit is [" +GetUnit()+"] ) for " + GetName(); 00101 G4Exception("G4PSNofCollision::SetUnit","DetPS0009",JustWarning,msg); 00102 } 00103 }
void G4PSNofCollision::Weighted | ( | G4bool | flg = true |
) | [inline] |
Definition at line 59 of file G4PSNofCollision.hh.
Referenced by G4ScoreQuantityMessenger::SetNewValue().