G4PionMinusNuclearAtRestChips.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // 17.02.2009 M.Kossov, now it is recommended to use the G4QCaptureAtRest process
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   // hide assignment operator as private 
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      // null physics table
00066      void BuildPhysicsTable(const G4ParticleDefinition&){}
00067 
00068      G4double AtRestGetPhysicalInteractionLength(const G4Track&track,
00069        G4ForceCondition*condition);
00070 
00071      // zero mean lifetime
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; // Assume identical laws as for muons
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   // Create target
00093   G4Element* theTarget = theSelector.GetElement(aTrack.GetMaterial());
00094   G4Nucleus aTargetNucleus(theTarget->GetA_asInt(), theTarget->GetZ_asInt());
00095   
00096   // Call chips
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

Generated on Mon May 27 17:49:21 2013 for Geant4 by  doxygen 1.4.7