Belle II Software development
CALogger.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <utility>
11#include <vector>
12#include <string>
13
14
15namespace Belle2 {
22 struct CALogger {
24 unsigned int nPasses = 0;
25
27 std::vector< std::pair< int, std::vector<unsigned int> > > passResults;
28
30 unsigned int nFails = 0;
31
33 // small lambda function for printing the results
34 std::string getStringCellsOfState(std::vector<unsigned int>& nCellsOfState)
35 {
36 std::string out = "";
37 for (unsigned int i = 0; i < nCellsOfState.size(); i++)
38 { out += "had " + std::to_string(nCellsOfState[i]) + " cells of state " + std::to_string(i) + "\n"; }
39 return out;
40 }
41 };
42
44} //Belle2 namespace
Abstract base class for different kinds of events.
simple logger for CA algorithm
Definition: CALogger.h:22
std::string getStringCellsOfState(std::vector< unsigned int > &nCellsOfState)
returns string containing number of Cells for each state occurred:
Definition: CALogger.h:34
std::vector< std::pair< int, std::vector< unsigned int > > > passResults
collects results for each pass for debugging purposes
Definition: CALogger.h:27
unsigned int nFails
counts number of fails happened so far
Definition: CALogger.h:30
unsigned int nPasses
counts number of passes executed so far
Definition: CALogger.h:24