/////////////////////////////////////////////////////////////////// // // Conditional processor based on number of events processed so far. // // Author: M Mottram // // REVISION HISTORY: // 2014-04-22 : M Mottram - new file. // /////////////////////////////////////////////////////////////////// #ifndef __RAT_NumberProcessedProc__ #define __RAT_NumberProcessedProc__ #include #include namespace RAT { class NumberProcessedProc : public Processor { public: // Create new count processor. // // Default is for conditional to return OKTRUE every 10th physics event. NumberProcessedProc(); // Destroy count processor. virtual ~NumberProcessedProc(); // Applies the number command // // param: should be "number" // 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 ); // 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: int fDsCount; // Number of physics events int fNumber; // Number of physics events in "number" interval }; } // namespace RAT #endif