//////////////////////////////////////////////////////////////////// /// \class RAT::AddNoiseProc /// /// \brief Add noise to MC that did not create noise hits during Gsim simulation /// /// \author Jonathan Chalaturnyk /// /// REVISION HISTORY:\n /// 17 Apr 2020 : Jonathan Chalaturnyk - Created processor /// 26 Oct 2020 : Mark Anderson - Change to inherit from Noise class /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_AddNoiseProc__ #define __RAT_AddNoiseProc__ #include #include #include #include namespace RAT { namespace DS { class Entry; class Run; class MCPMT; class MCPE; } class AddNoiseProc : public Processor, public Noise { public: AddNoiseProc(); ~AddNoiseProc(); virtual void BeginOfRun(DS::Run&); virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); const std::vector& GetSortedPMTCollection(); private: /// Generate noise for hits already simulated from DS MC branch void AddNoiseToHits(const DS::Entry& ds); /// Detect a photoelectron at a given PMT and modify the event. void DetectPhotoelectron(const unsigned int pmtID, DS::MCPE& photoElectron); void Sort(); std::vector fMCPMTs; ///< The MCPMT collection. std::map fMCPMTMap; ///< The MCPMT collection, mapped by PMT ID. bool fSorted; ///< Is the collection sorted? std::map fNormalToLowGain; ///< Map between normal PMTs (which are geo-built) and low gain (which are not). double fEventCutOffTime; ///< Max time photoelectrons can have to be included in collection. }; } // namespace RAT #endif