OpenMS
Loading...
Searching...
No Matches
IonDetector.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14#include <functional>
15
16namespace OpenMS
17{
23 class OPENMS_DLLAPI IonDetector :
25 {
26public:
28 enum class Type
29 {
30 TYPENULL,
31 ELECTRONMULTIPLIER,
32 PHOTOMULTIPLIER,
33 FOCALPLANEARRAY,
34 FARADAYCUP,
35 CONVERSIONDYNODEELECTRONMULTIPLIER,
36 CONVERSIONDYNODEPHOTOMULTIPLIER,
37 MULTICOLLECTOR,
38 CHANNELELECTRONMULTIPLIER,
39 CHANNELTRON,
40 DALYDETECTOR,
41 MICROCHANNELPLATEDETECTOR,
42 ARRAYDETECTOR,
43 CONVERSIONDYNODE,
44 DYNODE,
45 FOCALPLANECOLLECTOR,
46 IONTOPHOTONDETECTOR,
47 POINTCOLLECTOR,
48 POSTACCELERATIONDETECTOR,
49 PHOTODIODEARRAYDETECTOR,
50 INDUCTIVEDETECTOR,
51 ELECTRONMULTIPLIERTUBE,
52 SIZE_OF_TYPE
53 };
55 static const std::string NamesOfType[static_cast<size_t>(Type::SIZE_OF_TYPE)];
56
58 enum class AcquisitionMode
59 {
60 ACQMODENULL,
61 PULSECOUNTING,
62 ADC,
63 TDC,
64 TRANSIENTRECORDER,
65 SIZE_OF_ACQUISITIONMODE
66 };
68 static const std::string NamesOfAcquisitionMode[static_cast<size_t>(AcquisitionMode::SIZE_OF_ACQUISITIONMODE)];
69
76
83
91 static const std::string& typeToString(Type type);
92
100 static Type toType(const std::string& name);
101
109 static const std::string& acquisitionModeToString(AcquisitionMode mode);
110
118 static AcquisitionMode toAcquisitionMode(const std::string& name);
119
123 IonDetector(const IonDetector &) = default;
128
130 IonDetector & operator=(const IonDetector &) = default;
133
135 bool operator==(const IonDetector & rhs) const;
137 bool operator!=(const IonDetector & rhs) const;
138
140 Type getType() const;
142 void setType(Type type);
143
147 void setAcquisitionMode(AcquisitionMode acquisition_mode);
148
150 double getResolution() const;
152 void setResolution(double resolution);
153
157 void setADCSamplingFrequency(double ADC_sampling_frequency);
158
169 Int getOrder() const;
171 void setOrder(Int order);
172
173protected:
179
180 };
181} // namespace OpenMS
182
183namespace std
184{
194 template<>
195 struct hash<OpenMS::IonDetector>
196 {
197 std::size_t operator()(const OpenMS::IonDetector& d) const noexcept
198 {
199 std::size_t seed = OpenMS::hash_int(static_cast<int>(d.getType()));
200 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<int>(d.getAcquisitionMode())));
201 OpenMS::hash_combine(seed, OpenMS::hash_float(d.getResolution()));
202 OpenMS::hash_combine(seed, OpenMS::hash_float(d.getADCSamplingFrequency()));
203 OpenMS::hash_combine(seed, OpenMS::hash_int(d.getOrder()));
204 return seed;
205 }
206 };
207} // namespace std
208
Description of a ion detector (part of a MS Instrument)
Definition IonDetector.h:25
bool operator!=(const IonDetector &rhs) const
Equality operator.
Type
Detector type.
Definition IonDetector.h:29
IonDetector & operator=(const IonDetector &)=default
Assignment operator.
Int getOrder() const
returns the position of this part in the whole Instrument.
double getResolution() const
returns the resolution (in ns)
void setResolution(double resolution)
sets the resolution (in ns)
static StringList getAllNamesOfType()
Returns all detector type names known to OpenMS.
IonDetector()
Constructor.
void setADCSamplingFrequency(double ADC_sampling_frequency)
sets the analog-to-digital converter sampling frequency (in Hz)
static AcquisitionMode toAcquisitionMode(const std::string &name)
Convert a string to an AcquisitionMode enum.
void setOrder(Int order)
sets the order
AcquisitionMode getAcquisitionMode() const
returns the acquisition mode
double resolution_
Definition IonDetector.h:176
static StringList getAllNamesOfAcquisitionMode()
Returns all acquisition mode names known to OpenMS.
void setType(Type type)
sets the detector type
~IonDetector()
Destructor.
IonDetector(const IonDetector &)=default
Copy constructor.
Int order_
Definition IonDetector.h:178
static const std::string & typeToString(Type type)
Convert a Type enum to its string representation.
void setAcquisitionMode(AcquisitionMode acquisition_mode)
sets the acquisition mode
Type getType() const
returns the detector type
AcquisitionMode
Acquisition mode.
Definition IonDetector.h:59
IonDetector & operator=(IonDetector &&) &=default
Move assignment operator.
static const std::string & acquisitionModeToString(AcquisitionMode mode)
Convert an AcquisitionMode enum to its string representation.
static Type toType(const std::string &name)
Convert a string to a Type enum.
AcquisitionMode acquisition_mode_
Definition IonDetector.h:175
double ADC_sampling_frequency_
Definition IonDetector.h:177
bool operator==(const IonDetector &rhs) const
Equality operator.
Type type_
Definition IonDetector.h:174
double getADCSamplingFrequency() const
returns the analog-to-digital converter sampling frequency (in Hz)
IonDetector(IonDetector &&)=default
Move constructor.
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition MetaInfoInterface.h:36
int Int
Signed integer type.
Definition Types.h:72
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::size_t hash_int(T value) noexcept
Hash for an integer type.
Definition HashUtils.h:107
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
STL namespace.
std::size_t operator()(const OpenMS::IonDetector &d) const noexcept
Definition IonDetector.h:197