/* * SdsFEAmpModel.h * * Created on: Apr 4, 2011 * Author: esch * * Class to calculate ToT, TimeWalk, TimeStamp and Time till the signal is back to baseline from a TF1 amplifier model. * * */ #ifndef PndSdsFE_H_ #define PndSdsFE_H_ #include "TObject.h" #include "PndSdsFEAmpModelSimple.h" #include "TMath.h" #include "TF1.h" #include "TRandom2.h" #include "Math/Interpolator.h" #include "Math/InterpolationTypes.h" #include "PndSdsTotChargeConversion.h" #include "TVectorT.h" class PndSdsFE: public TObject { public: PndSdsFE(): fFrontEndModel(0), fNumberOfSupportPoints(0), fNumberOfMaxElectons(0), fFunction(0), fMaximumAmplitude(0),fThreshold(0), fBaselineEpsilon(0), fToF(0), fEventTime(0), fTimeOffSet(0), fTimeStep(0),fFunctionRange(0), fRand(0), i(0), stepsize(0), fCharge_list(0), fTot_list(0), inter(0) {}; // PndSdsFE(double charingtime, double constcurrent, double threshold, double frequency, int verbose); virtual ~PndSdsFE(); double GetTotFromCharge(Double_t charge); // Calculates the ToT value from the charge double GetChargeFromTot(double tot); // Calculates the charge from the tot value double GetTimeWalkFromCharge(double charge); // Calculates the TimeWalk from the charge double GetTimeWalkFromTot(double tot); // Calculates the TimeWalk from the TOT value double GetTimeBackToBaseline(double charge); // Calculates the time from start of the signal till the signal is fBaselineEpsilon close to baseline double GetTimeStamp(double eventtime, double tof, double charge); // Calculates the TimeStamp of the signal void SetParameter(double chargingtime, double constcurrent, double threshold, double frequency); protected: double DigitizeTime(double time); double GetTimeOffSet(); void CreateInterpolatorList(); // Creates the Interpolatorlist for GetTotFromCharge calculation void SaveInterpolatorList(std::vector charge, std::vector tot); void LoadInterpolatorList(); void GetInterpolatorList(); PndSdsFEAmpModelSimple *fFrontEndModel; int fNumberOfSupportPoints; int fNumberOfMaxElectons ; TF1 *fFunction; double fMaximumAmplitude; // Saves position of the maximum amplitude of the signal double fThreshold; // Threshold for Signal from Parameter database double fBaselineEpsilon; // double fToF; // Time of Flight from MC double fEventTime; // EventTime from MC double fTimeOffSet; // Random offset double fTimeStep; double fFunctionRange; //Range of the function. max 100 fC => 624 150.9 e => max.tot 10503 ns (with thr.= 1100 e) TRandom2 fRand; int i; double stepsize; std::vector fCharge_list; std::vector fTot_list; ROOT::Math::Interpolator *inter; private: ClassDef(PndSdsFE,1); }; #endif /* PndSdsFE_H_ */