CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
Looses Class Reference

#include <Looses.h>

Public Member Functions

void count (const std::string &name, unsigned cut)
 Counting. More...
 
void summary ()
 Printing. More...
 
virtual ~Looses ()
 Virtual destructor (empty) More...
 

Static Public Member Functions

static Loosesinstance ()
 Constructor is not public (only one instance needed) More...
 

Private Member Functions

 Looses ()
 

Private Attributes

std::map< std::string, std::vector< unsigned > > theLosses
 

Static Private Attributes

static Loosesmyself = 0
 

Detailed Description

Definition at line 9 of file Looses.h.

Constructor & Destructor Documentation

Looses::~Looses ( )
virtual

Virtual destructor (empty)

Definition at line 16 of file Looses.cc.

References summary().

16 { summary(); }
void summary()
Printing.
Definition: Looses.cc:34
Looses::Looses ( )
private

Definition at line 9 of file Looses.cc.

Referenced by instance().

9 {}

Member Function Documentation

void Looses::count ( const std::string &  name,
unsigned  cut 
)

Counting.

Definition at line 19 of file Looses.cc.

References TkAlMuonSelectors_cfi::cut, mps_fire::i, dataset::name, and theLosses.

19  {
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 }
std::map< std::string, std::vector< unsigned > > theLosses
Definition: Looses.h:32
Looses * Looses::instance ( )
static

Constructor is not public (only one instance needed)

Definition at line 11 of file Looses.cc.

References Looses(), and myself.

11  {
12  if (!myself) myself = new Looses();
13  return myself;
14 }
Looses()
Definition: Looses.cc:9
static Looses * myself
Definition: Looses.h:29
void Looses::summary ( )

Printing.

Definition at line 34 of file Looses.cc.

References gather_cfg::cout, mps_fire::i, and theLosses.

Referenced by ~Looses().

34  {
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 }
std::map< std::string, std::vector< unsigned > > theLosses
Definition: Looses.h:32

Member Data Documentation

Looses * Looses::myself = 0
staticprivate

Definition at line 29 of file Looses.h.

Referenced by instance().

std::map< std::string, std::vector<unsigned> > Looses::theLosses
private

Definition at line 32 of file Looses.h.

Referenced by count(), and summary().