8 #include <TTreeReader.h>
9 #include <TTreeReader.h>
14 TString outfilename =
"",
15 float scalefactor = -1.4 / 1.5
18 outfilename=infilename;
19 outfilename.ReplaceAll(
".root",
".Bmap");
22 auto infile = TFile::Open(infilename);
23 TTreeReader
reader(
"fieldmap", infile);
24 TTreeReaderValue<float> r(reader,
"r");
25 TTreeReaderValue<float>
z(reader,
"z");
26 TTreeReaderValue<float> br(reader,
"br");
27 TTreeReaderValue<float> bz(reader,
"bz");
30 outfile.open(outfilename);
32 while (reader.Next()){
35 << *br *scalefactor <<
'\t'
36 << *bz *scalefactor << endl;