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 = nullptr
 

Detailed Description

Definition at line 9 of file Looses.h.

Constructor & Destructor Documentation

◆ ~Looses()

Looses::~Looses ( )
virtual

Virtual destructor (empty)

Definition at line 17 of file Looses.cc.

References summary().

17 { summary(); }
void summary()
Printing.
Definition: Looses.cc:31

◆ Looses()

Looses::Looses ( )
private

Definition at line 9 of file Looses.cc.

Referenced by instance().

9 {}

Member Function Documentation

◆ count()

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

Counting.

Definition at line 19 of file Looses.cc.

References DMR_cfg::cut, mps_fire::i, mergeVDriftHistosByStation::name, and theLosses.

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

◆ instance()

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)
13  myself = new Looses();
14  return myself;
15 }
Looses()
Definition: Looses.cc:9
static Looses * myself
Definition: Looses.h:29

◆ summary()

void Looses::summary ( )

Printing.

Definition at line 31 of file Looses.cc.

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

Referenced by ~Looses().

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

Member Data Documentation

◆ myself

Looses * Looses::myself = nullptr
staticprivate

Definition at line 29 of file Looses.h.

Referenced by instance().

◆ theLosses

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

Definition at line 32 of file Looses.h.

Referenced by count(), and summary().