//////////////////////////////////////////////////////////////////// /// \class RAT::AddForcedHitsProc /// /// \brief Simulate forced firing of channel discriminators due to MTCD /// (pedestals) or TUBii/external pulser signals. /// /// \author /// /// REVISION HISTORY:\n /// 22 Jan 2022 : Tereza Kroupa - Created processor /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_AddForcedHitsProc__ #define __RAT_AddForcedHitsProc__ #include #include #include #include namespace RAT { namespace DS { class Entry; class Run; } class AddForcedHitsProc : public Processor { public: // Create new AddForcedHits processor AddForcedHitsProc(); // Destroy AddForcedHits processor ~AddForcedHitsProc(); // Overload BeginOfRun to create a vector of channels that will be fired // and read pedestals values to set correct charges to forced hits virtual void BeginOfRun(DS::Run&); // Called for each event - add hits through GenerateHit virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); // Used to specify the channels to fire // param options are: // - channel: add hits to a set channel only, // should previously use this command to specify the card and the crate // - card: add hits to channels in a set card only, // should previously use this command to specify the crate // - crate: add hits to channels in a set crate only // value should be the channel, card or crate number virtual void SetI(const std::string& param, const int value); // Used to specify the time of the hits being added // param should be time // value should be the time at which to place hits in ns virtual void SetD(const std::string& param, const double value); private: void GenerateHit(int lcn, DS::Entry& ds); // Add a forced MCHit at time fTime on channel lcn std::vector fLCNs; // The channels hits are forced on bool fChannelFlag; // Channel to fire was set by user int fChannel; // Channel number (default = 0) bool fCardFlag; // Card to fire was set by user int fCard; // Card number (default = 0) bool fCrateFlag; // Crate to fire was set by user int fCrate; // Crate number (default = 0) double fTime; // Time at which the hits will be placed (default = TriggerFECDelay) bool fUsePedCharges; // Flags whether to use ECA pedestal constants as charges std::vector > fPedQ; // Pedestal charges DU::PMTInfo fPMTInfo; // PMTInfo to get channel type when adding the hit }; } // namespace RAT #endif