// $Id$ // // File: DBCALTimeSpectrum.h // Created: Mon Aug 1 08:55:45 EDT 2011 // Creator: davidl (on Linux ifarm1102 2.6.18-128.7.1.el5 x86_64) // #ifndef _DBCALTimeSpectrum_ #define _DBCALTimeSpectrum_ #include #include #include #include #include "DHistogram.h" #define NBINS_E 400 #define E_LO 0.0 #define E_HI 40.0 #define NBINS_ELECTRONIC 1300 #define ELECTRONIC_LO 0.0 #define ELECTRONIC_HI 130.0 class DBCALTimeSpectrum:public jana::JObject{ public: JOBJECT_PUBLIC(DBCALTimeSpectrum); DBCALTimeSpectrum(int layer, int sector); DBCALTimeSpectrum(double thresh_mV, vector &spectra, int layer, int sector); void AddDarkPulses(void); void Convolute(void); void FindTimes(double thresh_mV); double GetQ(DHistogram &h_electronic); TSpline* MakeTSpline(void); void Reset(void); void SamplingSmear(double Emax, double theta_thrown); void PoissonSmear(void); void DetectorJitterSmear(void); int layer; int sector; DHistogram Eup; DHistogram Edn; DHistogram electronic_up; DHistogram electronic_dn; double Etot; int fADC_up; int fADC_dn; double geometric_mean; double tup; double tdn; double tup_corrected; double tdn_corrected; // This method is used primarily for pretty printing // the second argument to AddString is printf style format void toStrings(vector > &items)const{ AddString(items, "layer", "%2d", layer); AddString(items, "sector", "%1d", sector); AddString(items, "Etot", "%f", Etot); AddString(items, "fADC_up", "%d", fADC_up); AddString(items, "fADC_dn", "%d", fADC_dn); AddString(items, "geometric_mean", "%6.1f", geometric_mean); AddString(items, "tup", "%6.2f", tup); AddString(items, "tdn", "%6.2f", tdn); AddString(items, "tup_corrected", "%6.2f", tup_corrected); AddString(items, "tdn_corrected", "%6.2f", tdn_corrected); } private: TRandom3 rnd; }; #endif // _DBCALTimeSpectrum_