~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to source/EXAMPLES/Tutorial_MSSpectrum.C

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2013-12-20 11:30:16 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20131220113016-wre5g9bteeheq6he
Tags: 1.11.1-3
* remove version number from libbost development package names;
* ensure that AUTHORS is correctly shipped in all packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <OpenMS/KERNEL/MSSpectrum.h>
2
 
#include <iostream>
3
 
 
4
 
using namespace OpenMS;
5
 
using namespace std;
6
 
 
7
 
Int main()
8
 
{
9
 
  MSSpectrum<> spectrum;
10
 
  Peak1D peak;
11
 
 
12
 
  for (Real mz=1500.0; mz>=500; mz-=100.0)
13
 
  { 
14
 
    peak.setMZ(mz);
15
 
    spectrum.push_back(peak);
16
 
  }
17
 
 
18
 
  spectrum.sortByPosition();
19
 
 
20
 
  MSSpectrum<>::Iterator it;
21
 
  for(it=spectrum.MZBegin(800.0); it!=spectrum.MZEnd(1000.0); ++it)
22
 
  {
23
 
    cout << it->getMZ() << endl;
24
 
  }
25
 
 
26
 
  return 0;
27
 
} //end of main