#include #include #include "TObject.h" using namespace std; #include #include "TW1Data.cxx" #include "TW1Data.h" #include "TROOT.h" #include "TCanvas.h" #include "TSystem.h" #include "TFile.h" #include "TString.h" #include "TTree.h" #include "TBranch.h" #include "TH1F.h" #include "TH2F.h" #include "RootInput.h" void run(){ double x1=-25.251; double y1=-34.755; double z1=-25.25; double d=50.50/16; double delx=0.975; double dely=3.002; double x, y, E, theta; TFile *f0 = new TFile("7Bedp.root","READ"); if(!f0){cout << "NULL pointer to TFile " << endl; return;} f0->ls(); TTree *t0 = (TTree*) f0->Get("SimulatedTree"); if(!t0){cout << " ========== NULL pointer to TTree ========" << endl; return;} cout << t0-> GetEntries() << endl; TW1Data *m_Event=new TW1Data(); t0->SetBranchAddress("W1",&W1); for(int i=0; iGetEntries();i++){ double E= m_Event->GetFrontEEnergy(i); double x = m_Event->GetFrontEStripNbr(i); double y = m_Event->GetBackEStripNbr(i); double theta = atan((sqrt(pow(x1+delx*x,2)+pow(y1-dely*x,2)))/(z1+y*d))*(180.0/3.14); cout << E << "\t" << theta << endl; }//for loop }