Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of experimental sensitivity classes #355

Merged
merged 219 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 198 commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
bed9ae9
First upload of prototype classes
jgalan Dec 19, 2022
afb35c3
Merge branch 'master' into jgalan_sensitivity
jgalan Dec 19, 2022
4bb5ff7
Merge branch 'master' into jgalan_sensitivity
jgalan Mar 8, 2023
711458f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 8, 2023
3be2b19
startup.cpp Adding more output
jgalan Mar 11, 2023
e96b2ff
TRestStringHelper::RemoteDelimiters method added
jgalan Mar 11, 2023
5667651
TRestComponent. Finalised integration of metadata members
jgalan Mar 11, 2023
d317b78
TRestComponent. Removing unwanted output
jgalan Mar 12, 2023
17b9ad5
Merge branch 'master' into jgalan_sensitivity
jgalan Mar 30, 2023
cd79025
TRestDataSet::GetTree(). Improving error output when fTree is null.
jgalan Mar 30, 2023
b54ae46
TRestDataSet::GenerateDataSet. Fixing typo
jgalan Mar 30, 2023
765a0f1
TRestComponent. Loading dataset
jgalan May 25, 2023
1e0cbc1
Merge branch 'jgalan_minor_fix' into jgalan_sensitivity
jgalan May 25, 2023
50c841a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 25, 2023
2302666
TRestDataSet. Fixing compilation issue
jgalan May 25, 2023
4337b0c
Merge branch 'master' into jgalan_sensitivity
jgalan May 26, 2023
31788a3
Merge remote-tracking branch 'origin' into jgalan_sensitivity
jgalan May 30, 2023
11a43e0
Merge branch 'master' into jgalan_sensitivity
jgalan May 30, 2023
1a57bc4
TRestComponent. Adding capability to import several files
jgalan May 30, 2023
f6dacf1
Merge remote-tracking branch 'origin' into jgalan_sensitivity
jgalan May 31, 2023
db86e08
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan May 31, 2023
dcb131a
Merge branch 'master' into jgalan_sensitivity
jgalan Jun 15, 2023
0696412
Merge branch 'master' into jgalan_sensitivity
jgalan Jul 6, 2023
b6e1690
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jul 10, 2023
fd7b0b0
TRestComponent::fParametricVariables is now a vector
jgalan Jul 10, 2023
27719f4
TRestComponent. Only a parameter is allowed now
jgalan Jul 19, 2023
47d8ad9
TRestDataSet::Import will not be set as merged if there is only one file
jgalan Jul 20, 2023
4fbcde2
TRestMetadata::SetError now receives an argument to fix the maximum n…
jgalan Jul 20, 2023
f297a93
TRestStringHelper::DoubleToString. Default precision is now %8.6e
jgalan Jul 21, 2023
a77dda7
TRestComponent. Implemented parameter node extraction from dataset
jgalan Jul 21, 2023
8ef3921
TRestDataSet. fColumnNameExpressions added to operator=
jgalan Jul 21, 2023
89e6c04
TRestComponent. Removing comments
jgalan Jul 21, 2023
7105d6d
Merge remote-tracking branch 'origin/jgalan-dataset' into jgalan_sens…
jgalan Jul 23, 2023
0fe4b89
TRestComponent. Added THnSparse initialization
jgalan Jul 23, 2023
4345360
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 23, 2023
f9c8042
restRoot. Increasing restRoot verbose level to info
jgalan Jul 24, 2023
87075d2
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jul 24, 2023
027e077
TRestComponent. Fixing sparse generation and adding GetHistogram meth…
jgalan Jul 24, 2023
eda8da3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2023
f9ec39f
TRestDataSet. Adding an option to enable MT. Default is ST
jgalan Jul 29, 2023
fb8c542
TRestComponent. Introducing Histograms and active node
jgalan Jul 29, 2023
c3fb4db
TRestComponent::FillHistograms finally implemented
jgalan Aug 8, 2023
7d709e7
TRestDataSet. Increasing class version
jgalan Aug 9, 2023
fc2c80a
Merge branch 'master' into jgalan_sensitivity
jgalan Sep 8, 2023
8d84606
Solving conflicts
jgalan Sep 8, 2023
05d77eb
TRestComponent. Adding a total rate method
jgalan Oct 3, 2023
68afa28
startup. StringToVector will skip empty strings
jgalan Oct 3, 2023
1160163
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2023
41605ac
restRoot. Avoiding arguments being interpreted as a file
jgalan Oct 12, 2023
2bc4a59
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2023
0aad692
TRestDataSet::EnableMultiThreading added. Now restRoot imports with M…
jgalan Nov 8, 2023
d4a0c57
Merge branch 'master' into jgalan_sensitivity
jgalan Nov 9, 2023
247f79e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2023
99c7fe6
TRestComponentDataSet and TRestComponentFormula added (WIP)
jgalan Nov 9, 2023
a25f8c2
Merge branch 'jgalan_restRoot' into jgalan_sensitivity
jgalan Nov 9, 2023
70da4fa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2023
ff3728f
TRestDataSet. Removing replicated code lines
jgalan Nov 10, 2023
6d28505
TRestComponentDataSet and TRestComponentFormula. Fixing values
jgalan Nov 10, 2023
c3aa0e4
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Nov 10, 2023
35d627e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 10, 2023
321ed6c
REST_OpenInputFile.C Fixing output style
jgalan Nov 10, 2023
c4fc5d3
TRestComponent. Proper implementation of metadata inhereted constructors
jgalan Nov 10, 2023
9531865
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Nov 14, 2023
59b0ef0
TRestComponent. Adding methods to recover the active node data member
jgalan Nov 22, 2023
f05e482
TRestComponentDataSet improving PrintMetadata output
jgalan Nov 22, 2023
547b4a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 22, 2023
eec29f7
Merge branch 'jgalan_minor_fixes' into jgalan_sensitivity
jgalan Nov 22, 2023
636c187
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Nov 22, 2023
dbf07ff
Merge branch 'jgalan_minor_fixes' into jgalan_sensitivity
jgalan Nov 23, 2023
6208b68
TRestRun::GetEntries returns now fSavedEntries if analysis tree is no…
jgalan Nov 23, 2023
3e60f5c
TRestComponent::ValidNode method added
jgalan Nov 24, 2023
8a585f4
TRestComponentDataSet. Now it is allowed to recover the component wit…
jgalan Nov 24, 2023
a400f5a
Merge branch 'master' into jgalan_sensitivity
jgalan Nov 24, 2023
e59e500
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 24, 2023
d9e4bee
TRestComponentDataSet::GetHistogram methods have been simplified
jgalan Nov 25, 2023
3164d77
TRestComponentDataSet. Final version with Nsim normalization and weights
jgalan Nov 27, 2023
aaf068f
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Nov 27, 2023
c66016e
TRestComponentDataSet::DrawComponent adding method to visualize densi…
jgalan Nov 28, 2023
86d28a6
TRestTools::CanvasDivisions method added
jgalan Nov 28, 2023
0032383
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 28, 2023
a8a998d
Merge branch 'jgalan_tools' into jgalan_sensitivity
jgalan Nov 29, 2023
399f712
TRestComponentDataSet::DrawComponent final implementation
jgalan Dec 1, 2023
c354aeb
TRestComponentDataSet. Adding some documentation parts
jgalan Dec 1, 2023
6881b3b
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Dec 1, 2023
9a1c338
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2023
b30707d
TRestComponent::GetDimensions method added
jgalan Dec 5, 2023
886fbde
TRestComponent::GetNormalizedRate method added
jgalan Dec 5, 2023
63cdd79
TRestComponentDataSet. Implementing interpolation into GetRate and ot…
jgalan Dec 5, 2023
3b05dc7
TRestComponentDataSet. Adding interpolation
jgalan Dec 5, 2023
9e12d89
TRestStringHelper::IntegerToBinary method added
jgalan Dec 5, 2023
cc6e256
TRestComponentDataSet. Updating to REST_StringHelper::IntegerToBinary…
jgalan Dec 5, 2023
c25dd24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 5, 2023
fc1704a
TRestResponse implementation (WIP)
jgalan Dec 15, 2023
3c6f7d7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 15, 2023
eadbbbb
Merge branch 'master' into jgalan_sensitivity
jgalan Dec 17, 2023
a1cd222
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 17, 2023
b96af1d
TRestComponentDataSet. Trying to fix pipeline
jgalan Dec 17, 2023
368cf03
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Dec 17, 2023
dfdd7ad
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 17, 2023
a0c37fc
TRestResponse. Adding fInterpolate data member to allow to enable/dis…
jgalan Dec 24, 2023
d193f3c
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Dec 30, 2023
7a040dd
TRestTools::GetFilesMatchingPattern now accepts an option to avoid ma…
jgalan Dec 30, 2023
f669d57
TRestTools. Removing debug output
jgalan Dec 30, 2023
8a6e919
REST_CheckValidRuns.C. Now uses GetFilesMatchingPattern that avoids i…
jgalan Dec 30, 2023
c50c566
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 30, 2023
6cb1146
restRoot. Adding a HINT restRootMacros
jgalan Dec 30, 2023
70ab0e5
TRestDataSet. Improving output
jgalan Jan 9, 2024
3f992fc
TRestComponentDataSet::ExtractNodeStatistics. Adding a precision to t…
jgalan Jan 11, 2024
baab26c
TRestComponent::GetRateWithResponse method implemented
jgalan Jan 11, 2024
3759218
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 11, 2024
fd4c0a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 11, 2024
b66097d
REST_AddComponent macro added to automatize addition of components to…
jgalan Jan 11, 2024
72205b8
TRestSystemOfUnits. Adding official headers
jgalan Jan 13, 2024
93893a4
TRestComponent. Cleaning up debug output
jgalan Jan 13, 2024
53adcf2
REST_StringHelper::Replace documentation fix
jgalan Jan 13, 2024
731c3fb
TRestComponentDataSet reviewed method documentation
jgalan Jan 13, 2024
362f05e
TRestComponent. Reviewing method documentation
jgalan Jan 13, 2024
23fe44a
TRestComponentFormula. First implementation of.
jgalan Jan 13, 2024
bc115fa
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 13, 2024
a4061d1
TRestComponent. Introducing GetRawRate method. GetRate will return th…
jgalan Jan 13, 2024
c9a2455
TRestMetadata. We ignore units inside string parameters
jgalan Jan 15, 2024
ecabfcb
TRestComponent. Histograms are now a common component
jgalan Jan 15, 2024
679e695
TRestComponentDataSet. Removing related histogram methods
jgalan Jan 15, 2024
3c9f069
TRestComponentFormula::FillHistograms has been implemented
jgalan Jan 15, 2024
84d71db
TRestComponentDataSet::LoadDataSets is now protected
jgalan Jan 15, 2024
12211a4
TRestComponent::GetRandom/GetMonteCarloDataFrame methods added
jgalan Jan 16, 2024
52dfa14
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 16, 2024
63a04bc
TRestComponentDataSet::FillHistograms will skip if histograms are alr…
jgalan Jan 16, 2024
d03b98a
TRestComponentFormula. Removing non-sense warning
jgalan Jan 16, 2024
cc412a4
TRestExperiment implementation (WIP)
jgalan Jan 16, 2024
436bbc6
REST_AddComponent.C updating to new TRestComponent scheme
jgalan Jan 16, 2024
c0c612a
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 16, 2024
10ed5ee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 16, 2024
c6fe4ea
Update source/framework/sensitivity/src/TRestComponent.cxx
jgalan Jan 16, 2024
befd7a7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 16, 2024
52e4f1a
TRestComponent::GetMonteCarloDataFrame fixing compilation
jgalan Jan 16, 2024
0aa8863
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 16, 2024
b02e0f8
TRestComponent::GetRandom now returns a RVecD
jgalan Jan 16, 2024
ee41821
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 16, 2024
7df7848
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 16, 2024
e960536
TRestComponent::GetMonteCarloDataFrame fixed
jgalan Jan 16, 2024
f8492c1
TRestComponentFormula::PrintMetadata fixed
jgalan Jan 16, 2024
c08ec43
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 16, 2024
e9d9123
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 16, 2024
bb032f6
TRestComponent::HasDensity method and condition added
jgalan Jan 17, 2024
8f1e36a
TRestComponent::GetTotalRate. Fixing integration
jgalan Jan 17, 2024
c78ff02
TRestExperiment::GetSignal/Background methods added
jgalan Jan 17, 2024
d4bd8a5
TRestComponent removing TH1 to avoid potential memory leak
jgalan Jan 17, 2024
06bef73
TRestDataSet::SetDataSet adding a method to define a external dataframe
jgalan Jan 18, 2024
4141802
TRestExperiment::GenerateMockDataSet method implemented
jgalan Jan 18, 2024
9d0ab8c
TRestDataSet. Fixing seg. fault when recovering keys
jgalan Jan 18, 2024
e3563f5
Adding macros REST_AddComponentDataSet and REST_AddComponentFormula
jgalan Jan 21, 2024
2fcf575
TRestTools. Adding support for pure std::string tables
jgalan Jan 21, 2024
419d731
TRestComponent. Adding protection in case of no-initialization
jgalan Jan 21, 2024
ced4782
TRestComponent. Fixing compilation issue
jgalan Jan 21, 2024
5af6ab3
TRestExperiment. Implemented import of experimental dataset
jgalan Jan 21, 2024
282ac44
REST_AddComponentFormula.C added
jgalan Jan 21, 2024
1d1857a
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 21, 2024
7ca1d82
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 21, 2024
6ab10ce
TRestExperiment::SetExperimentalDataSetFile helper method added
jgalan Jan 21, 2024
28654f2
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 21, 2024
c25314f
TRestExperimentList. Table may be built with any number of columns. E…
jgalan Jan 21, 2024
52b2d82
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 21, 2024
9836992
TRestAnalysisTree::GetDblObservableValue. Adding float type
jgalan Jan 23, 2024
91df0b9
Merge branch 'master' into jgalan_sensitivity
jgalan Jan 23, 2024
3bee7c7
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 23, 2024
d2f8b24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 23, 2024
d69293c
TRestSystemOfUnits. Fixing time units scaling leading to wrong results
jgalan Jan 23, 2024
a002f21
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 23, 2024
eeb379c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 23, 2024
d1d9db7
TRestComponent::SetActiveNode added with integer index
jgalan Jan 24, 2024
a2e08f6
TRestExperiment. Adding setters
jgalan Jan 24, 2024
f69e129
TRestExperimentList::GetComponent method added
jgalan Jan 24, 2024
8ed5880
TRestExperiment::PrintMetadata implemented
jgalan Jan 24, 2024
af0536a
TRestComponent. Adding fPrecision
jgalan Jan 24, 2024
1f0fa93
TRestComponent::SetActiveNode uses now the fPrecision value
jgalan Jan 24, 2024
e2b0321
Merge branch 'master' into jgalan_sensitivity
jgalan Jan 24, 2024
a3017b1
TRestSensitivity::InitFromConfigFile. Experiments are being read
jgalan Jan 28, 2024
4aa0526
TRestExperiment. fDataSet renamed to fExperimentalDataSet
jgalan Jan 28, 2024
597951f
TRestComponentDataSet::fSamples added to allow reducing the dataset s…
jgalan Jan 28, 2024
07f611f
TRestComponent. Adding precision and random numbers
jgalan Jan 28, 2024
eadf8bd
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 28, 2024
3cdcf5f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 28, 2024
cad9af2
TRestDataSet::Export fixed a bug and added posibility to exclude columns
jgalan Jan 29, 2024
ec9d1bd
TRestComponent::GetMonteCarloDataFrame. Now Rndm auxiliar column is r…
jgalan Jan 29, 2024
d97347f
TRestExperiment::GetExperimentalDataSet/DataFrame methods added
jgalan Jan 29, 2024
9d1996d
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 29, 2024
30a53e4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2024
13c1d88
TRestComponentFormula::FillHistograms. Adding a remark
jgalan Jan 29, 2024
2f24402
TRestComponent::RegenerateHistograms. It refills the histograms with …
jgalan Jan 29, 2024
18588aa
TRestComponent. Adding getters
jgalan Jan 30, 2024
93db557
TRestExperiment::PrintExperimentalData added
jgalan Jan 30, 2024
43a21aa
TRestExperiment. Validating that variable definitions are the same in…
jgalan Jan 30, 2024
408e2d6
TRestMetadata. Now is not pure abstract anymore to avoid problems wit…
jgalan Jan 30, 2024
770aa43
TRestExperiment::SetExperimentalDataSetFile. Improving method
jgalan Jan 30, 2024
bc0f6f1
TRestSensitivity. Adding methods UnbinnedLogLikelihood, ApproachByFac…
jgalan Jan 30, 2024
8d51deb
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Jan 30, 2024
e28f08d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 30, 2024
44b869f
TRestComponentDataSet::RegenerateActiveNodeDensity method added
jgalan Jan 30, 2024
c62eb23
TRestSystemOfUnits. Additional time alias added
jgalan Jan 31, 2024
c79da7d
TRestMetadata adding copy constructor implementation
jgalan Jan 31, 2024
b7dcec4
TRestComponent. variable XML-element renamed to cVariable
jgalan Jan 31, 2024
23d0577
CMakeLists. Adding GSL libraries
jgalan Feb 11, 2024
92250a6
Merge branch 'jgalan_sensitivity' of github.com:rest-for-physics/fram…
jgalan Feb 11, 2024
5267960
Merge branch 'jgalan_hotfix' into jgalan_sensitivity
jgalan Feb 11, 2024
662b7e1
REST_OpenInputFile.C updating output when openning dataset
jgalan Feb 12, 2024
498cb0e
TRestExperiment. Adding protection against seg.fault
jgalan Feb 12, 2024
9c83928
TRestExperimentList. Adding protections against seg.fault
jgalan Feb 12, 2024
30c9b34
TRestSensitivity::SignalStatisticalTest method added to evaluate sign…
jgalan Feb 12, 2024
27e3448
TRestSensitivity::SignalStatisticalTest adding prototyping
jgalan Feb 12, 2024
7a7e2d0
TRestComponent::fSamples allows to restrict the statistics use to bui…
jgalan Feb 12, 2024
56a3c41
TRestPhysics removing dummy comment
jgalan Feb 12, 2024
0da0e13
TRestComponentDataSet. Revisiting fSamples implementation
jgalan Feb 12, 2024
37820d2
Updating axion submodule to v2.2
jgalan Feb 12, 2024
68f296f
Updating legacy library to v1.0
jgalan Feb 12, 2024
d8ec95b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
a1ff7cd
CMakeLists.txt. GSL will only be searched for in case we are linking …
jgalan Feb 12, 2024
af542c0
Updating TRestVersion.h header to v2.4.2
jgalan Feb 12, 2024
4ed69d3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/doxygen/images/component_hitmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/doxygen/images/component_spectra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions macros/REST_AddComponentDataSet.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "TRestComponent.h"
#include "TRestTask.h"

