CFEL - ASG Software Suite  2.5.0
CASS
spectrometer.cpp
Go to the documentation of this file.
1 //Copyright (C) 2009-2010 Lutz Foucar
2 
3 /**
4  * @file spectrometer.cpp file contains the classes that describe a REMI type
5  * spectrometer.
6  *
7  * @author Lutz Foucar
8  */
9 
10 #include <cmath>
11 
12 #include "spectrometer.h"
13 
14 #include "particle.h"
15 #include "cass_settings.h"
16 
17 using namespace cass::ACQIRIS;
18 
20 {
21  s.beginGroup("Spectrometer");
22  int size = s.beginReadArray("Regions");
23  for (int i = 0; i < size; ++i)
24  {
25  s.setArrayIndex(i);
26  SpectrometerRegion region;
27  region.loadSettings(s);
28  _regions.push_back(region);
29  }
30  s.endArray();
31  _BFieldIsOn = s.value("BFieldIsOn",false).toBool();
32  _cyclotronPeriod = s.value("CyclotronPeriode",10).toDouble();
33  _cyclotronPeriod *= (p.mass_au() / std::abs(p.charge_au()));
34  _rotationClockwise = s.value("RotationClockwise",true).toBool();
35  s.endGroup();
36 }
37 
39 {
40  _length = s.value("Length",10).toDouble();
41  _efield = s.value("EField",10).toDouble();
42 }
setArrayIndex(int i)
double _length
the length of the spectrometer region in mm
Definition: spectrometer.h:53
double mass_au() const
retrieve the particle properties
Definition: particle.h:122
Settings for CASS.
Definition: cass_settings.h:30
bool _rotationClockwise
flag showing the direction of the magnetic field
Definition: spectrometer.h:128
regions_t _regions
the regions of the spectrometer
Definition: spectrometer.h:116
double _cyclotronPeriod
the cyclotron frequency of the particles in ns
Definition: spectrometer.h:122
a region of a spectrometer
Definition: spectrometer.h:36
things written only at end of run H5Dump ProcessorSummary size
void loadSettings(CASSSettings &s, const Particle &particle)
load the settings from .ini file
beginReadArray(const QString &prefix)
double _efield
the electric field strength inside this region in
Definition: spectrometer.h:55
double charge_au() const
retrieve the particle properties
Definition: particle.h:123
bool _BFieldIsOn
flag to tell whether the magnetic field is turned on
Definition: spectrometer.h:119
void loadSettings(CASSSettings &s)
load the settings from .ini file
value(const QString &key, const QVariant &defaultValue=QVariant()
file contains specialized class that do the settings for cass
file contains the classes that describe a particle that hit a delayline detector. ...
A Particle.
Definition: particle.h:70
contains the classes that describe a REMI type spectrometer.
beginGroup(const QString &prefix)