/** * @file SOnlineNeutronIDMon.cpp * @author Dan Saunders, on behalf of the SoLid collaboration. * @date 17 Feb 2016 */ #include "SOnlineNeutronIDMon.h" //============================================================================== //! Constructor setting up default values. SOnlineNeutronIDMon::SOnlineNeutronIDMon(SDetector * dtr, SClipboard * cb) : ISAlgorithm(dtr, cb, "SOnlineNeutronIDMon") {} //============================================================================== void SOnlineNeutronIDMon::initialize() { h_IonA = new TH1D("IonA", "IonA; IonA (samples); N;", 110, -10, 100); h_tot = new TH1D("tot", "tot; tot (samples); N;", 110, -10, 200); h_nPeaks = new TH1D("nPeaks", "nPeaks; nPeaks; N;", 110, -10, 100); } //============================================================================== //! Loop over events filling nID parameters. void SOnlineNeutronIDMon::execute() { for (auto event : (*cb()->events())) { h_IonA->Fill(event->NID_IonA()); h_nPeaks->Fill(event->NID_nPeaks()); h_tot->Fill(event->NID_tot()); } } //============================================================================== void SOnlineNeutronIDMon::finalize() { h_IonA->Write(); h_nPeaks->Write(); h_tot->Write(); } //==============================================================================