//////////////////////////////////////////////////////////////////// /// \class RAT::CAENCut /// /// \brief Flags flashers and pickup events for data cleaning /// /// \author Richie Bonventre /// \contact Eric Marzec /// /// REVISION HISTORY:\n /// 24 Sept 2012 : Richie Bonventre - first version /// 13 Nov 2014 : Eric Marzec - Made myself contact person. /// 02 Apr 2015 : GD Orebi Gann - Read run-level DAQ settings from DAQ_RUN_LEVEL /// /// \details This processor mimics the old AMB cut, using the peak /// and integral of ESUMHI to tags events that fall far outside /// the mean. /// /// /// /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_CAENCut__ #define __RAT_CAENCut__ #include #include #include #include namespace RAT { class CAENCut : public DataCleaningProc { public: CAENCut() : DataCleaningProc("caencut",1){}; virtual ~CAENCut(){}; virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); void BeginOfRun(DS::Run&); protected: virtual Processor::Result Event(DS::Entry& ds, DS::EV& ev); int fMinNhit; ///< Minimum nhit for attempting the cut int fPrePulseNumPedBins; ///< The number of bins at the start of the trace used for the pedestal int fPostPulseNumPedBins; ///< The number of bins at the end of the trace used for the pedestal TF1 fPeakBounds[2]; ///< The function that defines the lower and upper peak cut values TF1 fIntegralBounds[2]; ///< The function that defines the lower and upper integral cut values int fCutMode; ///< 1 = Cut if either peak or integral fails, 2 = Cut if both peak and integral fails bool fUseLowerCut; ///< Cut events that fall under the lower bound int fStartSample; ///< Sample number to start integrating / peak searching int fEndSample; ///< Sample number to stop integrating / peak searching bool fHasWarned; ///< Makes sure warning is only emitted once to avoid spam. DBLinkPtr fLDAQ; int fEsumTrig; ///< CAEN channel that ESUMHI is connected to }; } // namespace RAT #endif