17 #include <TTreeReader.h>
18 #include <TTreeReaderValue.h>
19 #include <TTreeReaderArray.h>
22 #include <TDatabasePDG.h>
30 #pragma GCC diagnostic push
31 #pragma GCC diagnostic ignored "-Wundefined-internal"
33 #pragma GCC diagnostic pop
35 R__LOAD_LIBRARY(libFullJetFinder.so)
38 if (value.GetSetupStatus() < 0) {
39 std::cerr <<
"Error " << value.GetSetupStatus()
40 <<
"setting up reader for " << value.GetBranchName() <<
'\n';
47 if((cur % (total/100))==0){
48 float frac = float(cur)/float(total) + 0.01;
51 int pos = barWidth * frac;
52 for (
int i = 0;
i < barWidth; ++
i) {
53 if (
i < pos) std::cout <<
"=";
54 else if (
i == pos) std::cout <<
">";
55 else std::cout <<
" ";
57 std::cout <<
"] " << int(frac * 100.0) <<
" %\r";
59 if(cur >= total*0.99) std::cout<<std::endl;
66 bool readJetTree(
const std::string &dataFiles =
"/sphenix/tg/tg01/hf/jkvapil/JET30_r11_30GeV/condorJob/myTestJets/outputData_000*.root"){
67 TChain *
tc =
new TChain(
"AntiKt_r04/Data");
68 tc->Add(dataFiles.data());
72 TTreeReaderValue<FullJetFinder::Container> jet_container(reader,
"JetContainer");
74 TH1I *h_jet_n =
new TH1I(
"h_jet_n",
"h_jet_n",2,-0.5,1.5);
75 TH1F *h_reco_jet_pt =
new TH1F(
"h_reco_jet_pt",
"h_reco_jet_pt",100,0,100);
76 TH1F *h_reco_track_pt =
new TH1F(
"h_reco_track_pt",
"h_reco_track_pt",100,0,100);
78 std::cout<<
"Total number of events: "<<n_events<<std::endl;
81 while (reader.Next()){
85 h_jet_n->Fill(0.0,jet_container->reco_jet_n);
86 h_jet_n->Fill(1.0,jet_container->truth_jet_n);
89 for (
auto reco_jet : jet_container->recojets){
90 h_reco_jet_pt->Fill(reco_jet.pt);
92 for (
auto chConstituent : reco_jet.chConstituents){
93 h_reco_track_pt->Fill(chConstituent.pt);
99 TCanvas *
c =
new TCanvas(
"c",
"c",2400,800);
104 h_reco_jet_pt->Draw();
106 h_reco_track_pt->Draw();