CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
SiStripDQMHistoryHelper Class Referenceabstract

#include <SiStripDQMHistoryHelper.h>

Inheritance diagram for SiStripDQMHistoryHelper:
SiStripPopConHistoryDQMBase GenericHistoryDQM SiStripPopConHistoryDQM

Public Member Functions

 SiStripDQMHistoryHelper (const edm::ParameterSet &pset)
 
virtual ~SiStripDQMHistoryHelper ()
 

Protected Member Functions

virtual uint32_t returnDetComponent (const MonitorElement *ME) const =0
 
virtual void scanTreeAndFillSummary (const std::vector< MonitorElement * > &MEs, HDQMSummary *summary, const std::string &histoName, const std::vector< std::string > &Quantities) const
 
std::string sep () const
 
virtual bool setDBLabelsForGauss (const std::string &keyName, std::vector< std::string > &userDBContent) const
 
virtual bool setDBLabelsForLandau (const std::string &keyName, std::vector< std::string > &userDBContent) const
 
virtual bool setDBLabelsForStat (const std::string &keyName, std::vector< std::string > &userDBContent) const
 
virtual bool setDBLabelsForUser (const std::string &keyName, std::vector< std::string > &userDBContent, const std::string &quantity) const
 
virtual bool setDBLabelsForUser (const std::string &keyName, std::vector< std::string > &userDBContent) const
 
virtual bool setDBValuesForGauss (const MonitorElement *me, HDQMSummary::InputVector &values) const
 
virtual bool setDBValuesForLandau (const MonitorElement *me, HDQMSummary::InputVector &values) const
 
virtual bool setDBValuesForStat (const MonitorElement *me, HDQMSummary::InputVector &values) const
 
virtual bool setDBValuesForUser (const MonitorElement *me, HDQMSummary::InputVector &values, const std::string &quantity) const
 
virtual bool setDBValuesForUser (const MonitorElement *me, HDQMSummary::InputVector &values) const
 

Private Attributes

HDQMfitUtilities m_fitME
 
std::string m_sep
 
bool m_useFullPath
 

Detailed Description

Definition at line 10 of file SiStripDQMHistoryHelper.h.

Constructor & Destructor Documentation

SiStripDQMHistoryHelper::SiStripDQMHistoryHelper ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 13 of file SiStripDQMHistoryHelper.h.

References edm::ParameterSet::getUntrackedParameter(), m_fitME, m_sep, returnDetComponent(), and ~SiStripDQMHistoryHelper().

14  : m_useFullPath{pset.getUntrackedParameter<bool>("useFullPath", false)}
15  , m_sep{"@"}
16  , m_fitME{}
17  {}
T getUntrackedParameter(std::string const &, T const &) const
SiStripDQMHistoryHelper::~SiStripDQMHistoryHelper ( )
virtual

Definition at line 4 of file SiStripDQMHistoryHelper.cc.

Referenced by SiStripDQMHistoryHelper().

4 {}

Member Function Documentation

virtual uint32_t SiStripDQMHistoryHelper::returnDetComponent ( const MonitorElement ME) const
protectedpure virtual
void SiStripDQMHistoryHelper::scanTreeAndFillSummary ( const std::vector< MonitorElement * > &  MEs,
HDQMSummary summary,
const std::string &  histoName,
const std::vector< std::string > &  Quantities 
) const
protectedvirtual

Definition at line 6 of file SiStripDQMHistoryHelper.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, mps_fire::i, m_useFullPath, HDQMSummary::put(), returnDetComponent(), setDBLabelsForGauss(), setDBLabelsForLandau(), setDBLabelsForStat(), setDBLabelsForUser(), setDBValuesForGauss(), setDBValuesForLandau(), setDBValuesForStat(), setDBValuesForUser(), AlCaHLTBitMon_QueryRunRegistry::string, and MuonErrorMatrixValues_cff::values.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob(), and sep().

