//////////////////////////////////////////////////////////////////// /// \class RAT::ThresholdFlasherCut /// /// \brief Tries to tag events where high thresholds cause /// a flasher to be missed /// /// \contact Tanner Kaptanoglu /// /// REVISION HISTORY:\n /// 31 June 2011 : Tanner Kaptanoglu - first version /// /// \details This processor looks for channels with very high /// charge hits, which are mostly flashers and shark /// fin events. Then it looks at the surrounding channels /// and counts channels with a very high discriminator /// thresholds. If several of the surrounding channels /// have high thresholds, the flashers won't have crosstalk /// and might be hard to cut. This processor throws away /// those events. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_ThresholdFlasherCut__ #define __RAT_ThresholdFlasherCut__ #include #include #include #include #include namespace RAT { class ThresholdFlasherCut : public DataCleaningProc { public: ThresholdFlasherCut() : DataCleaningProc("thresholdflashercut",1){}; virtual ~ThresholdFlasherCut(){}; virtual Processor::Result DSEvent(DS::Run&, DS::Entry& ds); void BeginOfRun(DS::Run&); protected: virtual Processor::Result Event(DS::Entry& ds, DS::EV& ev); int CountChannelsAboveThreshold(int id, int channel); int fEventCounter; // Count events float fIgnoreThreshold; // Threshold to ignore a channel std::vector fHitCounter; // Count each time a channel causes the event to be dirty std::vector fIgnoreChannel; // Ignore a bad channel int fAdjacentHits; ///< number of adjacent channels to consider int fAdjacentMaxed; ///< number of adjacent channels with maxed thresholds ///< Charge ranges for calibrated or uncalibrated to consider a hit bad int fUnCalQHSLow; int fUnCalQHSHigh; int fUnCalQHLLow; int fUnCalQHLHigh; int fUnCalQLXLow; int fUnCalQLXHigh; int fCalQHSLow; int fCalQHSHigh; int fCalQHLLow; int fCalQHLHigh; int fCalQLXLow; int fCalQLXHigh; }; } // namespace RAT #endif