// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: G4QDiscProcessMixer.cc,v 1.8 2009/04/22 12:26:13 mkossov Exp $ // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ // // ---------------- G4QDiscProcessMixer class ------------------- // by Mikhail Kossov, Aug 2007. // G4QDiscProcessMixer class of the CHIPS Simulation Branch in GEANT4 // ------------------------------------------------------------------------ // Short description: universal mixer of processes (NOT models as in GHAD!) // depending on the application energy region (defined by users). // ------------------------------------------------------------------------ //#define debug #include "G4QDiscProcessMixer.hh" // Constructor G4QDiscProcessMixer::G4QDiscProcessMixer(const G4String& name, const G4ParticleDefinition* particle, G4ProcessType pType): G4VDiscreteProcess(name, pType), DPParticle(particle) { #ifdef debug G4cout<<"G4QDiscProcessMixer::Constructor is called processName="<0) G4cout<* QDiscProc = new std::pair(DP, maxEn); theDPVector.push_back( QDiscProc ); } else { if(MEsecond) { std::pair* QDiscProc = new std::pair(DP, ME); theDPVector.push_back( QDiscProc ); } else // Wrong Max Energy Order for the new process in the sequence of processes { G4cerr<<"G4QDiscProcessMixer::AddDiscreteProcess:LastMaxE("<GetKineticEnergy(); // Projectile kinetic energy G4int maxDP=theDPVector.size(); if(maxDP) for(G4int i=maxDP-1; i>-1; i--) if(kEn < theDPVector[i]->second) return theDPVector[i]->first->PostStepGetPhysicalInteractionLength(Track,PrevStSize,F); return DBL_MAX; } // A fake class for compilation only G4double G4QDiscProcessMixer::GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*) { return DBL_MAX; } G4VParticleChange* G4QDiscProcessMixer::PostStepDoIt(const G4Track& Track, const G4Step& Step) { G4double kEn=Track.GetDynamicParticle()->GetKineticEnergy(); // Projectile kinetic energy G4int maxDP=theDPVector.size(); if(maxDP) for(G4int i=maxDP-1; i>-1; i--) if(kEn < theDPVector[i]->second) { //EnMomConservation= theDPVector[i]->first->GetEnegryMomentumConservation(); //nOfNeutrons = theDPVector[i]->first->GetNumberOfNeutronsInTarget(); return theDPVector[i]->first->PostStepDoIt(Track, Step); } return G4VDiscreteProcess::PostStepDoIt(Track, Step); } //G4LorentzVector G4QDiscProcessMixer::GetEnegryMomentumConservation() // {return EnMomConservation;} //G4int G4QDiscProcessMixer::GetNumberOfNeutronsInTarget() // {return nOfNeutrons;}