00001 #ifndef PulseCandidateFinder_h_ 00002 #define PulseCandidateFinder_h_ 00003 00004 #include "ModulesOptions.h" 00005 #include "TPulseIsland.h" 00006 #include "definitions.h" 00007 00008 #include "TH2.h" 00009 00029 class PulseCandidateFinder { 00030 00031 private: 00034 struct Location { 00035 int start; 00036 int stop; 00037 }; 00038 00039 public: 00047 PulseCandidateFinder(std::string detname, modules::options* opts); 00048 00051 PulseCandidateFinder(); 00052 00055 ~PulseCandidateFinder(); 00056 00058 void SetChannel(const std::string& detname); 00059 void SetSigma(double sigma); 00060 00061 private: 00064 const TPulseIsland* fPulseIsland; 00067 std::vector<Location> fPulseCandidateLocations; 00068 00069 00070 public: 00073 void FindPulseCandidates(const TPulseIsland* pulse); 00076 int GetNPulseCandidates() { return fPulseCandidateLocations.size(); } 00079 //std::vector<TPulseIsland*> GetPulseCandidates(); 00080 00081 void GetPulseCandidates(std::vector<TPulseIsland*>&)const; 00082 00083 private: 00091 void FindCandidatePulses_Fast(int rise); 00099 void FindCandidatePulses_Slow(int threshold); 00100 00101 public: 00105 void FillParameterHistogram(TH2D* histogram); 00106 00107 private: 00110 IDs::channel fChannel; 00113 double fParameterValue; 00116 double fNoise; 00119 double fPedestal; 00120 00123 static std::map<IDs::channel, int> fDefaultParameterValues; 00126 void SetDefaultParameterValues(); 00127 00130 int fNSigma; 00131 00138 bool CheckDigitiserOverflow(); 00139 00140 }; 00141 00142 #endif