#include #include #include #include void uuidFile() { auto file = TFile::Open("testUUID.root","recreate"); auto tree = new TTree("cal","cal"); TUUID run_info; tree->Branch("info_run",&run_info); for(int i=0;i<10;i++) { run_info=TUUID(); tree->Fill(); } tree->Write(); file->Write(); file->Close(); delete file; } void testUUIDInTFile() { uuidFile(); auto file = TFile::Open("testUUID.root","READONLY"); auto tree = dynamic_cast(file->FindObjectAny("cal")); if(tree) { //tree->SetBranchStatus("*",false); TUUID lastid; TUUID* id = nullptr; std::string name = "info_run"; if(tree->GetBranch(name.c_str())!=nullptr){ tree->SetBranchStatus(name.c_str(),true); tree->SetBranchAddress(name.c_str(),&id); for(int entry = 0;entryGetEntries();++entry) { tree->GetEntry(entry); if(lastid!=*id) { std::cout<<"found new run "<AsString()<