| name | language | licence |
|---|---|---|
| Reading a TRefArray | C++ | Other |
| SetDirectory | C++ | Other |
| MCEvents tree simple analysis | C++ | Other |
| Fitting to functions | C++ | Other |
| Load and execute a macro | C++ | Other |
| Feng's wierd way of making time plots | C++ | Other |
| Check to see if a file exists | C++ | Other |
| Creating a TTree | C++ | Other |
< 1 2 3 4 5 >
language: C++
licence: Other
Fitting to functions
options: view full snippet • send to code collector
TF1 *myfit = new TF1("myfit","[0]*sin(x) + [1]*exp(-[2]*x)", 0, 2);
myfit->SetParName(0,"c0");
myfit->SetParName(1,"c1");
myfit->SetParName(2,"slope");
myfit->SetParameter(0, 1);
myfit->SetParameter(1, 0.05);
myfit->SetParameter(2, 0.2);
histo->Fit("fexp");
cout << myfit->GetChisquare() / myfit->GetNDF() << endl;



library
latex (12)