///////////////////////////////////////////////////////////////////////// //// Conditional return on the reconstructed position. Returns OKTRUE if the //// event is kept or OKFALSE if event is cut. //// //// Author: Lauren Smart //// //// REVISION HISTORY: //// 2021-03-10 : Lauren Smart - new file. //// //// A cut value, plane (x, y, or z), and mode are specified by the user. //// The mode type determines whether events "greater" or "less" than the //// cut value are discarded. The cut processor is applied to the first //// vertex of the named fit result. /////////////////////////////////////////////////////////////////////////// #ifndef __RAT_PositionCutProc__ #define __RAT_PositionCutProc__ #include namespace RAT { class PositionCutProc : public Processor { public: // Create a new cut processor PositionCutProc() : Processor("PositionCutProc") { }; // Destroy cut processor virtual ~PositionCutProc() { }; // Applies the position command // // param should be cut // value should the cut value (maximum or minimum) // throws ParamUnknown if param is not cut virtual void SetD( const std::string& param, const double value ); // Applies the fitName, plane, and mode commands // // param should be fitName, plane, or mode // value should be the fit name to access, plane, or mode // mode is to cut greater or less than the cut value // throws ParamInvalid if the value for plane is not x, y, or z // throws ParamInvalid if the value for mode is not greater or less // throws ParamUnknown if param is not fitName, mode, or plane virtual void SetS( const std::string& param, const std::string& value ); // Process the event // // Conditional on the event position // // run: Data structure for the run // ds: Data structure for the event // returns OKTRUE if the event is kept or OKFALSE if event is cut virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds ); protected: double fCut; // Position to cut on std::string fFitName; // Name of FitResult to access std::string fPlane; // Name the plane on which to cut (x, y, or z) std::string fMode; // Cut mode (cut greater or less than specified position) }; } // namespace RAT #endif