///////////////////////////////////////////////////////////////////////// // Conditional return on the nhit value. Returns OKTRUE if the event // number of hits, nhit, is greater than fMinNhits or OKFALSE if not. // // Author: P. G. Jones // // REVISION HISTORY: // 2013-11-14 : P Jones - new revision, based on CutProc. // 2018-01-14 : N Barros - Added an option to cut on clean hits. Defaults to false. // 2018-01-16 : R Lane - adjusted the processor to test all events in an EV event (important if running on simulation) // ////////////////////////////////////////////////////////////////////////// #ifndef __RAT_NHitCutProc__ #define __RAT_NHitCutProc__ #include namespace RAT { namespace DS { class EV; } class NHitCutProc : public Processor { public: // Create a new cut processor which cuts events which have no PMT hits NHitCutProc() : Processor("NHitCutProc"), fMinNHits(0),fCleanHits(false),fInTimeHits(false) { }; // Destroy the processor virtual ~NHitCutProc() { }; // Applies the nhit command // // param should be nhit // value should be the minimum value // throws ParamUnknown if param is not nhit // throws ParamInvalid if value is not >=0 virtual void SetI( const std::string& param, const int value ); // Process the event // // Conditional on the number of hits // // run: Data structure for the run // ds: Data structure for the event // returns OKTRUE if the hits > fMinHits or OKFALSE if not virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds ); virtual Processor::Result Event( DS::Run& run, DS::EV& ev ); protected: unsigned int fMinNHits; // Minimum number of nhits to return true unsigned int fNHitsCut; // NHits cut from database table bool fCleanHits; bool fInTimeHits; }; } // namespace RAT #endif