BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BgsGentleGenocide.cc
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// File and Version Information:
3// $Id: BgsGentleGenocide.cc,v 1.1 2007/10/12 07:30:20 caogf Exp $
4//
5// Description:
6// Class BgsGentleGenocide
7//
8// A process that prevents the associated particle from being tracked
9// if it has traveled more than the specified number of steps and
10// falls below the specified kinetic energy.
11//
12// To fix an apparent "loophole" in hadronic ionization for tritium
13//
14// Environment:
15// Software developed for the BaBar Detector at the SLAC B-Factory.
16//
17// Author List:
18// David Williams
19//
20// Copyright Information:
21// Copyright (C) 2001 SLAC
22//
23//-----------------------------------------------------------------------------
24
25#include "PhySim/BgsGentleGenocide.hh"
26#include "PhySim/BaBar.hh"
27
28//
29// Constructor
30//
31BgsGentleGenocide::BgsGentleGenocide( G4double theMaxKineticEnergy, G4int theMinNumberSteps,
32 const G4String& name, G4ProcessType type )
33 : BgsGenocide( name, type )
34 , maxKineticEnergy( theMaxKineticEnergy )
35 , minNumberSteps( theMinNumberSteps ) {
36 ;
37}
38
39//
40// Destructor
41//
43
44//
45// Decide what to do at each step
46//
48 const G4Track& track, G4double previousStepSize, G4ForceCondition* condition ) {
49 *condition = NotForced;
50
51 //
52 // Do nothing if we haven't reached the minimum number of steps
53 //
54 if ( track.GetCurrentStepNumber() < minNumberSteps ) return DBL_MAX;
55
56 //
57 // Do nothing if we are above the threshold kinetic energy
58 //
59 const G4DynamicParticle* particle = track.GetDynamicParticle();
60
61 if ( particle->GetKineticEnergy() > maxKineticEnergy ) return DBL_MAX;
62
63 //
64 // Die!
65 //
66 // const G4ThreeVector &pos = track.GetPosition();
67
68 const G4VProcess* creator = track.GetCreatorProcess();
69 G4String creatorProcessName = "(none?)";
70 if ( creator ) creatorProcessName = creator->GetProcessName();
71
72 /*
73 G4cout << "BgsGentleGenocide: rogue "
74 << particle->GetDefinition()->GetParticleName()
75 << " terminated, created by "
76 << creatorProcessName << G4endl;
77
78 G4cout << " KE = "
79 << particle->GetKineticEnergy()/keV << " keV, "
80 << " global coords (cm): ("
81 << pos.x()/cm << ","
82 << pos.y()/cm << ","
83 << pos.z()/cm << ")" << G4endl;
84 */
85
86 *condition = NotForced;
87 return 0;
88}
BgsGenocide(const G4String &name="BgsGenocide", G4ProcessType type=fUserDefined)
Definition BgsGenocide.cc:7
BgsGentleGenocide(G4double theMaxKineticEnergy, G4int theMinNumberSteps, const G4String &name="BgsGentleGenocide", G4ProcessType type=fUserDefined)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)