Doinf operations on histograms in two different .root files

hi all,

we have two root files, a.root and b.root.

a.root contains a histogram called AA
b.root BB

We want to divide AA by BB. How does one do this,

a) At the command level, i.e., after doing root a.root b.root

or, in

b) a macro

thanks
vivek

{ TFile *f1 = new TFile("file1.root"); TH1 *AA = (TH1*)f1->Get("AA"); TFile *f2 = new TFile("file2.root"); TH1 *BB = (TH1*)f2->Get("BB"); AA->Divide(BB); AA->Draw(); } Rene