//////////////////////////////////////////////////////////////////// /// \file inzdab.c /// /// \brief Reads some standard data from a root file. /// /// \author P G Jones /// /// 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 The standard data is checked to ensure the inzdab /// producer is working correctly. /// //////////////////////////////////////////////////////////////////// void inzdab(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* hQLX = new TH1F( "hQLX", "UnCal QLX Values", 4500, 0.0, 4500.0 ); hQLX->SetXTitle( "QLX ADC values" ); hQLX->SetYTitle( "Count per 1 ADC bin" ); TH1F* hQHS = new TH1F( "hQHS", "UnCal QHS Values", 4500, 0.0, 4500.0 ); hQHS->SetXTitle( "QHS ADC values" ); hQHS->SetYTitle( "Count per 1 ADC bin" ); TH1F* hQHL = new TH1F( "hQHL", "UnCal QHL Values", 4500, 0.0, 4500.0 ); hQHL->SetXTitle( "QHL ADC values" ); hQHL->SetYTitle( "Count per 1 ADC bin" ); TH1F* hTAC = new TH1F( "hTAC", "UnCal TAC Values", 3500, 0.0, 3500.0 ); hTAC->SetXTitle( "TAC ADC values" ); hTAC->SetYTitle( "Count per 1 ADC bin" ); TH1F* hLCN = new TH1F( "hLCN", "UnCal LCN Values", 10000, 0.0, 10000.0 ); hLCN->SetXTitle( "LCN ADC values" ); hLCN->SetYTitle( "Count per 1 ADC bin" ); event_ttree->Draw( "evs.uncalPMTs.normal.qlx>>hQLX", "", "goff" ); event_ttree->Draw( "evs.uncalPMTs.normal.qhs>>hQHS", "", "goff" ); event_ttree->Draw( "evs.uncalPMTs.normal.qhl>>hQHL", "", "goff" ); event_ttree->Draw( "evs.uncalPMTs.normal.time>>hTAC", "", "goff" ); event_ttree->Draw( "evs.uncalPMTs.normal.id>>hLCN", "", "goff" ); hQLX->Write(); hQHS->Write(); hQHL->Write(); hTAC->Write(); hLCN->Write(); outtfile->Close(); event_tfile->Close(); delete event_tfile; delete outtfile; }