7 {
8  //
9  // -- Scan full root file and fill module numbers and histograms
10  //
11  //-----------------------------------------------------------------------------------------------
12 
13  edm::LogInfo("DQMHistoryServiceBase") << "[DQMHistoryServiceBase::scanTreeAndFillSummary] keyName " << keyName;
14 
15  std::stringstream ss;
16 
17  // Use boost regex for more flexibility
18  boost::regex re;
19  try {
20  re.assign(keyName);
21  } catch ( boost::regex_error& e ) {
22  std::cout << "Error: " << keyName << " is not a valid regular expression: \""
23  << e.what() << "\"" << std::endl;
24  std::cout << "Skip search for matches" << std::endl;
25  return;
26  }
27  for ( const MonitorElement* me : MEs ) {
28  // Name including path
29  std::string me_name;
30  if ( m_useFullPath ) {
31  me_name = me->getFullname();
32  } else {
33  me_name = me->getName();
34  // If the line does not start with a "^" add it
35  if( me_name.find("^") != 0 ) {
36  me_name = "^" + me_name;
37  }
38  }
39  // regex_search has grep-like behaviour
40  if ( boost::regex_search(me_name, re) ) {
41 
43  std::vector<std::string> userDBContent;
44 
45  ss << "\nFound compatible ME " << me_name << " for key " << keyName << std::endl;
46 
47  for ( const std::string& quant : Quantities ) {
48  if ( quant == "landau" ) {
49  setDBLabelsForLandau(keyName, userDBContent);
50  setDBValuesForLandau(me, values);
51  } else if ( quant == "gauss" ) {
52  setDBLabelsForGauss(keyName, userDBContent);
53  setDBValuesForGauss(me, values);
54  } else if ( quant == "stat" ) {
55  setDBLabelsForStat(keyName, userDBContent);
56  setDBValuesForStat(me, values);
57  } else {
58  setDBLabelsForUser(keyName, userDBContent, quant);
59  setDBValuesForUser(me, values, quant);
60  }
61  }
62  uint32_t detid = returnDetComponent(me);
63 
64  ss << "detid " << detid << " \n";
65  for ( size_t i = 0; i < values.size(); ++i )
66  ss << "Quantity " << userDBContent[i] << " value " << values[i] << std::endl;
67 
68  summary->put(detid, values, userDBContent);
69  }
70  }
71  edm::LogInfo("DQMHistoryServiceBase") << "[DQMHistoryServiceBase::scanTreeAndFillSummary] " << ss.str();
72 }
bool put(const uint32_t &detID, InputVector &input, std::vector< std::string > &userContent)
Definition: HDQMSummary.cc:26
virtual bool setDBLabelsForUser(const std::string &keyName, std::vector< std::string > &userDBContent, const std::string &quantity) const
virtual bool setDBValuesForStat(const MonitorElement *me, HDQMSummary::InputVector &values) const
virtual bool setDBLabelsForStat(const std::string &keyName, std::vector< std::string > &userDBContent) const
std::vector< float > InputVector
Definition: HDQMSummary.h:62
virtual bool setDBLabelsForLandau(const std::string &keyName, std::vector< std::string > &userDBContent) const
virtual bool setDBValuesForGauss(const MonitorElement *me, HDQMSummary::InputVector &values) const
virtual uint32_t returnDetComponent(const MonitorElement *ME) const =0
quant
Definition: HTMonitor.h:44
virtual bool setDBValuesForUser(const MonitorElement *me, HDQMSummary::InputVector &values, const std::string &quantity) const
virtual bool setDBLabelsForGauss(const std::string &keyName, std::vector< std::string > &userDBContent) const
virtual bool setDBValuesForLandau(const MonitorElement *me, HDQMSummary::InputVector &values) const
std::string SiStripDQMHistoryHelper::sep ( ) const
inlineprotected
bool SiStripDQMHistoryHelper::setDBLabelsForGauss ( const std::string &  keyName,
std::vector< std::string > &  userDBContent 
) const
protectedvirtual

Definition at line 83 of file SiStripDQMHistoryHelper.cc.

