#include #include #include #include namespace RAT { TUBII::TUBII() { DBLinkPtr fLDAQ = DB::Get()->GetLink("DAQ"); DBLinkPtr fRLDAQ = DB::Get()->GetLink("DAQ_RUN_LEVEL"); fAttenuationSetting = fRLDAQ->GetIArray("attenuationChannels"); fAttenuationValues = fLDAQ->GetDArray("attenuationValues"); fUnityGainValues = fLDAQ->GetDArray("unityGainValues"); fBaselineShift = fLDAQ->GetDArray("baselineShift"); fChannelSelectionSetting = fRLDAQ->GetIArray("channelSelectTUBii"); } AnalogSignal* TUBII::PerformAnalogTransform(AnalogSignal *trace, int inputChannel) { if(IsValidAnalogChannel(inputChannel) ) { Transformation t(GetAttenuationFactor(inputChannel),GetBaselineShift(inputChannel)); return new TransformedSum(trace,t); } else { warn<<"TUBII::PerformAnalogTransform: Invalid channel: "<=0; } double TUBII::Transformation::operator()(double value) { return attenuation*value+shift; } double TUBII::TransformedSum::GetHeight(double time) { return this->transform(originalSignal->GetHeight(time)); } } // namespace RAT