Dear @Wile_E_Coyote, I was just noticing one thing about the 2d plot that you helped me to do in this topic Difference between arrays .
As you can see, by plotting the energies in two scintillators (Called scintillator 8 and scintillator 9) I’ve energies around 1700ADC count
when I plot the energies in 2d plots, energies looks likes divided by 1000, indeed I’ve these plots in which energies are 2 ADC counts… I can’t understand the reason…
This is the used code:
TCanvas *c25 = new TCanvas("c25",canvtitle,1280,1024);
c25->Divide (2,1);
c25->cd(1);
TH2F *henecdsubstringcutrelTHF = new TH2F("henecdsubstringcutrelTHF", "", 50, 0., 50.,50., 0.,50.);
TCut cut1 = TString::Format("TMath::Abs(Calo_Time[%d] - Calo_Time[%d] - (%f)) < (%d)*(%f) && TMath::Abs(Calo_Time[%d] - Calo_Time[%d] - (%f)) < (%d)*(%f) && TMath::Abs(Calo_Time[%d] - Calo_Time[%d] - (%f)) < (%d)*(%f)", a, b, p1, csig, p2, a, c, p13sub, csig, p23sub,a, d, p14sub, csig, p24sub).Data();
TString what = TString::Format("Calo_EnDep[%d] : Calo_EnDep[%d]>> henecdsubstringcutrelTHF", d, c);
t->Draw(what, cut1);
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
henecdsubstringcutrelTHF->SetTitle(cdhenecdsubstringcutrelTHFname);
henecdsubstringcutrelTHF->GetXaxis()->SetTitle(cdeneXnameabenecvsd);
henecdsubstringcutrelTHF->GetYaxis()->SetTitle(cdeneYnameabenecvsd);
henecdsubstringcutrelTHF->GetYaxis()->SetTitleSize(c2_YTitleSize);
henecdsubstringcutrelTHF->GetYaxis()->SetTitleFont(c2_YTitleFont);
henecdsubstringcutrelTHF->GetYaxis()->SetTitleOffset(c2_YTitleOffset);
henecdsubstringcutrelTHF->GetYaxis()->SetLabelFont(c2_YLabelFont);
henecdsubstringcutrelTHF->GetYaxis()->SetLabelSize(c2_YLabelSize);
henecdsubstringcutrelTHF->GetXaxis()->SetTitleSize(c2_XTitleSize);
henecdsubstringcutrelTHF->GetXaxis()->SetTitleFont(c2_XTitleFont);
henecdsubstringcutrelTHF->GetXaxis()->SetTitleOffset(c2_XTitleOffset);
henecdsubstringcutrelTHF->GetXaxis()->SetLabelFont(c2_XLabelFont);
henecdsubstringcutrelTHF->GetXaxis()->SetLabelSize(c2_XLabelSize);
henecdsubstringcutrelTHF->Draw("COLZ");
henecdsubstringcutrelTHF->SetName(heneabname);
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
TLegend* leghenecdsubstringcutrelTHF = new TLegend(0.65, 0.7, .75, .75);
leghenecdsubstringcutrelTHF->SetHeader("Legend");
leghenecdsubstringcutrelTHF->SetNColumns(1);
leghenecdsubstringcutrelTHF->AddEntry(leghenecdsubstringcutrelTHF, "Data", "l");
leghenecdsubstringcutrelTHF->Draw();
gPad->Update();
TPaveStats *statsghenecdsubstringcutrelTHF = (TPaveStats*)henecdsubstringcutrelTHF->GetListOfFunctions()->FindObject("stats");
statsghenecdsubstringcutrelTHF->SetTextColor(kBlue);
statsghenecdsubstringcutrelTHF->SetX1NDC(0.80); statsghenecdsubstringcutrelTHF->SetX2NDC(0.98);
statsghenecdsubstringcutrelTHF->SetY1NDC(0.77); statsghenecdsubstringcutrelTHF->SetY2NDC(0.92);
gPad->Update();
c25->cd(2);
TH2F *henecdsubstringcutrelTHFsumdiff = new TH2F("henecdsubstringcutrelTHFsumdiff", "", 50, 0., 50., 50, 0., 50.);
TString whatsumdiff = TString::Format("(Calo_EnDep[%d] - Calo_EnDep[%d]) : (Calo_EnDep[%d] + Calo_EnDep[%d])>> henecdsubstringcutrelTHFsumdiff", c, d,c,d);
t->Draw(whatsumdiff, cut1);
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
henecdsubstringcutrelTHFsumdiff->SetTitle(cdhenecdsubstringcutrelTHFnamesumdiff);
henecdsubstringcutrelTHFsumdiff->GetXaxis()->SetTitle(cdeneXnameabenecvsdsumdiff);
henecdsubstringcutrelTHFsumdiff->GetYaxis()->SetTitle(cdeneYnameabenecvsdsumdiff);
henecdsubstringcutrelTHFsumdiff->GetYaxis()->SetTitleSize(c2_YTitleSize);
henecdsubstringcutrelTHFsumdiff->GetYaxis()->SetTitleFont(c2_YTitleFont);
henecdsubstringcutrelTHFsumdiff->GetYaxis()->SetTitleOffset(c2_YTitleOffset);
henecdsubstringcutrelTHFsumdiff->GetYaxis()->SetLabelFont(c2_YLabelFont);
henecdsubstringcutrelTHFsumdiff->GetYaxis()->SetLabelSize(c2_YLabelSize);
henecdsubstringcutrelTHFsumdiff->GetXaxis()->SetTitleSize(c2_XTitleSize);
henecdsubstringcutrelTHFsumdiff->GetXaxis()->SetTitleFont(c2_XTitleFont);
henecdsubstringcutrelTHFsumdiff->GetXaxis()->SetTitleOffset(c2_XTitleOffset);
henecdsubstringcutrelTHFsumdiff->GetXaxis()->SetLabelFont(c2_XLabelFont);
henecdsubstringcutrelTHFsumdiff->GetXaxis()->SetLabelSize(c2_XLabelSize);
henecdsubstringcutrelTHFsumdiff->Draw("COLZ");
henecdsubstringcutrelTHFsumdiff->SetName(heneabname);
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
TLegend* leghenecdsubstringcutrelTHFsumdiff = new TLegend(0.65, 0.7, .75, .75);
leghenecdsubstringcutrelTHFsumdiff->SetHeader("Legend");
leghenecdsubstringcutrelTHFsumdiff->SetNColumns(1);
leghenecdsubstringcutrelTHFsumdiff->AddEntry(leghenecdsubstringcutrelTHF, "Data", "l");
leghenecdsubstringcutrelTHFsumdiff->Draw();
gPad->Update();
TPaveStats *statsghenecdsubstringcutrelTHFsumdiff = (TPaveStats*)henecdsubstringcutrelTHFsumdiff->GetListOfFunctions()->FindObject("stats");
statsghenecdsubstringcutrelTHFsumdiff->SetTextColor(kBlue);
statsghenecdsubstringcutrelTHFsumdiff->SetX1NDC(0.80); statsghenecdsubstringcutrelTHFsumdiff->SetX2NDC(0.98);
statsghenecdsubstringcutrelTHFsumdiff->SetY1NDC(0.77); statsghenecdsubstringcutrelTHFsumdiff->SetY2NDC(0.92);
gPad->Update();
c25->Print(myplothenecdsubstringcutrelTHF);
delete c25;
ROOT Version: 5.3438
Platform: Windows
Compiler: Not Provided