void run102RhChain(std::string event_file, std::string outfile) { TFile *event_tfile = new TFile(event_file.c_str()); TTree *event_ttree = (TTree*)event_tfile->Get("T"); TFile *outtfile = new TFile(outfile.c_str(), "RECREATE"); TH1F *e_ke = new TH1F("e_ke", "e- (or e+) Kinetic Energy",1000,0,3.0); e_ke->SetYTitle("Events per bin"); e_ke->SetXTitle("Energy (MeV)"); TH1F *gamma_ke = new TH1F("gamma_ke", "Gamma Kinetic Energy",1000,0,3.0); gamma_ke->SetYTitle("Events per bin"); gamma_ke->SetXTitle("Gamma Energy (MeV)"); TH1F *alpha_ke = new TH1F("alpha_ke", "Alpha Kinetic Energy",1000,0,10.0); alpha_ke->SetYTitle("Events per bin"); alpha_ke->SetXTitle("Alpha Energy (MeV)"); TH1F *time = new TH1F("time", "Initial Time of Particles",1000,0,100.0); time->SetYTitle("Events per bin"); time->SetXTitle("time (ns)"); event_ttree->Draw("ds.mc.particles.kineticEnergy>>e_ke", "ds.mc.particles.pdgCode==11||ds.mc.particles.pdgCode==-11","goff"); event_ttree->Draw("ds.mc.particles.kineticEnergy>>gamma_ke", "ds.mc.particles.pdgCode==22","goff"); event_ttree->Draw("ds.mc.particles.kineticEnergy>>alpha_ke", "ds.mc.particles.pdgCode==1000020040","goff"); event_ttree->Draw("ds.mc.particles.mcTime>>time","","goff"); e_ke->Write(); gamma_ke->Write(); alpha_ke->Write(); time->Write(); outtfile->Close(); event_tfile->Close(); delete event_tfile; delete outtfile; }