//////////////////////////////////////////////////////////////////// /// \class RAT:PingCratesTriggerSignals /// /// \brief Calculate some information about the CAEN signals /// /// \author Tanner Kaptanoglu /// /// \details The CAEN digitizes the N100L, N20LB and ESUMH trigger /// signals. This code looks at those digitized waveforms /// and calculates the baseline, peak, and the /// number of samples above some threshold for pedestal events /// during the `ping crates'. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_PingCratesTriggerSignals__ #define __RAT_PingCratesTriggerSignals__ #include #include #include #include #include namespace RAT { class PingCratesTriggerSignals : public Processor { public: PingCratesTriggerSignals(); virtual ~PingCratesTriggerSignals(){}; virtual void BeginOfRun(DS::Run&); virtual void EndOfRun(DS::Run& run); virtual Processor::Result DSEvent(DS::Run&, DS::Entry& ds); virtual Processor::Result Event(DS::Entry& ds, DS::EV& ev); protected: double Maximum(std::vector waveform, double baseline); // Returns maximum of waveform double Baseline(std::vector waveform); // Returns baseline of waveform int NSamples(std::vector waveform, double baseline, double fVFraction); // Returns nsamples above a fraction of the peak int RiseTime(std::vector waveform, double baseline, int max_adc); // Return rise time of the waveform int FallTime(std::vector waveform, double baseline, int max_adc); // Return fall time of the waveform std::vector fID; // Pattern ID std::vector fType; // Type of CAEN waveform std::vector fBaseline; // Baseline of waveform std::vector fPeak; // Peak of waveform std::vector fSamples; // Number of samples above threshold std::vector fRise; // Number of samples in the rise time std::vector fFall; // Number of samples in the fall time size_t fCalType; // Cal type in header for ping crates size_t fBaselineSamples; // Number of samples to find baseline double fVFraction; // Fraction of the peak }; } // namespace RAT #endif