00001 00008 #ifndef PULSE_h 00009 #define PULSE_h 00010 00011 #include "PulseFit.hh" 00012 #include "Message.hh" 00013 #include <vector> 00014 #include <iostream> 00015 00021 class Pulse{ 00022 public: 00023 Pulse() { Clear(); } 00024 virtual ~Pulse() { } 00025 void Clear(); 00026 void Print(int channel, int pulse); 00027 public: 00028 bool found_start; 00029 bool found_end; 00030 bool found_peak; 00031 bool peak_saturated; 00032 int start_index; 00033 double start_time; 00034 int end_index; 00035 double end_time; 00036 int peak_index; 00037 double peak_time; 00038 double peak_amplitude; 00039 double integral; 00040 double npe; 00041 std::vector <double> f_param; 00042 double f90; 00043 double t05; 00044 double t10; 00045 double t90; 00046 double t95; 00047 double fixed_int1; 00048 double fixed_int2; 00049 bool fixed_int1_valid; 00050 bool fixed_int2_valid; 00051 PulseFit fit; 00052 00053 bool is_s1; 00054 double dt; 00055 bool start_clean; 00056 bool end_clean; 00057 bool is_clean; 00058 00059 double ratio1; 00060 double ratio2; 00061 double ratio3; 00062 00063 double gatti; 00064 double ll_ele; 00065 double ll_nuc; 00066 double ll_r; 00067 double pulse_shape_int; 00068 00069 ClassDef(Pulse,7); 00070 }; 00071 00072 inline void Pulse::Clear() 00073 { 00074 found_start = false; 00075 found_end = false; 00076 found_peak = false; 00077 peak_saturated = false; 00078 start_index = -1; 00079 start_time = 0; 00080 end_index = -1; 00081 end_time = 0; 00082 peak_index = -1; 00083 peak_time = 0; 00084 peak_amplitude = -1; 00085 integral=0; 00086 npe=0; 00087 f_param.clear(); 00088 f90 = -1; 00089 t05 = 0; 00090 t10 = 0; 00091 t90 = 0; 00092 t95 = 0; 00093 gatti = 0; 00094 ll_ele = 0; 00095 ll_nuc = 0; 00096 ll_r = 0; 00097 fixed_int1 = 0; 00098 fixed_int2 = 0; 00099 fixed_int1_valid = false; 00100 fixed_int2_valid = false; 00101 pulse_shape_int = 0; 00102 ratio1 = 0; 00103 ratio2 = 0; 00104 ratio3 = 0; 00105 dt = -1; 00106 is_s1 = false; 00107 start_clean = false; 00108 end_clean = false; 00109 is_clean = false; 00110 }; 00111 00112 inline void Pulse::Print(int channel, int pulse) 00113 { 00114 Message m(INFO); 00115 m<<std::endl; 00116 m<<"************************************************************************"<<std::endl; 00117 m<<"******************* CHANNEL "<<channel<<" PULSE "<<pulse<<" INFORMATION *******************"<<std::endl; 00118 m<<"************************************************************************"<<std::endl; 00119 m<<"Peak Saturated: "<<peak_saturated<<std::endl; 00120 m<<"Start Index: "<<start_index<<std::endl; 00121 m<<"Start Time: "<<start_time<<std::endl; 00122 m<<"End Index: "<<end_index<<std::endl; 00123 m<<"End Time: "<<end_time<<std::endl; 00124 m<<"DT: "<<dt<<std::endl; 00125 m<<"Peak Index: "<<peak_index<<std::endl; 00126 m<<"Peak Time: "<<peak_time<<std::endl; 00127 m<<"Peak Amplitude: "<<peak_amplitude<<std::endl; 00128 m<<"Integral: "<<integral<<std::endl; 00129 m<<"Npe: "<<npe<<std::endl; 00130 m<<"T05: "<<t05<<std::endl; 00131 m<<"T10: "<<t10<<std::endl; 00132 m<<"T90: "<<t90<<std::endl; 00133 m<<"T95: "<<t95<<std::endl; 00134 m<<"F90: "<<f90<<std::endl; 00135 m<<"Gatti: "<<gatti<<std::endl; 00136 m<<"LL Electron: "<<ll_ele<<std::endl; 00137 m<<"LL Nuclear: "<<ll_nuc<<std::endl; 00138 m<<"LL Ratio: "<<ll_r<<std::endl; 00139 m<<"Pulse Shape Integral: "<<pulse_shape_int<<std::endl; 00140 m<<"Fixed Integral 1 Valid: "<<fixed_int1_valid<<std::endl; 00141 m<<"Fixed Integral 1 : "<<fixed_int1<<std::endl; 00142 m<<"Fixed Integral 2 Valid: "<<fixed_int2_valid<<std::endl; 00143 m<<"Fixed Integral 2 : "<<fixed_int2<<std::endl; 00144 m<<"Is S1: "<<is_s1<<std::endl; 00145 m<<"Start Clean: "<<start_clean<<std::endl; 00146 m<<"End Clean: "<<end_clean<<std::endl; 00147 m<<"Is Clean: "<<is_clean<<std::endl; 00148 m<<"************************************************************************"<<std::endl; 00149 } 00150 #endif