/////////////////////////////////////////////////////////////////// // // Conditional processor based on time coincidences. // Finds a Prompt event candidate, defined by NhitCleaned within a given interval // Finds the Delayed event candidates, defined by NhitCleaned in another interval // and with triggerTime within a given time interval from the Prompt candidate triggerTime // Will mark the Prompt, Delayed or Both for OKTRUE // // Author: Sofia Andringa // Revision History: 2018-03-30 - first version /////////////////////////////////////////////////////////////////// #ifndef __RAT_CoincProc__ #define __RAT_CoincProc__ #include #include namespace RAT { class CoincProc : public Processor { public: // Create new count processor. // // Default is for conditional to return OKTRUE if within 500 micro-seconds event. CoincProc(); // Destroy count processor. virtual ~CoincProc(); // Applies the number command // // param: should be "TWindow" (in micro-seconds) // value: should be the conditional interval to check // Throws ParamUnknown if param is not number // Throws ParamInvalid if value is not >0 virtual void SetI( const std::string& param, const int value ); virtual void SetD( const std::string& param, const double value ); // Called for each event // // Increment event counters, check if counter is equal to "number" interval. // // run: run information to process // ds: entry information to process // Returns as OKTRUE if counter is equal to interval, OKFALSE otherwise virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds ); protected: //internal variable double fTimeStart; // Start time of current window - internal variable //parameters double fTimeWindow; // Upper duration of coincident window double fLowWindow; // Lower duration of coincidence window - to veto retriggers size_t fNhitFirst; // min Nhit threshold for first (Prompt) event in coincidence size_t fNhitSecond; // min Nhit threshold for second (Delayed) event in coincidence size_t fNhitFirstMax; // max Nhit cut for first (Prompt) event in coincidence size_t fNhitSecondMax; // max Nhit cut for second (Delayed) event in coincidence // for reference //int fNCoincFound; // Just counting, for reference //int fNfirstFound; // Just counting, for reference //int fNsecondFound; // Just counting, for reference int fMode; // return TRUE for (1) events passing the Prompt cuts, no coincidence selection (2) Delayed events in coincidence with prompt (3) Prompt and Delayed candidated }; } // namespace RAT #endif