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 TRestDataSet #345

Merged
merged 44 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f968878
TRestDataSet metadata class added
vicctorps May 18, 2022
274782b
dset.rml added RML TRestDataSet example
vicctorps May 18, 2022
6c7208e
TRestDataSet::SiderealTime added
vicctorps May 25, 2022
f33bb65
dset.rml fixing minor bug
vicctorps May 25, 2022
1857613
dset.rml renamed to dataset.rml
vicctorps May 25, 2022
a8f42f2
TRestDataSet fixing compilation
vicctorps May 25, 2022
459d43d
TRestDataSet updates
vicctorps Jun 9, 2022
3e0ab07
Merge branch 'master' into vicctorps_dataset
jgalan Sep 14, 2022
ec0b9ee
Merge branch 'master' into vicctorps_dataset
jgalan Sep 14, 2022
7625cea
Merge branch 'master' into vicctorps_dataset
jgalan Nov 25, 2022
6f9279d
TRestDataSet. Fixing compilation issues
jgalan Nov 25, 2022
14b7c79
Reviewing TRestDataSet
jgalan Nov 29, 2022
8ce86f2
Merge branch 'jgalan_units_fix' into vicctorps_dataset
jgalan Nov 29, 2022
7ece330
TRestDataSet implemented metadata filters
jgalan Nov 30, 2022
c2677b0
TRestMetadata::GetParameter will return empty instead of
jgalan Nov 30, 2022
684c20b
TRestMetadataPlot. Replacing TString by std::string to use .empty()
jgalan Nov 30, 2022
6e4de7f
TRestDataSet. Adding observables list
jgalan Dec 1, 2022
0744f12
Merge branch 'master' into vicctorps_dataset
jgalan Dec 2, 2022
7f1fb5f
TRestDataSet::PrintMetadata now prints out metadata filters
jgalan Dec 7, 2022
8ba6de4
TRestAnalysisTree. Refurbished GetObservableNames method
jgalan Dec 7, 2022
cb2a3d7
TRestDataSet. Implemented initialization of DataFrame and TTree
jgalan Dec 7, 2022
fb5d84a
TRestDataSet::Export method has been implemented
jgalan Dec 8, 2022
f39851d
TRestDataSet::Export adding header to csv format
jgalan Dec 8, 2022
e3fbbea
Adding dataset.rml example
jgalan Dec 8, 2022
356c759
Revert "TRestMetadataPlot. Replacing TString by std::string to use .e…
jgalan Nov 30, 2022
c064c1a
Revert "TRestMetadata::GetParameter will return empty instead of"
jgalan Dec 8, 2022
bf8ac30
TRestDataSet. Adding documentation
jgalan Dec 8, 2022
bfb8963
TRestDataSet. Trying to fix indenting issue
jgalan Dec 8, 2022
deef9a1
TRestDataSet. Trying to fix indenting issue
jgalan Dec 8, 2022
35cca0a
TRestDataSet. Fixing typos on documentation
jgalan Dec 8, 2022
a95ea39
TRestDataSet::fTotalDuration added to keep control of the accumulated…
jgalan Dec 9, 2022
4709494
use nullptr
lobis Dec 9, 2022
2659311
made methods `const` when possible, unified style with framework (imp…
lobis Dec 9, 2022
12b1c49
TRestDataSet. Removing new/delete scheme
jgalan Dec 10, 2022
dc930eb
Merge branch 'jgalan_dataset' of github.com:rest-for-physics/framewor…
jgalan Dec 10, 2022
f7b3527
dataset.rml Updating dataset example
jgalan Dec 10, 2022
7426c5c
TRestDataSet. Implementing quantity metadata members
jgalan Dec 10, 2022
ff87945
TRestDataSet. Quantity data member is now encapsulated inside Relevan…
jgalan Dec 10, 2022
4945af4
TRestDataSet::GetFileSelection method added
jgalan Dec 10, 2022
6973bea
TRestDataSet. Implemeting readout of relevant quantities
jgalan Dec 10, 2022
15222f3
TRestDataSet. Adding relevant quantities documentation
jgalan Dec 10, 2022
467a25c
TRestDataSet::Export. Txt output now includes relevant quantities
jgalan Dec 10, 2022
b388349
TRestDataSet. Now observables separator is a comma
jgalan Dec 12, 2022
17229cc
Merge branch 'master' into jgalan_dataset
jgalan Dec 13, 2022
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
5 changes: 5 additions & 0 deletions source/framework/core/inc/TRestDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class TRestDataSet : public TRestMetadata {
/// If the corresponding element is not empty it will check if the metadata member is lower
std::vector<Double_t> fFilterLowerThan; //<

/// The total integrated run time of selected files
Double_t fTotalDuration = 0; //<

/// The resulting RDataFrame object after initialization
ROOT::RDataFrame fDataSet = 0; //!

Expand Down Expand Up @@ -85,6 +88,8 @@ class TRestDataSet : public TRestMetadata {
Int_t GetNumberOfColumns() { return fDataSet.GetColumnNames().size(); }
Int_t GetNumberOfBranches() { return GetNumberOfColumns(); }

Double_t GetTotalTimeInSeconds() { return fTotalDuration; }
jgalan marked this conversation as resolved.
Show resolved Hide resolved

void Export(std::string fname);

void PrintMetadata() override;
Expand Down
10 changes: 10 additions & 0 deletions source/framework/core/src/TRestDataSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ std::vector<std::string> TRestDataSet::FileSelection() {
<< RESTendl;
}

fTotalDuration = 0;
for (const auto& file : fileNames) {
TRestRun* run = new TRestRun(file);
juanangp marked this conversation as resolved.
Show resolved Hide resolved
double runStart = run->GetStartTimestamp();
Expand Down Expand Up @@ -321,6 +322,7 @@ std::vector<std::string> TRestDataSet::FileSelection() {

if (!accept) continue;

fTotalDuration += run->GetEndTimestamp() - run->GetStartTimestamp();
jgalan marked this conversation as resolved.
Show resolved Hide resolved
fFileSelection.push_back(file);
}
RESTInfo << RESTendl;
Expand All @@ -338,6 +340,10 @@ void TRestDataSet::PrintMetadata() {
RESTMetadata << " - EndTime : " << fEndTime << RESTendl;
RESTMetadata << " - Path : " << TRestTools::SeparatePathAndName(fFilePattern).first << RESTendl;
RESTMetadata << " - File pattern : " << TRestTools::SeparatePathAndName(fFilePattern).second << RESTendl;
RESTMetadata << " " << RESTendl;
RESTMetadata << " - Accumulated run time (seconds) : " << fTotalDuration << RESTendl;
RESTMetadata << " - Accumulated run time (hours) : " << fTotalDuration / 3600. << RESTendl;
RESTMetadata << " - Accumulated run time (days) : " << fTotalDuration / 3600. / 24. << RESTendl;

RESTMetadata << " " << RESTendl;

Expand Down Expand Up @@ -477,6 +483,10 @@ void TRestDataSet::Export(std::string fname) {
fprintf(f, "### StartTime : %s\n", fStartTime.c_str());
fprintf(f, "### EndTime : %s\n", fEndTime.c_str());
fprintf(f, "###\n");
fprintf(f, "### Accumulated run time (seconds) : %lf\n", fTotalDuration);
fprintf(f, "### Accumulated run time (hours) : %lf\n", fTotalDuration / 3600.);
fprintf(f, "### Accumulated run time (days) : %lf\n", fTotalDuration / 3600. / 24.);
fprintf(f, "###\n");
fprintf(f, "### Data path : %s\n", TRestTools::SeparatePathAndName(fFilePattern).first.c_str());
fprintf(f, "### File pattern : %s\n", TRestTools::SeparatePathAndName(fFilePattern).second.c_str());
fprintf(f, "###\n");
Expand Down