CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
EcalPyWrapperHelper< T > Class Template Referenceabstract

#include <EcalPyWrapperFunctions.h>

Public Member Functions

 EcalPyWrapperHelper (unsigned int totalValues, unsigned int status=0, std::string names="-Means: ")
 
std::string printBarrelsEndcaps (const std::vector< T > &barrelItems, const std::vector< T > &endcapItems)
 

Static Public Attributes

static const unsigned int MEAN = 0
 
static const unsigned int STATUS = 1
 

Protected Types

typedef std::vector< std::pair
< std::string, float > > 
type_vValues
 

Protected Member Functions

virtual type_vValues getValues (const std::vector< T > &vItems)=0
 

Protected Attributes

std::string names
 
unsigned int status
 
unsigned int total_values
 

Private Member Functions

std::string printValues (const type_vValues &vValues, const unsigned int &total)
 

Detailed Description

template<class T>
class EcalPyWrapperHelper< T >

Definition at line 18 of file EcalPyWrapperFunctions.h.

Member Typedef Documentation

template<class T>
typedef std::vector<std::pair< std::string, float> > EcalPyWrapperHelper< T >::type_vValues
protected

Definition at line 56 of file EcalPyWrapperFunctions.h.

Constructor & Destructor Documentation

template<class T>
EcalPyWrapperHelper< T >::EcalPyWrapperHelper ( unsigned int  totalValues,
unsigned int  status = 0,
std::string  names = "-Means: " 
)
inline

Definition at line 23 of file EcalPyWrapperFunctions.h.

23 : "):total_values(totalValues), status(status), names(names){}

Member Function Documentation

template<class T>
virtual type_vValues EcalPyWrapperHelper< T >::getValues ( const std::vector< T > &  vItems)
protectedpure virtual
template<class T>
std::string EcalPyWrapperHelper< T >::printBarrelsEndcaps ( const std::vector< T > &  barrelItems,
const std::vector< T > &  endcapItems 
)
inline

Definition at line 25 of file EcalPyWrapperFunctions.h.

Referenced by cond::PayLoadInspector< DataT >::summary().

25  {
26  std::stringstream ss;
27 
28  //print barrels:
29  type_vValues barrelsVec = getValues(barrelItems);
30  unsigned int barrelsTotal = barrelItems.size();
31  ss << std::endl << "---Barrels. Total: " << barrelsTotal << std::endl;
32  switch (status){
33  case (MEAN) : ss << names << std::endl; break;
34  case (STATUS): ss << "-With errors: " << std::endl; break;// << ecalcond::bad(barrelItems) << std::endl; break;
35  default : break;
36  }
37  ss << printValues(barrelsVec, barrelsTotal);
38 
39  //print endcaps:
40  type_vValues endcapVec = getValues(endcapItems);
41  unsigned int endcapTotal = endcapItems.size();
42  ss << std::endl << "---Endcaps. Total: " << endcapTotal << std::endl;
43  switch (status){
44  case (MEAN) : ss << names << std::endl; break;
45  case (STATUS): ss << "-With errors: " << std::endl; break;// << ecalcond::bad(endcapItems) << std::endl; break;
46  default : break;
47  }
48  ss << printValues(endcapVec, endcapTotal);
49 
50  return ss.str();
51  }
static const unsigned int STATUS
std::vector< std::pair< std::string, float > > type_vValues
std::string printValues(const type_vValues &vValues, const unsigned int &total)
virtual type_vValues getValues(const std::vector< T > &vItems)=0
static const unsigned int MEAN
template<class T>
std::string EcalPyWrapperHelper< T >::printValues ( const type_vValues vValues,
const unsigned int &  total 
)
inlineprivate

Definition at line 95 of file EcalPyWrapperFunctions.h.

Referenced by EcalPyWrapperHelper< EcalDAQStatusCode >::printBarrelsEndcaps().

95  {
96  std::stringstream ss;
97 
98  for (type_vValues::const_iterator iVal = vValues.begin(); iVal != vValues.end(); ++iVal){
99  switch (status){
100  case (MEAN) : ss << iVal->first << ": " << ((iVal->second)/total) << std::endl; break;
101  case (STATUS): if (iVal->second != 0) {ss << iVal->first << ": " << ((iVal->second)) << std::endl; break;} else {break; }
102  default : break;
103  }
104 
105  }
106  return ss.str();
107  }
static const unsigned int STATUS
static const unsigned int MEAN

Member Data Documentation

template<class T>
const unsigned int EcalPyWrapperHelper< T >::MEAN = 0
static
template<class T>
std::string EcalPyWrapperHelper< T >::names
protected
template<class T>
const unsigned int EcalPyWrapperHelper< T >::STATUS = 1
static
template<class T>
unsigned int EcalPyWrapperHelper< T >::status
protected
template<class T>
unsigned int EcalPyWrapperHelper< T >::total_values
protected

Definition at line 53 of file EcalPyWrapperFunctions.h.