//////////////////////////////////////////////////////////////////////// /// \class RAT::DQTellieProc /// /// \brief Data quality TELLIE processor /// /// \authors James Waterfield // /// /// REVISION HISTORY: /// - 2014 11 26 - Matt Strait - Doxygen fixes // - 2016 06 14 - Mark Stringer - Fixes to handle multiple subruns in data /// - 2016 07 20 - M. Mottram - Update for ROOT6 compatibility // - 2016 11 30 - Mark Stringer (James Waterfield) Changes to code made by James Waterfield for his Thesis, also removal of hardcoded values. // - 2017 02 08 - Mark Stringer - Bug Fixes to DB output and changing the filenames of the output images. Removal of the hardcoded trigger bit value // replaced with a value from DQCHECKS.ratdb /// /// \details Checks TELLIE specific calibration runs. /// Trigger efficiency, run length, NHit, fibre fired /// time profiles are all checked by this processor. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_DQTellieProc__ #define __RAT_DQTellieProc__ #include #include #include #include #include #include #include class TH1D; class TH1I; class TVector3; class TVector2; #include namespace RAT { namespace DS { class Run; class Entry; class EV; } } namespace RAT { class DQTellieProc : public DataQualityProc { public: DQTellieProc(); virtual ~DQTellieProc(); /// /// @param[in] run DS::Run location in data structure virtual void BeginOfRun( DS::Run& run ); /// Access event in run /// /// @param[in] run DS::Run location in data structure /// @param[in] ds DS::Entry location in data structure virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds ); /// /// @param[in] run DS::Run location in data structure virtual void EndOfRun( DS::Run& run ); protected: /// Checks hits of 2 PMTs on same panel to ensure /// maxPMT is not hot /// /// @param[in] maxPMT int LCN of highest hit PMT /// @return true = pmt is hot; fale pmt is not hot. virtual bool CheckNeighbours(int subRunIndex ,int maxPMT); /// @param[in] ds DS::Entry location in data structure /// @param[in] ev DS::EV event location in data structure virtual Processor::Result Event( DS::Entry& ds, DS::EV& ev ); /// Produces .png of PSUP projection hit map /// /// @param[in] directProject TVector2 central direct light spot on PSUP. /// @param[in] reflectedProject TVector2 central reflected light spot on PSUP. /// @param[in] lightOriginProject TVector2 calculated light origin on PSUP. virtual void PlotFibreCheck(const TVector2& directProject,const TVector2& reflectedProject,const TVector2& lightOriginProject,int subRunIndex); /// Checks the correct fibre is firing. /// virtual void FibreCheck(int subRunIndex); /// Plots the time profile of the run (TAC ADC) /// /// @param[in] xPeaks std::vector tac ADC of time peaks virtual void PlotTac(std::vector xPeaks,int subRunIndex); /// Iterate over v to find its max and min values and assign min_idx and\n /// max index their relavent values. /// /// @param[in] v std::vector vector to check min/max values /// @param[in] min_idx size_t index of minimum value of v /// @param[in] max_idx size_t index of maximum value of v virtual void MinMaxIndex(std::vector v, size_t& min_idx, size_t& max_idx); /// Checks time profile of TAC /// virtual void TimingChecks(int subRunIndex); DBLinkPtr fDQChecks; /// fTellieCount; /// fTellieEvents; /// fFailPulseDelayCount; /// fFirstEventTime; ///