CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions

EcalPyWrapperHelper< T > Class Template Reference

#include <EcalPyWrapperFunctions.h>

List of all members.

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.

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

Member Function Documentation

template<class T>
virtual type_vValues EcalPyWrapperHelper< T >::getValues ( const std::vector< T > &  vItems) [protected, pure 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().

                                                                                                           {
                std::stringstream ss;

                //print barrels:
                type_vValues barrelsVec = getValues(barrelItems);
                unsigned int barrelsTotal = barrelItems.size();
                ss << std::endl << "---Barrels. Total: " << barrelsTotal << std::endl;
                        switch (status){
                                case (MEAN)  : ss << names << std::endl; break;
                                case (STATUS): ss << "-With errors: " << std::endl; break;// << ecalcond::bad(barrelItems) << std::endl; break;
                                default      : break;
                        }
                ss << printValues(barrelsVec, barrelsTotal);

                //print endcaps:
                type_vValues endcapVec = getValues(endcapItems);
                unsigned int endcapTotal = endcapItems.size();
                ss << std::endl << "---Endcaps. Total: " << endcapTotal << std::endl;
                        switch (status){
                                case (MEAN)  : ss << names << std::endl; break;
                                case (STATUS): ss << "-With errors: " << std::endl; break;// << ecalcond::bad(endcapItems) << std::endl; break;
                                default      : break;
                        }
                ss << printValues(endcapVec, endcapTotal);      

                return ss.str();
        }
template<class T>
std::string EcalPyWrapperHelper< T >::printValues ( const type_vValues vValues,
const unsigned int &  total 
) [inline, private]

Definition at line 95 of file EcalPyWrapperFunctions.h.

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

                                                                                        {
                std::stringstream ss;

                for (type_vValues::const_iterator iVal = vValues.begin(); iVal != vValues.end(); ++iVal){
                        switch (status){
                                case (MEAN)  : ss << iVal->first << ": " << ((iVal->second)/total) << std::endl; break;
                                case (STATUS): if (iVal->second != 0) {ss << iVal->first << ": " << ((iVal->second)) << std::endl; break;} else {break; }
                                default      : break;
                        }
                        
                }
                return ss.str();
        }

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>
unsigned int EcalPyWrapperHelper< T >::status [protected]
template<class T>
const unsigned int EcalPyWrapperHelper< T >::STATUS = 1 [static]
template<class T>
unsigned int EcalPyWrapperHelper< T >::total_values [protected]

Definition at line 53 of file EcalPyWrapperFunctions.h.