References sep(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob(), scanTreeAndFillSummary(), and sep().

84 {
85  userDBContent.push_back(keyName+sep()+std::string("gaussMean"));
86  userDBContent.push_back(keyName+sep()+std::string("gaussSigma"));
87  userDBContent.push_back(keyName+sep()+std::string("gaussChi2NDF"));
88  return true;
89 }
bool SiStripDQMHistoryHelper::setDBLabelsForLandau ( const std::string &  keyName,
std::vector< std::string > &  userDBContent 
) const
protectedvirtual

Definition at line 74 of file SiStripDQMHistoryHelper.cc.

References sep(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob(), scanTreeAndFillSummary(), and sep().

75 {
76  userDBContent.push_back(keyName+sep()+std::string("landauPeak"));
77  userDBContent.push_back(keyName+sep()+std::string("landauPeakErr"));
78  userDBContent.push_back(keyName+sep()+std::string("landauSFWHM"));
79  userDBContent.push_back(keyName+sep()+std::string("landauChi2NDF"));
80  return true;
81 }
bool SiStripDQMHistoryHelper::setDBLabelsForStat ( const std::string &  keyName,
std::vector< std::string > &  userDBContent 
) const
protectedvirtual

Definition at line 91 of file SiStripDQMHistoryHelper.cc.

References sep(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob(), scanTreeAndFillSummary(), and sep().

92 {
93  userDBContent.push_back(keyName+sep()+std::string("entries"));
94  userDBContent.push_back(keyName+sep()+std::string("mean"));
95  userDBContent.push_back(keyName+sep()+std::string("rms"));
96  return true;
97 }
virtual bool SiStripDQMHistoryHelper::setDBLabelsForUser ( const std::string &  keyName,
std::vector< std::string > &  userDBContent,
const std::string &  quantity 
) const
inlineprotectedvirtual

Reimplemented in SiStripPopConHistoryDQM, and GenericHistoryDQM.

Definition at line 29 of file SiStripDQMHistoryHelper.h.

References setDBLabelsForUser().

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob(), scanTreeAndFillSummary(), and setDBLabelsForUser().

29 { return setDBLabelsForUser(keyName, userDBContent); }
virtual bool setDBLabelsForUser(const std::string &keyName, std::vector< std::string > &userDBContent, const std::string &quantity) const
virtual bool SiStripDQMHistoryHelper::setDBLabelsForUser ( const std::string &  keyName,
std::vector< std::string > &  userDBContent 
) const
inlineprotectedvirtual
bool SiStripDQMHistoryHelper::setDBValuesForGauss ( const MonitorElement me,
HDQMSummary::InputVector values 
) const
protectedvirtual

Definition at line 110 of file SiStripDQMHistoryHelper.cc.

References HDQMfitUtilities::doGaussFit(), HDQMfitUtilities::getFitChi(), HDQMfitUtilities::getFitnDof(), HDQMfitUtilities::getGaussPar(), and m_fitME.

Referenced by scanTreeAndFillSummary(), and setDBLabelsForUser().

111 {
112  m_fitME.doGaussFit(const_cast<MonitorElement*>(me));
113  values.push_back( m_fitME.getGaussPar("mean") );
114  values.push_back( m_fitME.getGaussPar("sigma") );
115  if (m_fitME.getFitnDof()!=0 ) values.push_back( m_fitME.getFitChi()/m_fitME.getFitnDof() );
116  else values.push_back(-99.);
117  return true;
118 }
double doGaussFit(MonitorElement *ME)
double getGaussPar(std::string s)
bool SiStripDQMHistoryHelper::setDBValuesForLandau ( const MonitorElement me,
HDQMSummary::InputVector values 
) const
protectedvirtual

Definition at line 99 of file SiStripDQMHistoryHelper.cc.

References HDQMfitUtilities::doLanGaussFit(), HDQMfitUtilities::getFitChi(), HDQMfitUtilities::getFitnDof(), HDQMfitUtilities::getLanGaussConv(), HDQMfitUtilities::getLanGaussPar(), HDQMfitUtilities::getLanGaussParErr(), and m_fitME.

Referenced by scanTreeAndFillSummary(), and setDBLabelsForUser().

100 {
101  m_fitME.doLanGaussFit(const_cast<MonitorElement*>(me));
102  values.push_back( m_fitME.getLanGaussPar("mpv") );
103  values.push_back( m_fitME.getLanGaussParErr("mpv") );
104  values.push_back( m_fitME.getLanGaussConv("fwhm") );
105  if (m_fitME.getFitnDof()!=0 ) values.push_back( m_fitME.getFitChi()/m_fitME.getFitnDof() );
106  else values.push_back(-99.);
107  return true;
108 }
double getLanGaussParErr(std::string s)
double getLanGaussConv(std::string s)
double getLanGaussPar(std::string s)
double doLanGaussFit(MonitorElement *ME)
bool SiStripDQMHistoryHelper::setDBValuesForStat ( const MonitorElement me,
HDQMSummary::InputVector values 
) const
protectedvirtual

Definition at line 120 of file SiStripDQMHistoryHelper.cc.

References MonitorElement::getEntries(), MonitorElement::getMean(), and MonitorElement::getRMS().

Referenced by scanTreeAndFillSummary(), and setDBLabelsForUser().

121 {
122  values.push_back( me->getEntries());
123  values.push_back( me->getMean());
124  values.push_back( me->getRMS());
125  return true;
126 }
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double getEntries() const
get # of entries
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual bool SiStripDQMHistoryHelper::setDBValuesForUser ( const MonitorElement me,
HDQMSummary::InputVector values,
const std::string &  quantity 
) const
inlineprotectedvirtual

Reimplemented in SiStripPopConHistoryDQM, and GenericHistoryDQM.

Definition at line 35 of file SiStripDQMHistoryHelper.h.

References setDBValuesForUser().

Referenced by scanTreeAndFillSummary(), and setDBValuesForUser().

35 { return setDBValuesForUser(me, values); }
virtual bool setDBValuesForUser(const MonitorElement *me, HDQMSummary::InputVector &values, const std::string &quantity) const
virtual bool SiStripDQMHistoryHelper::setDBValuesForUser ( const MonitorElement me,
HDQMSummary::InputVector values 
) const
inlineprotectedvirtual

Definition at line 36 of file SiStripDQMHistoryHelper.h.

36 { return false; }

Member Data Documentation

HDQMfitUtilities SiStripDQMHistoryHelper::m_fitME
mutableprivate
std::string SiStripDQMHistoryHelper::m_sep
private

Definition at line 40 of file SiStripDQMHistoryHelper.h.

Referenced by sep(), and SiStripDQMHistoryHelper().

bool SiStripDQMHistoryHelper::m_useFullPath
private

Definition at line 39 of file SiStripDQMHistoryHelper.h.

Referenced by scanTreeAndFillSummary().