CMS 3D CMS Logo

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