/*! \file Class that holds the data associated to an individual radio channel. \author Tim Huege \version */ #ifndef _revt_Channel_h_ #define _revt_Channel_h_ #include #include // TH: include is apparently needed, although forward declaration should in principle be enough (see Station.h), strange #include #include #include #include namespace revt { class Station; /** \class Channel Channel.h revt/Channel.h \brief Class that holds the data associated to an individual radio channel. \ingroup revt */ typedef utl::Trace ChannelTimeSeries; typedef utl::Trace< std::complex > ChannelFrequencySpectrum; typedef utl::FFTDataContainer< utl::Trace, double, std::complex > ChannelFFTDataContainer; class Channel { public: /// Return Id of the Channel int GetId() const { return fId; } /// Return Id of the station to which this Channel belongs int GetStationId() const { return fStationId; } /// Get the Nyquist zone unsigned int GetNyquistZone() const { return fChannelRadioData->GetNyquistZone(); } /// Set the Nyquist zone void SetNyquistZone(const unsigned int zone) { fChannelRadioData->SetNyquistZone(zone); } /// Get the frequency corresponding to a bin of the frequency spectrum double GetFrequencyOfBin(const ChannelFrequencySpectrum::SizeType bin) const { return fChannelRadioData->GetFrequencyOfBin(bin); } /// Get the mimimum frequency of the spectrum frequency spectrum double GetMinimumFrequency() const { return (Channel::GetFrequencyOfBin(0) < Channel::GetFrequencyOfBin(fChannelRadioData->GetConstFrequencySpectrum().GetSize()-1)) ? Channel::GetFrequencyOfBin(0) : Channel::GetFrequencyOfBin(fChannelRadioData->GetConstFrequencySpectrum().GetSize()-1); } /// Get the maximum frequency of the spectrum frequency spectrum double GetMaximumFrequency() const { return (Channel::GetFrequencyOfBin(0) > Channel::GetFrequencyOfBin(fChannelRadioData->GetConstFrequencySpectrum().GetSize()-1)) ? Channel::GetFrequencyOfBin(0) : Channel::GetFrequencyOfBin(fChannelRadioData->GetConstFrequencySpectrum().GetSize()-1); } /// retrieve Channel Time Series (write access, only use this if you intend to change the data) ChannelTimeSeries& GetChannelTimeSeries() { return fChannelRadioData->GetTimeSeries(); } /// retrieve Channel Time Series (read access) const ChannelTimeSeries& GetConstChannelTimeSeries() const { return fChannelRadioData->GetConstTimeSeries(); } /// retrieve Channel Frequency Spectrum (write access, only use this if you intend to change the data) ChannelFrequencySpectrum& GetChannelFrequencySpectrum() { return fChannelRadioData->GetFrequencySpectrum(); } /// retrieve Channel Frequency Spectrum (read access) const ChannelFrequencySpectrum& GetConstChannelFrequencySpectrum() const { return fChannelRadioData->GetConstFrequencySpectrum(); } /// retrieve Channel FFTDataContainer (read access) const ChannelFFTDataContainer& GetFFTDataContainer() const { return *fChannelRadioData; } /// retrieve Channel FFTDataContainer (write access) ChannelFFTDataContainer& GetFFTDataContainer() { return *fChannelRadioData; } void SetSaturated() { fIsSaturated = true; } void SetNotSaturated(){ fIsSaturated = false; } bool IsSaturated() const { return fIsSaturated; } void SetActive() { fIsActive = true; } /// Active means that it is used in reconstruction. By default this is true after read-in, but can be deactivated later. void SetNotActive() { fIsActive = false; } bool IsActive() const { return fIsActive; } void SetSignalThreshold(const unsigned int thresh) { fSignalThreshold = thresh; } /// From DAQ void SetNoiseThreshold(const unsigned int thresh) { fNoiseThreshold = thresh; } /// From DAQ unsigned int GetSignalThreshold() const { return fSignalThreshold; } /// From DAQ unsigned int GetNoiseThreshold() const { return fNoiseThreshold; } /// From DAQ void SetScintHighVoltage(const double scinthv) { fScintHighVoltage = scinthv; } double GetScintHighVoltage() const { return fScintHighVoltage; } /// Get channel level reconstructed data ChannelRecData& GetRecData(); const ChannelRecData& GetRecData() const; /// Make channel reconstructed data object void MakeRecData(); /// Check whether channel reconstructed data exists bool HasRecData() const { return fRecData; } private: Channel(const int stationId, const int id); int fStationId; int fId; bool fIsSaturated; bool fIsActive; unsigned int fSignalThreshold; unsigned int fNoiseThreshold; double fScintHighVoltage; utl::ShadowPtr fRecData; utl::InitializedShadowPtr fChannelRadioData; ///< container for the radio time and frequency data friend class revt::Station; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. REvent/Channel.o -k" // End: