G4HadronicInteraction.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 //
00027 // $Id$
00028 //
00029 // Hadronic Interaction  abstract base class
00030 // This class is the base class for the model classes.
00031 // It sorts out the energy-range for the models and provides
00032 // class utilities.
00033 // original by H.P. Wellisch
00034 // Modified by J.L.Chuma, TRIUMF, 21-Mar-1997
00035 // Last modified: 3-Apr-1997
00036 // Added units to energy initialization: J.L. Chuma  04-Apr-97
00037 // Modified by J.L.Chuma, 05-May-97  to Initialize theBlockedCounter
00038 // Modified by J.L.Chuma, 08-Jul-97 to implement the Nucleus changes
00039 // Adding a registry for memory management of hadronic models, HPW 22-Mar-99
00040 // 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
00041 //                          and reorder methods in the header 
00042 // 29-Jun-2009 V.Ivanchenko add SampleInvariantT method
00043 // 29-Aug-2009 V.Ivanchenko moved G4ReactionDynamics to G4InelasticInteraction,
00044 //                          add const pointers, and added recoilEnergyThreshold
00045 //                          member and accesors
00046 
00047 // Class Description
00048 // This is the base class for all hadronic interaction models in geant4.
00049 // If you want to implement a new way of producing a final state, please,
00050 //  inherit from here.
00051 // Class Description - End
00052  
00053 #ifndef G4HadronicInteraction_h
00054 #define G4HadronicInteraction_h 1
00055  
00056 #include "G4HadFinalState.hh"
00057 #include "G4Material.hh"
00058 #include "G4Nucleus.hh"
00059 #include "G4Track.hh"
00060 #include "G4HadProjectile.hh"
00061 #include "G4ReactionDynamics.hh"
00062 
00063 class G4HadronicInteraction
00064 {
00065 public: // With description
00066     
00067   G4HadronicInteraction(const G4String& modelName = "HadronicModel");
00068     
00069   virtual ~G4HadronicInteraction();
00070     
00071   virtual G4HadFinalState *ApplyYourself(const G4HadProjectile &aTrack, 
00072                                          G4Nucleus & targetNucleus ) = 0;
00073   // The interface to implement for final state production code.
00074 
00075   virtual G4double SampleInvariantT(const G4ParticleDefinition* p, 
00076                                     G4double plab,
00077                                     G4int Z, G4int A);
00078   // The interface to implement sampling of scattering or change exchange
00079    
00080   virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/, 
00081                               G4Nucleus & /*targetNucleus*/)
00082   { return true;}
00083  
00084   inline G4double GetMinEnergy() const
00085   { return theMinEnergy; }
00086     
00087   G4double GetMinEnergy( const G4Material *aMaterial,
00088                          const G4Element *anElement ) const;
00089    
00090   inline void SetMinEnergy( G4double anEnergy )
00091   { theMinEnergy = anEnergy; }
00092     
00093   void SetMinEnergy( G4double anEnergy, const G4Element *anElement );
00094     
00095   void SetMinEnergy( G4double anEnergy, const G4Material *aMaterial );
00096     
00097   inline G4double GetMaxEnergy() const
00098   { return theMaxEnergy; }
00099     
00100   G4double GetMaxEnergy( const G4Material *aMaterial,
00101                          const G4Element *anElement ) const;
00102     
00103   inline void SetMaxEnergy( const G4double anEnergy )
00104   { theMaxEnergy = anEnergy; }
00105     
00106   void SetMaxEnergy( G4double anEnergy, const G4Element *anElement );
00107     
00108   void SetMaxEnergy( G4double anEnergy, const G4Material *aMaterial );
00109   
00110   inline const G4HadronicInteraction* GetMyPointer() const
00111   { return this; }
00112 
00113   inline G4int GetVerboseLevel() const
00114   { return verboseLevel; }
00115 
00116   inline void SetVerboseLevel( G4int value )
00117   { verboseLevel = value; }
00118 
00119   inline const G4String& GetModelName() const
00120   { return theModelName; }
00121 
00122   void DeActivateFor(const G4Material* aMaterial);
00123  
00124   inline void ActivateFor( const G4Material *aMaterial ) 
00125   { 
00126     Block(); 
00127     SetMaxEnergy(GetMaxEnergy(), aMaterial);
00128     SetMinEnergy(GetMinEnergy(), aMaterial);
00129   }
00130 
00131   void DeActivateFor( const G4Element *anElement ); 
00132   inline void ActivateFor( const G4Element *anElement )
00133   { 
00134     Block(); 
00135     SetMaxEnergy(GetMaxEnergy(), anElement);
00136     SetMinEnergy(GetMinEnergy(), anElement);
00137   }
00138 
00139   G4bool IsBlocked( const G4Material *aMaterial ) const;
00140   G4bool IsBlocked( const G4Element *anElement) const;
00141 
00142   inline void SetRecoilEnergyThreshold(G4double val) 
00143   { recoilEnergyThreshold = val; }
00144 
00145   G4double GetRecoilEnergyThreshold() const 
00146   { return recoilEnergyThreshold;}
00147 
00148   inline G4bool operator==(const G4HadronicInteraction &right ) const
00149   { return ( this == (G4HadronicInteraction *) &right ); }
00150     
00151   inline G4bool operator!=(const G4HadronicInteraction &right ) const
00152   { return ( this != (G4HadronicInteraction *) &right ); }
00153 
00154   virtual const std::pair<G4double, G4double> GetFatalEnergyCheckLevels() const;
00155 
00156   virtual std::pair<G4double, G4double> GetEnergyMomentumCheckLevels() const;
00157 
00158   inline void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
00159   { epCheckLevels.first = relativeLevel;
00160     epCheckLevels.second = absoluteLevel; }
00161 
00162   virtual void ModelDescription(std::ostream& outFile) const ; //=0;
00163 
00164 private:
00165     
00166   G4HadronicInteraction(const G4HadronicInteraction &right );
00167   const G4HadronicInteraction& operator=(const G4HadronicInteraction &right);
00168 
00169 protected:
00170 
00171   inline void SetModelName(const G4String& nam) 
00172   { theModelName = nam; }
00173 
00174   inline G4bool IsBlocked() const { return isBlocked;}
00175   inline void Block() { isBlocked = true; }
00176     
00177   G4HadFinalState theParticleChange;
00178   // the G4HadFinalState object which is modified and returned
00179   // by address by the ApplyYourself method,
00180   // (instead of aParticleChange as found in G4VProcess)
00181     
00182   G4int verboseLevel;
00183   // control flag for output messages
00184   // 0: silent
00185   // 1: warning messages
00186   // 2: more
00187   // (instead of verboseLevel as found in G4VProcess)
00188 
00189   // these two have global validity energy range    
00190   G4double theMinEnergy;
00191   G4double theMaxEnergy;
00192 
00193   G4bool isBlocked;
00194 
00195 private:       
00196     
00197   G4double recoilEnergyThreshold;
00198 
00199   G4String theModelName;
00200 
00201   std::pair<G4double, G4double> epCheckLevels;
00202 
00203   std::vector<std::pair<G4double, const G4Material *> > theMinEnergyList;
00204   std::vector<std::pair<G4double, const G4Material *> > theMaxEnergyList;
00205   std::vector<std::pair<G4double, const G4Element *> > theMinEnergyListElements;
00206   std::vector<std::pair<G4double, const G4Element *> > theMaxEnergyListElements;
00207   std::vector<const G4Material *> theBlockedList;
00208   std::vector<const G4Element *> theBlockedListElements;
00209 };
00210  
00211 #endif

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