//////////////////////////////////////////////////////////////////// /// \class RAT::DecayChain_Gen /// /// \brief Implements a GLG4Sim-style generator for a chain of radioactive /// decays. The class we use is DecayChain, prepared by Joe Formaggio /// and Jason Detwiler. This class is based on code in GLG4Sim/GLG4Gen. /// /// \author Joe Formaggio and Jason Detwiler -- not on SNO+ /// \author Logan Sibley /// \author Eric Vazquez-Jauregui /// /// REVISION HISTORY:\n /// 10 Jan 2006 : WGS \n /// 02 Nov 2009 : Aleksandra Bialek - added midchain and alpha options \n /// 28 May 2010 : Logan Sibley - added screening option to decay_chain \n /// 23 Sep 2010 : Logan Sibley - added gamma decay option \n /// 03 Jan 2013 : Logan Sibley - now adds parent info into DS /// 04 Aug 2015 : Matt Mottram - Use G4IonTable to get ions /// 07 Feb 2017 : Nuno Barros - Removing time and pos gen instances since they /// since they are defined in the base GLG4gen /// /// \details To use this generator, the command is: /// /generator/add decaychain ISOTOPE:POSITION[:TIME][:MIDCHAIN][:SCREEN] /// (that is, TIME, MIDCHAIN and SCREEN are optional). ISOTOPE comes /// from the list in data/beta_decays.dat. POSITION and TIME are the /// same as for the combo generator. For example: /// /generator/add decaychain 208Tl:fill \n\n /// /// To start in the middle of a decay chain at ISOTOPE, one should /// set the command as: /// /generator/add decaychain ISOTOPE:POSITION:TIME:midchain /// The generator then searches through all elements in each chain and /// creates the chain starting from that ISOTOPE. \n \n /// /// There is also an option to have only one decay of that ISOTOPE. /// By default, the decay for elements is beta decay. To not crash RAT /// one should choose an ISOTOPE which undergoes beta decay, not alpha /// or gamma decay. If an alpha or gamma decay of ISOTOPE is required, /// one should set: /// /generator/add decaychain ISOTOPE:POSITION:TIME:alpha or /// /generator/add decaychain ISOTOPE:POSITION:TIME:gamma /// The generator will then use the information from beta_decays.dat /// for the alpha or gamma decay of ISOTOPE. Note that gamma decays /// include electron capture decays and internal transitions. \n \n /// /// Note that 'chains' may also consist of a list of the various decay /// processes a single ISOTOPE may undergo. For example, if ISOTOPE /// may both beta decay and electron capture, then there will be two /// entries for ISOTOPE in beta_decays.dat, one DECAY and one GAMMA /// type. The CHAIN type for isotope will then select the appropriate /// decay type according to the branching ratios for each. /// /// The last option is to choose whether or not to apply a screening /// correction to the calculation of the Fermi function in beta /// decay. If SCREEN is not specified, or is set to 'none', then no /// screening correction will be applied. To apply a screening /// correction, one should set: /// /generator/add decaychain ISOTOPE:POSITION:TIME::screen /// One may also specify MIDCHAIN, if required. Further information /// regarding the screening is in src/gen/FermiFunction.cc and will be /// available in SNO+ DocDB. \n \n /// /// For now, the implicit assumption is that all the isotopes in the /// decay chain remain at the fixed point determined by the position /// generator (no drifting during decays). There is also no "deferring" /// of any tracks of emitted particles into other events. "TIME" /// refers to the start of the selected decay chain. As with the combo /// generator, the default is a poisson. \n \n /// /// The location of the file path data/beta_decays.dat is assumed to be /// relative to the directory in which we're running RAT. If you have /// to start RAT from a different location, want to use a different /// beta_decays.dat file, etc., you can change the file path by setting /// the variable $RATDecayDataDir in your shell environment. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_DecayChain_Gen__ #define __RAT_DecayChain_Gen__ #include #include class G4Event; class GLG4TimeGen; class GLG4PosGen; namespace RAT{ // Forward declarations in RAT namespace class DecayChain; class DecayChain_Gen : public GLG4Gen { public: DecayChain_Gen(const G4String & name = "DecayChain"); virtual ~DecayChain_Gen(); virtual void GenerateEvent(G4Event *event); virtual void ResetTime(double offset=0.0); virtual bool IsRepeatable() const { return true; }; virtual void SetState(G4String state); virtual G4String GetState() const; virtual void SetTimeState(G4String state); virtual G4String GetTimeState() const; virtual void SetPosState(G4String state); virtual G4String GetPosState() const; protected: // Generator initialization, specified by the user. G4String fStateStr; // The decay chain for the isotope selected by the user. DecayChain* fDecayChain; bool fInMiddle; //to start chain from the isotope; bool fInAlphaDecay;// to have only alpha decay bool fInGammaDecay;// to have only gamma decay bool fScreenCorr; // to use a screening correction in the beta decay }; } #endif