//-------------------------- // Joe Santoro // Debug Script for Rene Brun //--------------------------- { gROOT->Reset(); gStyle->SetPalette(1); gStyle->SetFrameFillColor(19); gStyle->SetNumberContours(30); gStyle->SetOptStat(0); typedef struct event_t { double q2; double t_prime; double W; double NU; double x_b; double phi_lab; double phi_cm; double PSI; double phi_H; double IMkk; double p_mom; double t_max; double phi_proton; double t; double t_min; double cos_thetaCM; double cos_thetaH; double gamma_factor; double epsilon; }; event_t gevent, aevent; TBranch *GEN = GENTREE->GetBranch("GEN_EVENT"); GEN->SetAddress(&gevent); TBranch *ACC = ACCTREE->GetBranch("ACC_EVENT"); ACC->SetAddress(&aevent); TH2D *hq2tgen = new TH2D("hq2tgen","Q^{2} vs t gen",20,-4.0, 0.0, 20,1.0,4.0); //loop over Tree of generated events Int_t nentries = (Int_t)GENTREE->GetEntries(); cout<< "There are: "<GetEntry(i); hq2tgen->Fill(gevent.t, gevent.q2); if(i % 100 == 0) { fprintf(stderr,"%d\r",i); fflush(stderr); } } // Save acceptance plots to a root file acc_plots.root TFile *acc_plots = new TFile("acc_plots.root","RECREATE"); hq2tgen->Print(); hq2tgen->Write(); delete acc_plots; }