REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestComponentDataSet.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_TRestComponentDataSet
24#define REST_TRestComponentDataSet
25
26#include <THn.h>
27
28#include "TRestComponent.h"
29#include "TRestDataSet.h"
30
33 private:
35 std::vector<std::string> fWeights; //<
36
39 std::vector<Int_t> fNSimPerNode; //<
40
42 std::vector<Int_t> fTotalSamples; //<
43
45 std::vector<std::string> fDataSetFileNames; //<
46
50
53
56
58 Bool_t fDataSetLoaded = false;
59
60 Bool_t ValidDataSet();
61
62 protected:
63 void RegenerateActiveNodeDensity() override;
64
65 std::vector<Double_t> ExtractParameterizationNodes();
66 std::vector<Int_t> ExtractNodeStatistics();
67 void FillHistograms() override;
68
69 Bool_t VariablesOk();
70 Bool_t WeightsOk();
71
72 Bool_t LoadDataSets();
73
74 public:
75 Bool_t IsDataSetLoaded() { return fDataSetLoaded; }
76
77 void PrintStatistics();
78
79 void PrintMetadata() override;
80 void Initialize() override;
81 void InitFromConfigFile() override;
82
84 TRestComponentDataSet(const char* cfgFileName, const std::string& name);
86
87 ClassDefOverride(TRestComponentDataSet, 3);
88};
89#endif
It defines a background/signal model distribution in a given parameter space (tipically x,...
Bool_t ValidDataSet()
Takes care of initializing datasets if have not been initialized. On sucess it returns true.
TRestDataSet fDataSet
The dataset used to initialize the distribution.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
Bool_t fDataSetLoaded
It is true of the dataset was loaded without issues.
void FillHistograms() override
It will produce a histogram with the distribution defined using the variables and the weights for eac...
std::vector< Int_t > fNSimPerNode
std::vector< std::string > fWeights
A list with the dataset columns used to weight the distribution density and define rate.
Bool_t LoadDataSets()
A method responsible to import a list of TRestDataSet into fDataSet and check that the variables and ...
Bool_t VariablesOk()
It returns true if all variables have been found inside TRestDataSet.
void PrintStatistics()
It prints out the statistics available for each parametric node.
TRestComponentDataSet()
Default constructor.
~TRestComponentDataSet()
Default destructor.
void RegenerateActiveNodeDensity() override
It will regenerate the density histogram for the active node. It is practical in the case when the nu...
std::vector< Int_t > fTotalSamples
It defines the total number of entries for each parameterization node (Initialized by the dataset)
std::vector< Double_t > ExtractParameterizationNodes()
It returns a vector with all the different values found on the dataset column for the user given para...
void Initialize() override
It will initialize the data frame with the filelist and column names (or observables) that have been ...
Bool_t WeightsOk()
It returns true if all weights have been found inside TRestDataSet.
std::vector< std::string > fDataSetFileNames
The filename of the dataset used.
std::vector< Int_t > ExtractNodeStatistics()
It returns a vector with the number of entries found for each parameterization node.
void InitFromConfigFile() override
It customizes the retrieval of XML data values of this class.
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