Message: Re: How To Turn Physics Completely Off? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How To Turn Physics Completely Off? 

Forum: Event and Track Management
Re: Question How To Turn Physics Completely Off? (ozgur ates)
Date: 21 Feb, 2009
From: Tom Roberts <Tom Roberts>

It does not make sense to "turn physics completely off". At a minimum you need the Transportation physics process.

Probably what you actually want to do is turn stochastic physics processes off. That is, don't let particles decay or interact, and omit energy-loss straggling. My code does this, for instance, when tracking a reference particle that must go down the center of a beam line (it must be the correct particle type so it is bent correctly in bending magnets, but not be scattered by vacuum windows or other material in the beam line, etc.).

Here's what my code does:

        // turn off delta rays (and other particle production) by
        // setting production cut very high in energy by setting
        // the required range large.
        UI->ApplyCommand("/run/setCut 1 km");
        // Turn off enegry-loss straggling
        UI->ApplyCommand("/process/eLoss/fluct false");
        G4String cmd = "/process/inactivate ";
        // run through list of processes, applying cmd to stochastic ones
        G4ProcessTable *pt = G4ProcessTable::GetProcessTable();
        G4ProcessTable::G4ProcNameVector *nv = pt->GetNameList();
        for(unsigned int i=0; i<nv->size(); ++i) {
                G4String name = (*nv)[i];

        /// isStochasticProcess() returns true if the process is stochastic.
        bool isStochasticProcess(G4String name) {
                // these are standard Geant4 processes
                if(name.find("Trans") < name.size()) return false;
                if(name.find("Ioni") < name.size()) return false;
                // the next two are G4beamline processes
                if(name.find("Limiter") < name.size()) return false;
                if(name.find("BLCMD") < name.size()) return false;
                return true;

 Add Message Add Message
to: "Re: How To Turn Physics Completely Off?"

 Subscribe Subscribe

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

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]