16 using namespace Diana;
23 fCutOffFrequency = GetDouble(
"CutOffFrequency",300000);
24 fAttenuation = GetDouble(
"AttenuationDB",60);
25 fPulseLabel = GetString(
"PulseLabel",
"DAQ@Pulse",
false);
26 fOverWritePulse = GetBool(
"OverwritePulse",
true);
27 fDownSampling = GetDouble(
"DownSampling",1.,
false);
28 if(fDownSampling < 1.) Panic(
"Downsampling factor (%f) must be >= 1",fDownSampling);
36 if(!fOverWritePulse) {
41 Info(
"Cutoff set to %f",fCutOffFrequency);
51 if(fFilters.find(
channel) == fFilters.end()) {
54 GlobalData().Get(
"DAQ",&
rHandle,
"");
58 const double ADC2mV = channelRunData.
fADC2mV;
59 double fracFreq = fCutOffFrequency/samplFreq;
61 int M = fAttenuation * 0.025/fracFreq;
65 configuration.
fCutoff = fracFreq;
66 configuration.
fAttDB = fAttenuation;
71 Panic(
"Filter reduction (%d) is greater than triggerPosition/2 (%d), try a lower attenuation or a higher cutoff frequency (Size of filter scales linearly with them)",fir->
GetFilterReduction(),trigPos/2);
74 if(!fir) Panic(
"Cannot create FIR for channel %d",
channel);
82 info.
R = fDownSampling;
90 GlobalHandle<QCFirData> cfh(
"FirData");
92 cfh.SetRun(header.
GetRun());
93 cfh.Set(configuration);
94 GlobalData().Set(&cfh,
"CurrentWriter");
98 void* rdv = (
void*)&channelRunData;
103 GlobalData().Set(&
rHandle,
"CurrentWriter");
110 QPulse& oldPulse = eva.
Get<
QPulse>(fPulseLabel.owner.c_str(),fPulseLabel.name.c_str());
120 if(i*info.
R<fOutput.Size()){
122 fOutput[i] = fOutput[i*info.
R];
126 fOutput.Resize(samps);
132 if(fOverWritePulse) {
137 ev.
Get<
QPulseInfo>(
"PulseInfo").GetMasterSample().SetSampleIndex(ms);
QRunDataHandle rHandle(753)
#define REGISTER_MODULE(clazz)
QDriver::Action Init(Diana::QEventAssembler &eva)
Init method.
QDriver::Action Do(Diana::QEventAssembler &eva)
Do method. Declare and implement only one of the two versions.
QDriver::Action Done()
Done method.
Data class for QFir (Ported from Calder)
basic channel and run based info. Used in the QRunData object.
double fSamplingFrequency
sampling frequency in Hz
int fNumberOfSamples
number of samples in ADC window
double fADC2mV
conversion: mV = ADC * fADC2mV
class to store ActionId and fEventNumber (in case fActionId=ACT_GOTOEV)
Visitor class of QEvent that provides full handling of QEvent.
QEvent & GetEvent()
Get the QEvent.
void Get(const char *owner, WriteHandle< Q > &handle)
Get QObject from the event in write mode. This method has to be called in the event loop,...
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.
QFir FIR low pass filter (Ported from Calder)
QError Filter(const Diana::QVector &input, Diana::QVector &output) const
size_t GetFilterReduction() const
Raw event: bolometer channel, trigger positions and types.
const QSampleInfo & GetMasterSample() const
Get MasterSample.
const int & GetChannelId() const
Get ChannelId.
Raw event: sampled waveform.
void SetSamplesADC(const Diana::QVectorI &samples)
Set Samples acquired from ADC.
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
Int_t GetSampleIndex() const
Get SampleIndex from the beginning of the waveform.
void SetSampleIndex(Int_t index)
Set SampleIndex.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...