#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" int run() { float theta[16][16]; float x1=-25.251; float y1=-34.755; float z1=-25.25; float d=50.50/16; float delx=0.975; float dely=3.002; TFile* f0 = new TFile("7Bedp.root","READ","myroot"); TTree *t0 = (TTree*) f0->Get("SimulatedTree"); W1 *myW1=0; t0->SetBranchAddress("W1", &myW1); TH1F* Theta = new TH1F("Theta", "Emitted Theta",180, 0, 180); for(int ii=0;iiGetEntries();ii++) { t0->GetEntry(ii); for(fW1_BackE_StripNbr=0;fW1_BackE_StripNbr<16;fW1_BackE_StripNbr++) { for(fW1_FrontE_StripNbr=0;fW1_FrontE_StripNbr<16;fW1_FrontE_StripNbr++) { float s=sqrt(pow((x1+delx*fW1_FrontE_StripNbr),2)+pow((y1+dely*fW1_FrontE_StripNbr),2)); Theta->Fill((atan(s/(z1+(fW1_BackE_StripNbr*d)))*(180/3.14))); } } } Theta->Draw(); return 0; }