3 #include <fwk/CentralConfig.h>
5 #include <utl/Branch.h>
6 #include <utl/config.h>
7 #include <utl/ErrorLogger.h>
11 #include <revt/REvent.h>
12 #include <revt/Station.h>
13 #include <revt/Channel.h>
14 #include <revt/StationRecData.h>
28 Branch topBranch = CentralConfig::GetInstance()->
GetTopBranch(
"RdChannelTimeSeriesWindowCutter");
42 WARNING(
"No radio event found!");
46 REvent& rEvent =
event.GetREvent();
51 for (
auto& station : rEvent.StationsRange()) {
52 for (
auto& channel : station.ChannelsRange()) {
54 if (!channel.IsActive())
59 const double binning = timeSeries.
GetBinning();
62 if (fWindowStart > timeSeries.
GetSize() * binning) {
64 info <<
"Station "<< station.GetId() <<
" Channel " << channel.GetId()
65 <<
" StartTime > Length of time series, not a good idea! Skip to next channel";
71 if (fWindowStart + fWindowSize > timeSeries.
GetSize() * binning) {
73 info <<
"Station "<< station.GetId() <<
" Channel " << channel.GetId()
74 <<
" StopTime > Length of time series. Stop time will be set at end of the time series";
77 fWindowSize = (timeSeries.
GetSize() - 1) * binning - fWindowStart;
86 for (
auto i = iBegin; i < iEnd; ++i)
87 tempTimeSeries.
PushBack(timeSeries[i]);
88 timeSeries = tempTimeSeries;
92 const double traceStartTime = station.GetRecData().GetParameter(eTraceStartTime);
95 station.GetRecData().SetParameter(eTraceStartTime, traceStartTime + fWindowStart,
false);
103 RdChannelTimeSeriesWindowCutter::Finish()
Branch GetTopBranch() const
Interface class to access to the Radio part of an event.
double GetBinning() const
size of one slot
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Class representing a document branch.
std::vector< double >::size_type SizeType
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
void SetBinning(const double binning)
ResultFlag
Flag returned by module methods to the RunController.
void PushBack(const T &value)
Insert a single value at the end.