#include "TFile.h" #include "TH1.h" #include "TH2.h" #include "TChain.h" #include "TTree.h" #include "TLeaf.h" #include #define UpdateEvents 2000 //using namespace std; void GetValue(const char *filename = "eu152_11july_afterGlitch.002", const char *treename = "RoseNIAS") { ROOT::EnableImplicitMT(); const char* nmHis[20]; Int_t NoPara; Long64_t nentries; TChain *fChain = new TChain(treename); fChain->AddFile(filename); TObjArray*obj = fChain->GetListOfBranches(); NoPara = obj->GetEntries(); //Number of parameters in Tree and hence in experiment nentries = fChain->GetEntriesFast(); // Number of events in the Tree ROOT::RDataFrame df(treename, filename); std::vector> histos; for (const std::string &col : df.GetColumnNames()) { auto h = df.Histo1D(col); histos.push_back(h); } histos[0]->Draw(); // !!!!!This DOES NOT WORK!!!! histos[0]->GetMean(); // !!!!!This DOES NOT WORK!!!! // Computation has been booked but it has not started yet. // The first time you access one of the histograms, // all of them will be filled in a single event loop //cout << "\n Total Number Entries in the TChain is:\t" << nentries << endl; //printf ("EVENTS = %8d....\n", nentries); }