//////////////////////////////////////////////////////////////////// /// \file pcaproctw.cc /// /// \brief Extracts PCA information /// /// \author F Descamps, /// /// 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 /// //////////////////////////////////////////////////////////////////// #include #include #include #include void pcaproctw(std::string event_file, std::string outfile) { RAT::DU::DSReader* dsReader = new RAT::DU::DSReader(event_file); TFile *outtfile = new TFile(outfile.c_str(),"RECREATE"); TH2D *hPCATW=new TH2D("hPCATW","hPCATW;QHS [cap];ECA time [ns]",400,0,400,600,0,600); for( size_t iEntry = 0; iEntry < dsReader->GetEntryCount(); iEntry++ ) { const RAT::DS::Entry& rDS = dsReader->GetEntry( iEntry ); for( size_t iEV = 0; iEV < rDS.GetEVCount(); iEV++ ) { const RAT::DS::EV& rEV = rDS.GetEV( iEV ); for( size_t ipmt = 0; ipmt < rEV.GetCalPMTs().GetAllCount(); ipmt++ ) { const RAT::DS::PMTCal& pmtCal = rEV.GetCalPMTs().GetAllPMT( ipmt ); const unsigned int id = pmtCal.GetID(); if( id == 8990 ) // This pmt will have the most hits in for this laserball position hPCATW->Fill( pmtCal.GetQHS(), pmtCal.GetTime() ); } } } outtfile->cd(); hPCATW->Write(); outtfile->Close(); delete outtfile; delete dsReader; }