Skip to content

Adding command line rootslimtree for removing branches from a tree. #150

Merged
dpiparo merged 3 commits into
root-project:masterfrom
lawrenceleejr:feature/addCommandLineTreeSlimming
Apr 13, 2017
Merged

Adding command line rootslimtree for removing branches from a tree. #150
dpiparo merged 3 commits into
root-project:masterfrom
lawrenceleejr:feature/addCommandLineTreeSlimming

Conversation

@lawrenceleejr
Copy link
Copy Markdown
Contributor

Hi all,

I've added a new command-line tool called rootslimtree which will remove branches from an input tree and write out a new file. This is actually implemented in cmdLineUtils.rootEventselector() and the rooteventselector function has been updated to also have this ability, so in case a user wants to remove both branches and events, this can be done in a single step.

Related to #149.

Thanks!
-Larry

…mplemented within rooteventselector so both branches and entries can be thrown out in one step.
@dpiparo
Copy link
Copy Markdown
Member

dpiparo commented Apr 4, 2016

Hi Larry,

wow, great.
Before merging, I'd have two observations to discuss:
o I wonder if this can be integrated with the eventsSelector tool
o I wonder if one could list the branches, both included and excluded, as a semicolon separated list, e.g. "muons;muons_calib;ak6_jets;ak6_calib_jets" so to be able to pick just the information needed for a quick (or not so quick) analysis.

Cheers,
Danilo

@lawrenceleejr
Copy link
Copy Markdown
Contributor Author

Hey Danilo,

Sure thing. So

  • If you mean the rooteventselector command, then I have added it to that since it's implemented using the machinery. So at its core, you can now drop entries and branches with one call to rooteventselector. Or if you only care about removing branches you can use the dedicated rootslimtree command. (I just thought rooteventselector doesn't actually sound like it should remove branches.) Or have I misunderstood your comment?
  • And so the include and exclude arguments can be used separately and currently take a comma separated list of branch names (or, rather input to SetBranchStatus, so it can e.g. include wildcards). You can use them together, and exclude runs first. So say you have a "whitelist" of branches you want to keep, you can run with
-e "*" -i "branch1,branch2,etc"

Does that address your comments?

Thanks!
-L

@lawrenceleejr
Copy link
Copy Markdown
Contributor Author

Actually a friend was testing this and found a bug where when trying to remove branches, all entries are removed. Fixing.... Sorry for the noise.

-L

@lawrenceleejr
Copy link
Copy Markdown
Contributor Author

Ok bug fixed now. Was a silly CloneTree(0) call.

-L

@lawrenceleejr
Copy link
Copy Markdown
Contributor Author

Hi Danilo,

Any updates on this?

-L

@dpiparo dpiparo self-assigned this Jun 20, 2016
@dpiparo dpiparo merged commit 356d6af into root-project:master Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants