#include #include #include #include "TFile.h" #include "TTree.h" #include "TLeaf.h" #include "TLeafI.h" using namespace std; void timedist() { //Specify the filename of input data. TFile *file = new TFile("input_data.root", "READ"); TTree *tree = (TTree*) file->Get("Data"); TBranch *branch = (TBranch*) tree->GetBranch("dev_ID"); tree->Print(); //tree->Scan("timestamp"); // Reads data from the input file. TLeaf *l_dev_ID = (TLeaf*)tree->GetLeaf("dev_ID"); TLeaf *l_timestamp = (TLeaf*)tree->GetLeaf("timestamp"); //Creates new tree for data TFile* output_file = new TFile("timewindows.root", "RECREATE"); TTree* mydata =new TTree("MyData","MyData"); //cout << l_timestamp->GetLen()<GetLenStatic()<GetLenType()<GetEntries(); for(int i=0; iGetValueLong64(i) << endl; getchar(); } } int main() { }