Message: Modifying Example N03 Stepping Action Class to Score In Water Phantom Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Modifying Example N03 Stepping Action Class to Score In Water Phantom 

Forum: Biasing and Scoring
Date: 23 Dec, 2012
From: Ben Hug <Ben Hug>

Hi All,

Im trying to modify the SteppingAction.cc for the N03 example in Geant4.9.6.

The stepping Action section where the scoring is completed is as follows:

***********************************************************************
void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
  // get volume of the current step
  G4VPhysicalVolume* volume 
  = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();

  // collect energy and track length step by step
  G4double edep = aStep->GetTotalEnergyDeposit();

  G4double stepl = 0.;
  if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
    stepl = aStep->GetStepLength();

  if (volume == detector->GetAbsorber()) eventaction->AddAbs(edep,stepl);
  if (volume == detector->GetGap())      eventaction->AddGap(edep,stepl);
**********************************************************************

I have modified the DetectorConstruction.cc file to suit my own geometry with a detector volume in the centre of a water phantom with a physical volume name of physical_detector (see code below)...

***********************************************************************
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  // DEFINE A VOLUME IN CENTRE OF WATER PHANTOM TO BE SCORED
  G4double detectorSize = 2* cm;
  G4Box* detector = new G4Box("detectorVolume", detectorSize/2, detectorSize/2, detectorSize/2);

  G4LogicalVolume* logical_detector = new G4LogicalVolume(detector, water, "detectorVolume_log", 0, 0, 0);

  G4VPhysicalVolume* physical_detector = new G4PVPlacement(0,G4ThreeVector(0,0,0), logical_detector, "detector_phys", logical_waterPhantom, false, 0, true);
************************************************************************

I haven't changed anything in the SteppingAction and it is the same as Example N03.. when I compile i get the following error: *********************************************************************** /Applications/geant4.9.6/G4Work/ConeOutputFactor/src/SteppingAction.cc: In member function ‘virtual void SteppingAction::UserSteppingAction(const G4Step*)’: /Applications/geant4.9.6/G4Work/ConeOutputFactor/src/SteppingAction.cc:73: error: ‘class DetectorConstruction’ has no member named ‘GetAbsorber’ /Applications/geant4.9.6/G4Work/ConeOutputFactor/src/SteppingAction.cc:74: error: ‘class DetectorConstruction’ has no member named ‘GetGap’ ************************************************************************

I cant find where the 'GetAbsorber' is defined nor how the line works in the above section where the code determines if the track occurs in a particular part of the geometry and if so scores the energy deposited..

Can Anyone help??

I am completely lost.

Thanks In Advance,

Cheers

Ben

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Modifying Example N03 Stepping Action Class to Score In Water Phantom   (Tsukasa Aso - 26 Dec, 2012)
(_ Ok: Re: Modifying Example N03 Stepping Action Class to Score In Water Phantom   (Ben Hug - 29 Dec, 2012)
 Add Message Add Message
to: "Modifying Example N03 Stepping Action Class to Score In Water Phantom"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews