Hi Philippe
Indeed, it was a typo of mine–sorry for that, but in principle the 2nd looping should be “controllable” ie j<nb should be enough as well 
I tried to do what you proposed, ie work with somename etc… So, this what I thought, based on your help – I use a sprintf to pass the GetName of the Branch, like the next script (it also works if I pass a certain branchName, “MET” for example)
tree1_ = treeSignal;
tree2_ = treeBkg;
//tree1_->AddFriend(tree2_,"tree2_");
TObjArray *lb1 = tree1_->GetListOfBranches();
TObjArray *lb2 = tree2_->GetListOfBranches();
Int_t nb = lb1->GetEntries();
for (Int_t i=0;i<10;i++) {
TBranch *b = (TBranch*)lb1->At(i);
for ( Int_t j=0;j<10;j++) {
TBranch *c = (TBranch*)lb2->At(j);
char name[20];char name2[20];
sprintf(name,"%s",b->GetName()); //could also work if "MET"
sprintf(name2,"%s",c->GetName());
tree1_->Draw(Form("%s:%s>>hcor",name,name2,"","goff"));
TH2 *hcor = (TH2*)gDirectory->Get("hcor");
}}
So, the difference here is that I do not use AddFriend method, and it works ie returns non-zero values . Now, I guess, if I would do
tree1_ = treeSignal;
tree2_ = treeBkg;
tree1_->AddFriend(tree2_,"tree2_");
TObjArray *lb1 = tree1_->GetListOfBranches();
TObjArray *lb2 = treeBkg->GetListOfBranches();
Int_t nb = lb1->GetEntries();
for (Int_t i=0;i<10;i++) {
TBranch *b = (TBranch*)lb1->At(i);
for ( Int_t j=0;j<10;j++) {
TBranch *c = (TBranch*)lb2->At(j);
char name[20];char name2[20];
sprintf(name,"%s",b->GetName());
sprintf(name2,"%s",c->GetName());
tree1_->Draw(Form("%s:tree2_.%s>>hcor",name,name2,"","goff"));
TH2 *hcor = (TH2*)gDirectory->Get("hcor");
}}
would in principle be the same , with the first script no? I mean, what if I do not use the AddFriend method, and just assing 2 TObjects to the ttree1_ and ttree2_? Is there any great difference I should worry about?
Also, what really amazed me, is that if the nb integer is greater than one specific value (like 15 for example,but this value depends on the total number of entries I run, but in any case is really less than the real nb value), I get always zeros (no crash or warnings) --this is why actually I got all these zeros before --if nb > some value, the hcor->zero … but not crash/warnings etc …Any ideas why?
Best
Alexis