BALL  1.5.0
shiftModel1D.h
Go to the documentation of this file.
1 #ifndef BALL_NMR_SHIFTMODEL1D_H
2 #define BALL_NMR_SHIFTMODEL1D_H
3 
4 #ifndef BALL_NMR_SHIFTMODULE_H
5 # include <BALL/NMR/shiftModule.h>
6 #endif
7 
8 #ifndef BALL_NMR_SPECTRUM_H
9  #include <BALL/NMR/spectrum.h>
10 #endif
11 
12 
13 namespace BALL
14 {
19  : public ShiftModule
20  {
21 
22  public:
24 
25 
28 
30  H = 1,
31  N,
32  C,
35  C_BACKBONE
36  };
37 
39 
42 
45  ShiftModel1D();
46 
51  ShiftModel1D(const String& filename,SPECTRUM_TYPE st, bool compute_shifts=true);
52 
57  ShiftModel1D(const String& filename,SPECTRUM_TYPE st, double origin, double dimension, double spacing, bool compute_shifts=true);
58 
61  ShiftModel1D(const ShiftModel1D& model);
62 
65  virtual ~ShiftModel1D();
66 
69  void clear();
70 
72 
75 
79  void setFilename(const String& filename);
80 
83  const String& getFilename() const
84  {
85  return parameters_.getFilename();
86  };
87 
90  const Parameters& getParameters() const
91  {
92  return parameters_;
93  };
94 
97  const std::vector<Peak1D>& getPeaks() const
98  {
99  return peaks_;
100  };
101 
104  void setPeaks(std::vector<Peak1D> peaks)
105  {
106  peaks_ = peaks;
107  };
108 
109 
112  const double& getOrigin() const
113  {
114  return origin_;
115  };
116 
119  void setOrigin(const double& origin)
120  {
121  origin_ = origin;
122  };
123 
126  const double& getDimension() const
127  {
128  return dimension_;
129  };
130 
133  void setDimension( const double& dimension)
134  {
135  dimension_ = dimension;
136  }
137 
140  const double getSpacing() const
141  {
142  return spacing_;
143  };
144 
147  void setSystem( System* system)
148  {
149  system_ = system;
150  };
151 
154  const System* getSystem() const
155  {
156  return system_;
157  };
158 
159 
160  void operator >> (Spectrum1D& spectrum);
161 
163 
166 
169  bool isValid() const;
170 
172 
175 
178  bool start();
179 
182  bool finish();
183 
186  Processor::Result operator () (Composite& composite);
188 
189  protected:
190 
191 
192  /*_ Initialize the model from the parameter file.
193  This method assumes that object has a valid parameter file assigned.
194  It sets {\tt valid_} to <b> true </b> if it could create a shift model
195  from the contents of the parameter file.
196  @throws BALL::Exception::FileNotFound
197  */
198  bool init_();
199 
200  /*_ The spectrum peaks
201  * */
202  std::vector<Peak1D> peaks_;
203 
204  /*_ The origin of the data
205  */
206  double origin_;
207 
208  /*_ Dimension of the data
209  */
210  double dimension_;
211 
212  /*_ spacing of the data
213  */
214  double spacing_;
215 
216  /*_ spectrum type
217  * */
219 
220  /*_ The parameters object ?? Why do we need them??? evtl durch String filename ersetzten
221  */
223 
224  /*_ pointer to the system
225  */
227 
228  /*_ The validity flag.
229  Set to <b> true </b> if the object was initialized correctly.
230  */
231  bool valid_;
232 
235 
236  bool hasType_(Atom* a, SPECTRUM_TYPE type);
237 
238  }; // end of class
239 
240 } // namespace BALL
241 
242 #endif // BALL_NMR_SHIFTMODEL1D_H
BALL::Parameters
Definition: parameters.h:24
BALL::ShiftModel1D::getParameters
const Parameters & getParameters() const
Definition: shiftModel1D.h:90
BALL::ShiftModel1D::valid_
bool valid_
Definition: shiftModel1D.h:231
BALL::ShiftModel1D::dimension_
double dimension_
Definition: shiftModel1D.h:210
BALL::System
Definition: KERNEL/system.h:38
BALL::ShiftModule
Definition: shiftModule.h:41
BALL::ShiftModel1D::C
@ C
Definition: shiftModel1D.h:32
BALL::ShiftModel1D::N
@ N
Definition: shiftModel1D.h:31
BALL::ShiftModel1D::setOrigin
void setOrigin(const double &origin)
Definition: shiftModel1D.h:119
BALL::Atom
Definition: atom.h:87
BALL::ShiftModel1D::getOrigin
const double & getOrigin() const
Definition: shiftModel1D.h:112
BALL::String
Definition: string.h:56
BALL::ShiftModel1D::SPECTRUM_TYPE
SPECTRUM_TYPE
Definition: shiftModel1D.h:29
BALL
Definition: constants.h:12
BALL::ShiftModel1D::setSystem
void setSystem(System *system)
Definition: shiftModel1D.h:147
shiftModule.h
BALL::ShiftModel1D::spacing_
double spacing_
Definition: shiftModel1D.h:214
BALL::ShiftModel1D::getFilename
const String & getFilename() const
Definition: shiftModel1D.h:83
BALL::ShiftModel1D::getPeaks
const std::vector< Peak1D > & getPeaks() const
Definition: shiftModel1D.h:97
BALL::ShiftModel1D::compute_shifts_
bool compute_shifts_
Flag for shift computation.
Definition: shiftModel1D.h:234
BALL::Composite
Definition: composite.h:71
BALL::ShiftModel1D::H_ON_BACKBONE
@ H_ON_BACKBONE
Definition: shiftModel1D.h:33
spectrum.h
BALL::ShiftModel1D::getSpacing
const double getSpacing() const
Definition: shiftModel1D.h:140
BALL::ShiftModel1D::setPeaks
void setPeaks(std::vector< Peak1D > peaks)
Definition: shiftModel1D.h:104
BALL::ShiftModel1D::parameters_
Parameters parameters_
Definition: shiftModel1D.h:222
BALL::ShiftModel1D::getSystem
const System * getSystem() const
Definition: shiftModel1D.h:154
BALL::ShiftModel1D::getDimension
const double & getDimension() const
Definition: shiftModel1D.h:126
BALL::ShiftModel1D::origin_
double origin_
Definition: shiftModel1D.h:206
BALL::operator>>
std::istream & operator>>(std::istream &is, TRegularData1D< ValueType > &grid)
Input operator.
Definition: regularData1D.h:802
BALL::ShiftModel1D::type_
SPECTRUM_TYPE type_
Definition: shiftModel1D.h:218
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL::Spectrum
Definition: spectrum.h:46
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::ShiftModel1D
Definition: shiftModel1D.h:18
BALL::ShiftModel1D::peaks_
std::vector< Peak1D > peaks_
Definition: shiftModel1D.h:202
BALL::ShiftModel1D::system_
System * system_
Definition: shiftModel1D.h:226
BALL::ShiftModel1D::N_BACKBONE
@ N_BACKBONE
Definition: shiftModel1D.h:34
BALL::ShiftModel1D::setDimension
void setDimension(const double &dimension)
Definition: shiftModel1D.h:133