You can create all histograms using something like this:
const char *i_name[] = { "4e", "2e2m", "4m" };
const int j_number[] = { 345709, 364250, 364251 };
for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) {
hCuts[i][j] =
new TH1F(TString::Format("hCuts_%s_%d", i_name[i], j_number[j]),
"all channel;cut;events", 5, 0.5, 5.5);
TAxis *a = hCuts[i][j]->GetXaxis();
a->SetBinLabel(1, "all");
a->SetBinLabel(2, "A");
a->SetBinLabel(3, "B");
a->SetBinLabel(4, "C");
a->SetBinLabel(5, "D");
}