Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/radioactive_decay/include/G4RadioactiveDecay.hh

    r1315 r1347  
    6161#include "G4RadioactiveDecayRateVector.hh"
    6262#include "G4RIsotopeTable.hh"
     63#include "G4RadioactivityTable.hh"
     64
    6365#include <vector>
     66
    6467
    6568//class G4UserlimitsForRD;
     
    7477class G4RadioactiveDecay : public G4VRestDiscreteProcess
    7578{
    76   // class description
    77  
    78   // Implementation of nuclear radioactive decay process.
    79   // It simulates the decays of radioactive nuclei, which is submitted to RDM in the form
    80   // of G4Ions. Half-liffe and decay schemes are hold in the Radioactivity database
    81   // All decay products are submitted back to the particle tracking process through
    82   // the G4ParticleChangeForRadDecay object.
    83 
    84   // class description - end
    85  
     79        // class description
     80
     81        // Implementation of nuclear radioactive decay process.
     82        // It simulates the decays of radioactive nuclei, which is submitted to RDM in the form
     83        // of G4Ions. Half-liffe and decay schemes are hold in the Radioactivity database
     84        // All decay products are submitted back to the particle tracking process through
     85        // the G4ParticleChangeForRadDecay object.
     86
     87        // class description - end
     88
    8689public: // with description
    8790
    88   G4RadioactiveDecay (const G4String& processName="RadioactiveDecay");
    89   ~G4RadioactiveDecay();
    90   // constructor and destructor
    91   //
    92 
    93   G4bool IsApplicable(const G4ParticleDefinition &);
    94   // Returns true if the specified isotope is
    95   //  1) defined as "nucleus" and
    96   //  2) it is within theNucleusLimit
    97   //
    98   G4bool IsLoaded (const G4ParticleDefinition &);
    99   // Returns true if the decay table of the specified nuclei is ready.
    100   //
    101   void SelectAVolume(const G4String aVolume);
    102   // Select a logical volume in which RDM applies.
    103   //
    104   void DeselectAVolume(const G4String aVolume);
    105   // remove a logical volume from the RDM applied list
    106   //
    107   void SelectAllVolumes();
    108   // Select all logical volumes for the application of RDM.
    109   //
    110   void DeselectAllVolumes();
    111   // Remove all logical volumes from RDM applications.
    112   //
    113   void SetDecayBias (G4String filename);
    114   //   Sets the decay biasing scheme using the data in "filename"
    115   //
    116   void SetHLThreshold (G4double hl) {halflifethreshold = hl;}
    117   // Set the half-life threshold for isomer production
    118   //
    119   void SetICM (G4bool icm) {applyICM = icm;}
    120   // Enable/disable ICM
    121   //
    122   void SetARM (G4bool arm) {applyARM = arm;}
    123   // Enable/disable ARM
    124   //
    125   void SetSourceTimeProfile (G4String filename) ;
    126   //  Sets source exposure function using histograms in "filename"
    127   //
    128   G4bool IsRateTableReady(const G4ParticleDefinition &);
    129   // Returns true if the coefficient and decay time table for all the
    130   // descendants of the specified isotope are ready.
    131   //
    132   // used in VR decay mode only
    133   //
    134   void AddDecayRateTable(const G4ParticleDefinition &);
    135   // Calculates the coefficient and decay time table for all the descendants
    136   // of the specified isotope.  Adds the calculated table to the private data
    137   // member "theDecayRateTableVector".
    138   //
    139   //
    140   // used in VR decay mode only
    141   //
    142   void GetDecayRateTable(const G4ParticleDefinition &);
    143   // Used to retrieve the coefficient and decay time table for all the
    144   // descendants of the specified isotope from "theDecayRateTableVector"
    145   // and place it in "theDecayRateTable".
    146   //
    147   //
    148   // used in VR decay mode only
    149   //
    150   void SetDecayRate(G4int,G4int,G4double, G4int, std::vector<G4double>,
    151                     std::vector<G4double>);
    152   // Sets "theDecayRate" with data supplied in the arguements.
    153   //
    154   //  //
    155   // used in VR decay mode only
    156   //
    157 
    158   G4DecayTable *LoadDecayTable (G4ParticleDefinition & theParentNucleus);
    159   // Load the decay data of isotope theParentNucleus.
    160   //
    161   inline void  SetVerboseLevel(G4int value) {verboseLevel = value;}
    162   // Sets the VerboseLevel which controls duggering display.
    163   //
    164   inline G4int GetVerboseLevel() const {return verboseLevel;}
    165   // Returns the VerboseLevel which controls level of debugging output.
    166   //
    167   inline void SetNucleusLimits(G4NucleusLimits theNucleusLimits1)
    168   {theNucleusLimits = theNucleusLimits1 ;}
    169   //  Sets theNucleusLimits which specifies the range of isotopes
    170   //  the G4RadioactiveDecay applies.
    171   //
    172   inline G4NucleusLimits GetNucleusLimits() const
    173   {return theNucleusLimits;}
    174   //  Returns theNucleusLimits which specifies the range of isotopes
    175   //  the G4RadioactiveDecay applies.
    176   //
    177   inline void SetAnalogueMonteCarlo (G4bool r ) { AnalogueMC  = r; }
    178   //   Controls whether G4RadioactiveDecay runs in analogue mode or
    179   //   variance reduction mode.
    180   inline void SetFBeta (G4bool r ) { FBeta  = r; }
    181   //   Controls whether G4RadioactiveDecay uses fast beta simulation mode
    182   //
    183   inline G4bool IsAnalogueMonteCarlo () {return AnalogueMC;}
    184   //   Returns true if the simulation is an analogue Monte Carlo, and false if
    185   //   any of the biassing schemes have been selected.
    186   //
    187   inline void SetBRBias (G4bool r ) { BRBias  = r;
    188   SetAnalogueMonteCarlo(0);}
    189   //   Sets whether branching ration bias scheme applies.
    190   //
    191   inline void SetSplitNuclei (G4int r) { NSplit = r; SetAnalogueMonteCarlo(0); }
    192   //  Sets the N number for the Nuclei spliting bias scheme
    193   //
    194   inline G4int GetSplitNuclei () {return NSplit;}
    195   //  Returns the N number used for the Nuclei spliting bias scheme
    196   //
     91        G4RadioactiveDecay (const G4String& processName="RadioactiveDecay");
     92        ~G4RadioactiveDecay();
     93        // constructor and destructor
     94        //
     95
     96        G4bool IsApplicable(const G4ParticleDefinition &);
     97        // Returns true if the specified isotope is
     98        //  1) defined as "nucleus" and
     99        //  2) it is within theNucleusLimit
     100        //
     101        G4bool IsLoaded (const G4ParticleDefinition &);
     102        // Returns true if the decay table of the specified nuclei is ready.
     103        //
     104        void SelectAVolume(const G4String aVolume);
     105        // Select a logical volume in which RDM applies.
     106        //
     107        void DeselectAVolume(const G4String aVolume);
     108        // remove a logical volume from the RDM applied list
     109        //
     110        void SelectAllVolumes();
     111        // Select all logical volumes for the application of RDM.
     112        //
     113        void DeselectAllVolumes();
     114        // Remove all logical volumes from RDM applications.
     115        //
     116        void SetDecayBias (G4String filename);
     117        //   Sets the decay biasing scheme using the data in "filename"
     118        //
     119        void SetHLThreshold (G4double hl) {halflifethreshold = hl;}
     120        // Set the half-life threshold for isomer production
     121        //
     122        void SetICM (G4bool icm) {applyICM = icm;}
     123        // Enable/disable ICM
     124        //
     125        void SetARM (G4bool arm) {applyARM = arm;}
     126        // Enable/disable ARM
     127        //
     128        void SetSourceTimeProfile (G4String filename) ;
     129        //  Sets source exposure function using histograms in "filename"
     130        //
     131        G4bool IsRateTableReady(const G4ParticleDefinition &);
     132        // Returns true if the coefficient and decay time table for all the
     133        // descendants of the specified isotope are ready.
     134        //
     135        // used in VR decay mode only
     136        //
     137        void AddDecayRateTable(const G4ParticleDefinition &);
     138        // Calculates the coefficient and decay time table for all the descendants
     139        // of the specified isotope.  Adds the calculated table to the private data
     140        // member "theDecayRateTableVector".
     141        //
     142        //
     143        // used in VR decay mode only
     144        //
     145        void GetDecayRateTable(const G4ParticleDefinition &);
     146        // Used to retrieve the coefficient and decay time table for all the
     147        // descendants of the specified isotope from "theDecayRateTableVector"
     148        // and place it in "theDecayRateTable".
     149        //
     150        //
     151        // used in VR decay mode only
     152        //
     153        void SetDecayRate(G4int,G4int,G4double, G4int, std::vector<G4double>,
     154                std::vector<G4double>);
     155        // Sets "theDecayRate" with data supplied in the arguements.
     156        //
     157        //  //
     158        // used in VR decay mode only
     159        //
     160
     161        std::vector<G4RadioactivityTable*> GetTheRadioactivityTables() {return theRadioactivityTables;}
     162        // return the vector of G4Radioactivity map
     163        // should be used in VR mode only
     164
     165        G4DecayTable *LoadDecayTable (G4ParticleDefinition & theParentNucleus);
     166        // Load the decay data of isotope theParentNucleus.
     167        //
     168        inline void  SetVerboseLevel(G4int value) {verboseLevel = value;}
     169        // Sets the VerboseLevel which controls duggering display.
     170        //
     171        inline G4int GetVerboseLevel() const {return verboseLevel;}
     172        // Returns the VerboseLevel which controls level of debugging output.
     173        //
     174        inline void SetNucleusLimits(G4NucleusLimits theNucleusLimits1)
     175        {theNucleusLimits = theNucleusLimits1 ;}
     176        //  Sets theNucleusLimits which specifies the range of isotopes
     177        //  the G4RadioactiveDecay applies.
     178        //
     179        inline G4NucleusLimits GetNucleusLimits() const
     180        {return theNucleusLimits;}
     181        //  Returns theNucleusLimits which specifies the range of isotopes
     182        //  the G4RadioactiveDecay applies.
     183        //
     184        inline void SetAnalogueMonteCarlo (G4bool r ) {
     185          AnalogueMC  = r;
     186          if (!AnalogueMC) halflifethreshold = 1e-6*s;
     187        }
     188        //   Controls whether G4RadioactiveDecay runs in analogue mode or
     189        //   variance reduction mode.
     190        inline void SetFBeta (G4bool r ) { FBeta  = r; }
     191        //   Controls whether G4RadioactiveDecay uses fast beta simulation mode
     192        //
     193        inline G4bool IsAnalogueMonteCarlo () {return AnalogueMC;}
     194        //   Returns true if the simulation is an analogue Monte Carlo, and false if
     195        //   any of the biassing schemes have been selected.
     196        //
     197        inline void SetBRBias (G4bool r ) { BRBias  = r;
     198        SetAnalogueMonteCarlo(0);}
     199        //   Sets whether branching ration bias scheme applies.
     200        //
     201        inline void SetSplitNuclei (G4int r) { NSplit = r; SetAnalogueMonteCarlo(0); }
     202        //  Sets the N number for the Nuclei spliting bias scheme
     203        //
     204        inline G4int GetSplitNuclei () {return NSplit;}
     205        //  Returns the N number used for the Nuclei spliting bias scheme
     206        //
    197207public:
    198  
    199   void BuildPhysicsTable(const G4ParticleDefinition &);
     208
     209        void BuildPhysicsTable(const G4ParticleDefinition &);
    200210
    201211protected:
    202212
    203   G4VParticleChange* DecayIt( const G4Track& theTrack,
    204                               const G4Step&  theStep);
    205 
    206   G4DecayProducts* DoDecay(G4ParticleDefinition& theParticleDef);
    207 
    208   G4double GetMeanFreePath(const G4Track& theTrack,
    209                            G4double previousStepSize,
    210                            G4ForceCondition* condition);
    211 
    212   G4double GetMeanLifeTime(const G4Track& theTrack,
    213                            G4ForceCondition* condition);
    214 
    215   G4double GetTaoTime(G4double,G4double);
    216 
    217   G4double GetDecayTime();
    218 
    219   G4int GetDecayTimeBin(const G4double aDecayTime);
     213        G4VParticleChange* DecayIt( const G4Track& theTrack,
     214                const G4Step&  theStep);
     215
     216        G4DecayProducts* DoDecay(G4ParticleDefinition& theParticleDef);
     217
     218        G4double GetMeanFreePath(const G4Track& theTrack,
     219                G4double previousStepSize,
     220                G4ForceCondition* condition);
     221
     222        G4double GetMeanLifeTime(const G4Track& theTrack,
     223                G4ForceCondition* condition);
     224
     225        G4double GetTaoTime(G4double,G4double);
     226
     227        G4double GetDecayTime();
     228
     229        G4int GetDecayTimeBin(const G4double aDecayTime);
    220230
    221231private:
    222232
    223   G4RadioactiveDecay(const G4RadioactiveDecay &right);
    224   G4RadioactiveDecay & operator=(const G4RadioactiveDecay &right);
     233        G4RadioactiveDecay(const G4RadioactiveDecay &right);
     234        G4RadioactiveDecay & operator=(const G4RadioactiveDecay &right);
    225235
    226236private:
    227237
    228   G4RadioactiveDecaymessenger  *theRadioactiveDecaymessenger;
    229 
    230   G4PhysicsTable               *aPhysicsTable;
    231 
    232   G4RIsotopeTable              *theIsotopeTable;
    233 
    234   G4NucleusLimits               theNucleusLimits;
    235 
    236   const G4double                HighestBinValue;
    237   const G4double                LowestBinValue;
    238 
    239   const G4int                   TotBin;
    240 
    241   G4bool                        AnalogueMC;
    242   G4bool                        BRBias;
    243   G4bool                        FBeta;
    244   G4int                         NSplit;
    245 
    246   G4double                      halflifethreshold;
    247   G4bool                        applyICM;
    248   G4bool                        applyARM;
    249 
    250   G4int                         NSourceBin;
    251   G4double                      SBin[99];
    252   G4double                      SProfile[99];
    253 
    254   G4int                         NDecayBin;
    255   G4double                      DBin[99];
    256   G4double                      DProfile[99];
    257 
    258   std::vector<G4String>         LoadedNuclei;
    259   std::vector<G4String>         ValidVolumes;
    260 
    261   G4RadioactiveDecayRate        theDecayRate;
    262   G4RadioactiveDecayRates       theDecayRateVector;
    263   G4RadioactiveDecayRateVector  theDecayRateTable;
    264   G4RadioactiveDecayRateTable   theDecayRateTableVector;
    265 
    266   static const G4double         levelTolerance;
    267 
    268   // Remainder of life time at rest
    269   G4double                      fRemainderLifeTime;
    270 
    271   G4int                         verboseLevel;
    272 
    273 
    274   // ParticleChange for decay process
    275   G4ParticleChangeForRadDecay   fParticleChangeForRadDecay;
    276 
    277   inline G4double AtRestGetPhysicalInteractionLength
    278     (const G4Track& track, G4ForceCondition* condition)
    279   {fRemainderLifeTime = G4VRestDiscreteProcess::
    280     AtRestGetPhysicalInteractionLength(track, condition );
    281   return fRemainderLifeTime;}
    282 
    283   inline G4VParticleChange* AtRestDoIt
    284     (const G4Track& theTrack, const G4Step& theStep)
    285   {return DecayIt(theTrack, theStep);}
    286 
    287   inline G4VParticleChange* PostStepDoIt
    288     (const G4Track& theTrack, const G4Step& theStep)
    289   {return DecayIt(theTrack, theStep);}
     238        G4RadioactiveDecaymessenger  *theRadioactiveDecaymessenger;
     239
     240        G4PhysicsTable               *aPhysicsTable;
     241
     242        G4RIsotopeTable              *theIsotopeTable;
     243
     244        G4NucleusLimits               theNucleusLimits;
     245
     246        const G4double                HighestBinValue;
     247        const G4double                LowestBinValue;
     248
     249        const G4int                   TotBin;
     250
     251        G4bool                        AnalogueMC;
     252        G4bool                        BRBias;
     253        G4bool                        FBeta;
     254        G4int                         NSplit;
     255
     256        G4double                      halflifethreshold;
     257        G4bool                        applyICM;
     258        G4bool                        applyARM;
     259
     260        G4int                         NSourceBin;
     261        G4double                      SBin[99];
     262        G4double                      SProfile[99];
     263
     264        G4int                         NDecayBin;
     265        G4double                      DBin[99];
     266        G4double                      DProfile[99];
     267
     268        std::vector<G4String>         LoadedNuclei;
     269        std::vector<G4String>         ValidVolumes;
     270
     271        G4RadioactiveDecayRate        theDecayRate;
     272        G4RadioactiveDecayRates       theDecayRateVector;
     273        G4RadioactiveDecayRateVector  theDecayRateTable;
     274        G4RadioactiveDecayRateTable   theDecayRateTableVector;
     275
     276        // for the radioactivity tables
     277        std::vector<G4RadioactivityTable*>      theRadioactivityTables;
     278        G4int                         decayWindows[99];
     279
     280        //
     281        static const G4double             levelTolerance;
     282
     283        // Remainder of life time at rest
     284        G4double                      fRemainderLifeTime;
     285
     286        G4int                         verboseLevel;
     287
     288
     289        // ParticleChange for decay process
     290        G4ParticleChangeForRadDecay   fParticleChangeForRadDecay;
     291
     292        inline G4double AtRestGetPhysicalInteractionLength
     293                (const G4Track& track, G4ForceCondition* condition)
     294        {fRemainderLifeTime = G4VRestDiscreteProcess::
     295        AtRestGetPhysicalInteractionLength(track, condition );
     296        return fRemainderLifeTime;}
     297
     298        inline G4VParticleChange* AtRestDoIt
     299                (const G4Track& theTrack, const G4Step& theStep)
     300        {return DecayIt(theTrack, theStep);}
     301
     302        inline G4VParticleChange* PostStepDoIt
     303                (const G4Track& theTrack, const G4Step& theStep)
     304        {return DecayIt(theTrack, theStep);}
    290305
    291306};
Note: See TracChangeset for help on using the changeset viewer.