5 #include <fwk/CentralConfig.h>
6 #include <fwk/RandomEngineRegistry.h>
8 #include <utl/config.h>
9 #include <utl/ErrorLogger.h>
10 #include <utl/Noise.h>
11 #include <utl/NoiseWhite.h>
12 #include <utl/NoiseSaS.h>
13 #include <utl/NoiseCCIR670.h>
14 #include <utl/RandomEngine.h>
15 #include <utl/Reader.h>
16 #include <utl/StringCompare.h>
17 #include <utl/TraceAlgorithm.h>
19 #include <evt/Event.h>
20 #include <rdet/RDetector.h>
21 #include <rdet/Channel.h>
22 #include <revt/Channel.h>
23 #include <revt/Station.h>
24 #include <revt/REvent.h>
26 #include <boost/random.hpp>
27 #include <boost/random/exponential_distribution.hpp>
28 #include <boost/random/uniform_real.hpp>
39 fSaSSigmaOverride(0.),
40 fSaSAlphaOverride(0.),
42 randgen(time(nullptr)),
45 randomGenerator_sigma(randgen, interval_noise),
46 randomGenerator_h(randgen, interval_h)
53 INFO(
"RdChannelNoiseGenerator::Init()");
57 CentralConfig::GetInstance()->
GetTopBranch(
"RdChannelNoiseGenerator");
60 RandomEngine*
const prndEngine = &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
70 std::string atmosphereNoiseString;
71 topBranch.
GetChild(
"CCIR670AtmosphereProfile").
GetData(atmosphereNoiseString);
81 std::string industryProfileString;
82 topBranch.
GetChild(
"CCIR670IndustryProfile").
GetData(industryProfileString);
98 WARNING(
"Illegal noise type defined!");
110 WARNING(
"No radio event found!");
120 INFO(
"adding noise");
139 trace[bin] += noiseTrace[bin] *
fNoiseRMS / RMS;
172 double cof0 =
pow(1 -
pow(0.29, 2), -0.5);
186 mySpec[bin] += antennaHeight*noiseSpec[bin];
196 RdChannelNoiseGenerator::Finish()
198 INFO(
"RdChannelNoiseGenerator::Finish()");
ChannelFFTDataContainer & GetFFTDataContainer()
retrieve Channel FFTDataContainer (write access)
Branch GetTopBranch() const
int GetId() const
Return Id of the Channel.
Report success to RunController.
boost::indirect_iterator< InternalChannelIterator, Channel & > ChannelIterator
Iterator over station for read/write.
Interface class to access to the Radio part of an event.
Skip remaining modules in the current loop and continue with next iteration of the loop...
double GetBinning() const
size of one slot
#define INFO(message)
Macro for logging informational messages.
StationIterator StationsEnd()
StationIterator StationsBegin()
void Init()
Initialise the registry.
revt::REvent & GetREvent()
Detector description interface for Channel-related data.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
ChannelIterator ChannelsBegin()
begin Channel iterator for read/write
double pow(const double x, const unsigned int i)
boost::filter_iterator< StationFilter, AllStationIterator > StationIterator
Iterator over all (non-exculded) stations.
Station & GetStation(const int stationId)
retrieve station by id throw utl::NonExistentComponentException if n.a.
bool StringEquivalent(const std::string &a, const std::string &b, Predicate p)
Utility to compare strings for equivalence. It takes a predicate to determine the equivalence of indi...
double CreateSaSNoiseInTimeDomain(const double alpha)
Returns the noise in time domain.
ChannelTimeSeries & GetChannelTimeSeries()
retrieve Channel Time Series (write access, only use this if you intend to change the data) ...
ChannelIterator ChannelsEnd()
end Channel iterator for read/write
virtual std::complex< double > GetSpectralFieldNoiseAtFrequency(double parFrequency, double parBandwidth) const =0
Returns the noise (complex value representing amplitude and phase) at a given frequency.
Class representing a document branch.
class to hold data at the radio Station level.
Noise profiles based on the textbook of Meinke and Grundlach.
C< F > & GetFrequencySpectrum()
read out the frequency spectrum (write access)
std::vector< std::complex< double > >::size_type SizeType
Wraps the random number engine used to generate distributions.
utl::ShadowPtr< utl::Noise > fNoise
Top of the hierarchy of the detector description interface.
C< T > & GetTimeSeries()
read out the time series (write access)
utl::ShadowPtr< utl::NoiseSaS > fNoise_time_domain
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
int GetId() const
Get the station Id.
static double RootMeanSquare(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the RootMeanSquare of trace between bin1 and bin2.
Class producing noise originating from a Symmetric alpha-Stable distribution function.
boost::variate_generator< boost::mt19937, boost::uniform_real< double > > randomGenerator_h
ResultFlag
Flag returned by module methods to the RunController.
ChannelFrequencySpectrum & GetChannelFrequencySpectrum()
retrieve Channel Frequency Spectrum (write access, only use this if you intend to change the data) ...
double GetFrequencyOfBin(const ChannelFrequencySpectrum::SizeType bin) const
Get the frequency corresponding to a bin of the frequency spectrum.
Class that holds the data associated to an individual radio channel.
Report failure to RunController, causing RunController to terminate execution.
const rdet::RDetector & GetRDetector() const
boost::variate_generator< boost::mt19937, boost::uniform_real< double > > randomGenerator_sigma
const Station & GetStation(const int stationId) const
Get station by Station Id.
double GetIntegratedEffectiveAntennaHeight(const double freq) const
Class producing white noise with a given temperature.