Hello there,
Not sure this is the right place. I have a combination of TChain, addFriend, Project that seems to reveal what it looks like a bug, but maybe I am just wrongly using the tools. I am using ROOT 6.32.06.
I prepare some TChains :
TChain* mu_000 = new TChain("nt");
TChain* mu_140 = new TChain("nt");
TChain* mu_200 = new TChain("nt");
mu_000->Add("AOD.41864953._00*01.root");
mu_140->Add("AOD.41929789._00*01.root");
mu_200->Add("AOD.41929979._00*01.root");
Then I put then all together in a single TTree :
TTree *nt = new TTree();;
nt->AddFriend(mu_000,"mu_000");
nt->AddFriend(mu_140,"mu_140");
nt->AddFriend(mu_200,"mu_200");
And project into histograms :
TH2F* resolution_vs_pt_000 = new TH2F("res_pt_000","res_pt_000",100,0,100,100,-20,20);
TH2F* resolution_vs_pt_140 = new TH2F("res_pt_140","res_pt_140",100,0,100,100,-20,20);
TH2F* resolution_vs_pt_200 = new TH2F("res_pt_200","res_pt_200",100,0,100,100,-20,20);
TH2F* resolution2_vs_pt_000 = new TH2F("res2_pt_000","res_pt_000",100,0,100,100,-20,20);
TH2F* resolution2_vs_pt_140 = new TH2F("res2_pt_140","res_pt_140",100,0,100,100,-20,20);
TH2F* resolution2_vs_pt_200 = new TH2F("res2_pt_200","res_pt_200",100,0,100,100,-20,20);
mu_000->Project("res_pt_000","100.0*(offelpt-truthpt)/truthpt:truthpt*1e-3","truthpt>1e3");
mu_140->Project("res_pt_140","100.0*(offelpt-truthpt)/truthpt:truthpt*1e-3","truthpt>1e3");
mu_200->Project("res_pt_200","100.0*(offelpt-truthpt)/truthpt:truthpt*1e-3","truthpt>1e3");
nt->Project("res2_pt_000","100.0*(mu_000.offelpt-mu_000.truthpt)/mu_000.truthpt:mu_000.truthpt*1e-3","mu_000.truthpt>1e3");
nt->Project("res2_pt_140","100.0*(mu_140.offelpt-mu_140.truthpt)/mu_140.truthpt:mu_140.truthpt*1e-3","mu_140.truthpt>1e3");
nt->Project("res2_pt_200","100.0*(mu_200.offelpt-mu_200.truthpt)/mu_200.truthpt:mu_200.truthpt*1e-3","mu_200.truthpt>1e3");
When plotting, I can easily see that the results are similar, but one point in each histogram seems to blow up completely.
Also, I would like to change the coordinate of the Stat box when displaying some of the histograms created in a similar way a bit ahead :
resolution_000->Draw();
resolution_140->Draw("sames");
resolution_200->Draw("sames");
gPad->Update();
TPaveStats* pav000 = (TPaveStats *) resolution_000->FindObject("stats");
TPaveStats* pav140 = (TPaveStats *) resolution_140->FindObject("stats");
TPaveStats* pav200 = (TPaveStats *) resolution_200->FindObject("stats");
std::cout << "PAVs : " << pav000 << " " << pav140 << " " << pav200 << std::endl;
pav000->SetY1NDC(0.3);
pav000->SetY2NDC(0.5);
pav140->SetY1NDC(0.5);
pav140->SetY2NDC(0.7);
pav200->SetY1NDC(0.7);
pav200->SetY2NDC(0.9);
gPad->Update();
I put the three input files and the code (compareMu.C) in ~damazio/public/ in lxplus. Please, let me know if you need anything else to reproduce this.