BOSS 6.6.4.p03
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 "BaBar.hh"
26#include "BgsGentleGenocide.hh"
27
28
29//
30// Constructor
31//
32BgsGentleGenocide::BgsGentleGenocide( G4double theMaxKineticEnergy,
33 G4int theMinNumberSteps,
34 const G4String &name,
35 G4ProcessType type )
36 : BgsGenocide( name, type ),
37 maxKineticEnergy(theMaxKineticEnergy),
38 minNumberSteps(theMinNumberSteps)
39{;}
40
41
42//
43// Destructor
44//
46
47
48//
49// Decide what to do at each step
50//
52 const G4Track& track,
53 G4double previousStepSize,
54 G4ForceCondition* condition )
55{
56 *condition = NotForced;
57
58 //
59 // Do nothing if we haven't reached the minimum number of steps
60 //
61 if (track.GetCurrentStepNumber() < minNumberSteps) return DBL_MAX;
62
63 //
64 // Do nothing if we are above the threshold kinetic energy
65 //
66 const G4DynamicParticle *particle = track.GetDynamicParticle();
67
68 if (particle->GetKineticEnergy() > maxKineticEnergy) return DBL_MAX;
69
70 //
71 // Die!
72 //
73 // const G4ThreeVector &pos = track.GetPosition();
74
75 const G4VProcess *creator = track.GetCreatorProcess();
76 G4String creatorProcessName = "(none?)";
77 if (creator) creatorProcessName = creator->GetProcessName();
78
79 /*
80 G4cout << "BgsGentleGenocide: rogue "
81 << particle->GetDefinition()->GetParticleName()
82 << " terminated, created by "
83 << creatorProcessName << G4endl;
84
85 G4cout << " KE = "
86 << particle->GetKineticEnergy()/keV << " keV, "
87 << " global coords (cm): ("
88 << pos.x()/cm << ","
89 << pos.y()/cm << ","
90 << pos.z()/cm << ")" << G4endl;
91 */
92
93 *condition = NotForced;
94 return 0;
95}
96
#define DBL_MAX
Definition: KalFitAlg.h:13
BgsGentleGenocide(G4double theMaxKineticEnergy, G4int theMinNumberSteps, const G4String &name="BgsGentleGenocide", G4ProcessType type=fUserDefined)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
virtual ~BgsGentleGenocide()