Message: Re: MaterialPropertiesTable and raytracing question Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: MaterialPropertiesTable and raytracing question 

Keywords: G4MaterialPropertiesTable
Forum: Processes Involving Optical Photons
Date: 18 Oct, 2001
From: Gumplinger Peter <Gumplinger Peter>

Please, have a look at examples/novice/N06/src on how the MaterialPropertiesTable is used.

First, you have to generate one:

G4MaterialPropertiesTable *myMPT1 = new G4MaterialPropertiesTable();

Then, you fill it with:

myMPT1->AddProperty("ABSLENGTH",PPCKOV, ABSORPTION1, NUMENTRIES);

where "ABSLENGTH" is the name ('key') of the property. This 'key' will appear again in the code of the 'absorption process' implementation.

The variables PPCKOV and ABSORPTION1 are arrays of length NUMENTRIES:

  const G4int NUMENTRIES = 32;

  G4double PPCKOV[NUMENTRIES] =
            { 2.034E-9*GeV, 2.068E-9*GeV, 2.103E-9*GeV, 2.139E-9*GeV,
              2.177E-9*GeV, 2.216E-9*GeV, 2.256E-9*GeV, 2.298E-9*GeV,
              2.341E-9*GeV, 2.386E-9*GeV, 2.433E-9*GeV, 2.481E-9*GeV,
              2.532E-9*GeV, 2.585E-9*GeV, 2.640E-9*GeV, 2.697E-9*GeV,
              2.757E-9*GeV, 2.820E-9*GeV, 2.885E-9*GeV, 2.954E-9*GeV,
              3.026E-9*GeV, 3.102E-9*GeV, 3.181E-9*GeV, 3.265E-9*GeV,
              3.353E-9*GeV, 3.446E-9*GeV, 3.545E-9*GeV, 3.649E-9*GeV,
              3.760E-9*GeV, 3.877E-9*GeV, 4.002E-9*GeV, 4.136E-9*GeV };

  G4double ABSORPTION1[NUMENTRIES] =
           {344.8*cm,  408.2*cm,  632.9*cm,  917.4*cm, 1234.6*cm, 1388.9*cm,
           1515.2*cm, 1724.1*cm, 1886.8*cm, 2000.0*cm, 2631.6*cm, 3571.4*cm,
           4545.5*cm, 4761.9*cm, 5263.2*cm, 5263.2*cm, 5555.6*cm, 5263.2*cm,
           5263.2*cm, 4761.9*cm, 4545.5*cm, 4166.7*cm, 3703.7*cm, 3333.3*cm,
           3000.0*cm, 2850.0*cm, 2700.0*cm, 2450.0*cm, 2200.0*cm, 1950.0*cm,
           1750.0*cm, 1450.0*cm };

The minimum number for NUMENTRIES is 2. You your case, ABSORPTION1 would be your value for '1/mu' (can be the same for both entries) and PPCKOV would be the range of geantino momentum in your simulation.

You now have to associate the MaterialPropertiesTable with an already defined material:

Water->SetMaterialPropertiesTable(myMPT1);

As for 'geantino absorption', this isn't a defined process in GEANT4. You'll have to implement it similarly to, for example, the optical photon absorption process, see /home/gum/geant4/source/processes/optical and the files G4OpAbsorption.hh and G4OpAbsorption.cc. Your IsApplicable method would be:

inline
G4bool G4OpAbsorption::IsApplicable(const G4ParticleDefinition& aParticleType)
{
   return ( &aParticleType == G4Geantino::Geantino() );
}

In your application, you now have to generate this new process:

  G4GeantinoAbsorption* theAbsorptionProcess = new G4GeantinoAbsorption();

Now, you have to add your 'geantino absorption proccess' to the process manager of the geantino:

pmanager->AddDiscreteProcess(theAbsorptionProcess);

similar to ExN06PhysicsList.cc

As for your remaining questions:

Only you know where to retrieve the results. GEANT4 can't know that and it can't know what you mean by 'results'. If your implementation is correct, the geantino flux should deminish like exp(-mu*l) in a homogeneous medium. In your user stepping action, you can count how often a geantino makes it a certain depth into the medium. You can write your counter out at the end of the run.

Instead of using a 'geantino' to test exponential absorption, you could just as well use an 'G4OpticalPhoton and only attach the G4OpAbsorption process to it. This saves you from the problem of having to implement a new process in G4 (Geantino Absorption).

Regards, Peter Gumplinger (gum@triumf.ca)

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

 Add Message Add Message
to: "Re: MaterialPropertiesTable and raytracing question"

 Subscribe Subscribe

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