OpenMS
Loading...
Searching...
No Matches
IonSource.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
15#include <functional>
16
17namespace OpenMS
18{
19
25 class OPENMS_DLLAPI IonSource :
27 {
28public:
30 enum class InletType
31 {
32 INLETNULL,
33 DIRECT,
34 BATCH,
35 CHROMATOGRAPHY,
36 PARTICLEBEAM,
37 MEMBRANESEPARATOR,
38 OPENSPLIT,
39 JETSEPARATOR,
40 SEPTUM,
41 RESERVOIR,
42 MOVINGBELT,
43 MOVINGWIRE,
44 FLOWINJECTIONANALYSIS,
45 ELECTROSPRAYINLET,
46 THERMOSPRAYINLET,
47 INFUSION,
48 CONTINUOUSFLOWFASTATOMBOMBARDMENT,
49 INDUCTIVELYCOUPLEDPLASMA,
50 MEMBRANE,
51 NANOSPRAY,
52 SIZE_OF_INLETTYPE
53 };
55 static const std::string NamesOfInletType[static_cast<size_t>(InletType::SIZE_OF_INLETTYPE)];
56
59 {
60 IONMETHODNULL,
61 ESI,
62 EI,
63 CI,
64 FAB,
65 TSP,
66 LD,
67 FD,
68 FI,
69 PD,
70 SI,
71 TI,
72 API,
73 ISI,
74 CID,
75 CAD,
76 HN,
77 APCI,
78 APPI,
79 ICP,
80 NESI,
81 MESI,
82 SELDI,
83 SEND,
84 FIB,
85 MALDI,
86 MPI,
87 DI,
88 FA,
89 FII,
90 GD_MS,
91 NICI,
92 NRMS,
93 PI,
94 PYMS,
95 REMPI,
96 AI,
97 ASI,
98 AD,
99 AUI,
100 CEI,
101 CHEMI,
102 DISSI,
103 LSI,
104 PEI,
105 SOI,
106 SPI,
107 SUI,
108 VI,
109 AP_MALDI,
110 SILI,
111 SALDI,
112 SIZE_OF_IONIZATIONMETHOD
113 };
115 static const std::string NamesOfIonizationMethod[static_cast<size_t>(IonizationMethod::SIZE_OF_IONIZATIONMETHOD)];
116
118 enum class Polarity
119 {
120 POLNULL,
121 POSITIVE,
122 NEGATIVE,
123 SIZE_OF_POLARITY
124 };
126 static const std::string NamesOfPolarity[static_cast<size_t>(Polarity::SIZE_OF_POLARITY)];
127
149
157 static const std::string& inletTypeToString(InletType type);
158
166 static InletType toInletType(const std::string& name);
167
175 static const std::string& ionizationMethodToString(IonizationMethod method);
176
184 static IonizationMethod toIonizationMethod(const std::string& name);
185
193 static const std::string& polarityToString(Polarity polarity);
194
202 static Polarity toPolarity(const std::string& name);
203
207 IonSource(const IonSource &) = default;
209 IonSource(IonSource&&) = default;
212
214 IonSource & operator=(const IonSource &) = default;
217
219 bool operator==(const IonSource & rhs) const;
221 bool operator!=(const IonSource & rhs) const;
222
226 void setInletType(InletType inlet_type);
227
232
236 void setPolarity(Polarity polarity);
237
248 Int getOrder() const;
250 void setOrder(Int order);
251
252protected:
257
258 };
259
260} // namespace OpenMS
261
262// Hash function specialization for IonSource
263namespace std
264{
265 template<>
266 struct hash<OpenMS::IonSource>
267 {
268 std::size_t operator()(const OpenMS::IonSource& is) const noexcept
269 {
270 // Hash all fields used in operator==: order_, inlet_type_, ionization_method_, polarity_, and MetaInfoInterface
271 std::size_t seed = OpenMS::hash_int(is.getOrder());
272 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<int>(is.getInletType())));
273 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<int>(is.getIonizationMethod())));
274 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<int>(is.getPolarity())));
275
276 // Hash MetaInfoInterface base class (handles both UInt and String keys)
277 OpenMS::hash_combine(seed, std::hash<OpenMS::MetaInfoInterface>{}(is));
278
279 return seed;
280 }
281 };
282}
283
Description of an ion source (part of a MS Instrument)
Definition IonSource.h:27
static const std::string & inletTypeToString(InletType type)
Convert an InletType enum to its string representation.
InletType
inlet type
Definition IonSource.h:31
static StringList getAllNamesOfInletType()
Returns all inlet type names known to OpenMS.
void setPolarity(Polarity polarity)
sets the ionization mode
Int getOrder() const
returns the position of this part in the whole Instrument.
~IonSource()
Destructor.
void setIonizationMethod(IonizationMethod ionization_type)
sets the ionization method
IonSource()
Constructor.
void setInletType(InletType inlet_type)
sets the inlet type
IonSource(const IonSource &)=default
Copy constructor.
void setOrder(Int order)
sets the order
Polarity getPolarity() const
returns the ionization mode
IonSource & operator=(const IonSource &)=default
Assignment operator.
IonizationMethod ionization_method_
Definition IonSource.h:254
Int order_
Definition IonSource.h:256
InletType getInletType() const
returns the inlet type
static StringList getAllNamesOfIonizationMethod()
Returns all ionization method names known to OpenMS.
Polarity
Polarity of the ion source.
Definition IonSource.h:119
IonizationMethod
ionization method
Definition IonSource.h:59
static StringList getAllNamesOfPolarity()
Returns all polarity names known to OpenMS.
static Polarity toPolarity(const std::string &name)
Convert a string to a Polarity enum.
static const std::string & ionizationMethodToString(IonizationMethod method)
Convert an IonizationMethod enum to its string representation.
static const std::string & polarityToString(Polarity polarity)
Convert a Polarity enum to its string representation.
static IonizationMethod toIonizationMethod(const std::string &name)
Convert a string to an IonizationMethod enum.
IonizationMethod getIonizationMethod() const
returns the ionization method
IonSource & operator=(IonSource &&) &=default
Move assignment operator.
bool operator==(const IonSource &rhs) const
Equality operator.
Polarity polarity_
Definition IonSource.h:255
InletType inlet_type_
Definition IonSource.h:253
IonSource(IonSource &&)=default
Move constructor.
bool operator!=(const IonSource &rhs) const
Equality operator.
static InletType toInletType(const std::string &name)
Convert a string to an InletType enum.
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
STL namespace.
std::size_t operator()(const OpenMS::IonSource &is) const noexcept
Definition IonSource.h:268