//////////////////////////////////////////////////////////////////////// /// \class RAT::DQLaserballProc /// /// \brief Data quality optics processor /// /// \authors // Mark Stringer // Ashley R. Back /// /// REVISION HISTORY: // 20/8/2015: Fixed bug where only X axis was used to check if the laserball is in the central axis. //\n 30/11/2016: Removed dependence on calib branch in SOC file also added output of checked files to DQ Records. /// /// \detail Executes all the data quality checks concerned with \n /// quality assurance of optics runs. Based on qc_oca.cxx, \n /// part of QSNO, that ran optics quality assurance for SNO. \n /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_DQLaserballProc__ #define __RAT_DQLaserballProc__ class TH1D; class TH2D; class TVector3; #include #include #include #include #include #include #include #include #include namespace RAT { namespace DS { class Run; class SOC; } } namespace RAT { class DQLaserballProc : public DataQualityProc { public: DQLaserballProc(); virtual ~DQLaserballProc(); virtual void BeginOfRun( DS::Run& run ); virtual void SOCAnalysis( DS::SOC& soc ); virtual void EndOfRun( DS::Run& run ); std::vector TimeChecks(DS::SOC& soc); std::vector GetQHSInfo(DS::SOC& soc); bool FitPositionTest(DS::SOC& soc,double threshold); double GetNHit( DS::SOC& soc); std::vector GetFullOccupancyMeanSpread(DS::SOC& soc); std::vector GetPromptOccupancyMeanSpread(DS::SOC& soc); int GetNZero(DS::SOC& soc); private: TH2D CrateMapFromChannelHisto(TH1D); int crateNumber(int LCN); int cardNumber(int LCN); int channelNumber(int LCN); DBLinkPtr fDQChecks; DBLinkPtr fManipInfo; //int fRunNumber; //int fSOCPass; //int fPreviousRunNumber; //int fPreviousSOCPass; std::string fDataDirectory; std::string fCHSDirectory; DU::LightPathCalculator fLP; DU::GroupVelocity fGV; DU::PMTInfo fPMTInfo; std::vector fCentralAxesX; std::vector fCentralAxesY; TVector3 fLaserballPosition; //Laserball wavelenth in nm double fLaserballWavelength; double fMinTime; double fMaxTime; double fMinQhsLow; double fMaxQhsLow; double fMinQhsPeak; double fMaxQhsPeak; double fMinQhsHigh; double fMaxQhsHigh; double fFitPositionThreshOnCentralAxis; double fFitPositionThreshOffCentralAxis; int fMinNHit; int fMaxNHit; double fMaxFullOccupancyMean; double fMaxFullOccupancySpread; double fMaxPromptOccupancyMean; double fMaxPromptOccupancySpread; int fMaxNZero; int fMaxNBadPMTs; double fMaxPMTTimeError; std::string fSourceType; bool fPositionValid; }; }// namespace RAT #endif // __RAT_DQLaserballProc__