[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
[1196] | 25 | // |
---|
[1055] | 26 | // 17.02.2009 M.Kossov, now it is recommended to use the G4QCaptureAtRest process |
---|
[819] | 27 | // |
---|
| 28 | #ifndef G4PionMinusNuclearAtRestChips_h |
---|
| 29 | #define G4PionMinusNuclearAtRestChips_h |
---|
| 30 | |
---|
| 31 | #include "globals.hh" |
---|
| 32 | #include "G4VRestProcess.hh" |
---|
| 33 | #include "G4StopElementSelector.hh" |
---|
| 34 | #include "G4PionMinus.hh" |
---|
| 35 | #include "G4ChiralInvariantPhaseSpace.hh" |
---|
[962] | 36 | #include "G4HadronicProcessType.hh" |
---|
[819] | 37 | |
---|
| 38 | class G4PionMinusNuclearAtRestChips : public G4VRestProcess |
---|
| 39 | { |
---|
| 40 | private: |
---|
| 41 | // hide assignment operator as private |
---|
| 42 | G4PionMinusNuclearAtRestChips& operator=(const G4PionMinusNuclearAtRestChips &right); |
---|
| 43 | G4PionMinusNuclearAtRestChips(const G4PionMinusNuclearAtRestChips& ); |
---|
| 44 | |
---|
| 45 | public: |
---|
| 46 | |
---|
[1055] | 47 | G4PionMinusNuclearAtRestChips(const G4String& processName ="PionMinusCaptureAtRest") |
---|
[962] | 48 | : G4VRestProcess (processName, fHadronic) |
---|
| 49 | { |
---|
| 50 | SetProcessSubType(fHadronAtRest); |
---|
| 51 | } |
---|
[819] | 52 | |
---|
| 53 | ~G4PionMinusNuclearAtRestChips() {} |
---|
| 54 | |
---|
| 55 | G4bool IsApplicable(const G4ParticleDefinition& aParticle) |
---|
| 56 | { |
---|
| 57 | return ( &aParticle == G4PionMinus::PionMinusDefinition() ); |
---|
| 58 | } |
---|
| 59 | |
---|
[1055] | 60 | // null physics table |
---|
[819] | 61 | void BuildPhysicsTable(const G4ParticleDefinition&){} |
---|
| 62 | |
---|
| 63 | G4double AtRestGetPhysicalInteractionLength(const G4Track&track, |
---|
[1055] | 64 | G4ForceCondition*condition); |
---|
[819] | 65 | |
---|
[1055] | 66 | // zero mean lifetime |
---|
[819] | 67 | G4double GetMeanLifeTime(const G4Track& aTrack, |
---|
[1055] | 68 | G4ForceCondition* condition) {return 0.0;} |
---|
[819] | 69 | |
---|
| 70 | G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&); |
---|
| 71 | |
---|
| 72 | private: |
---|
| 73 | G4ChiralInvariantPhaseSpace theModel; |
---|
| 74 | G4StopElementSelector theSelector; // Assume identical laws as for muons |
---|
| 75 | }; |
---|
| 76 | |
---|
| 77 | inline |
---|
| 78 | G4VParticleChange * G4PionMinusNuclearAtRestChips:: |
---|
| 79 | AtRestDoIt(const G4Track& aTrack, const G4Step&aStep) |
---|
| 80 | { |
---|
| 81 | if(aTrack.GetDynamicParticle()->GetDefinition() != G4PionMinus::PionMinus()) |
---|
| 82 | { |
---|
[1055] | 83 | throw G4HadronicException(__FILE__, __LINE__, |
---|
| 84 | "Calling G4PionMinusNuclearAtRestChips with particle other than pi-!!!"); |
---|
[819] | 85 | } |
---|
| 86 | |
---|
| 87 | // Create target |
---|
| 88 | G4Element * theTarget = theSelector.GetElement(aTrack.GetMaterial()); |
---|
| 89 | G4Nucleus aTargetNucleus(theTarget->GetN() ,theTarget->GetZ()); |
---|
| 90 | |
---|
| 91 | // Call chips |
---|
| 92 | return theModel.ApplyYourself(aTrack, aTargetNucleus); |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | G4double G4PionMinusNuclearAtRestChips:: |
---|
[1055] | 96 | AtRestGetPhysicalInteractionLength(const G4Track&track, G4ForceCondition*condition) |
---|
[819] | 97 | { |
---|
| 98 | ResetNumberOfInteractionLengthLeft(); |
---|
| 99 | *condition = NotForced; |
---|
| 100 | currentInteractionLength = GetMeanLifeTime(track, condition); |
---|
| 101 | #ifdef CHIPSdebug |
---|
| 102 | if ((currentInteractionLength <0.0) || (verboseLevel>2)) |
---|
| 103 | { |
---|
| 104 | G4cout << "G4PionMinusNuclearAtRestChips::AtRestGetPhysicalInteractionLength "; |
---|
| 105 | G4cout << "[ " << GetProcessName() << "]" <<G4endl; |
---|
| 106 | track.GetDynamicParticle()->DumpInfo(); |
---|
| 107 | G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; |
---|
| 108 | G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl; |
---|
| 109 | } |
---|
| 110 | #endif |
---|
| 111 | return theNumberOfInteractionLengthLeft * currentInteractionLength; |
---|
| 112 | } |
---|
| 113 | #endif |
---|