README.session2 for GlueX Tutorial Jan. 7, 2011 12/8/2010 DL The goals of this session are: A. Run a DANA(JANA) program to reconstruct events B. Inspect root file and generate TSelector for tree C. Analyze the reconstructed events using customized ROOT TSelector =========================================================== ------------------------------------------------- A. Run a DANA(JANA) program to reconstruct events ------------------------------------------------- 1. Run hd_root with the phys_tree plugin to reconstruct rho events and write results into ROOT tree. > ln -s ../HandsOnSession1/sim_rho_smeared.hddm > hd_root -PPLUGINS=phys_tree sim_rho_smeared.hddm -o sim_rho_smeared.root ------------------------------------------------- B. Inspect root file and generate TSelector for tree ------------------------------------------------- 1. Inspect contents of root file. > root sim_rho_smeared.root ... root [1] PHYSICS->cd() root [2] recon->Draw("Npip") root [3] recon->Draw("pip.p.Theta()") 2. Use root to generate a TSelector skeleton class from the phys_tree object. > root sim_rho_smeared.root ... root [1] PHYSICS->cd() root [2] recon->MakeSelector("mk_hists") root [3] .q ------------------------------------------------- C. Analyze the reconstructed events using a ROOT TSelector ------------------------------------------------- 1. Edit the mk_hists.C and mk_hists.h files to produce histograms. > nedit mk_hists.h {Add declaration of TH1D *mass_rho to class declaration} > nedit mk_hists.C {Add the following line to the mk_hists::Begin method} mass_rho = new TH1D("mass_rho", "Mass of #pi^{+} + #pi^{-} for all combos", 200, 0.0, 1.4); {Add the following lines to the mk_hists::Process method} GetEntry(entry); if(Npip>kMaxpip)Npip = kMaxpip; if(Npim>kMaxpim)Npim = kMaxpim; // Copy local elements into TLorentzVector objects TLorentzVector *pip = new TLorentzVector[Npip]; for(Int_t i=0; iFill(rho.M()); } } 3. Run the selector and plot the pi+ pi- mass > root sim_rho_smeared.root ... root [1] PHYSICS->cd() root [2] recon->Process("mk_hists.C") root [3] mass_rho->Draw();