G4ProtonAntiProtonAtRestChips.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 // (Why only antiproton-proton, when the antiproton-nucleus is made? - M.K.)
00027 // 17.02.2009 M.Kossov, now it is recommended to use the G4QCaptureAtRest process
00028 #ifndef G4ProtonAntiProtonAtRestChips_h
00029 #define G4ProtonAntiProtonAtRestChips_h
00030 
00031 #include <CLHEP/Units/SystemOfUnits.h>
00032 
00033 #include "globals.hh"
00034 #include "G4VRestProcess.hh"
00035 #include "G4ParticleTable.hh"
00036 #include "G4Quasmon.hh"
00037 #include "G4QHadronVector.hh"
00038 #include "G4ParticleChange.hh"
00039 #include "G4LorentzVector.hh"
00040 #include "G4DynamicParticle.hh"
00041 #include "G4IonTable.hh"
00042 #include "G4Neutron.hh"
00043 #include "G4StopElementSelector.hh"
00044 #include "G4ChiralInvariantPhaseSpace.hh"
00045 #include "G4HadronicProcessType.hh"
00046 #include "G4HadronicDeprecate.hh"
00047 
00048 
00049 class G4ProtonAntiProtonAtRestChips : public G4VRestProcess
00050 {
00051   private:
00052   // hide assignment operator as private 
00053       G4ProtonAntiProtonAtRestChips& operator=(const G4ProtonAntiProtonAtRestChips &right);
00054       G4ProtonAntiProtonAtRestChips(const G4ProtonAntiProtonAtRestChips& );
00055    
00056   public:
00057  
00058      G4ProtonAntiProtonAtRestChips(const G4String& processName=
00059                                                             "AntiProtonAnnihilationAtRest")
00060       : G4VRestProcess (processName, fHadronic) 
00061      {
00062        G4HadronicDeprecate("G4ProtonAntiProtonAtRestChips");
00063        SetProcessSubType(fHadronAtRest);
00064      }
00065  
00066      ~G4ProtonAntiProtonAtRestChips() {}
00067 
00068      G4bool IsApplicable(const G4ParticleDefinition& aParticle)
00069      {
00070        return ( &aParticle == G4AntiProton::AntiProtonDefinition() );
00071      }
00072 
00073   // null physics table
00074      void BuildPhysicsTable(const G4ParticleDefinition&){}
00075 
00076      G4double AtRestGetPhysicalInteractionLength(const G4Track&track,
00077        G4ForceCondition*condition);
00078 
00079   // zero mean lifetime
00080      G4double GetMeanLifeTime(const G4Track& aTrack,
00081          G4ForceCondition* condition) {return 0.0;}
00082 
00083      G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&); 
00084 
00085   private:
00086     G4ChiralInvariantPhaseSpace theModel;
00087     G4StopElementSelector theSelector; // Assume identical laws as for muons
00088 };
00089 
00090 inline
00091 G4VParticleChange * G4ProtonAntiProtonAtRestChips::
00092 AtRestDoIt(const G4Track& aTrack, const G4Step&aStep)
00093 {
00094   // Create target
00095   G4Element * theTarget = theSelector.GetElement(aTrack.GetMaterial());
00096   G4Nucleus aTargetNucleus(theTarget->GetA_asInt(), theTarget->GetZ_asInt());
00097 
00098   // Check model validity - note this will be a sub-branch in the ordinary stopping @@@@@@
00099   // in the long haul. @@@@@@
00100   if(aTrack.GetDynamicParticle()->GetDefinition() != G4AntiProton::AntiProton())
00101   {
00102     throw G4HadronicException(__FILE__, __LINE__,
00103                 "Calling G4ProtonAntiProtonAtRestChips with particle other than p-bar!!!");
00104   }
00105   if(aTargetNucleus.GetZ_asInt() != 1)
00106   {
00107     throw G4HadronicException(__FILE__, __LINE__,
00108                 "Calling G4ProtonAntiProtonAtRestChips for target other than Hydrogen!!!");
00109   }
00110   
00111   // Call chips
00112   return theModel.ApplyYourself(aTrack, aTargetNucleus);
00113 }
00114 
00115 G4double G4ProtonAntiProtonAtRestChips::
00116 AtRestGetPhysicalInteractionLength(const G4Track&track,
00117        G4ForceCondition*condition)
00118 {
00119   ResetNumberOfInteractionLengthLeft();
00120   *condition = NotForced;
00121   currentInteractionLength = GetMeanLifeTime(track, condition);
00122 #ifdef CHIPSdebug
00123   if ((currentInteractionLength <0.0) || (verboseLevel>2))
00124   {
00125     G4cout << "G4ProtonAntiProtonAtRestChips::AtRestGetPhysicalInteractionLength ";
00126     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
00127     track.GetDynamicParticle()->DumpInfo();
00128     G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
00129     G4cout << "MeanLifeTime = " << currentInteractionLength/CLHEP::ns << "[ns]" <<G4endl;
00130   }
00131 #endif
00132   return theNumberOfInteractionLengthLeft * currentInteractionLength;
00133 }
00134 #endif

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