W pliku
src/MyDetectorConstruction.cc
(zmiany
kolorem czerwonym)
.................................................................
#include "G4VisAttributes.hh"
#include
"G4MultiFunctionalDetector.hh"
#include
"G4SDManager.hh"
#include
"G4PSSphereSurfaceCurrent.hh"
........................................................................................
void MyDetectorConstruction::SetupScoring(G4LogicalVolume*
scoringVolume)
{
//
Create
a new sensitive detector named "MyDetector"
G4MultiFunctionalDetector* detector =
new
G4MultiFunctionalDetector("MyDetector");
//
Get
pointer to detector manager
G4SDManager* manager = G4SDManager::GetSDMpointer();
//
Register detector with manager
manager->AddNewDetector(detector);
//
Attach detector to scoring volume
scoringVolume->SetSensitiveDetector(detector);
//
Create a primitive Scorer named MyScorer
G4PSSphereSurfaceCurrent* scorer =
new
G4PSSphereSurfaceCurrent("MyScorer",fCurrent_In);
//
Register scorer with detector
detector->RegisterPrimitive(scorer);
}