//////////////////////////////////////////////////////////////////// /// \file parentinfo.C /// /// \brief Extracts parent information for testing /// /// \author J Wilson /// /// REVISION HISTORY:\n /// 2014-05-29 : P G Jones - Added header information.\n // 2018-02-10 : R Lane - change to function arguments necessary for ROOT 6 compatibility /// /// \details /// //////////////////////////////////////////////////////////////////// void parentinfo(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 *hparPDG = new TH1F("hparPDG", "Parent PDG code", 20, 0, 20); hparPDG->SetYTitle("Events per bin"); hparPDG->SetXTitle("parent PDG code"); event_ttree->Draw("ds.mc.parents.pdgCode>>hparPDG","",""); hparPDG->Write(); outtfile->Close(); event_tfile->Close(); delete event_tfile; delete outtfile; }