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  long long unsigned int fSplitEntries = 600000000;
59 
61  TVector2 fDFRange = TVector2(0, 0);
62 
64  Bool_t fDataSetLoaded = false;
65 
66  Bool_t ValidDataSet();
67 
68  protected:
69  void RegenerateActiveNodeDensity() override;
70 
71  std::vector<Double_t> ExtractParameterizationNodes();
72  std::vector<Int_t> ExtractNodeStatistics();
73  void FillHistograms() override;
74 
75  Bool_t VariablesOk();
76  Bool_t WeightsOk();
77 
78  Bool_t LoadDataSets();
79 
80  public:
81  Bool_t IsDataSetLoaded() { return fDataSetLoaded; }
82 
83  void PrintStatistics();
84 
85  void PrintMetadata() override;
86  void Initialize() override;
87  void InitFromConfigFile() override;
88 
90  TRestComponentDataSet(const char* cfgFileName, const std::string& name);
92 
93  ClassDefOverride(TRestComponentDataSet, 4);
94 };
95 #endif
It defines a background/signal model distribution in a given parameter space (tipically x,...
long long unsigned int fSplitEntries
It helps to split large datasets when extracting the parameterization nodes.
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.
TVector2 fDFRange
It creates a sample subset using a range definition.
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