REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestExperimentList.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_TRestExperimentList
24 #define REST_TRestExperimentList
25 
26 #include "TRestExperiment.h"
27 #include "TRestMetadata.h"
28 
31  private:
33  std::string fComponentPattern = ""; //<
34 
36  std::vector<std::string> fComponentFiles; //<
37 
39  std::string fDataSetPattern = ""; //<
40 
42  std::vector<std::string> fDataSetFilenames; //<
43 
45  std::string fExperimentsFile = ""; //< Exposure/TrackingData - SignalComponent - BackgroundComponent
46 
48  std::vector<std::vector<std::string> > fExperimentsTable; //<
49 
51  std::vector<TRestExperiment*> fExperiments; //<
52 
54  std::vector<Double_t> fParameterizationNodes; //<
55 
57  Bool_t fUseAverage = false; //<
58 
60  Double_t fExposureTime = 0;
61 
63  std::string fExposureStrategy = "equal";
64 
66  Double_t fExposureFactor = 0;
67 
69  TRestComponent* fSignal = nullptr; //<
70 
72  TRestComponent* fBackground = nullptr; //<
73 
74  protected:
75  TRestComponent* GetComponent(std::string compName);
76 
77  void InitFromConfigFile() override;
78 
79  public:
80  void Initialize() override;
81 
82  void SetExposure(const Double_t& exposure) { fExposureTime = exposure; }
83  void SetSignal(TRestComponent* comp) { fSignal = comp; }
84  void SetBackground(TRestComponent* comp) { fBackground = comp; }
85 
87  std::vector<Double_t> GetParameterizationNodes() { return fParameterizationNodes; }
88  void PrintParameterizationNodes();
89 
90  std::vector<TRestExperiment*> GetExperiments() { return fExperiments; }
91  TRestExperiment* GetExperiment(const size_t& n) {
92  if (n >= GetNumberOfExperiments())
93  return nullptr;
94  else
95  return fExperiments[n];
96  }
97 
98  size_t GetNumberOfExperiments() { return fExperiments.size(); }
99 
100  void PrintMetadata() override;
101 
102  TRestExperimentList(const char* cfgFileName, const std::string& name);
103 
106 
107  ClassDefOverride(TRestExperimentList, 2);
108 };
109 #endif
It defines a background/signal model distribution in a given parameter space (tipically x,...
A helper metadata class to create a list of TRestExperiment instances.
std::string fExperimentsFile
A file where we define experiment components, exposureTime, and tracking data of each experiment.
std::vector< TRestExperiment * > fExperiments
A vector with a list of experiments includes the background components in this model.
std::vector< Double_t > fParameterizationNodes
The fusioned list of parameterization nodes found at each experiment signal.
std::vector< std::string > fComponentFiles
A vector with filenames containing the components.
void InitFromConfigFile() override
It customizes the retrieval of XML data values of this class.
TRestComponent * fBackground
If not null this will be the common signal used in each experiment.
Bool_t fUseAverage
The mock dataset will be generated using the mean counts instead of a real MonteCarlo.
void Initialize() override
It will initialize the data frame with the filelist and column names (or observables) that have been ...
std::string fExposureStrategy
In case an exposure time is given it defines how to assign time to each experiment (equal/ksvz).
void ExtractExperimentParameterizationNodes()
It scans all the experiment signals parametric nodes to build a complete list of nodes used to build ...
Double_t fExposureFactor
The factor used on the exponential exposure time as a function of the experiment number.
std::string fComponentPattern
A fullpath filename pattern helping to initialize the component files vector.
std::string fDataSetPattern
A fullpath filename pattern helping to initialize the dataset files vector.
TRestExperimentList()
Default constructor.
std::vector< std::string > fDataSetFilenames
A vector with filenames containing the datasets with experimental data.
TRestComponent * fSignal
If not null this will be the common signal used in each experiment.
std::vector< std::vector< std::string > > fExperimentsTable
A table with the experiment file information.
~TRestExperimentList()
Default destructor.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
Double_t fExposureTime
If not zero this will be the common exposure time in micro-seconds (standard REST units)
It includes a model definition and experimental data used to obtain a final experimental sensitivity.
A base class for any REST metadata class.
Definition: TRestMetadata.h:74