Dear All
I need an help to plot the result of geant4 output in root.
My code below have no process if I put n = 100,000. but when I set it to be 10,000 will be okay.
{
TFile f1(“HeliumOutPut.root”);
TH1F* helium = new TH1F("", “”, 3000, 0, 300);
double n = 100000;
double p = 10000000;
for (Int_t i=0;i<n;i++)
{
helium->SetBinContent(i, (totaldose->GetBinContent(i)/p));
}
//plot helium
helium->Draw();
//_________________________________________________________________________________
TFile f2(“ProtonOutPut.root”);
TH1F* proton = new TH1F("", “”, 3000, 0, 300);
for (Int_t j=0;j<n;j++)
{
proton->SetBinContent(j, (totaldoseproton->GetBinContent(j)/p));
}
//plot proton
proton->Draw(“same”);
}
note: I use root version 6.22 but it seems okay in root version 5.34