Hi , I have a code written down here to covert large csv data set to root format for easy analysis. The csv file I have contains 7,000,001 row of 9 parameter values. However, When I used TBrowser(), I notice beside the 7,000,001 set of “ntuple3”, there was a second set of “ntuples2” that have around 5,000,000~ entry which is weird as it looks like it appear from no where.
I have tried check the branches and leafs of the tree in root, I could not figure out what the cause. I figure it may have to something to do with the code i written(below).
void convertCSV_root() {
TString dir = gSystem->UnixPathName(__FILE__);
dir.ReplaceAll("convertCSV_root.cc","");
dir.ReplaceAll("/./","/");
TFile *f = new TFile("DataFile_B0002.root","RECREATE");
TTree *tree = new TTree("ntuple","data from csv file");
TFile *fin = new TFile("DataFile_B0002_data.csv","rb");
char line[20];
// while (fgets(&line,20,fin))
tree->ReadFile("DataFile_B0002_data.csv","Time/F:CH11/F:CH12/F:CH21/F:CH22/F:CH31/F:CH32/F:CH41/F:CH42/F",',');
f->Write();
}
a portion of the csv file
0.00000000e+000,0.00000e+000,-2.00000e-003,-2.00000e-003,-4.00000e-003,-2.00000e-003,-2.00000e-003,-4.00000e-003,-2.00000e-003
1.000000000e-003,+8.00000e-003,0.00000e+000,-2.00000e-003,-4.00000e-003,-4.0000e-003,0.00000e+000,-1.00000e-003,-2.00000e-003
....
Has anyone encounter this before?