#ifndef RestTask_AddComponent
#define RestTask_AddComponent

//*******************************************************************************************************
//*** Description: This macro will load from an RML the component chosen in the arguments and it
//*** will write it inside the file given as outputFile
//***
//*** --------------
//*** Usage: restManager AddComponentDataSet components.rml sectionName [outputFile] [componentName] [update]
//***
//*** Arguments description:
//***
//*** - cfgFile: The RML configuration file where the component definition can be found.
//*** - sectionName: The section name used to select a component inside the RML file.
//*** - outputFile: The file where the component is written, by default is components.root.
//*** - componentName: This argument allows to change the component name stored in the output file.
//*** By default it will take the same value as section name.
//*** - update: If disabled it will create a new file erasing any other previously added components.
//*** It is enabled by default.
//***
//*******************************************************************************************************

Int_t REST_AddComponentDataSet(std::string cfgFile, std::string sectionName,
std::string outputFile = "components.root", std::string componentName = "",
Bool_t update = true) {
TRestComponentDataSet comp(cfgFile.c_str(), sectionName.c_str());
comp.Initialize();

TFile* f;
if (update)
f = TFile::Open(outputFile.c_str(), "UPDATE");
else
f = TFile::Open(outputFile.c_str(), "RECREATE");

if (componentName == "") componentName = sectionName;

comp.Write(componentName.c_str());

f->Close();

return 0;
}
#endif
46 changes: 46 additions & 0 deletions macros/REST_AddComponentFormula.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "TRestComponent.h"
#include "TRestTask.h"

