I have a TTree object stored within a NTuple. I have also generated some appropriate TCut that I would like to apply. Currently I am using ->Draw(“branch”, TCuts) to produce histograms for different variables.
Is there a way to apply a TCut to a branch and then save the resulting branch to a new TTree without it being a TH1F object?
this worked as intended. For anyone looking to do the same I made the following macro.
#include <ROOT/RDataFrame.hxx>
int dataFrame(){
TCut *filter = new TCut("Some Cut"); //I use TCut's for another part of my code not featured.
ROOT:RDataFrame d1("Tree", "FilePath");
d1.Filter(filter->GetTitle()) //Do not use ; here! GetTitle converts the cut to string for the FIlter.
.Snapshot("NewTree","NewFilePath"); //Save the resulting NTuple.
return 0;
}