/////////////////////////////////////////////////////////////////// /// \class RAT::NucleonDecayGen /// /// \brief Generator for invisible nucleon decay events /// /// \author Ian Coulter -- contact person /// /// REVISION HISTORY: /// 21/03/14 -- Initial commit, I Coulter /// 03/03/15 -- Add in full list of decay gammas /// (Now with additional n and p!). /// 10/02/2017 -- N. Barros : Added BeginOfRun to load database parameters /// /// \details Allows user to choose proton or neutron /// and generates the emitted decay products from /// invisible nucleon decay in 16O based on /// spectrum drawn from a ratdb file /// /////////////////////////////////////////////////////////////////// #ifndef __RAT_VERTEXGEN_NUCLEONDECAY__ #define __RAT_VERTEXGEN_NUCLEONDECAY__ #include #include #include #include #include #include #include class G4Event; namespace RAT { class VertexGen_NucleonDecay : public GLG4VertexGen { public: VertexGen_NucleonDecay(); virtual ~VertexGen_NucleonDecay(); virtual void GeneratePrimaryVertex(G4Event *event, G4ThreeVector &dx, G4double dt); virtual bool IsRepeatable() const { return true; }; virtual void SetState(G4String state); virtual G4String GetState(); virtual void BeginOfRun(); // Returns index of the decay mode from a table of possibilities in the ratdb int SelectDecayMode(G4String nucleonType); // Create a vertex based on particle type and energy void CreateVertex(G4String type, G4double energy, G4Event* event, G4ThreeVector& dx, G4double dt); protected: G4String fStateStr; // generator initialisation, specified by user: G4String fNucleonType; // Type of nucleon decay: proton (default) or neutron DBLinkPtr fNDecay; // Links to the NUCLEON_DECAY.ratdb /// Vectors recording the energies of the gammas, protons and neutrons for each decay mode. /// The final N or P distinguishes weather there are for neutrons or protons std::vector fEnergyGammaN, fEnergyGammaP, fEnergyProtonN, fEnergyProtonP, fEnergyNeutronN, fEnergyNeutronP; /// Vectors recording the branching fractions of each decay mode. std::vector fFractionN, fFractionP; private: G4ParticleDefinition *fGamma, *fProton, *fNeutron; }; } // namespace RAT #endif // __RAT_VERTEXGEN_NucleonDecay__