//////////////////////////////////////////////////////////////////// /// \class RAT::AfterPulse /// /// \brief Simulate after pulsing in the PMTs. /// /// \author Tanner Kaptanoglu /// /// REVISION HISTORY:\n /// 12 Sept 2016 : Tanner Kaptanoglu - first version /// /// \details Generates after pulsing created in the PMTs /// at a user-defined probability per photoelectron. /// Handles passing photoelectrons across events, as /// required by late after-pulses. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_AfterPulse_hh__ #define __RAT_AfterPulse_hh__ #include extern "C" { #include } namespace RAT { class AfterPulse { public: AfterPulse(); ~AfterPulse(); void BeginOfRun(); // Builds a vector containing all of the after-pulse hit times // in their universal times, so that later events can check // if an after pulse, created in a previous event, fell into // its trigger window. void GenerateAfterPulse(const int& days, const int& secs, const double& nsecs); // Samples the after-pulsing time distribution double CalculateAfterPulseTime(); protected: // Decides if the after-pulse was detected and, if so, // builds the after-pulse photoelectron void DetectAfterPulse(const uint64_t& event_time); int fAPFlag; // Flag specifing whether to run the after-pulsing double fAPFraction; // Fraction of photoelectrons that create an after-pulse std::vector fAPTime; // Time distribution of the after-pulse std::vector fAPProb; // Probability of each time size_t fPMTCount; // Number of PMTs float fTriggerWindow; // After-pulse time for each created after pulse std::vector > fAfterPulseTime; // Front-end time for each PE std::vector > fFrontEndTime; // Used as an index for after-pulsing vector std::vector countAP; }; } // namespace RAT #endif