7 TFile ofile(
"conductivity_experiment.root",
"RECREATE");
12 "Potential:Current:Temperature:Pressure");
16 float pot,cur,temp,pres;
17 for (
int i=0;i<10000;++i){
18 pot=
rndm.Uniform(0.,10.);
19 temp=
rndm.Uniform(250.,350.);
20 pres=
rndm.Uniform(0.5,1.5);
21 cur=pot/(10.+0.05*(temp-300.)-0.2*(pres-1.));
23 pot*=
rndm.Gaus(1.,0.01);
24 temp+=
rndm.Gaus(0.,0.3);
25 pres*=
rndm.Gaus(1.,0.02);
26 cur*=
rndm.Gaus(1.,0.01);
28 cond_data.
Fill(pot,cur,temp,pres);
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
void Close(Option_t *option="") override
Close a file.
A simple TTree restricted to a list of float variables only.
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
Random number generator class based on M.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
void write_ntuple_to_file()