musrWiz 0.1.0
Loading...
Searching...
No Matches
PInstrumentDef.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PInstrumentDef.h
4
5 Author: Andreas Suter
6 e-mail: andreas.suter@psi.ch
7
8***************************************************************************/
9
10/***************************************************************************
11 * Copyright (C) 2007-2026 by Andreas Suter *
12 * andreas.suter@psi.ch *
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28 ***************************************************************************/
29
30#ifndef _PINSTRUMENTDEF_H_
31#define _PINSTRUMENTDEF_H_
32
33#include <QString>
34#include <QVector>
35
45{
46 public:
51
56
61 void setName(QString str) { fName = str; }
62
67 void setRelGeomPhase(double phase) { fRelGeomPhase = phase; }
68
73 void setForwards(QVector<int> num) { fForward = num; }
74
79 void setBackwards(QVector<int> num) { fBackward = num; }
80
85 void setAlpha(double alpha) { fAlpha = alpha; }
86
91 QString getName() { return fName; }
92
97 double getRelGeomPhase() { return fRelGeomPhase; }
98
103 QVector<int> getForwards() { return fForward; }
104
109 QVector<int> getBackwards() { return fBackward; }
110
115 double getAlpha() { return fAlpha; }
116
117 private:
118 QString fName;
119 QVector<int> fForward;
120 QVector<int> fBackward;
121 double fAlpha;
123};
124
133{
134 public:
138 PSetup();
139
144
149 void setName(QString str) { fName = str; }
150
155 void setNoOfDetectors(int no) { fNoOfDetectors = no; }
156
161 void setFgbOffset(int fgbOffset) { fFgbOffset = fgbOffset; }
162
167 void setLgb(int lgb) { fLgb = lgb; }
168
174 void setBkgRange(int start, int end) { fBkgStartBin = start; fBkgEndBin = end; }
175
180 void addDetector(PDetector detector) { fLogicDetectors.push_back(detector); }
181
186 void addAsymDetector(PDetector detector) { fLogicAsymDetectors.push_back(detector); }
187
192 QString getName() { return fName; }
193
199
205
211
216 int getFgbOffset() { return fFgbOffset; }
217
222 int getLgb() { return fLgb; }
223
228 int getBkgStartBin() { return fBkgStartBin; }
229
234 int getBkgEndBin() { return fBkgEndBin; }
235
241 PDetector* getDetector(int idx);
242
248 PDetector* getAsymDetector(int idx);
249
250 private:
251 QString fName;
254 int fLgb;
257
258 QVector<PDetector> fLogicDetectors;
259 QVector<PDetector> fLogicAsymDetectors;
260};
261
270{
271 public:
275 PInstrument();
276
281
286 void setRunNameTemplate(QString str) { fRunNameTemplate = str; }
287
292 void setBeamline(QString str) { fBeamline = str; }
293
298 void setDataFileFormat(QString str) { fDataFileFormat = str; }
299
304 void setInstitue(QString str) { fInstitue = str; }
305
310 void setName(QString str) { fName = str; }
311
316 void addSetupZF(PSetup zf) { fZF.push_back(zf); }
317
322 void addSetupTF(PSetup tf) { fTF.push_back(tf); }
323
328 void addSetupLF(PSetup lf) { fLF.push_back(lf); }
329
335
340 QString getBeamline() { return fBeamline; }
341
346 QString getDataFileFormat() { return fDataFileFormat; }
347
352 QString getInstitute() { return fInstitue; }
353
358 QString getName() { return fName; }
359
364 QVector<PSetup> getZFSetups() { return fZF; }
365
370 QVector<PSetup> getTFSetups() { return fTF; }
371
376 QVector<PSetup> getLFSetups() { return fLF; }
377
383 PSetup* getZFSetup(QString name="");
384
390 PSetup* getTFSetup(QString name="");
391
397 PSetup* getLFSetup(QString name="");
398
399 private:
401 QString fBeamline;
403 QString fInstitue;
404 QString fName;
405
406 QVector<PSetup> fZF;
407 QVector<PSetup> fTF;
408 QVector<PSetup> fLF;
409};
410
418{
419 public:
423 PInstitute();
424
429
434 void setName(QString str) { fName = str; }
435
440 void addInstrument(PInstrument instrument) { fInstrument.push_back(instrument); }
441
446 QString getName() { return fName; }
447
452 QVector<PInstrument> getInstruments() { return fInstrument; }
453
459 PInstrument *getInstrument(QString name);
460
461 private:
462 QString fName;
463 QVector<PInstrument> fInstrument;
464};
465
466#endif // _PINSTRUMENTDEF_H_
The PDetector class represents a logical muon detector.
Definition PInstrumentDef.h:45
void setRelGeomPhase(double phase)
Sets the relative geometric phase.
Definition PInstrumentDef.h:67
double fRelGeomPhase
relative geometric phase in degrees
Definition PInstrumentDef.h:122
void setAlpha(double alpha)
Sets the alpha correction factor.
Definition PInstrumentDef.h:85
QString getName()
Returns the detector name.
Definition PInstrumentDef.h:91
QVector< int > getBackwards()
Returns the backward detector indices.
Definition PInstrumentDef.h:109
double fAlpha
alpha correction factor
Definition PInstrumentDef.h:121
double getRelGeomPhase()
Returns the relative geometric phase.
Definition PInstrumentDef.h:97
QVector< int > fForward
forward detector indices
Definition PInstrumentDef.h:119
QVector< int > fBackward
backward detector indices
Definition PInstrumentDef.h:120
void setBackwards(QVector< int > num)
Sets the backward detector indices.
Definition PInstrumentDef.h:79
QVector< int > getForwards()
Returns the forward detector indices.
Definition PInstrumentDef.h:103
void setName(QString str)
Sets the detector name.
Definition PInstrumentDef.h:61
QString fName
detector name
Definition PInstrumentDef.h:118
void setForwards(QVector< int > num)
Sets the forward detector indices.
Definition PInstrumentDef.h:73
~PDetector()
Destructor.
Definition PInstrumentDef.h:55
PDetector()
Constructor.
Definition PInstrumentDef.h:50
double getAlpha()
Returns the alpha correction factor.
Definition PInstrumentDef.h:115
QString getName()
Returns the institute name.
Definition PInstrumentDef.h:446
PInstrument * getInstrument(QString name)
Returns an instrument by name.
Definition PInstrumentDef.cpp:153
QVector< PInstrument > getInstruments()
Returns all instruments belonging to this institute.
Definition PInstrumentDef.h:452
void setName(QString str)
Sets the institute name.
Definition PInstrumentDef.h:434
PInstitute()
Constructor. Initializes the name to empty.
Definition PInstrumentDef.cpp:141
~PInstitute()
Destructor.
Definition PInstrumentDef.h:428
QVector< PInstrument > fInstrument
list of instruments at this institute
Definition PInstrumentDef.h:463
void addInstrument(PInstrument instrument)
Adds an instrument to this institute.
Definition PInstrumentDef.h:440
QString fName
institute name
Definition PInstrumentDef.h:462
The PInstrument class represents a muon spectrometer instrument.
Definition PInstrumentDef.h:270
QVector< PSetup > getLFSetups()
Returns all LF setups.
Definition PInstrumentDef.h:376
void addSetupLF(PSetup lf)
Adds a longitudinal-field (LF) setup configuration.
Definition PInstrumentDef.h:328
PSetup * getTFSetup(QString name="")
Returns a TF setup by name.
Definition PInstrumentDef.cpp:112
void setName(QString str)
Sets the instrument name.
Definition PInstrumentDef.h:310
QString fInstitue
institute name
Definition PInstrumentDef.h:403
void setInstitue(QString str)
Sets the institute name.
Definition PInstrumentDef.h:304
void addSetupTF(PSetup tf)
Adds a transverse-field (TF) setup configuration.
Definition PInstrumentDef.h:322
PSetup * getLFSetup(QString name="")
Returns a LF setup by name.
Definition PInstrumentDef.cpp:128
void setRunNameTemplate(QString str)
Sets the run name template for data file naming.
Definition PInstrumentDef.h:286
PInstrument()
Constructor. Initializes all strings to empty.
Definition PInstrumentDef.cpp:80
void addSetupZF(PSetup zf)
Adds a zero-field (ZF) setup configuration.
Definition PInstrumentDef.h:316
void setDataFileFormat(QString str)
Sets the data file format.
Definition PInstrumentDef.h:298
QString fDataFileFormat
data file format
Definition PInstrumentDef.h:402
QString getBeamline()
Returns the beamline name.
Definition PInstrumentDef.h:340
PSetup * getZFSetup(QString name="")
Returns a ZF setup by name.
Definition PInstrumentDef.cpp:96
QString getName()
Returns the instrument name.
Definition PInstrumentDef.h:358
QString fName
instrument name
Definition PInstrumentDef.h:404
QString getRunNameTemplate()
Returns the run name template.
Definition PInstrumentDef.h:334
QString fBeamline
beamline identifier
Definition PInstrumentDef.h:401
QString getDataFileFormat()
Returns the data file format.
Definition PInstrumentDef.h:346
~PInstrument()
Destructor.
Definition PInstrumentDef.h:280
QString fRunNameTemplate
template for run file names
Definition PInstrumentDef.h:400
QString getInstitute()
Returns the institute name.
Definition PInstrumentDef.h:352
QVector< PSetup > fZF
zero-field setups
Definition PInstrumentDef.h:406
QVector< PSetup > fTF
transverse-field setups
Definition PInstrumentDef.h:407
QVector< PSetup > getTFSetups()
Returns all TF setups.
Definition PInstrumentDef.h:370
QVector< PSetup > fLF
longitudinal-field setups
Definition PInstrumentDef.h:408
QVector< PSetup > getZFSetups()
Returns all ZF setups.
Definition PInstrumentDef.h:364
void setBeamline(QString str)
Sets the beamline name.
Definition PInstrumentDef.h:292
The PSetup class represents a measurement setup configuration.
Definition PInstrumentDef.h:133
PSetup()
Constructor. Initializes all values to -1/empty.
Definition PInstrumentDef.cpp:36
void setBkgRange(int start, int end)
Sets the background range for asymmetry fits.
Definition PInstrumentDef.h:174
int getNoOfLogicalDetectors()
Returns the number of logical detectors for single-histogram fits.
Definition PInstrumentDef.h:204
PDetector * getDetector(int idx)
Returns a pointer to a single-histogram logical detector.
Definition PInstrumentDef.cpp:53
int fNoOfDetectors
total number of physical detectors
Definition PInstrumentDef.h:252
void setLgb(int lgb)
Sets the last good bin.
Definition PInstrumentDef.h:167
QString fName
setup name
Definition PInstrumentDef.h:251
void setNoOfDetectors(int no)
Sets the total number of physical detectors.
Definition PInstrumentDef.h:155
int fBkgEndBin
background range end bin
Definition PInstrumentDef.h:256
void setName(QString str)
Sets the setup name.
Definition PInstrumentDef.h:149
QVector< PDetector > fLogicDetectors
logical detectors for single-histogram fits
Definition PInstrumentDef.h:258
QString getName()
Returns the setup name.
Definition PInstrumentDef.h:192
PDetector * getAsymDetector(int idx)
Returns a pointer to an asymmetry logical detector.
Definition PInstrumentDef.cpp:68
~PSetup()
Destructor.
Definition PInstrumentDef.h:143
void addAsymDetector(PDetector detector)
Adds a logical detector for asymmetry fits.
Definition PInstrumentDef.h:186
int getLgb()
Returns the last good bin.
Definition PInstrumentDef.h:222
void addDetector(PDetector detector)
Adds a logical detector for single-histogram fits.
Definition PInstrumentDef.h:180
int getNoOfDetectors()
Returns the total number of physical detectors.
Definition PInstrumentDef.h:198
int fLgb
last good bin
Definition PInstrumentDef.h:254
QVector< PDetector > fLogicAsymDetectors
logical detectors for asymmetry fits
Definition PInstrumentDef.h:259
int getNoOfLogicalAsymDetectors()
Returns the number of logical detectors for asymmetry fits.
Definition PInstrumentDef.h:210
int fFgbOffset
first good bin offset from t0
Definition PInstrumentDef.h:253
int getBkgEndBin()
Returns the background range end bin.
Definition PInstrumentDef.h:234
int fBkgStartBin
background range start bin
Definition PInstrumentDef.h:255
int getFgbOffset()
Returns the first good bin offset.
Definition PInstrumentDef.h:216
int getBkgStartBin()
Returns the background range start bin.
Definition PInstrumentDef.h:228
void setFgbOffset(int fgbOffset)
Sets the first good bin offset from t0.
Definition PInstrumentDef.h:161