Hi, everyone.
I am facing a strange problem. Here is the structure of my code
std::pair<double,double> FindMin(TGraph *gr){
//Define a function to find a minimum of Graph
}
double FindDis(TGraph * gr){
//Define another function
}
void read(){
TFile *f1 = TFile::Open("/Users/tianyu/InducedCharge/COMSOL/test/0p25_Noextend/test/Graph_0p8i.root","READ");
TGraph *gr1 = (TGraph*)f1->Get("SeF5-");
std::pair<double,double> min = FindMin(gr1);
double x_p = min.first;
double dis = FindDis(gr1);
//create canvas and graph
TCanvas c1("c1","",600,600);
gr1->Draw();
}
After running the program, nothing displayed. Iām sure that the functions I defined work well. The TCanvas seems not work. But when I tried to delete
TCanvas c1(āc1ā,āā,600,600);
and let root create canvas automatically, the graph could be displayed. There is no error or warning reported. Can someone shows some suggestions?
_
ROOT Version: 6.32.02
Platform: macosxarm64
Compiler: clang-1500.3.9.4