/////////////////////////////////////////////////////////////////////////
// Conditional return on the number of Cherenkov photons. Returns OKTRUE
// if any Cherenkov photons are produced in the event or OKFALSE if no
// Cherenkov photons are produced.
//
// Author: Christopher Jones <christopher.jones@physics.ox.ac.uk>
//
// REVISION HISTORY:
//         2015-04-10 : C. Jones: new revision
//
/////////////////////////////////////////////////////////////////////////

#ifndef __RAT_CherenkovPhotonCountCutProc__
#define __RAT_CherenkovPhotonCountCutProc__

#include <RAT/Processor.hh>

namespace RAT
{

class CherenkovPhotonCountCutProc : public Processor
{
public:
  // Create a new cut processor, cuts events with no Cherenkov photons generated in the active volume
  CherenkovPhotonCountCutProc() : Processor("CherenkovPhotonCountCutProc"), fCherenkovCount(0) { };

  // Destroy the processor
  virtual ~CherenkovPhotonCountCutProc() { };

  // Applies the CherenkovPhotonCount command.
  //
  // param should be CherenkovCount
  // value should be the minimum value
  // throws ParamUnknown if param is not CherenkovCount
  // throws ParamInvalid if value is negative
  virtual void SetI( const std::string& param,
                     const int value );

  // Process the event
  //
  // Conditional on the Cherenkov photons generated in the active volume
  //
  // run is the data structure for the run
  // ds is the data structure for the event
  // returns OKTRUE if the cherenkovCount > fCherenkovCount or OKFALSE if not
  virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds );
protected:
  unsigned int fCherenkovCount; // Minimum number of Cherenkov photons in the active volume for a given event.
};

} // namespace RAT

#endif