15 using namespace Diana;
20 fPulseLabel = GetString(
"PulseLabel",
"DAQ@Pulse",
false);
21 TriggerAlgo = GetString(
"Algorithm",
"BULLDAQ",
false);
22 fDebounce = GetDouble(
"Debounce",0,
false);
23 fSaveFiltered = GetBool(
"SaveFiltered",
false,
false);
24 fSaveHeight = GetBool(
"SaveHeight",
false,
false);
26 Panic(
"Choose a value between 0 and 1 excluded!");
53 GlobalData().Get(
"",&
rHandle,
"");
63 it = channel2trigger.find(chan);
64 if(it==channel2trigger.end()){
65 Info(
"Adding trigger for channel %d",chan);
67 channel2trigger.insert(std::pair<int,QTrigger*>(chan,Trigger));
68 channel2trigger[chan]->SetDebounce((
int)(fDebounce*ppp.Size()));
69 channel2trigger[chan]->SetReader(
this);
71 channel2trigger[chan]->SetWindow(ppp.Size());
72 channel2trigger[chan]->SetChannel(chan);
75 vector<double> trace (ppp.Size());
76 for(
size_t i =0; i <ppp.Size();i++){
80 channel2trigger[chan]->TriggerStream(trace);
81 vector<int> trigs = channel2trigger[chan]->GetTriggers();
84 Intervals.Resize(trigs.size()-1);
85 for(
size_t i =1; i <trigs.size();i++){
86 Intervals[i-1] = trigs[i]-trigs[i-1];
91 Intervals.Initialize(0);
94 vector<double> filt_stream = channel2trigger[chan]->GetFilteredStream();
96 QVector stream(filt_stream.size());
97 for(
size_t i =0; i <filt_stream.size();i++){
98 stream[i] = filt_stream[i];
101 fff.SetSamplesADC(stream);
106 vector<double> THeights = channel2trigger[chan]->GetTriggerHeights();
107 std::set<double> Triggers (THeights.begin(), THeights.end());
108 ev.
Get<
QDouble>(
"HighestTrigger") = *Triggers.rbegin();
QRunDataHandle rHandle(753)
#define REGISTER_MODULE(clazz)
Q_BEGIN_NAMESPACE QTrigger * QTriggerFactory(const std::string name)
Function for selecting trigger type.
Peak Finder module that lets you choose which peak finding algorithm to choose.
void Do(Diana::QEvent &ev)
Do method. Declare and implement only one of the two versions.
void Init(Diana::QEvent &ev)
Init method.
base types wrapped into a QObject. Currently implemented types are QInt QDouble and QFloat....
basic channel and run based info. Used in the QRunData object.
double fSamplingFrequency
sampling frequency in Hz
number of pulses and time interval beetwen peaks in the same acquired window
const Q & GetByLabel(const QEventLabel &label) const
Get a QObject in read mode by label.
void RequireByLabel(const QEventLabel &label) const
notify the QEvent that we need a QObject, if not found an exception is thrown
void Require(const std::string &owner, const std::string &name) const
notify the QEvent that we need a QObject, if not found an exception is thrown
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
void Add(WriteHandle< Q > &handle)
Add a QObject to the event.
Raw event: bolometer channel, trigger positions and types.
const int & GetChannelId() const
Get ChannelId.
Raw event: sampled waveform.
const Diana::QVector & GetSamples() const
Get Samples casted to double (QVector instead of QVectorI). Use this method in place of GetSamplesADC...
global handle for QRunData
const QChannelRunData & GetChannelRunData(const int channel) const
get channel based run data quantities
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...