57 thetaSpan = 90. * deg;
65 delete theMatScannerSteppingAction;
75 G4cerr <<
"Illegal application state - Scan() ignored." <<
G4endl;
79 if (theMatScannerSteppingAction ==
nullptr) {
88void G4MaterialScanner::StoreUserActions()
101 if (theSDMan !=
nullptr) {
111void G4MaterialScanner::RestoreUserActions()
119 if (theSDMan !=
nullptr) {
125void G4MaterialScanner::DoScan()
145 for (
G4int iTheta = 0; iTheta < nTheta; ++iTheta) {
147 if (iTheta > 0) theta +=
G4double(iTheta) * thetaSpan /
G4double(nTheta - 1);
152 G4cout <<
" Theta(deg) Phi(deg) Length(mm) x0 lambda0" <<
G4endl;
154 for (
G4int iPhi = 0; iPhi < nPhi; ++iPhi) {
155 auto anEvent =
new G4Event(iEvent++);
158 eyeDirection =
G4ThreeVector(std::cos(theta) * std::cos(phi), std::cos(theta) * std::sin(phi),
160 theRayShooter->
Shoot(anEvent, eyePosition, eyeDirection);
161 theMatScannerSteppingAction->
Initialize(regionSensitive, theRegion);
167 G4cout <<
" " << std::setw(11) << theta / deg <<
" " << std::setw(11) << phi / deg
168 <<
" " << std::setw(11) << length / mm <<
" " << std::setw(11) << x0 <<
" "
170 aveLength += length / mm;
176 G4cout <<
" ave. for theta = " << std::setw(11) << theta / deg <<
" : " << std::setw(11)
177 << aveLength / nPhi <<
" " << std::setw(11) << aveX0 / nPhi <<
" " << std::setw(11)
178 << aveLambda / nPhi <<
G4endl;
190 if (aRegion !=
nullptr) {
196 G4cerr <<
"Region <" << val <<
"> not found. Command ignored." <<
G4endl;
199 G4cerr <<
" " << i->GetName();
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4UserTrackingAction * GetUserTrackingAction()
void SetUserAction(G4UserEventAction *userAction)
G4UserSteppingAction * GetUserSteppingAction()
G4UserStackingAction * GetUserStackingAction()
G4UserEventAction * GetUserEventAction()
static G4EventManager * GetEventManager()
void ProcessOneEvent(G4Event *anEvent)
static G4GeometryManager * GetInstance()
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=nullptr)
void OpenGeometry(G4VPhysicalVolume *vol=nullptr)
G4double GetLambda0() const
G4double GetTotalStepLength() const
void Initialize(G4bool rSens, G4Region *reg)
G4bool SetRegionName(const G4String &val)
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
void Shoot(G4Event *evt, G4ThreeVector vtx, G4ThreeVector direc)
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static G4RunManagerKernel * GetRunManagerKernel()
void Activate(G4String dName, G4bool activeFlag)
static G4SDManager * GetSDMpointerIfExist()
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4bool SetNewState(const G4ApplicationState &requestedState)
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const