Message: scoring volume setting Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None scoring volume setting 

Forum: Biasing and Scoring
Date: 01 Jul, 2013
From: riazi <riazi>

Dear Geant4 Experts

Thank you a lot for your efforts in teaching Geant4 for others.

I have a question about the mechanism of setting scoring volume to stepping action class from detector construction class (in Construct() function) for example in Example B1:

(
 // Set scoring volume to stepping action 
  // (where we will account energy deposit)
  //
  B1SteppingAction* steppingAction = B1SteppingAction::Instance(); 
    steppingAction->SetVolume(logicShape2);
 )
this is the only place in the example that the SetVolume function is called, this function sets the fVolume private variable of B1SteppingAction class. however the variable fVolume is intialized to zero in constructor of B1SteppingAction class and it dosn't change in the B1SteppingAction class elsewhere. Now how the fVolume variable is set to scoring volume to compare with volume of the current step?

B1SteppingAction::B1SteppingAction(): G4UserSteppingAction(),
  fVolume(0),
  fEnergy(0.)
{ 
  fgInstance = this;
}

void B1SteppingAction::UserSteppingAction(const G4Step* step)
 {
   // get volume of the current step
   G4LogicalVolume* volume 
    = step->GetPreStepPoint()->GetTouchableHandle()
       ->GetVolume()->GetLogicalVolume();      
   // check if we are in scoring volume
   if (volume != fVolume ) return;

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

With Best Regards, Riazi

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

1 None: Re: scoring volume setting   (Tsukasa Aso - 05 Jul, 2013)
(_ None: Re: scoring volume setting   (riazi - 10 Jul, 2013)
(_ None: Re: scoring volume setting   (Tsukasa Aso - 10 Jul, 2013)
(_ None: Re: scoring volume setting   (riazi - 12 Jul, 2013)
 Add Message Add Message
to: "scoring volume setting"

 Subscribe Subscribe

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