CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ElectronLimiter Class Reference

#include <ElectronLimiter.h>

Inheritance diagram for ElectronLimiter:

Public Member Functions

virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
 ElectronLimiter (const edm::ParameterSet &p)
 
virtual G4double GetMeanFreePath (const G4Track &, G4double, G4ForceCondition *)
 
virtual G4VParticleChange * PostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
void SetFieldCheckFlag (G4bool)
 
void SetRangeCheckFlag (G4bool)
 
virtual ~ElectronLimiter ()
 

Private Attributes

G4bool fieldCheckFlag
 
G4VEnergyLossProcess * fIonisation
 
G4ParticleChangeForGamma fParticleChange
 
G4bool killTrack
 
G4bool minStepLimit
 
const G4ParticleDefinition * particle
 
G4bool rangeCheckFlag
 

Detailed Description

Definition at line 17 of file ElectronLimiter.h.

Constructor & Destructor Documentation

ElectronLimiter::ElectronLimiter ( const edm::ParameterSet p)

Definition at line 15 of file ElectronLimiter.cc.

References fieldCheckFlag, fIonisation, edm::ParameterSet::getParameter(), killTrack, minStepLimit, particle, and rangeCheckFlag.

16  : G4VDiscreteProcess("eLimiter", fGeneral)
17 {
18  // set Process Sub Type
19  SetProcessSubType(static_cast<int>(STEP_LIMITER));
20 
21  minStepLimit = p.getParameter<double>("MinStepLimit")*mm;
22  rangeCheckFlag = false;
23  fieldCheckFlag = false;
24  killTrack = false;
25 
26  fIonisation = 0;
27  particle = 0;
28 }
T getParameter(std::string const &) const
G4VEnergyLossProcess * fIonisation
const G4ParticleDefinition * particle
ElectronLimiter::~ElectronLimiter ( )
virtual

Definition at line 30 of file ElectronLimiter.cc.

31 {}

Member Function Documentation

void ElectronLimiter::BuildPhysicsTable ( const G4ParticleDefinition &  part)
virtual

Definition at line 33 of file ElectronLimiter.cc.

References fIonisation, and particle.

34 {
35  particle = &part;
36  fIonisation = G4LossTableManager::Instance()->GetEnergyLossProcess(particle);
37  /*
38  std::cout << "ElectronLimiter::BuildPhysicsTable for "
39  << particle->GetParticleName()
40  << " ioni: " << fIonisation << " rangeCheckFlag: " << rangeCheckFlag
41  << " fieldCheckFlag: " << fieldCheckFlag << std::endl;
42  */
43 }
G4VEnergyLossProcess * fIonisation
part
Definition: HCALResponse.h:20
const G4ParticleDefinition * particle
G4double ElectronLimiter::GetMeanFreePath ( const G4Track &  ,
G4double  ,
G4ForceCondition *   
)
inlinevirtual

Definition at line 86 of file ElectronLimiter.cc.

88 {
89  return DBL_MAX;
90 }
G4VParticleChange * ElectronLimiter::PostStepDoIt ( const G4Track &  aTrack,
const G4Step &   
)
inlinevirtual

Definition at line 74 of file ElectronLimiter.cc.

References fParticleChange, and killTrack.

76 {
77  fParticleChange.Initialize(aTrack);
78  if(killTrack) {
79  fParticleChange.ProposeTrackStatus(fStopAndKill);
80  fParticleChange.ProposeLocalEnergyDeposit(aTrack.GetKineticEnergy());
81  fParticleChange.SetProposedKineticEnergy(0.0);
82  }
83  return &fParticleChange;
84 }
G4ParticleChangeForGamma fParticleChange
G4double ElectronLimiter::PostStepGetPhysicalInteractionLength ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
virtual

Definition at line 46 of file ElectronLimiter.cc.

References fieldCheckFlag, fIonisation, killTrack, MessageLogger_cff::limit, minStepLimit, and rangeCheckFlag.

49 {
50  *condition = NotForced;
51 
52  G4double limit = DBL_MAX;
53  killTrack = false;
54 
55  if(rangeCheckFlag) {
56  G4double safety = aTrack.GetStep()->GetPreStepPoint()->GetSafety();
57  if(safety > minStepLimit) {
58  G4double kinEnergy = aTrack.GetKineticEnergy();
59  G4double range = fIonisation->GetRangeForLoss(kinEnergy,
60  aTrack.GetMaterialCutsCouple());
61  if(safety >= range) {
62  killTrack = true;
63  limit = 0.0;
64  }
65  }
66  }
67  if(!killTrack && fieldCheckFlag) {
68  limit = minStepLimit;
69  }
70 
71  return limit;
72 }
G4VEnergyLossProcess * fIonisation
void ElectronLimiter::SetFieldCheckFlag ( G4bool  val)
inline

Definition at line 58 of file ElectronLimiter.h.

References fieldCheckFlag.

Referenced by ParametrisedEMPhysics::ConstructProcess().

59 {
60  fieldCheckFlag = val;
61 }
void ElectronLimiter::SetRangeCheckFlag ( G4bool  val)
inline

Definition at line 53 of file ElectronLimiter.h.

References rangeCheckFlag.

Referenced by ParametrisedEMPhysics::ConstructProcess().

54 {
55  rangeCheckFlag = val;
56 }

Member Data Documentation

G4bool ElectronLimiter::fieldCheckFlag
private
G4VEnergyLossProcess* ElectronLimiter::fIonisation
private
G4ParticleChangeForGamma ElectronLimiter::fParticleChange
private

Definition at line 41 of file ElectronLimiter.h.

Referenced by PostStepDoIt().

G4bool ElectronLimiter::killTrack
private
G4bool ElectronLimiter::minStepLimit
private

Definition at line 46 of file ElectronLimiter.h.

Referenced by ElectronLimiter(), and PostStepGetPhysicalInteractionLength().

const G4ParticleDefinition* ElectronLimiter::particle
private

Definition at line 44 of file ElectronLimiter.h.

Referenced by BuildPhysicsTable(), and ElectronLimiter().

G4bool ElectronLimiter::rangeCheckFlag
private