OpenMS
SwathMap.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <cmath>
13 
14 namespace OpenSwath
15 {
20  struct SwathMap
21  {
23  double lower;
24  double upper;
25  double center;
26  double imLower;
27  double imUpper;
28  bool ms1;
29 
31  lower(0.0),
32  upper(0.0),
33  center(0.0),
34  imLower(-1),
35  imUpper(-1),
36  ms1(false)
37  {}
38 
39  SwathMap(double mz_start, double mz_end, double mz_center, bool is_ms1)
40  : lower(mz_start),
41  upper(mz_end),
42  center(mz_center),
43  imLower(-1),
44  imUpper(-1),
45  ms1(is_ms1)
46 
47  {}
48 
49 
50  SwathMap(double mz_start, double mz_end, double mz_center, double imLower, double imUpper, bool is_ms1)
51  : lower(mz_start),
52  upper(mz_end),
53  center(mz_center),
56  ms1(is_ms1)
57  {}
58 
59  bool isEqual(const SwathMap& other, double tolerance = 1e-6) const
60  {
61  return (std::fabs(lower - other.lower) < tolerance) &&
62  (std::fabs(upper - other.upper) < tolerance) &&
63  (std::fabs(center - other.center) < tolerance) &&
64  (std::fabs(imLower - other.imLower) < tolerance) &&
65  (std::fabs(imUpper - other.imUpper) < tolerance) &&
66  (ms1 == other.ms1);
67  }
68 
69  };
70 
71 } //end Namespace OpenSwath
72 
Definition: Scoring.h:18
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:131
Data structure to hold one SWATH map with information about upper / lower isolation window and whethe...
Definition: SwathMap.h:21
SwathMap()
Definition: SwathMap.h:30
bool ms1
Definition: SwathMap.h:28
double imUpper
Definition: SwathMap.h:27
OpenSwath::SpectrumAccessPtr sptr
Definition: SwathMap.h:22
bool isEqual(const SwathMap &other, double tolerance=1e-6) const
Definition: SwathMap.h:59
double center
Definition: SwathMap.h:25
SwathMap(double mz_start, double mz_end, double mz_center, double imLower, double imUpper, bool is_ms1)
Definition: SwathMap.h:50
double lower
Definition: SwathMap.h:23
double imLower
Definition: SwathMap.h:26
double upper
Definition: SwathMap.h:24
SwathMap(double mz_start, double mz_end, double mz_center, bool is_ms1)
Definition: SwathMap.h:39