/************************************************************************** * BASF2 (Belle Analysis Framework 2) * * Copyright(C) 2010-2015 - Belle II Collaboration * * * * Author: The Belle II Collaboration * * Contributors: Luka Santelj * * * * This software is provided "as is" without any warranty. * **************************************************************************/ #pragma once #include #include #include #include #include #include #include namespace Belle2 { /** * testMon is a basic object to hold data for the run-dependency monitoring * Run summary TCanvases and monitoring variables */ class testMon : public TNamed { public: /** Constructor. */ testMon() {}; /** Constructor with name (always use this) */ testMon(const std::string& name) { fName = name; } /** * Add Canvas to monitoring object * @param canv pointer to canvas to add */ void addCanvas(TCanvas* canv) { for (auto cc : m_Canvases) { if (cc->GetName() == canv->GetName()) { B2ERROR("Canvas with name " << canv->GetName() << " already in the " << fName << " MonitoringObject! Use different name (or call getCanvas(name) to access pointer to the existing TCanvas)."); return; } } m_Canvases.push_back(canv); }; void setVariable(const std::string& var, float val) { auto vv = m_strVars.find(var); if (vv != m_strVars.end()) vv->second = val; else m_strVars.insert({var, val}); } private: std::vector m_Canvases; /**< vector of all TCanvases */ std::map m_strVars; ClassDefOverride(testMon, 1); /**< classdef */ }; //class } // namespace Belle2