OpenMS  2.6.0
Precursor.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Mathias Walzer $
32 // $Authors: Marc Sturm, Mathias Walzer $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/KERNEL/Peak1D.h>
40 
41 #include <set>
42 
43 namespace OpenMS
44 {
57  class OPENMS_DLLAPI Precursor :
58  public CVTermList,
59  public Peak1D
60  {
61 
62 public:
63 
66  {
67  CID,
68  PSD,
69  PD,
70  SID,
71  BIRD,
72  ECD,
73  IMD,
74  SORI,
75  HCID,
76  LCID,
77  PHD,
78  ETD,
79  PQD,
80  SIZE_OF_ACTIVATIONMETHOD
81  };
82 
85  {
86  NONE,
88  VSSC,
90  SIZE_OF_DRIFTTIMEUNIT
91  };
92 
93 
95  static const std::string NamesOfActivationMethod[SIZE_OF_ACTIVATIONMETHOD];
96  static const std::string NamesOfActivationMethodShort[SIZE_OF_ACTIVATIONMETHOD];
97 
99  Precursor();
101  Precursor(const Precursor &) = default;
102 
103  // note: we implement the move constructor ourselves due to a bug in MSVS
104  // 2015/2017 which cannot produce a default move constructor for classes
105  // that contain STL containers (other than vector).
106 
108  Precursor(Precursor&&) noexcept;
110  ~Precursor() override;
111 
113  Precursor & operator=(const Precursor &) = default;
115  Precursor& operator=(Precursor&&) & = default;
116 
118  bool operator==(const Precursor & rhs) const;
120  bool operator!=(const Precursor & rhs) const;
121 
123  const std::set<ActivationMethod> & getActivationMethods() const;
125  std::set<ActivationMethod> & getActivationMethods();
127  void setActivationMethods(const std::set<ActivationMethod> & activation_methods);
128 
130  double getActivationEnergy() const;
132  void setActivationEnergy(double activation_energy);
133 
144  double getIsolationWindowLowerOffset() const;
146  void setIsolationWindowLowerOffset(double bound);
147 
158  double getIsolationWindowUpperOffset() const;
160  void setIsolationWindowUpperOffset(double bound);
161 
169  double getDriftTime() const;
171  void setDriftTime(double drift_time);
172 
176  DriftTimeUnit getDriftTimeUnit() const;
177 
181  void setDriftTimeUnit(DriftTimeUnit dt);
182 
183 
194  double getDriftTimeWindowLowerOffset() const;
196  void setDriftTimeWindowLowerOffset(double drift_time);
197 
208  double getDriftTimeWindowUpperOffset() const;
210  void setDriftTimeWindowUpperOffset(double drift_time);
211 
213  Int getCharge() const;
215  void setCharge(Int charge);
216 
218  std::vector<Int> & getPossibleChargeStates();
220  const std::vector<Int> & getPossibleChargeStates() const;
222  void setPossibleChargeStates(const std::vector<Int> & possible_charge_states);
223 
225  inline double getUnchargedMass() const
226  {
227  int c = charge_;
228  (c == 0) ? c = 2 : c = charge_;
229  return getMZ() * c - c * Constants::PROTON_MASS_U;
230  }
231 
232 protected:
233 
234  std::set<ActivationMethod> activation_methods_;
236  double window_low_;
237  double window_up_;
238  double drift_time_;
243  std::vector<Int> possible_charge_states_;
244  };
245 } // namespace OpenMS
246 
OpenMS::Precursor::MILLISECOND
milliseconds
Definition: Precursor.h:87
OpenMS::Precursor::SORI
Sustained off-resonance irradiation.
Definition: Precursor.h:74
OpenMS::Precursor::window_up_
double window_up_
Definition: Precursor.h:237
OpenMS::Precursor::drift_time_unit_
DriftTimeUnit drift_time_unit_
Definition: Precursor.h:241
OpenMS::Precursor::SID
Surface-induced dissociation.
Definition: Precursor.h:70
OpenMS::Precursor::activation_methods_
std::set< ActivationMethod > activation_methods_
Definition: Precursor.h:234
Peak1D.h
OpenMS::Precursor::BIRD
Blackbody infrared radiative dissociation.
Definition: Precursor.h:71
OpenMS::Precursor::PHD
Photodissociation.
Definition: Precursor.h:77
OpenMS::Constants::c
const double c
OpenMS::Precursor::NONE
No unit.
Definition: Precursor.h:86
OpenMS::Precursor::IMD
Infrared multiphoton dissociation.
Definition: Precursor.h:73
OpenMS::Precursor::CID
Collision-induced dissociation.
Definition: Precursor.h:67
OpenMS::Precursor::ECD
Electron capture dissociation.
Definition: Precursor.h:72
OpenMS::Precursor::ETD
Electron transfer dissociation.
Definition: Precursor.h:78
OpenMS::Constants::PROTON_MASS_U
const double PROTON_MASS_U
Constants.h
OpenMS::Precursor::LCID
Low-energy collision-induced dissociation.
Definition: Precursor.h:76
OpenMS::Precursor
Precursor meta information.
Definition: Precursor.h:57
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::Precursor::FAIMS_COMPENSATION_VOLTAGE
compensation voltage
Definition: Precursor.h:89
int
OpenMS::Precursor::charge_
Int charge_
Definition: Precursor.h:242
OpenMS::Precursor::drift_window_low_
double drift_window_low_
Definition: Precursor.h:239
OpenMS::Precursor::drift_time_
double drift_time_
Definition: Precursor.h:238
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
OpenMS::Precursor::PQD
Pulsed q dissociation.
Definition: Precursor.h:79
OpenMS::CVTermList
Representation of controlled vocabulary term list.
Definition: CVTermList.h:52
OpenMS::Precursor::PSD
Post-source decay.
Definition: Precursor.h:68
OpenMS::Precursor::DriftTimeUnit
DriftTimeUnit
Drift time unit.
Definition: Precursor.h:84
CVTermList.h
OpenMS::Precursor::drift_window_up_
double drift_window_up_
Definition: Precursor.h:240
OpenMS::Precursor::window_low_
double window_low_
Definition: Precursor.h:236
OpenMS::Precursor::activation_energy_
double activation_energy_
Definition: Precursor.h:235
OpenMS::Precursor::PD
Plasma desorption.
Definition: Precursor.h:69
OpenMS::Precursor::ActivationMethod
ActivationMethod
Method of activation.
Definition: Precursor.h:65
OpenMS::Precursor::VSSC
volt-second per square centimeter
Definition: Precursor.h:88
OpenMS::Precursor::possible_charge_states_
std::vector< Int > possible_charge_states_
Definition: Precursor.h:243
OpenMS::Precursor::HCID
High-energy collision-induced dissociation.
Definition: Precursor.h:75