hist->Print("all") not working?

I have been trying to create a simple output text file as follows:

TFile *f4 = new TFile("/home/skulmiya/Geant4/geant4-install/share/Geant4-10.2.2/examples/basic/SiliconDetector-build/Data1.root");
p1 = (TH1D*)f4->Get("hist1");
p1->Print("all"); >energysil.txt

the last line works fine without everything after the semicolon, but when i add the text file it gives me:

ROOT_prompt_4:1:19: error: expected expression
p1->Print("all"); > energysil.txt
ROOT_prompt_4:1:21: error: use of undeclared identifier 'energysil'
p1->Print("all"); > energysil.txt

I have not the slightest clue why.
Any help is appreciated, thank you.

1 Like

thank you for the link,

I have just followed the set of commands suggested by @pcanal in the link above, which seemed to have worked, but when i look inside the newly created .log file all i get is the following output:

TH1.Print Name = hist1, Entries= 10000, Total sum= 10000

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.