#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) |
Definition at line 18 of file EcalPyWrapperFunctions.h.
typedef std::vector<std::pair< std::string, float> > EcalPyWrapperHelper< T >::type_vValues [protected] |
Definition at line 56 of file EcalPyWrapperFunctions.h.
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){}
virtual type_vValues EcalPyWrapperHelper< T >::getValues | ( | const std::vector< T > & | vItems | ) | [protected, pure virtual] |
Implemented in cond::EcalDAQTowerStatusHelper, cond::EcalDCSTowerStatusHelper, cond::EcalDQMChannelStatusHelper, cond::EcalDQMTowerStatusHelper, cond::EcalGainRatiosHelper, cond::EcalPedestalsHelper, cond::EcalTPGCrystalStatusHelper, cond::EcalTPGLinearizationConstHelper, and cond::EcalTPGPedestalsHelper.
Referenced by EcalPyWrapperHelper< EcalDAQStatusCode >::printBarrelsEndcaps().
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(); }
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(); }
const unsigned int EcalPyWrapperHelper< T >::MEAN = 0 [static] |
Definition at line 20 of file EcalPyWrapperFunctions.h.
Referenced by EcalPyWrapperHelper< EcalDAQStatusCode >::printBarrelsEndcaps(), and EcalPyWrapperHelper< EcalDAQStatusCode >::printValues().
std::string EcalPyWrapperHelper< T >::names [protected] |
Definition at line 55 of file EcalPyWrapperFunctions.h.
Referenced by EcalPyWrapperHelper< EcalDAQStatusCode >::printBarrelsEndcaps().
unsigned int EcalPyWrapperHelper< T >::status [protected] |
Definition at line 54 of file EcalPyWrapperFunctions.h.
Referenced by EcalPyWrapperHelper< EcalDAQStatusCode >::printBarrelsEndcaps(), and EcalPyWrapperHelper< EcalDAQStatusCode >::printValues().
const unsigned int EcalPyWrapperHelper< T >::STATUS = 1 [static] |
Definition at line 21 of file EcalPyWrapperFunctions.h.
Referenced by EcalPyWrapperHelper< EcalDAQStatusCode >::printBarrelsEndcaps(), and EcalPyWrapperHelper< EcalDAQStatusCode >::printValues().
unsigned int EcalPyWrapperHelper< T >::total_values [protected] |
Definition at line 53 of file EcalPyWrapperFunctions.h.