28 namespace CenterOfMass
51 assert(
typeid(Channel::waveform_t::value_type) ==
typeid(T));
54 const int32_t vOffset (static_cast<int32_t>(c.
offset() / c.
gain()));
55 const size_t wLength (
Data.size());
61 bool risingEdge =
false;
62 bool firsttime =
true;
63 int32_t startposval = -1;
66 for (
size_t i=3; i<wLength;++i)
71 || ( ( (
Data[i]-vOffset)*(
Data[i-1]-vOffset) ) < 0.))
102 cout <<
"error: polarity not found"<<endl;
106 if(fabs(signal[
polarity]-param.
_polarity) < std::sqrt(std::numeric_limits<double>::epsilon()))
108 for (CoMParameters::timeranges_t::const_iterator it (param.
_timeranges.begin());
112 if(signal[
time] > it->first && signal[
time] < it->second)
115 sig.push_back(signal);
136 if ((abs(
Data[i-3]-vOffset) < abs(
Data[i-2]-vOffset)) &&
137 (abs(
Data[i-2]-vOffset) < abs(
Data[i-1]-vOffset)) &&
138 (abs(
Data[i-1]-vOffset) < abs(
Data[i ]-vOffset)) )
167 instrument = s.
value(
"AcqirisInstrument",0).toUInt();
168 channelNbr = s.
value(
"ChannelNumber",0).toInt();
172 for (
int i = 0; i <
size; ++i)
176 s.
value(
"UpperLimit",1000).toDouble()));
190 CenterOfMass::getcom<char>(*_chan, _parameters, sig);
201 _chan = extactRightChannel<char>(evt,_instrument,_chNbr);
208 CenterOfMass::getcom<short>(*_chan, _parameters, sig);
219 _chan = extactRightChannel<short>(evt,_instrument,_chNbr);
std::vector< int16_t > waveform_t
define the waveform
Event to store all LCLS Data.
std::vector< signal_t > signals_t
waveform_t & waveform()
setter
void loadSettings(CASSSettings &)
load the settings of the extractor
void loadSettings(CASSSettings &s, CoMParameters &p, uint32_t &instrument, size_t &channelNbr)
implementation of loading settings for both Center of Mass classes
void associate(const CASSEvent &evt)
associate the event with this analyzer
file contains declaration of the CASSEvent
void associate(const CASSEvent &evt)
associate the event with this analyzer
SignalProducer::signals_t & operator()(SignalProducer::signals_t &sig)
extract signals form the CASSEvent
file contains the classes that describe an acqiris channel
timeranges_t _timeranges
the time ranges in which the signals are found
void getcom(const Channel &c, const CoMParameters ¶m, SignalProducer::signals_t &sig)
Implementation of Center of Mass.
file contains declaration of class that does a center of mass analysis of a waveform ...
things written only at end of run H5Dump ProcessorSummary size
SignalProducer::signals_t & operator()(SignalProducer::signals_t &sig)
retrieve signals from data
std::vector< double > signal_t
beginReadArray(const QString &prefix)
Polarity _polarity
the polarity that the signals have
Binary function for thresholding.
Polarity
the Polarity of a Signal in the waveform (Peak)
file contains functions that help analysing an acqiris waveform
file contains the declaration of the acqiris part of the CASSEvent
void loadSettings(CASSSettings &)
load the settings of the extractor
value(const QString &key, const QVariant &defaultValue=QVariant()
A Channel of an Acqiris Instrument.
file contains specialized class that do the settings for cass
struct to combine the parameters that the Center of Mass Extractors need
double _threshold
the level above which we think this is a signal (in V)
beginGroup(const QString &prefix)