//////////////////////////////////////////////////////////////////// #ifndef __RAT_VertexGen_IBD__ #define __RAT_VertexGen_IBD__ /** \class RAT::VertexGen_IBD vertex generator that can generate the products of a inverse beta-decay reaction from a reactor anti-neutrino. The direction of the neutrino is supplied, and the energy and angle of the produced positron and neutron are drawn from the distribution produced by the differential cross-section and a reactor anti-neutrino energy spectrum. 17-10-2016 - N. Barros - Added a couple of updates to follow with the overload of the reactor generator */ #include #ifdef RATDEBUG #include #endif #include #include #include class TH1D; class G4ParticleDefinition; namespace RAT { class IBDCrossSec; class VertexGen_IBD : public NeutrinoVertexGen { public: VertexGen_IBD(const char *arg_dbname="IBD"); virtual ~VertexGen_IBD(); virtual void GeneratePrimaryVertex( G4Event *argEvent, G4ThreeVector &dx, G4double dt); // This one only makes sense for neutrino sources such as ES and IBD virtual void GeneratePrimaryVertex( G4Event *argEvent, G4ThreeVector &dx, G4double dt, G4ThreeVector &nu_dir); // generates a primary vertex with given particle type, direction, energy, // and consistent polarization. virtual void SetState( G4String newValues ); // format: dir_x dir_y dir_z // If dir_x==dir_y==dir_z==0, the directions are isotropic. virtual G4String GetState(); // returns current state formatted as above virtual void BeginOfRun(); virtual void EndOfRun(); void SetSpectrum(TH1D *flux); void GenEvent(const G4ThreeVector &nu_dir, G4LorentzVector &neutrino, G4LorentzVector &positron, G4LorentzVector &neutron); void GenInteraction(double &E, double &CosThetaLab); virtual G4double GetRatePerTarget(); private: const G4ParticleDefinition *fANu, *fNeutron, *fEplus; G4ThreeVector fNuDir; double fCrossSecMax; double fFluxMax; IBDCrossSec *fCrossSec; static const double sDeltaM; TH1D *fFlux; std::vector fSpectrumX; std::vector fSpectrumY; bool fSpectrumLoaded; bool fStandaloneMode; #ifdef RATDEBUG Profiler fProfiler; #endif }; } // namespace RAT #endif