Skip to content

writing tables to files#3197

Merged
ktf merged 24 commits into
AliceO2Group:devfrom
pbuehler:dev
Mar 23, 2020
Merged

writing tables to files#3197
ktf merged 24 commits into
AliceO2Group:devfrom
pbuehler:dev

Conversation

@pbuehler

Copy link
Copy Markdown
Collaborator

Added functionality which allows to specify which columns of which table are saved to which tree in which file.
This information is provided to the internal-dpl-AOD-writer by the command line option 'keep' which is either the string 'dangling' or a ','-separated list of items. If keep is not provided no tables will be saved. An option to read the information from a json file is under development.

In the first case (--keep dangling) all dangling output tables (with all columns) will be saved to file. The name of the file can be specified by the command line option 'res-file'. If res-file is empty the data will be saved to AnalysisResults_x.root.

In the second case a ','-separated list of items
item1,item2,item3,...
is used to specify the output.

Each item consists of 4 parts separated by a ':' and has the format
origin/description/subSpec:treename:col1/col2/col3:filename

. The first part of the item string specifies the table to consider.
. The second part is the name of the tree the table will be saved to. If treename is missing (empty) then the description of the first part of the item string will be used as treename.
. The third part of the item string is a '/'-separated list of the table columns to save as tree branches. If this part is empty then all columns will be saved.
. Finally the fourth part of the item string is the name of the file the tree will be saved to. If filename is empty then the string provided by the command line option res-file will be used. If res-file is not specified then AnalysisResults will be used as file name.

ATTENTION: Be aware that the by default each time frame will be written to a separate file. The actual file name is filename_x.root, where x is an incremental number. Thus the filename provided should not contain the extension '.root'.

The command line option 'ntfmerge' can be used to save more than one time frame per file!

Valid example command line options:

--keep AOD/UNO/0
saves all columns of table UNO to tree UNO in files AnalysisResults_x.root

--keep AOD/UNO/0:uno:c1/c2/c3:unoresults
saves columns c1, c2, and c3 of table UNO to tree uno in files unoresults_x.root

--keep AOD/UNO/0:::unoresults
saves all columns of table UNO to tree UNO in files unoresults_x.root

--keep AOD/UNO/0:uno::unoresults,AOD/UNO/0:due:c2/c3:dueselection
saves all columns of table UNO to tree uno in files unoresults_x.root and columns c2 and c3 of the
same table to the files dueselection_x.root

--keep AOD/UNO/0:uno:c1/c2/c3
saves columns c1, c2, and c3 of table UNO to tree uno in files AnalysisResults_x.root

--keep AOD/UNO/0:uno:c1/c2/c3 --res-file testResults
saves columns c1, c2, and c3 of table UNO to tree uno in files testResults_x.root

@pbuehler pbuehler requested a review from a team as a code owner March 21, 2020 14:01
@ktf

ktf commented Mar 21, 2020

Copy link
Copy Markdown
Member

Thanks for the work.

One of the things we should do is to make sure we can save in the same file multiple timeframes. Especially for skims this is obviously mandatory as we might have little no events per timeframe (otherwise the skim most likely does not make sense). Anyways, this can come later.

Could you please fix the code formatting issues and the one reported by Codacy? Thanks.

@ktf ktf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the issues reported by travis / codacy.

Comment thread Framework/Core/src/CommonDataProcessors.cxx Outdated
Comment thread Framework/Core/src/DataDescriptorQueryBuilder.cxx Outdated
@pbuehler pbuehler requested a review from ktf March 23, 2020 13:18
@ktf ktf merged commit 2607277 into AliceO2Group:dev Mar 23, 2020
@ktf

ktf commented Mar 23, 2020

Copy link
Copy Markdown
Member

I've merged this. Please add some more documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants