REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestExperiment.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_TRestExperiment
24#define REST_TRestExperiment
25
26#include <TRandom3.h>
27
28#include "TRestComponent.h"
29#include "TRestDataSet.h"
30#include "TRestMetadata.h"
31
34 private:
36 Double_t fExposureTime = 0; //<
37
40
42 TRestComponent* fSignal = nullptr; //<
43
45 std::string fExperimentalDataSet = ""; //<
46
49
51 Bool_t fMockData = false; //<
52
54 Bool_t fDataReady = false; //<
55
57 Int_t fExperimentalCounts = 0; //<
58
60 TRandom3* fRandom = nullptr;
61
63 UInt_t fSeed = 0; //<
64
65 protected:
66 void InitFromConfigFile() override;
67
68 public:
69 void GenerateMockDataSet();
70 Int_t GetExperimentalCounts() const { return fExperimentalCounts; }
71
72 Bool_t IsMockData() const { return fMockData; }
73 Bool_t IsDataReady() const { return fDataReady; }
74
75 void SetExposureInSeconds(const Double_t exposure) { fExposureTime = exposure / units("s"); }
76 void SetSignal(TRestComponent* comp) { fSignal = comp; }
77 void SetBackground(TRestComponent* comp) { fBackground = comp; }
78
79 void SetExperimentalDataSet(const std::string& filename);
80
81 Double_t GetExposureInSeconds() const { return fExposureTime * units("s"); }
82 TRestComponent* GetBackground() const { return fBackground; }
83 TRestComponent* GetSignal() const { return fSignal; }
84 TRestDataSet GetExperimentalDataSet() const { return fExperimentalData; }
85 ROOT::RDF::RNode GetExperimentalDataFrame() const { return fExperimentalData.GetDataFrame(); }
86
87 void PrintExperimentalData() { GetExperimentalDataFrame().Display("")->Print(); }
88
89 void Initialize() override;
90
91 void PrintMetadata() override;
92
93 TRestExperiment(const char* cfgFileName, const std::string& name = "");
96
97 ClassDefOverride(TRestExperiment, 1);
98};
99#endif
It defines a background/signal model distribution in a given parameter space (tipically x,...
It allows to group a number of runs that satisfy given metadata conditions.
Definition: TRestDataSet.h:34
ROOT::RDF::RNode GetDataFrame() const
Gives access to the RDataFrame.
Definition: TRestDataSet.h:127
It includes a model definition and experimental data used to obtain a final experimental sensitivity.
UInt_t fSeed
Seed used in random generator.
Int_t fExperimentalCounts
It keeps track on the number of counts inside the dataset.
TRestComponent * fBackground
A pointer to the background component.
Bool_t fDataReady
Only if it is true we will be able to calculate the LogLikelihood.
TRestComponent * fSignal
A pointer to the signal component.
void InitFromConfigFile() override
It customizes the retrieval of XML data values of this class.
void Initialize() override
It will initialize the data frame with the filelist and column names (or observables) that have been ...
~TRestExperiment()
Default destructor.
TRestExperiment()
Default constructor.
TRestDataSet fExperimentalData
It contains the experimental data (should contain same columns as the components)
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
TRandom3 * fRandom
Internal process random generator.
void SetExperimentalDataSet(const std::string &filename)
std::string fExperimentalDataSet
It defines the filename used to load the dataset.
Double_t fExposureTime
The exposure time. If 0 it will be extracted from the tracking dataset (In us, standard REST unit)
Bool_t fMockData
If enabled it means that the experimental data was MC-generated.
A base class for any REST metadata class.
Definition: TRestMetadata.h:70