8 #include "../interface/Operations.h"
9 #include "../interface/Utils.h"
12 using namespace jsoncollector;
15 using std::stringstream;
24 double added = elems.at(0);
25 for (
unsigned int i = 1;
i < elems.size();
i++)
31 return sum(elems) / elems.size();
35 for (
unsigned int i = 0;
i < elems.size() - 1;
i++)
43 vector<vector<int> > inputHistos;
45 for (
unsigned int i = 0;
i < elems.size();
i++) {
46 vector<int> currentHisto;
47 string currentHistoAsString = elems.at(
i);
49 inputHistos.push_back(currentHisto);
52 if (inputHistos.size() > 0) {
55 for (
unsigned int i = 0;
i < inputHistos.size();
i++) {
57 maxSize = inputHistos[
i].
size();
61 vector<int> resultingHisto(maxSize);
62 for (
unsigned int i = 0;
i < resultingHisto.size();
i++)
63 resultingHisto[
i] = 0;
65 for (
unsigned int i = 0;
i < inputHistos.size();
i++) {
66 vector<int> currentHisto = inputHistos[
i];
67 for (
unsigned int j = 0;
j < currentHisto.size();
j++) {
68 resultingHisto[
j] += currentHisto[
j];
72 string resHistoAsString;
74 return resHistoAsString;
77 return "Cannot load input histos";
82 for (
unsigned int i = 0;
i < elems.size();
i++) {
84 if (
i != elems.size() - 1) {
static const std::string CAT
static const std::string AVG
static std::string histo(const std::vector< std::string > &)
static void stringToIntArray(std::vector< int > &theVector, const std::string &theString)
static const std::string SAME
static const std::string HISTO
static double sum(std::vector< double >)
tuple maxSize
'/store/data/Commissioning08/BeamHalo/RECO/StuffAlmostToP5_v1/000/061/642/10A0FE34-A67D-DD11-AD05-000...
static bool matchExactly(std::string s1, std::string s2)
static double avg(std::vector< double >)
static const std::string SUM
static std::string cat(const std::vector< std::string > &)
static void intArrayToString(std::vector< int > &theVector, std::string &theString)
tuple size
Write out results.
static std::string same(const std::vector< std::string > &)