2 1D histograms to a TProfile

Dear experts,

I have 2 1D histograms A and B, I want to draw a TProfile which is B vs. A, how to do that ?

Thanks,
Jike