#include #include #include namespace RAT { CountsBetween::CountsBetween() : Processor("CountsBetween") { fDsCount = 0; //fEvCount = 0; fMinimum = 0; fMaximum = -1; } CountsBetween::~CountsBetween() { /* Do nothing */ } void CountsBetween::SetI( const std::string& param, const int value ) { if( param == "CBmin" ){ if (value >= 0) fMinimum = value; else throw ParamInvalid( param, "CountsBetween Minimum must be >= 0" ); } else if( param == "CBmax" ){ if (value == -1 || value > fMinimum) fMaximum = value; else throw ParamInvalid( param, "CountsBetween Maximum must be >Minimum for cutting or -1 for no upper cut" ); } else throw ParamUnknown( param ); } Processor::Result CountsBetween::DSEvent(DS::Run&, DS::Entry& ds) { fDsCount++; //fEvCount += ds.GetEVCount(); if (fDsCount >= fMinimum){ if(fMaximum == -1) return OKTRUE; else if(fDsCount < fMaximum) return OKTRUE; else return OKFALSE; } else return OKFALSE; } } // namespace RAT