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