00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef G4PionMinusNuclearAtRestChips_h
00029 #define G4PionMinusNuclearAtRestChips_h
00030
00031 #include <CLHEP/Units/SystemOfUnits.h>
00032
00033 #include "globals.hh"
00034 #include "G4VRestProcess.hh"
00035 #include "G4StopElementSelector.hh"
00036 #include "G4PionMinus.hh"
00037 #include "G4ChiralInvariantPhaseSpace.hh"
00038 #include "G4HadronicProcessType.hh"
00039 #include "G4HadronicDeprecate.hh"
00040
00041
00042 class G4PionMinusNuclearAtRestChips : public G4VRestProcess
00043 {
00044 private:
00045
00046 G4PionMinusNuclearAtRestChips& operator=(const G4PionMinusNuclearAtRestChips &right);
00047 G4PionMinusNuclearAtRestChips(const G4PionMinusNuclearAtRestChips& );
00048
00049 public:
00050
00051 G4PionMinusNuclearAtRestChips(const G4String& processName ="PionMinusCaptureAtRest")
00052 : G4VRestProcess (processName, fHadronic)
00053 {
00054 G4HadronicDeprecate("G4PionMinusNuclearAtRestChips");
00055 SetProcessSubType(fHadronAtRest);
00056 }
00057
00058 ~G4PionMinusNuclearAtRestChips() {}
00059
00060 G4bool IsApplicable(const G4ParticleDefinition& aParticle)
00061 {
00062 return ( &aParticle == G4PionMinus::PionMinusDefinition() );
00063 }
00064
00065
00066 void BuildPhysicsTable(const G4ParticleDefinition&){}
00067
00068 G4double AtRestGetPhysicalInteractionLength(const G4Track&track,
00069 G4ForceCondition*condition);
00070
00071
00072 G4double GetMeanLifeTime(const G4Track& aTrack,
00073 G4ForceCondition* condition) {return 0.0;}
00074
00075 G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
00076
00077 private:
00078 G4ChiralInvariantPhaseSpace theModel;
00079 G4StopElementSelector theSelector;
00080 };
00081
00082 inline
00083 G4VParticleChange * G4PionMinusNuclearAtRestChips::
00084 AtRestDoIt(const G4Track& aTrack, const G4Step&aStep)
00085 {
00086 if(aTrack.GetDynamicParticle()->GetDefinition() != G4PionMinus::PionMinus())
00087 {
00088 throw G4HadronicException(__FILE__, __LINE__,
00089 "Calling G4PionMinusNuclearAtRestChips with particle other than pi-!!!");
00090 }
00091
00092
00093 G4Element* theTarget = theSelector.GetElement(aTrack.GetMaterial());
00094 G4Nucleus aTargetNucleus(theTarget->GetA_asInt(), theTarget->GetZ_asInt());
00095
00096
00097 return theModel.ApplyYourself(aTrack, aTargetNucleus);
00098 }
00099
00100 G4double G4PionMinusNuclearAtRestChips::
00101 AtRestGetPhysicalInteractionLength(const G4Track&track, G4ForceCondition*condition)
00102 {
00103 ResetNumberOfInteractionLengthLeft();
00104 *condition = NotForced;
00105 currentInteractionLength = GetMeanLifeTime(track, condition);
00106 #ifdef CHIPSdebug
00107 if ((currentInteractionLength <0.0) || (verboseLevel>2))
00108 {
00109 G4cout << "G4PionMinusNuclearAtRestChips::AtRestGetPhysicalInteractionLength ";
00110 G4cout << "[ " << GetProcessName() << "]" <<G4endl;
00111 track.GetDynamicParticle()->DumpInfo();
00112 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
00113 G4cout << "MeanLifeTime = " << currentInteractionLength/CLHEP::ns << "[ns]" <<G4endl;
00114 }
00115 #endif
00116 return theNumberOfInteractionLengthLeft * currentInteractionLength;
00117 }
00118 #endif