Log scale in Pad when pad number is a variable

The situation is the following: A Canvas is divided in several pads,
a loop is running over the pads and drawing the appropriate histograms in
the respective pads:
for (int iPad=1; iPad<=4; iPad++)
{
OutPlot[iCanv]->cd(iPad);
int histo=4*(iCanv)+iPad-1; // a 2x2 divided canvas
if (lLogy[histo]) …
if (histo<nhist) myHist[histo]->Draw();
}

at the … the pad should be switched to log y. How do I specify the pad number, if it is a variable? OutPlot[iCanv]_iPad-SetLogY();
does obviously not work. Thanks in advance for comments.

Once you have set teh current pad (via cd) you can use gPad
as the pointer to the current pad. In your case, do

Rene