PulseFinder.hh
Go to the documentation of this file.00001
00006 #ifndef PULSEFINDER_h
00007 #define PULSEFINDER_h
00008
00009 #include "BaseModule.hh"
00010
00015 class PulseFinder : public BaseModule{
00016 public:
00017 PulseFinder();
00018 ~PulseFinder();
00019
00020 int Initialize();
00021 int Finalize();
00022 int Process(EventPtr evt);
00023
00025 int EvaluatePulse(Pulse& pulse, ChannelData* chdata,
00026 int start_index, int end_index) const;
00027
00029 void DiscriminatorSearch(ChannelData* chdata,
00030 std::vector<int>& start_index,
00031 std::vector<int>& end_index);
00032
00034 void VarianceSearch(ChannelData* chdata,
00035 std::vector<int>& start_index,
00036 std::vector<int>& end_index);
00037
00038 void IntegralSearch(ChannelData* chdata,
00039 std::vector<int>& start_index,
00040 std::vector<int>& end_index);
00041
00043 void CurvatureSearch(ChannelData* chdata,
00044 std::vector<int>& start_index,
00045 std::vector<int>& end_index);
00046
00047 static const std::string GetDefaultName(){ return "PulseFinder"; }
00048
00049 enum SEARCH_MODE { VARIANCE , DISCRIMINATOR , INTEGRAL , CURVATURE };
00050
00051 private:
00052
00053 bool align_pulses;
00054 SEARCH_MODE mode;
00055 bool normalize;
00056 int start_window;
00057 double min_start_variance;
00058 int min_resolution;
00059 int min_start_peak_sep;
00060 bool discriminator_relative;
00061 double discriminator_value;
00062 int discriminator_start_add;
00063 int discriminator_end_add;
00064 double integral_start_time;
00065 double integral_end_time;
00066 double integral_start_threshold;
00067 double integral_end_threshold;
00068 double min_sep_time;
00069 double multipulse_thresh_value;
00070 double amplitude_start_threshold;
00071 double amplitude_end_threshold;
00072 double min_pulse_time;
00073 double lookback_time;
00074
00075
00076
00077 int down_sample_factor;
00078 double pulse_start_curvature;
00079 int pile_up_curvature;
00080 double pulse_end_slope;
00081 double fixed_time1;
00082 double fixed_time2;
00083
00084 double PredictedNPE(double t0, double t, double fprompt,
00085 double tau1, double tau2)
00086 {
00087 return fprompt*(1.-exp(-(t-t0)/tau1)) + (1-fprompt)*(1.-exp(-(t-t0)/tau2));
00088 }
00089
00090 };
00091
00092
00093 std::istream& operator>>(std::istream& in, PulseFinder::SEARCH_MODE& m);
00094 std::ostream& operator<<(std::ostream& out, const PulseFinder::SEARCH_MODE& m);
00095
00096 #endif