////////////////////////////////////////////////////////////////////// // Extracts individual PMT noise rates, average noise rate, // and charge distribution characteristics // // Author: Constantin Weisser // Contact: Ed Callaghan // // REVISION HISTORY: // 31 July 2015 : Kevin Nuckolls - Revisions to data structure, // Add charge analysis features // 14 August 2017 : Ed Callaghan - Change trigger selection to reject // blacklisted triggers, // Add "perpmt_pgt" field to output // NOISE_RUN_LEVEL ratdb file // 18 Dec 2017 : Logan Lebanowski - Subtract cross-talk hits from // noise hits // 11 January 2018 : Ed Callaghan - Guard against NaN's in 0-PGT runs // // This processor analyzes events with only the Pulsed // Global Trigger (PGT) in the trigger word to extract hits in PMTs // caused by dark current. It then calculates the average noise rate // across the detector, average noise rate per PMT, and extracts the // Peak Bin Value, Threshold Level, and High Half Point from both // QHS and QHL charge distributions. // ////////////////////////////////////////////////////////////////////// #ifndef __RAT_PMTNoiseProc__ #define __RAT_PMTNoiseProc__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace RAT { class PMTNoiseProc : public Processor { public: PMTNoiseProc(); virtual Processor::Result DSEvent( DS::Run& run, DS::Entry& ds ); virtual ~PMTNoiseProc() { } virtual void BeginOfRun( DS::Run& ); virtual void EndOfRun( DS::Run& ); // @param[in] param should be outname // @param[in] value should be the name of output file // @throws ParamUnknown if the param is not outname virtual void SetS( const std::string& param, const std::string& value ); // @param[in] param should be simulation, average_min, or average_max // @param[in] value should be 0 or 1 (simulation) or >= 0 (average bound) // @throws ParamUnknown if the param is not simulation // @throws ParamInvalid if the value is not 0 or 1 virtual void SetI( const std::string& param, const int value ); protected: std::string fID; // Option Id for this processor // Extract charge spectrum QHS and QHL peak, threshold and hhp values. int GainFitPoints(int PMTNum, // PMT ID int chargeFlag, // 0 = QHS, 1 = QHL double &peakBinVal, // Return the position of the peak double &threshVal, // Return the position of the threshold double &hhpVal); // Return the position of the high-half point // Number of events with only PulseGT and non-blacklisted bits // in the trigger word int fPGTCounter; int fPMTCount; // PMT Noise Vectors std::vector fHitCounter; // PGT hit counter for every PMT unsigned int fPGTMask; // Mask for PulseGT unsigned int fBlacklist; // Mask for triggers excluded from noise rate std::string fBlacklistTriggers; // Comma-separated list of excluded triggers std::vector includeTriggers; // User force-allow triggers std::vector excludeTriggers; // User excluded triggers // QHS and QHL Charge Distribution Vectors std::vector< std::vector > fQHSArray; std::vector< std::vector > fQHLArray; std::vector fQHSMin; std::vector fQHSMax; std::vector fQHLMin; std::vector fQHLMax; int fSimulationFlag; int fAverageMinBound; int fAverageMaxBound; std::string fFilename; TFile *fFile; }; } // namespace RAT #endif