Message: Change some process in G4OpAbsorption Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Change some process in G4OpAbsorption 

Forum: Processes Involving Optical Photons
Date: 28 Aug, 2014
From: <cyuchiash>

Hi, everyone!

I am trying to change the code in the so that I can add a secondary once the optical photon is absorbed in the certain material.

Here's how I edit the code.

G4OpAbsorption::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)

        G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
        Material = pPostStepPoint -> GetMaterial();
        G4MaterialPropertyVector* Rindex;

        Rindex = Material ->GetMaterialPropertiesTable()->GetProperty("IMAGINARYRINDEX");

            if (Rindex) {
                if (verboseLevel>0) {
	           G4cout << "\n** Photoelectric! **" << G4endl;

                G4ThreeVector ElectDirection = G4RandomDirection();
                G4double ElectKineEnergy = aStep.GetTrack()->GetKineticEnergy(); 

                G4DynamicParticle* aParticle1= new G4DynamicParticle(G4Electron::Electron(), ElectDirection, ElectKineEnergy);
                 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
       } else {

           if (verboseLevel>0) {
	     G4cout << "\n** Photon absorbed! **" << G4endl;
           return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);

However, after I recompile Geant4 and the application, I found no changes. What's the problem! How can I get the expected result?

 Add Message Add Message
to: "Change some process in G4OpAbsorption"

 Subscribe Subscribe

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