Ignore:
Timestamp:
Apr 20, 2009, 5:54:05 PM (15 years ago)
Author:
garnier
Message:

update to geant4.9.2

Location:
trunk/source/processes/hadronic/models/management/include
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/management/include/G4HadronicInteraction.hh

    r962 r1007  
    2525//
    2626//
    27 // $Id: G4HadronicInteraction.hh,v 1.9 2009/01/24 11:56:27 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
    29 //
    30 // Hadronic Interaction  abstract base class
    31 // This class is the base class for the model classes.
    32 // It sorts out the energy-range for the models and provides
    33 // class utilities.
    34 // original by H.P. Wellisch
    35 // Modified by J.L.Chuma, TRIUMF, 21-Mar-1997
    36 // Last modified: 3-Apr-1997
    37 // Added units to energy initialization: J.L. Chuma  04-Apr-97
    38 // Modified by J.L.Chuma, 05-May-97  to Initialize theBlockedCounter
    39 // Modified by J.L.Chuma, 08-Jul-97 to implement the Nucleus changes
    40 // Adding a registry for memory management of hadronic models, HPW 22-Mar-99
    41 // 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
    42 //                          and reorder methods in the header
     27// $Id: G4HadronicInteraction.hh,v 1.8 2007/01/11 05:30:01 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-02 $
     29//
     30 // Hadronic Interaction  abstract base class
     31 // This class is the base class for the model classes.
     32 // It sorts out the energy-range for the models and provides
     33 // class utilities.
     34 // original by H.P. Wellisch
     35 // Modified by J.L.Chuma, TRIUMF, 21-Mar-1997
     36 // Last modified: 3-Apr-1997
     37 // Added units to energy initialization: J.L. Chuma  04-Apr-97
     38 // Modified by J.L.Chuma, 05-May-97  to Initialize theBlockedCounter
     39 // Modified by J.L.Chuma, 08-Jul-97 to implement the Nucleus changes
     40 // Adding a registry for memory management of hadronic models, HPW 22-Mar-99
    4341
    4442// Class Description
    4543// This is the base class for all hadronic interaction models in geant4.
    46 // If you want to implement a new way of producing a final state, please,
    47 //  inherit from here.
     44// If you want to implement a new way of producing a final state, please inherit
     45// from here.
    4846// Class Description - End
    4947 
     
    5250 
    5351#include "G4HadFinalState.hh"
     52#include "G4DynamicParticle.hh"
    5453#include "G4ReactionDynamics.hh"
    5554#include "G4Material.hh"
     
    5756#include "G4Track.hh"
    5857#include "G4HadProjectile.hh"
    59 
    60 class G4HadronicInteraction
    61 {
     58#include "G4HadronicInteractionRegistry.hh"
     59#include "G4HadronicException.hh"
     60
     61 class G4HadronicInteraction
     62 {
     63 public:
     64   
     65    G4HadronicInteraction(const G4String& modelName = "HadronicModel") :
     66      verboseLevel(0), theMinEnergy(0.0*GeV), theMaxEnergy(25.0*GeV),
     67      isBlocked(false), theModelName(modelName)
     68    {
     69      G4HadronicInteractionRegistry::RegisterMe(this);
     70    }
     71   
     72    virtual ~G4HadronicInteraction()
     73    {
     74      G4HadronicInteractionRegistry::RemoveMe(this);
     75    }
     76   
     77 private:
     78   
     79    inline G4HadronicInteraction(
     80     const G4HadronicInteraction &right )
     81    { *this = right; }
     82   
     83    inline const G4HadronicInteraction & operator=(
     84     const G4HadronicInteraction &right )
     85    {
     86     G4String text = "unintended use of G4HadronicInteraction::operator=";
     87     throw G4HadronicException(__FILE__, __LINE__, text);
     88     return right;
     89    }
     90   
     91 public:
     92   
     93    inline G4bool operator==(
     94     const G4HadronicInteraction &right ) const
     95    { return ( this == (G4HadronicInteraction *) &right ); }
     96   
     97    inline G4bool operator!=(
     98     const G4HadronicInteraction &right ) const
     99    { return ( this != (G4HadronicInteraction *) &right ); }
     100   
     101    inline G4double GetMinEnergy() const
     102    { return theMinEnergy; }
     103   
     104    virtual G4double GetMinEnergy( const G4Material *aMaterial,
     105                                  const G4Element *anElement ) const;
     106   
     107    inline void SetMinEnergy( const G4double anEnergy )
     108    { theMinEnergy = anEnergy; }
     109   
     110    virtual void SetMinEnergy( G4double anEnergy, G4Element *anElement );
     111   
     112    virtual void SetMinEnergy( G4double anEnergy, G4Material *aMaterial );
     113   
     114    inline G4double GetMaxEnergy() const
     115    { return theMaxEnergy; }
     116   
     117    virtual G4double GetMaxEnergy( const G4Material *aMaterial,
     118                                  const G4Element *anElement ) const;
     119   
     120    inline void SetMaxEnergy( const G4double anEnergy )
     121    { theMaxEnergy = anEnergy; }
     122   
     123    virtual void SetMaxEnergy( G4double anEnergy, G4Element *anElement );
     124   
     125    virtual void SetMaxEnergy( G4double anEnergy, G4Material *aMaterial );
     126 
     127    inline const G4HadronicInteraction *GetMyPointer() const
     128    { return this; }
     129
     130    inline G4int GetVerboseLevel() const
     131    { return verboseLevel; }
     132
     133    inline void SetVerboseLevel( G4int value )
     134    { verboseLevel = value; }
     135
     136    inline const G4String& GetModelName() const
     137    { return theModelName; }
     138
    62139public: // With description
    63 
    64    
    65   G4HadronicInteraction(const G4String& modelName = "HadronicModel");
    66    
    67   virtual ~G4HadronicInteraction();
    68    
    69   virtual G4HadFinalState *ApplyYourself(const G4HadProjectile &aTrack,
    70                                          G4Nucleus & targetNucleus ) = 0;
    71   // This is the interface to implement for final state production code.
    72    
    73   virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
    74                               G4Nucleus & /*targetNucleus*/)
    75   {  return true;}
    76  
    77   inline G4double GetMinEnergy() const
    78   { return theMinEnergy; }
    79    
    80   virtual G4double GetMinEnergy( const G4Material *aMaterial,
    81                                  const G4Element *anElement ) const;
    82    
    83   inline void SetMinEnergy( const G4double anEnergy )
    84   { theMinEnergy = anEnergy; }
    85    
    86   virtual void SetMinEnergy( G4double anEnergy, G4Element *anElement );
    87    
    88   virtual void SetMinEnergy( G4double anEnergy, G4Material *aMaterial );
    89    
    90   inline G4double GetMaxEnergy() const
    91   { return theMaxEnergy; }
    92    
    93   virtual G4double GetMaxEnergy( const G4Material *aMaterial,
    94                                  const G4Element *anElement ) const;
    95    
    96   inline void SetMaxEnergy( const G4double anEnergy )
    97   { theMaxEnergy = anEnergy; }
    98    
    99   virtual void SetMaxEnergy( G4double anEnergy, G4Element *anElement );
    100    
    101   virtual void SetMaxEnergy( G4double anEnergy, G4Material *aMaterial );
    102  
    103   inline const G4HadronicInteraction *GetMyPointer() const
    104   { return this; }
    105 
    106   inline G4int GetVerboseLevel() const
    107   { return verboseLevel; }
    108 
    109   inline void SetVerboseLevel( G4int value )
    110   { verboseLevel = value; }
    111 
    112   inline const G4String& GetModelName() const
    113   { return theModelName; }
     140    // This is the interface to implement for final state production code.
     141   
     142    virtual G4HadFinalState *ApplyYourself(
     143            const G4HadProjectile &aTrack, G4Nucleus & targetNucleus ) = 0;
    114144   
    115145public: // Without description
    116146
    117   virtual void DeActivateFor( G4Material *aMaterial );
    118    
    119   virtual void ActivateFor( G4Material *aMaterial )
    120   {
    121     Block();
    122     SetMaxEnergy(GetMaxEnergy(), aMaterial);
    123     SetMinEnergy(GetMinEnergy(), aMaterial);
    124   }
    125 
    126   virtual void DeActivateFor( G4Element *anElement );
    127   virtual void ActivateFor( G4Element *anElement )
    128   {
    129     Block();
    130     SetMaxEnergy(GetMaxEnergy(), anElement);
    131     SetMinEnergy(GetMinEnergy(), anElement);
    132   }
    133 
    134   virtual G4bool IsBlocked( const G4Material *aMaterial ) const;
    135 
    136   virtual G4bool IsBlocked( const G4Element *anElement) const;
    137 
    138   inline G4bool operator==(const G4HadronicInteraction &right ) const
    139   { return ( this == (G4HadronicInteraction *) &right ); }
    140    
    141   inline G4bool operator!=(const G4HadronicInteraction &right ) const
    142   { return ( this != (G4HadronicInteraction *) &right ); }
    143    
    144 private:
    145    
    146   G4HadronicInteraction(const G4HadronicInteraction &right );
    147    
    148   const G4HadronicInteraction& operator=(const G4HadronicInteraction &right);
    149 
    150 protected:
    151 
    152   inline G4bool IsBlocked() const { return isBlocked;}
    153   inline void Block() { isBlocked = true; }
    154    
    155   G4HadFinalState theParticleChange;
    156   // the G4HadFinalState object which is modified and returned
    157   // by address by the ApplyYourself method,
    158   // (instead of aParticleChange as found in G4VProcess)
    159    
    160   G4int verboseLevel;
    161   // control flag for output messages
    162   // 0: silent
    163   // 1: warning messages
    164   // 2: more
    165   // (instead of verboseLevel as found in G4VProcess)
    166    
    167   G4ReactionDynamics theReactionDynamics;
    168    
    169   // these two have global validity
    170   // units are assumed to be MeV
    171    
    172   G4double theMinEnergy;
    173   G4double theMaxEnergy;
    174    
    175   G4bool isBlocked;
    176 
    177   G4String theModelName;
    178    
    179 private:
     147    virtual void DeActivateFor( G4Material *aMaterial );
     148   
     149    virtual void ActivateFor( G4Material *aMaterial )
     150    {
     151      Block();
     152      SetMaxEnergy(GetMaxEnergy(), aMaterial);
     153      SetMinEnergy(GetMinEnergy(), aMaterial);
     154    }
     155
     156    virtual void DeActivateFor( G4Element *anElement );
     157    virtual void ActivateFor( G4Element *anElement )
     158    {
     159      Block();
     160      SetMaxEnergy(GetMaxEnergy(), anElement);
     161      SetMinEnergy(GetMinEnergy(), anElement);
     162    }
     163
     164    virtual G4bool IsBlocked( const G4Material *aMaterial ) const;
     165
     166    virtual G4bool IsBlocked( const G4Element *anElement) const;
     167   
     168    virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
     169                               G4Nucleus & /*targetNucleus*/){  return true;}
     170 protected:
     171   
     172    G4HadFinalState theParticleChange;
     173    // the G4HadFinalState object which is modified and returned
     174    // by address by the ApplyYourself method,
     175    // (instead of aParticleChange as found in G4VProcess)
     176   
     177    G4int verboseLevel;
     178    // control flag for output messages
     179    // 0: silent
     180    // 1: warning messages
     181    // 2: more
     182    // (instead of verboseLevel as found in G4VProcess)
     183   
     184    G4ReactionDynamics theReactionDynamics;
     185   
     186    // these two have global validity
     187    // units are assumed to be MeV
     188   
     189    G4double theMinEnergy;
     190    G4double theMaxEnergy;
     191   
     192    G4bool IsBlocked() const { return isBlocked;}
     193    void Block() { isBlocked = true; }
     194    G4bool isBlocked;
     195
     196    G4String theModelName;
     197   
     198 private:
    180199       
    181    std::vector<std::pair<G4double, G4Material *> > theMinEnergyList;
    182    std::vector<std::pair<G4double, G4Material *> > theMaxEnergyList;
    183    std::vector<std::pair<G4double, G4Element *> > theMinEnergyListElements;
    184    std::vector<std::pair<G4double, G4Element *> > theMaxEnergyListElements;
    185    std::vector<G4Material *> theBlockedList;
    186    std::vector<G4Element *> theBlockedListElements;
    187 };
     200    std::vector<std::pair<G4double, G4Material *> > theMinEnergyList;
     201    std::vector<std::pair<G4double, G4Material *> > theMaxEnergyList;
     202    std::vector<std::pair<G4double, G4Element *> > theMinEnergyListElements;
     203    std::vector<std::pair<G4double, G4Element *> > theMaxEnergyListElements;
     204    std::vector<G4Material *> theBlockedList;
     205    std::vector<G4Element *> theBlockedListElements;
     206 };
    188207 
    189208#endif
  • trunk/source/processes/hadronic/models/management/include/G4HadronicInteractionRegistry.hh

    r962 r1007  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HadronicInteractionRegistry.hh,v 1.4 2009/02/14 19:24:52 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
    28 //
    29 // 23-Jan-2009 V.Ivanchenko make the class to be a singleton
    30 
    31 // Class Description
    32 // This is the a singleton class to store all hadronic interactions
    33 // Class Description - End
    34 
    3526#ifndef G4HadronicInteractionRegistry_h
    3627#define G4HadronicInteractionRegistry_h 1
     
    3829#include <vector>
    3930#include "globals.hh"
    40 
    4131class G4HadronicInteraction;
    4232
    4333class G4HadronicInteractionRegistry
    4434{
    45 public:
    46 
    47   static G4HadronicInteractionRegistry* Instance();
    48   // access
     35  public:
    4936 
    5037  ~G4HadronicInteractionRegistry();
     38 
     39  static void RegisterMe(G4HadronicInteraction * aModel);
     40  static void RemoveMe(G4HadronicInteraction * aModel);
     41   
     42  protected:
    5143
    52   void Clean();
    53   //delete models
    54  
    55   void RegisterMe(G4HadronicInteraction * aModel);
    56   //register new model
     44  G4HadronicInteractionRegistry(G4String );
     45  static G4HadronicInteractionRegistry & theRegistry();
    5746
    58   void RemoveMe(G4HadronicInteraction * aModel);
    59   //deregister model
    60    
    61 private:
     47  private:
    6248
    63   G4HadronicInteractionRegistry();
     49  //  !!!  can not use "copy constructor" nor "default constructor" !!!!
     50       G4HadronicInteractionRegistry(const G4HadronicInteractionRegistry &right)
     51       { nModels = right.nModels; }
     52       G4HadronicInteractionRegistry() {nModels = 0;}
    6453
    65   static G4HadronicInteractionRegistry* theInstance;
     54  //  !!!  Assignment operation is forbidden !!!
     55      const G4HadronicInteractionRegistry & operator=(const G4HadronicInteractionRegistry &)
     56      { return *this;}
     57
     58  void AddModel(G4HadronicInteraction * aModel);
    6659 
    6760  G4int nModels;
  • trunk/source/processes/hadronic/models/management/include/G4InelasticInteraction.hh

    r962 r1007  
    2525//
    2626//
    27 // $Id: G4InelasticInteraction.hh,v 1.6 2009/01/24 11:56:27 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4InelasticInteraction.hh,v 1.5 2007/01/11 05:30:12 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    30 // Hadronic Process: Inelastic Interaction
    31 // This class is an abstract base class, since the pure virtual
    32 // function ApplyYourself has not been defined yet.
    33 // original by H.P. Wellisch
    34 // Modified by J.L. Chuma, TRIUMF, 22-Nov-1996
    35 // Modified by J.L. Chuma  27-Mar-1997
    36 // Modified by J.L. Chuma  30-Apr-1997
    37 // Modified by J.L. Chuma  05-Aug-1997  to pass the original incident particle to
    38 //                                      CalculateMomenta
    39 // Modified by J.L. Chuma  05-Jun-1998  to include quasiElastic flag to allow for
    40 //                                      TwoBody to be called directly, bypassing
    41 //                                      TwoCluster, and allowing TwoCluster to be
    42 //                                      called with no secondaries
    43 // 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
     30 // Hadronic Process: Inelastic Interaction
     31 // This class is an abstract base class, since the pure virtual
     32 // function ApplyYourself has not been defined yet.
     33 // original by H.P. Wellisch
     34 // Modified by J.L. Chuma, TRIUMF, 22-Nov-1996
     35 // Modified by J.L. Chuma  27-Mar-1997
     36 // Modified by J.L. Chuma  30-Apr-1997
     37 // Modified by J.L. Chuma  05-Aug-1997  to pass the original incident particle to
     38 //                                      CalculateMomenta
     39 // Modified by J.L. Chuma  05-Jun-1998  to include quasiElastic flag to allow for
     40 //                                      TwoBody to be called directly, bypassing
     41 //                                      TwoCluster, and allowing TwoCluster to be
     42 //                                      called with no secondaries
    4443 
    4544#ifndef G4InelasticInteraction_h
     
    5453#include "G4ReactionDynamics.hh"
    5554
    56 class G4InelasticInteraction : public G4HadronicInteraction
    57 {
    58 public:
     55 class G4InelasticInteraction : public G4HadronicInteraction
     56 {
     57 public:
    5958   
    60     G4InelasticInteraction(const G4String& modelName = "LEInelastic");
     59    G4InelasticInteraction(const G4String& modelName = "LEInelastic")
     60     : G4HadronicInteraction(modelName)
     61    { cache = 0.0;}
    6162   
    62     virtual ~G4InelasticInteraction();
     63    virtual ~G4InelasticInteraction()
     64    { }
    6365   
    64 protected:
     66 protected:
    6567   
    6668    G4double Pmltpc( G4int np, G4int nm, G4int nz, G4int n,
     
    98100                      G4ReactionProduct &targetParticle,
    99101                      G4bool &incidentHasChanged );
    100 private:
     102   private:
    101103   
    102104      G4double cache;
    103105      G4ThreeVector what;
    104106
    105 };
     107 };
    106108 
    107109#endif
  • trunk/source/processes/hadronic/models/management/include/G4V3DNucleus.hh

    r962 r1007  
    2626//
    2727// $Id: G4V3DNucleus.hh,v 1.6 2008/05/16 14:02:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    3030#ifndef G4V3DNucleus_h
  • trunk/source/processes/hadronic/models/management/include/G4VHighEnergyGenerator.hh

    r962 r1007  
    2626//
    2727// $Id: G4VHighEnergyGenerator.hh,v 1.4 2006/06/29 20:45:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    3030#ifndef G4VHighEnergyGenerator_h
  • trunk/source/processes/hadronic/models/management/include/G4VIntraNuclearTransportModel.hh

    r962 r1007  
    2626//
    2727// $Id: G4VIntraNuclearTransportModel.hh,v 1.4 2007/01/11 05:29:46 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    3030// $Id: G4IntraNuclearTransportMode.hh,v 1.0 1998/06/30
  • trunk/source/processes/hadronic/models/management/include/G4VKineticNucleon.hh

    r962 r1007  
    2626//
    2727// $Id: G4VKineticNucleon.hh,v 1.4 2006/06/29 20:45:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    3030#ifndef G4VKineticNucleon_h
  • trunk/source/processes/hadronic/models/management/include/G4VNuclearDensity.hh

    r962 r1007  
    2626//
    2727// $Id: G4VNuclearDensity.hh,v 1.4 2006/06/29 20:45:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    3030#ifndef G4VNuclearDensity_h
  • trunk/source/processes/hadronic/models/management/include/G4VPreCompoundModel.hh

    r962 r1007  
    2626//
    2727// $Id: G4VPreCompoundModel.hh,v 1.5 2007/01/11 05:29:34 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-02 $
    2929//
    3030
Note: See TracChangeset for help on using the changeset viewer.