#include "PndSdsTotChargeConversion.h" ///Default constructor PndSdsTotChargeConversion::PndSdsTotChargeConversion(Int_t VerboseLevel) : PndSdsChargeConversion(kToT){ SetParameter("ftr", 100.); SetParameter("fa", 60.); SetParameter("fth", 3000.); SetParameter("fclk", 50.); ftimestep = 1. / GetParameter("fclk") * 1000.; fVerboseLevel = VerboseLevel; StartExecute(); Warning("constructor","default constructor used"); if (fVerboseLevel>0){ std::cout<<"Tot parameter "<0){ std::cout<<"Tot parameter "< now set to 60 e/ns"); SetParameter("fa",60.); } Q = charge; Qt = GetParameter("fth"); //Error handling: if there is a parameter leading to a division by zero Q=Qt=1 is set to prevent this if (Qt < 0){ Error("ConvertChargeToDigiValue(Double_t charge)","threshold is less than zero -> now set to 0 eV"); Qt = 0.; } if ((Q <= Qt) or (Q <= 0)){ Warning("ConvertChargeToDigiValue(Double_t charge)","charge is equal or less than threshold -> zero TOT"); Q = 1.; Qt = 1.; } t1e = (GetParameter("ftr")*Qt/Q+ftimeoffset); //exact time when signal is over threshold t2e = (Q-Qt)/GetParameter("fa")+ftimeoffset+GetParameter("ftr"); //exact time when signal is again below threshold //return (t2e-t1e); //turn off clock return GetTotWC(); } Double_t PndSdsTotChargeConversion::GetTotWC(){ //calculates start time, stop time with a clock fstarttime = (Int_t) ( t1e / ftimestep ) * ftimestep + ftimestep; //quantization of the start signal fstoptime = (Int_t) ( t2e / ftimestep ) * ftimestep + ftimestep; //quantization of the stop signal /* std::cout<<" start point exact: "<