REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
TRestHaloMetadata.h
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see https://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see https://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
23#ifndef REST_TRestHaloMetadata
24#define REST_TRestHaloMetadata
25
26#include "TRestMetadata.h"
27
29class TRestHaloMetadata : public TRestMetadata {
30private:
31 double fStartTime = 0; // Initial timestamp (Unix)
32 double fIntegrationTime = 0; // Seconds per spectrum
33 int fFramesPerSpectrum = 0; // Frame averaging count
34 double fResolutionBandwidth = 0; // Hz
35 double fReferencePowerdBm = 0; // dBm
36 bool fPreamplifierEnabled = false; // true/false
37 double fCenterFrequency = 0; // Hz
38 int fNumSpectra = 0;
39 int fNumFreqPoints = 0;
40
41 // optional metadata
42 TString fExperimentName = "";
43 int fRunNumber = -1;
44 double fAttenuation = 0; // dB if available
45 TString fNotes = "";
46 TString fLastCal = ""; // Most recent calibration run filename
47 double fStdDev = 0; // Sample standard deviation of spectrum
48 bool fUncertaintiesProvided = false; // true if uncertainties were provided, false if computed
49 // unit for the stored values (0 = V_RMS, 1 = W)
50 Int_t fValueUnit = 0; // use enum EValueUnit
51
52public:
53 // Units stored with the data. Prefer enum for clarity.
54 enum EValueUnit {
55 V_RMS = 0,
56 W = 1
57 };
58
59 TRestHaloMetadata();
60 ~TRestHaloMetadata() override;
61
62 // --- Setters ---
63 void SetStartTime(double v) { fStartTime = v; }
64 void SetIntegrationTime(double v) { fIntegrationTime = v; }
65 void SetFramesPerSpectrum(int v) { fFramesPerSpectrum = v; }
66 void SetResolutionBandwidth(double v) { fResolutionBandwidth = v; }
67 void SetReferencePower(double v) { fReferencePowerdBm = v; }
68 void SetPreamplifierEnabled(bool v) { fPreamplifierEnabled = v; }
69 void SetCenterFrequency(double v) { fCenterFrequency = v; }
70 void SetNumSpectra(int v) { fNumSpectra = v; }
71 void SetNumFreqPoints(int v) { fNumFreqPoints = v; }
72
73 void SetExperimentName(const TString& n) { fExperimentName = n; }
74 void SetRunNumber(int r) { fRunNumber = r; }
75 void SetAttenuation(double a) { fAttenuation = a; }
76 void SetNotes(const TString& n) { fNotes = n; }
77 void SetLastCal(const TString& f) { fLastCal = f; }
78 void SetStdDev(double s) { fStdDev = s; }
79 void SetUncertaintiesProvided(bool b) { fUncertaintiesProvided = b; }
80 void SetValueUnit(Int_t u) { fValueUnit = u; }
81
82 // --- Getters ---
83 double GetStartTime() const { return fStartTime; }
84 double GetIntegrationTime() const { return fIntegrationTime; }
85 int GetFramesPerSpectrum() const { return fFramesPerSpectrum; }
86 double GetResolutionBandwidth() const { return fResolutionBandwidth; }
87 double GetReferencePower() const { return fReferencePowerdBm; }
88 bool GetPreamplifierEnabled() const { return fPreamplifierEnabled; }
89 double GetCenterFrequency() const { return fCenterFrequency; }
90
91 int GetNumSpectra() const { return fNumSpectra; }
92 int GetNumFreqPoints() const { return fNumFreqPoints; }
93
94 TString GetExperimentName() const { return fExperimentName; }
95 int GetRunNumber() const { return fRunNumber; }
96 double GetAttenuation() const { return fAttenuation; }
97 TString GetNotes() const { return fNotes; }
98 TString GetLastCal() const { return fLastCal; }
99 double GetStdDev() const { return fStdDev; }
100 bool GetUncertaintiesProvided() const { return fUncertaintiesProvided; }
101 Int_t GetValueUnit() const { return fValueUnit; }
102 TString GetValueUnitString() const;
103
104 void PrintMetadata() override;
105
106 ClassDefOverride(TRestHaloMetadata, 1);
107};
108
109#endif
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
TRestMetadata()
TRestMetadata default constructor.