CFEL - ASG Software Suite  2.5.0
CASS
cfd.h
Go to the documentation of this file.
1 //Copyright (C) 2003-2010 Lutz Foucar
2 
3 /**
4  * @file cfd.h file contains declaration of class that does a constant fraction
5  * descrimination like analysis of a waveform
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _CFD_H_
11 #define _CFD_H_
12 
13 #include <iostream>
14 #include "cass.h"
15 #include "signal_extractor.h"
16 
17 namespace cass
18 {
19 namespace ACQIRIS
20 {
21 class Channel;
22 
23 /** struct to combine the parameters that the Constant Fraction Extractors need
24  *
25  * @author Lutz Foucar
26  */
28 {
29  typedef std::pair<double,double> timerange_t;
30  typedef std::vector<timerange_t> timeranges_t;
31 
32  /** the time ranges in which the signals are found */
33  timeranges_t _timeranges;
34 
35  /** the polarity that the signals have */
37 
38  /** the level above which we think this is a signal (in V) */
39  double _threshold;
40 
41  /** the delay of the cfd */
42  int32_t _delay;
43 
44  /** the fraction of the cfd */
45  double _fraction;
46 
47  /** the walk of the cfd (in V) */
48  double _walk;
49 };
50 
51 
52 /** Finds Signals in a waveform.
53  *
54  * Analyzes a waveform and find signals using a constant fraction algorithm.
55  * It then does all the further analysis of the identified Signal.
56  *
57  * This class will work on waveforms with a depth of 8 Bits.
58  *
59  * User settable parameters via CASS.ini:\n
60  * One can set these parameters for each SignalProducer of the Detectortype.
61  * Therefore the settings will be for the the following signal producers:
62  * - For MCP in Delayline and TofDetectors its :
63  * - AcqirisDetectors/%detectorname%/MCP
64  * - For Layer Wireends in Delaylinedetectors its:
65  * - AcqirisDetectors/%detectorname%/%Layername%/%Wireendname%
66  *
67  * @cassttng .../ConstantFraction/{AcqirisInstrument}\n
68  * Acqiris Instrument that this channel is in:
69  * - 8: Camp (Acqiris Multiinstrument with 5 Cards (20 Channels))
70  * - 4: AMO I-ToF
71  * - 5: AMO Magnetic Bottle
72  * - 2: AMO Gas Detector
73  * @cassttng .../ConstantFraction/{ChannelNumber} \n
74  * Channel within the instrument (starts counting from 0)
75  * @cassttng .../ConstantFraction/Timeranges/(0,1,...)/{LowerLimit|UpperLimit}\n
76  * set of timeranges. One can set more than one range of interest.
77  * Default is no timerange, which will result in no signal will be
78  * found.
79  * @cassttng .../ConstantFraction/{Polarity}\n
80  * the polarity of the signals that we are interested in:
81  * - 1: Positive Polarity
82  * - 2: Negative Polarity
83  * @cassttng .../ConstantFraction/{Threshold}\n
84  * the theshold for the signals in Volts:
85  * @cassttng .../ConstantFraction/{Delay}\n
86  * delay in ns used by the constant fraction method:
87  * @cassttng .../ConstantFraction/{Fraction}\n
88  * fraction used by the constant fraction method:
89  * @cassttng .../ConstantFraction/{Walk}\n
90  * walk of the Constant Fraction Discriminator in Volts
91  *
92  * @author Lutz Foucar
93  */
94 class CFD8Bit : public SignalExtractor
95 {
96 public:
97  /** extract signals form the CASSEvent
98  *
99  * Calls cfd to extract the Signal from _chan. For details how see cfd.
100  *
101  * @return reference of the input result container
102  * @param[in] sig this is the container for the results
103  */
105 
106  /** associate the event with this analyzer
107  *
108  * Extracts a pointer the channel for which we are there for from the
109  * event with the help of extractRightChannel.
110  *
111  * @param evt The event from which we get the pointer to the channel.
112  */
113  void associate(const CASSEvent& evt);
114 
115  /** load the settings of the extractor
116  *
117  * Calls the loadSettings implementation to retrieve all information to be
118  * able extract the signals from _channel. And to be able to extract the
119  * right channel from the events in associate().
120  *
121  * @param s the CASSSettings object to retrieve the information from
122  */
123  void loadSettings(CASSSettings&);
124 
125 private:
126  /** parameters for extracting the signals from the channels waveform */
128 
129  /** the instrument that the channel is in */
130  uint32_t _instrument;
131 
132  /** the channelnumber of the channel we extracting the signals from */
133  size_t _chNbr;
134 
135  /** pointer to the channel we are extracting the signals from */
136  const Channel * _chan;
137 };
138 
139 
140 /** Finds signals in a 16 bit waveform.
141  *
142  * Member description is the same as in the 8 Bit version. @see class CFD8Bit
143  *
144  * @author Lutz Foucar
145  */
146 class CFD16Bit : public SignalExtractor
147 {
148 public:
150  void associate(const CASSEvent& evt);
151  void loadSettings(CASSSettings&);
152 
153 private:
155  uint32_t _instrument;
156  size_t _chNbr;
157  const Channel*_chan;
158 };
159 
160 }//end namespace acqiris
161 }//end namespace cass
162 #endif
SignalProducer::signals_t & operator()(SignalProducer::signals_t &sig)
retrieve signals from data
Definition: cfd.cpp:254
double _walk
the walk of the cfd (in V)
Definition: cfd.h:48
Event to store all LCLS Data.
Definition: cass_event.h:32
double _threshold
the level above which we think this is a signal (in V)
Definition: cfd.h:39
int32_t _delay
the delay of the cfd
Definition: cfd.h:42
std::vector< signal_t > signals_t
std::pair< double, double > timerange_t
Definition: cfd.h:29
Settings for CASS.
Definition: cass_settings.h:30
double _fraction
the fraction of the cfd
Definition: cfd.h:45
void associate(const CASSEvent &evt)
associate the event with this analyzer
Definition: cfd.cpp:265
void loadSettings(CASSSettings &)
load the settings of the extractor
Definition: cfd.cpp:242
size_t _chNbr
the channelnumber of the channel we extracting the signals from
Definition: cfd.h:133
Finds Signals in a waveform.
Definition: cfd.h:94
timeranges_t _timeranges
the time ranges in which the signals are found
Definition: cfd.h:33
Base class for classes that extract Signals from recorded data.
Polarity
the Polarity of a Signal in the waveform (Peak)
file contains global definitions for project cass
file file contains base class for all classes that extract signals from the recorded data ...
Finds signals in a 16 bit waveform.
Definition: cfd.h:146
const Channel * _chan
pointer to the channel we are extracting the signals from
Definition: cfd.h:136
A Channel of an Acqiris Instrument.
Definition: channel.hpp:31
const Channel * _chan
Definition: cfd.h:157
uint32_t _instrument
the instrument that the channel is in
Definition: cfd.h:130
CFDParameters _parameters
parameters for extracting the signals from the channels waveform
Definition: cfd.h:127
void loadSettings(CASSSettings &)
load the settings of the extractor
Definition: cfd.cpp:260
struct to combine the parameters that the Constant Fraction Extractors need
Definition: cfd.h:27
std::vector< timerange_t > timeranges_t
Definition: cfd.h:30
uint32_t _instrument
Definition: cfd.h:155
CFDParameters _parameters
Definition: cfd.h:154
Polarity _polarity
the polarity that the signals have
Definition: cfd.h:36
void associate(const CASSEvent &evt)
associate the event with this analyzer
Definition: cfd.cpp:247
SignalProducer::signals_t & operator()(SignalProducer::signals_t &sig)
extract signals form the CASSEvent
Definition: cfd.cpp:236