Hi,
yes it is possible if you do something like this:
auto histo = new TH1D("h1","my histogram",100,1,0);
tree->Draw( "leaf >> h1");
int num = histo->Integral();
Note that inside TTree::Draw you must use the histogram name (i.e h1), while when calling TH1::Integral you must use the C++ instance name (i.e histo )