I have a problem with the programs in attached:
root.C create three files: Maxwell.dat, Maxwell.root and TABLE.dat;
plot.C reads file .root and its tree, so I declare a new tree and three histograms to plot data generated in root.C.
For the first (h1) and second (h2) histogram I haven’t problems ( they are both TH2F), but with h3, that is a TH3F, I have two problems( c2.png in attached):
Statistics are all zero ( so I think the TH3F has problems to read tree’s data);
Range of palette is wrong: radius of sphere is 1, so distance of markers can’t be more than one.
I have another question: if I put in my program the function " system(“read”)" the menus bar of Canvas isn’t shown, how can I resolve It?
Thanks and sorry for my English root.C (5.47 KB) plot.C (3.23 KB)
Processing root.C...
In file included from input_line_10:1:
/Users/couet/Downloads/root.C:145:7: warning: switch condition has boolean value [-Wswitch-bool]
switch(ratio>=test)
^ ~~~~~~~~~~~
type Nmol: 1
type Molecule kind (max 20 chars & no blanks):
Can you fix the code and tell me what I should answer to the questions your program asks ?
Processing root.C...
In file included from input_line_10:1:
/Users/couet/Downloads/root.C:145:7: warning: switch condition has boolean value [-Wswitch-bool]
switch(ratio>=test)
^ ~~~~~~~~~~~
type Nmol: 1
type Molecule kind (max 20 chars & no blanks):
Can you fix the code and tell me what I should answer to the questions your program asks ?[/quote]
Right! I fixed programs ( and I put them in attachments of first post). Now values are just entered.
Thank you
void plot(){
TFile *f = new TFile("Maxwell.root");
TTree *tree3= (TTree*)f->Get("tree");
TH3F *h3 = new TH3F("h3","Representation of gas in the sphere",10,-1,1,10,-1,1,10,-1,1);
gStyle->SetPalette(55);
tree3->Draw("x:y:z:8*sqrt(x*x+y*y+z*z)>>h3"," sqrt(x*x+y*y+z*z)>0","colz",100000);
}
The stats are 0 … it looks like the histogram is not filled…