//////////////////////////////////////////////////////////////////// /// \class RAT::TUBII /// /// \brief Simulate the Trigger Utility Board Mk.II (TUBii) /// /// \author Eric Marzec /// /// REVISION HISTORY:\n /// May 26th 2016 - Eric M - Created file /// /// \details /// This class acts as a simulation of the Trigger Utility Board Mk. II (TUBii). /// Currently it only simulates the transformation TUBii performs on analog /// signals. However it's transformation is somewhat different from the /// transform perfored IRL. Real life TUBii is designed for an MTCA+ signal /// which has a -5V baseline. However the simulated MTCA+ has no such baseline /// offset so the simulated TUBii does not perform the baseline shift real life /// TUBii does. ////////////////////////////////////////////////////////////////////// // #ifndef __RAT_TUBII__ #define __RAT_TUBII__ #include #include namespace RAT { class TUBII{ public: TUBII(); ~TUBII() {} AnalogSignal* PerformAnalogTransform( AnalogSignal* trace,int inputChannel); bool IsValidAnalogChannel(int channel); double GetBaselineShift(int channel) {return fBaselineShift[channel];} double GetAttenuationFactor(int channel); class Transformation { public: Transformation(double _atten=1.0, double _shift=0.0): attenuation(_atten), shift(_shift) {} double attenuation; double shift; double operator()(double value); }; class TransformedSum : public AnalogSignal { public: TransformedSum( AnalogSignal *_sum,Transformation _transform): originalSignal(_sum),transform(_transform) {} ~TransformedSum() {} AnalogSignal *originalSignal; Transformation transform; double GetHeight(double time); }; private: std::vector fAttenuationSetting; // If attenuation should be applied on a channel std::vector fChannelSelectionSetting; // TUBii channel selector settings std::vector fAttenuationValues; // How large each channels attenuations is std::vector fUnityGainValues; // How close to 1.0 each channels unity gain is std::vector fBaselineShift; //How the baseline for analog things is changed }; } // namespace RAT #endif