/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Simulation/BOOST/PhySim/PhySim-00-00-10/src/BgsGentleGenocide.cc

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // File and Version Information:
00003 // $Id: BgsGentleGenocide.cc,v 1.1 2007/10/12 07:30:20 caogf Exp $
00004 //
00005 // Description:
00006 //      Class BgsGentleGenocide
00007 //
00008 //      A process that prevents the associated particle from being tracked
00009 //      if it has traveled more than the specified number of steps and
00010 //      falls below the specified kinetic energy.
00011 //
00012 //      To fix an apparent "loophole" in hadronic ionization for tritium
00013 //
00014 // Environment:
00015 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00016 //
00017 // Author List:
00018 //      David Williams
00019 //
00020 // Copyright Information:
00021 //      Copyright (C) 2001         SLAC
00022 //
00023 //-----------------------------------------------------------------------------
00024 
00025 #include "BaBar.hh"
00026 #include "BgsGentleGenocide.hh"
00027 
00028 
00029 //
00030 // Constructor
00031 //
00032 BgsGentleGenocide::BgsGentleGenocide( G4double theMaxKineticEnergy,
00033                                       G4int    theMinNumberSteps,
00034                                       const G4String &name, 
00035                                       G4ProcessType type     )
00036         : BgsGenocide( name, type ),
00037           maxKineticEnergy(theMaxKineticEnergy),
00038           minNumberSteps(theMinNumberSteps)
00039 {;}
00040 
00041 
00042 //
00043 // Destructor
00044 //
00045 BgsGentleGenocide::~BgsGentleGenocide() {;}
00046 
00047 
00048 //
00049 // Decide what to do at each step
00050 //
00051 G4double BgsGentleGenocide::PostStepGetPhysicalInteractionLength( 
00052                                const G4Track& track,
00053                                G4double   previousStepSize,
00054                                G4ForceCondition* condition )
00055 {
00056         *condition = NotForced;
00057         
00058         //
00059         // Do nothing if we haven't reached the minimum number of steps
00060         //      
00061         if (track.GetCurrentStepNumber() < minNumberSteps) return DBL_MAX;
00062 
00063         //
00064         // Do nothing if we are above the threshold kinetic energy
00065         //
00066         const G4DynamicParticle *particle = track.GetDynamicParticle();
00067         
00068         if (particle->GetKineticEnergy() > maxKineticEnergy) return DBL_MAX;
00069                 
00070         //
00071         // Die!
00072         //
00073         //      const G4ThreeVector &pos = track.GetPosition();
00074         
00075         const G4VProcess *creator = track.GetCreatorProcess();
00076         G4String creatorProcessName = "(none?)";
00077         if (creator) creatorProcessName = creator->GetProcessName();
00078 
00079         /*
00080         G4cout << "BgsGentleGenocide: rogue "
00081                << particle->GetDefinition()->GetParticleName() 
00082                << " terminated, created by " 
00083                << creatorProcessName << G4endl; 
00084 
00085         G4cout << " KE = "
00086                << particle->GetKineticEnergy()/keV << " keV, "
00087                << " global coords (cm): ("
00088                << pos.x()/cm << "," 
00089                << pos.y()/cm << "," 
00090                << pos.z()/cm << ")" << G4endl;
00091         */
00092 
00093         *condition = NotForced;
00094         return 0;
00095 }
00096 

Generated on Tue Nov 29 23:14:29 2016 for BOSS_7.0.2 by  doxygen 1.4.7