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.