CMS 3D CMS Logo

Looses.cc
Go to the documentation of this file.
1 //FAMOS headers
3 
4 #include <iomanip>
5 #include <iostream>
6 
7 Looses* Looses::myself = nullptr;
8 
10 
12  if (!myself)
13  myself = new Looses();
14  return myself;
15 }
16 
18 
19 void Looses::count(const std::string& name, unsigned cut) {
20  if (theLosses.find(name) == theLosses.end()) {
21  std::vector<unsigned> myCounts;
22  for (unsigned i = 0; i < 20; ++i)
23  myCounts.push_back(0);
24  theLosses[name] = myCounts;
25  }
26 
27  if (cut < 20)
28  ++theLosses[name][cut];
29 }
30 
32  std::map<std::string, std::vector<unsigned> >::const_iterator lossItr;
33  std::cout << "***** From LOOSES ***** : Cuts effects" << std::endl << std::endl;
34 
35  for (lossItr = theLosses.begin(); lossItr != theLosses.end(); ++lossItr) {
36  std::cout << lossItr->first << ":" << std::endl;
37  for (unsigned i = 0; i < 4; ++i) {
38  for (unsigned j = 0; j < 5; ++j) {
39  std::cout << std::setw(8) << lossItr->second[5 * i + j] << " ";
40  }
41  std::cout << std::endl;
42  }
43  std::cout << std::endl;
44  }
45 }
static Looses * instance()
Constructor is not public (only one instance needed)
Definition: Looses.cc:11
Looses()
Definition: Looses.cc:9
void summary()
Printing.
Definition: Looses.cc:31
Definition: Looses.h:9
std::map< std::string, std::vector< unsigned > > theLosses
Definition: Looses.h:32
void count(const std::string &name, unsigned cut)
Counting.
Definition: Looses.cc:19
virtual ~Looses()
Virtual destructor (empty)
Definition: Looses.cc:17
static Looses * myself
Definition: Looses.h:29