#ifndef RestTask_AddComponentFormula
#define RestTask_AddComponentFormula

//*******************************************************************************************************
//*** Description: This macro will load from an RML the component chosen in the arguments and it
//*** will write it inside the file given as outputFile
//***
//*** --------------
//*** Usage: restManager AddComponentFormula components.rml sectionName [outputFile] [componentName] [update]
//***
//*** Arguments description:
//***
//*** - cfgFile: The RML configuration file where the component definition can be found.
//*** - sectionName: The section name used to select a component inside the RML file.
//*** - outputFile: The file where the component is written, by default is components.root.
//*** - componentName: This argument allows to change the component name stored in the output file.
//*** By default it will take the same value as section name.
//*** - update: If disabled it will create a new file erasing any other previously added components.
//*** It is enabled by default.
//***
//*******************************************************************************************************

Int_t REST_AddComponentFormula(std::string cfgFile, std::string sectionName,
std::string outputFile = "components.root", std::string componentName = "",
Bool_t update = true) {
TRestComponentFormula comp(cfgFile.c_str(), sectionName.c_str());
comp.Initialize();

TFile* f;
if (update)
f = TFile::Open(outputFile.c_str(), "UPDATE");
else
f = TFile::Open(outputFile.c_str(), "RECREATE");

if (componentName == "") componentName = sectionName;

comp.Write(componentName.c_str());

f->Close();

return 0;
}
#endif
13 changes: 6 additions & 7 deletions macros/REST_CheckValidRuns.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ namespace fs = std::filesystem;
//*** CAUTION: Be aware that any non-REST file in the list will be removed if you use purge=1
//***
//*******************************************************************************************************
Int_t REST_CheckValidRuns(TString namePattern, Bool_t purge = false) {
Int_t REST_CheckValidRuns(std::string namePattern, Bool_t purge = false) {
TGeoManager::SetVerboseLevel(0);

vector<std::string> filesNotWellClosed;

TRestStringOutput RESTLog;

string a = TRestTools::Execute((string)("ls -d -1 " + namePattern));
vector<string> b = Split(a, "\n");
std::vector<std::string> b = TRestTools::GetFilesMatchingPattern(namePattern, true);

Double_t totalTime = 0;
int cont = 0;
Expand Down Expand Up @@ -76,11 +75,12 @@ Int_t REST_CheckValidRuns(TString namePattern, Bool_t purge = false) {
}

RESTLog << "Run time (hours) : " << run->GetRunLength() / 3600. << RESTendl;
if (run->GetRunLength() > 0) totalTime += run->GetRunLength() / 3600.;
RESTLog << "Entries : " << run->GetEntries() << RESTendl;

if (run->GetEndTimestamp() == 0 || run->GetRunLength() < 0) {
if (run->GetEndTimestamp() == 0 || run->GetRunLength() < 0 || run->GetEntries() == 0) {
filesNotWellClosed.push_back(filename);
}
} else if (run->GetRunLength() > 0)
totalTime += run->GetRunLength() / 3600.;

delete run;

Expand All @@ -100,7 +100,6 @@ Int_t REST_CheckValidRuns(TString namePattern, Bool_t purge = false) {
if (purge) {
RESTLog << "---------------------------" << RESTendl;
RESTLog << "The files have been removed" << RESTendl;
RESTLog << "---------------------------" << RESTendl;
}
}

Expand Down
2 changes: 1 addition & 1 deletion macros/REST_OpenInputFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void REST_OpenInputFile(const std::string& fileName) {
printf("\n%s\n", "The dataset is ready. You may now access the dataset using:");
printf("\n%s\n", " - dSet->PrintMetadata()");
printf("%s\n", " - dSet->GetDataFrame().GetColumnNames()");
printf("%s\n\n", " - dSet->GetTree()->GetEntries()");
printf("%s\n", " - dSet->GetTree()->GetEntries()");
printf("%s\n\n", " - dSet->GetDataFrame().Display({\"colName1,colName2\"})->Print()");
if (dSet) delete dSet;
dSet = new TRestDataSet();
Expand Down
32 changes: 6 additions & 26 deletions pipeline/panda-x/P3AutoChain.rml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--In this example, when launching the analysis, we are doing following operations inside TRestManager:
1. Initialize TRestRun
1.1 set input and output file for TRestRun(here input and output is in "globals")
Expand All @@ -13,25 +12,17 @@
2.4.1 add additional observables in the process
3. Add a task to call TRestProcessRunner to run
-->

<TRestManager name="CoBoDataAnalysis" title="Example" verboseLevel="info">

<TRestRun name="SJTU_Proto">
<parameter name="runNumber" value="auto"/>//change this value to "auto" to enable database
<parameter name="inputFileName" value="auto"/>
</TRestRun>

<TRestRun name="SJTU_Proto"><parameter name="runNumber" value="auto"/>//change this value to "auto" to enable database
<parameter name="inputFileName" value="auto"/></TRestRun>
<TRestProcessRunner name="Processor" verboseLevel="info">
<parameter name="eventsToProcess" value="0"/>
<parameter name="threadNumber" value="2"/>

<parameter name="inputAnalysisStorage" value="on"/>
<parameter name="inputEventStorage" value="off"/>
<parameter name="outputEventStorage" value="on"/>

<addProcess type="TRestRawMultiCoBoAsAdToSignalProcess" name="virtualDAQ" value="ON"/>
<addProcess type="TRestRawSignalAnalysisProcess" name="sAna" value="ON">
<parameter name="pointsOverThreshold" value="3"/>
<addProcess type="TRestRawSignalAnalysisProcess" name="sAna" value="ON"><parameter name="pointsOverThreshold" value="3"/>
/// We define all observables except MinValue because it is not yet in validation chain
<observable name="BaseLineMean" value="ON"/>
<observable name="BaseLineSigmaMean" value="ON"/>
Expand Down Expand Up @@ -61,31 +52,20 @@
<parameter name="zeroSuppression" value="true"/>
<parameter name="nPointsOverThreshold" value="3"/>
</addProcess>

<addProcess type="TRestRealTimeDrawingProcess" name="rD" value="ON" drawInterval="1000">
<TRestAnalysisPlot name="TriggerRatePlot" previewPlot="false">
<canvas size="(1000,800)" save="TriggerRate.png"/>
<plot name="TriggerRate" title="Trigger Rate" xlabel="Seconds From Start" ylabel="Counts" value="ON"
stats="ON">
<plot name="TriggerRate" title="Trigger Rate" xlabel="Seconds From Start" ylabel="Counts" value="ON" stats="ON">
<variable name="rateAna_SecondsFromStart" range="auto" nbins="100"/>
</plot>
</TRestAnalysisPlot>
</addProcess>


</TRestProcessRunner>

<addTask type="processEvents" value="ON"/>


<globals>
<searchPath value="$ENV{REST_INPUTDATA}/definitions/"/>
<parameter name="mainDataPath" value=""/>

<parameter name="pointThreshold" value="3"/>
</globals>

</TRestManager>


<!--parameter here is accessible to all the classes-->
<!--parameter here is accessible to all the classes-->
15 changes: 13 additions & 2 deletions source/bin/restRoot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) {
printf("\n");
printf(" restRoot --m [0,1]\n");
printf("\n");
printf(" Option 0 will disable macro loading. Option 1 is the default.\n");
printf(" Option 0 will disable macro loading. Option 0 is the default.\n");
printf("\n");
exit(0);
}
Expand All @@ -81,7 +81,18 @@ int main(int argc, char* argv[]) {
gROOT->ProcessLine("#include <TRestPhysics.h>");
gROOT->ProcessLine("#include <TRestSystemOfUnits.h>");
if (loadMacros) {
if (!silent) printf("= Loading macros ...\n");
if (!silent) {
printf("= Loading macros ...\n");
printf(
"= HINT. Loading all macros may require a long time till you get access to the interactive "
"shell\n");
printf("= HINT. You may use `restListMacros` outside `restRoot` to check the available macros\n");
printf(
"= HINT. Then, you may execute the macro externally by using: `restManager MacroName "
"[ARGUMENTS]\n");
printf("= HINT. `MacroName` is the name of the macro after removing the macro name header\n");
printf("= HINT. E.g. REST_Detector_XYZ(arg1,arg2) may be called as: restManager XYZ arg1 arg2\n");
}
vector<string> macroFiles;
const vector<string> patterns = {
REST_PATH + "/macros/REST_*.C", // framework
Expand Down
2 changes: 1 addition & 1 deletion source/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ link_libraries("-fPIC")

add_subdirectory(external)

set(contents external/tinyxml tools core analysis masks)
set(contents external/tinyxml tools core analysis masks sensitivity)

file(GLOB_RECURSE addon_src "tiny*cpp" "startup.cpp")

Expand Down
38 changes: 27 additions & 11 deletions source/framework/core/inc/TRestDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TRestDataSet : public TRestMetadata {
std::map<std::string, RelevantQuantity> fQuantity; //<

/// Parameter cuts over the selected dataset
TRestCut* fCut = nullptr;
TRestCut* fCut = nullptr; //<

/// The total integrated run time of selected files
Double_t fTotalDuration = 0; //<
Expand All @@ -103,12 +103,14 @@ class TRestDataSet : public TRestMetadata {
std::vector<std::string> fImportedFiles; //<

/// A list of new columns together with its corresponding expressions added to the dataset
std::vector<std::pair<std::string, std::string>> fColumnNameExpressions;
std::vector<std::pair<std::string, std::string>> fColumnNameExpressions; //<

/// A flag to enable Multithreading during dataframe generation
Bool_t fMT = false; //<

inline auto GetAddedColumns() const { return fColumnNameExpressions; }
// If the dataframe was defined externally it will be true
Bool_t fExternal = false; //<

/// The resulting RDF::RNode object after initialization
ROOT::RDF::RNode fDataSet = ROOT::RDataFrame(0); //!

Expand All @@ -123,20 +125,28 @@ class TRestDataSet : public TRestMetadata {
public:
/// Gives access to the RDataFrame
ROOT::RDF::RNode GetDataFrame() const {
if (fTree == nullptr) RESTWarning << "DataFrame has not been yet initialized" << RESTendl;
if (!fExternal && fTree == nullptr)
RESTWarning << "DataFrame has not been yet initialized" << RESTendl;
return fDataSet;
}

void SetDataFrame(const ROOT::RDF::RNode& dS) { fDataSet = dS; }

void EnableMultiThreading(Bool_t enable = true) { fMT = enable; }

/// Gives access to the tree
TTree* GetTree() const {
if (fTree == nullptr && fExternal) {
RESTInfo << "The tree is not accessible. Only GetDataFrame can be used in an externally "
"generated dataset"
<< RESTendl;
RESTInfo << "You may write a tree using GetDataFrame()->Snapshot(\"MyTree\", \"output.root\");"
<< RESTendl;
return fTree;
}

if (fTree == nullptr) {
RESTError << "Tree has not been yet initialized" << RESTendl;
RESTError << "You should invoke TRestDataSet::GenerateDataSet() before trying to access the tree"
<< RESTendl;
RESTError << "You should invoke TRestDataSet::GenerateDataSet() or " << RESTendl;
RESTError << "TRestDataSet::Import( fname ) before trying to access the tree" << RESTendl;
}
return fTree;
}
Expand Down Expand Up @@ -167,21 +177,27 @@ class TRestDataSet : public TRestMetadata {
inline auto GetFilterLowerThan() const { return fFilterLowerThan; }
inline auto GetFilterEqualsTo() const { return fFilterEqualsTo; }
inline auto GetQuantity() const { return fQuantity; }
inline auto GetAddedColumns() const { return fColumnNameExpressions; }
inline auto GetCut() const { return fCut; }
inline auto IsMergedDataSet() const { return fMergedDataset; }

inline void SetObservablesList(const std::vector<std::string>& obsList) { fObservablesList = obsList; }
inline void SetFilePattern(const std::string& pattern) { fFilePattern = pattern; }
inline void SetQuantity(const std::map<std::string, RelevantQuantity>& quantity) { fQuantity = quantity; }

void SetTotalTimeInSeconds(Double_t seconds) { fTotalDuration = seconds; }
void SetDataFrame(const ROOT::RDF::RNode& dS) {
fDataSet = dS;
fExternal = true;
}

TRestDataSet& operator=(TRestDataSet& dS);
Bool_t Merge(const TRestDataSet& dS);
void Import(const std::string& fileName);
void Import(std::vector<std::string> fileNames);
void Export(const std::string& filename);
void Export(const std::string& filename, std::vector<std::string> excludeColumns = {});

ROOT::RDF::RNode MakeCut(const TRestCut* cut);

ROOT::RDF::RNode DefineColumn(const std::string& columnName, const std::string& formula);

void PrintMetadata() override;
Expand All @@ -193,6 +209,6 @@ class TRestDataSet : public TRestMetadata {
TRestDataSet(const char* cfgFileName, const std::string& name = "");
~TRestDataSet();

ClassDefOverride(TRestDataSet, 5);
ClassDefOverride(TRestDataSet, 7);
};
#endif
4 changes: 2 additions & 2 deletions source/framework/core/inc/TRestMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ class TRestMetadata : public TNamed {
~TRestMetadata();

// Making class constructors protected to keep this class abstract
TRestMetadata& operator=(const TRestMetadata&) = delete;
TRestMetadata(const TRestMetadata&) = delete;
TRestMetadata& operator=(const TRestMetadata&);
TRestMetadata(const TRestMetadata&);

/// Call CINT to generate streamers for this class
ClassDef(TRestMetadata, 9);
Expand Down
Loading
Loading