CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelHistoryDQMService Class Reference

#include <SiPixelHistoryDQMService.h>

Inheritance diagram for SiPixelHistoryDQMService:
DQMHistoryServiceBase

Public Member Functions

 SiPixelHistoryDQMService (const edm::ParameterSet &, const edm::ActivityRegistry &)
 
 ~SiPixelHistoryDQMService ()
 
- Public Member Functions inherited from DQMHistoryServiceBase
virtual bool checkForCompatibility (std::string ss)
 
 DQMHistoryServiceBase (const edm::ParameterSet &, const edm::ActivityRegistry &)
 
virtual void getMetaDataString (std::stringstream &ss)
 
virtual void getObj (HDQMSummary *&obj)
 
virtual void initialize ()
 
virtual void setSeparator (std::string const &)
 
virtual ~DQMHistoryServiceBase ()
 

Private Member Functions

uint32_t returnDetComponent (const MonitorElement *ME)
 
bool setDBLabelsForUser (std::string &keyName, std::vector< std::string > &userDBContent, std::string &quantity)
 
bool setDBValuesForUser (std::vector< MonitorElement * >::const_iterator iterMes, HDQMSummary::InputVector &values, std::string &quantity)
 

Private Attributes

edm::ParameterSet iConfig_
 

Additional Inherited Members

- Protected Member Functions inherited from DQMHistoryServiceBase
virtual void createSummary ()
 
virtual uint32_t getRunNumber () const
 
virtual void openRequestedFile ()
 
virtual void scanTreeAndFillSummary (const std::vector< MonitorElement * > &MEs, HDQMSummary *summary, std::string &histoName, std::vector< std::string > &Quantities)
 
virtual bool setDBLabelsForGauss (std::string &keyName, std::vector< std::string > &userDBContent)
 
virtual bool setDBLabelsForLandau (std::string &keyName, std::vector< std::string > &userDBContent)
 
virtual bool setDBLabelsForStat (std::string &keyName, std::vector< std::string > &userDBContent)
 
virtual bool setDBLabelsForUser (std::string &keyName, std::vector< std::string > &userDBContent)
 
virtual bool setDBValuesForGauss (std::vector< MonitorElement * >::const_iterator iterMes, HDQMSummary::InputVector &values)
 
virtual bool setDBValuesForLandau (std::vector< MonitorElement * >::const_iterator iterMes, HDQMSummary::InputVector &values)
 
virtual bool setDBValuesForStat (std::vector< MonitorElement * >::const_iterator iterMes, HDQMSummary::InputVector &values)
 
virtual bool setDBValuesForUser (std::vector< MonitorElement * >::const_iterator iterMes, HDQMSummary::InputVector &values)
 
- Protected Attributes inherited from DQMHistoryServiceBase
DQMStoredqmStore_
 
HDQMfitUtilitiesfitME
 
std::string fSep
 
edm::ParameterSet iConfig_
 
HDQMSummaryobj_
 

Detailed Description

Author
Dean Andrew Hidas dhida.nosp@m.s@ce.nosp@m.rn.ch

Definition at line 13 of file SiPixelHistoryDQMService.h.

Constructor & Destructor Documentation

SiPixelHistoryDQMService::SiPixelHistoryDQMService ( const edm::ParameterSet iConfig,
const edm::ActivityRegistry aReg 
)
explicit

Definition at line 8 of file SiPixelHistoryDQMService.cc.

10 {
11  //setSeperator("@@#@@"); // Change the seperator used in DB
12  edm::LogInfo("SiPixelHistoryDQMService") << "[SiPixelHistoryDQMService::SiPixelHistoryDQMService]";
13 }
DQMHistoryServiceBase(const edm::ParameterSet &, const edm::ActivityRegistry &)
SiPixelHistoryDQMService::~SiPixelHistoryDQMService ( )

Definition at line 16 of file SiPixelHistoryDQMService.cc.

16  {
17  edm::LogInfo("SiPixelHistoryDQMService") << "[SiPixelHistoryDQMService::~SiPixelHistoryDQMService]";
18 }

Member Function Documentation

uint32_t SiPixelHistoryDQMService::returnDetComponent ( const MonitorElement ME)
privatevirtual

Reimplemented from DQMHistoryServiceBase.

Definition at line 21 of file SiPixelHistoryDQMService.cc.

References sipixelsummary::Barrel, sipixelsummary::Endcap, MonitorElement::getName(), sipixelsummary::HalfCylinder_mI, sipixelsummary::HalfCylinder_mO, sipixelsummary::HalfCylinder_pI, sipixelsummary::HalfCylinder_pO, LogTrace, sipixelsummary::Shell_mI, sipixelsummary::Shell_mO, sipixelsummary::Shell_pI, sipixelsummary::Shell_pO, AlCaHLTBitMon_QueryRunRegistry::string, and sipixelsummary::TRACKER.

21  {
22  LogTrace("SiPixelHistoryDQMService") << "[SiPixelHistoryDQMService::returnDetComponent]";
23  std::string str=ME->getName();
24  size_t __key_length__=7;
25  size_t __detid_length__=9;
26 
27 
28  if(str.find("__det__")!= std::string::npos){
29  return atoi(str.substr(str.find("__det__")+__key_length__,__detid_length__).c_str());
30  }
31  else if(str.find("Barrel")!= std::string::npos)
32  {return sipixelsummary::Barrel;}
33  else if(str.find("Shell_mI")!= std::string::npos)
34  {return sipixelsummary::Shell_mI;}
35  else if(str.find("Shell_mO")!= std::string::npos)
36  {return sipixelsummary::Shell_mO;}
37  else if(str.find("Shell_pI")!= std::string::npos)
38  {return sipixelsummary::Shell_pI;}
39  else if(str.find("Shell_pO")!= std::string::npos)
40  {return sipixelsummary::Shell_pO;}
41  else if(str.find("Endcap")!= std::string::npos)
42  {return sipixelsummary::Endcap;}
43  else if(str.find("HalfCylinder_mI")!= std::string::npos)
45  else if(str.find("HalfCylinder_mO")!= std::string::npos)
47  else if(str.find("HalfCylinder_pI")!= std::string::npos)
49  else if(str.find("HalfCylinder_pO")!= std::string::npos)
51  else {
52  return sipixelsummary::TRACKER; //Full Tracker
53  }
54 
55 }
const std::string & getName(void) const
get name of ME
#define LogTrace(id)
bool SiPixelHistoryDQMService::setDBLabelsForUser ( std::string &  keyName,
std::vector< std::string > &  userDBContent,
std::string &  quantity 
)
privatevirtual

Reimplemented from DQMHistoryServiceBase.

Definition at line 62 of file SiPixelHistoryDQMService.cc.

References DQMHistoryServiceBase::fSep, and AlCaHLTBitMon_QueryRunRegistry::string.

62  {
63  if (quantity == "user_ymean") {
64  userDBContent.push_back(keyName+fSep+std::string("yMean"));
65  userDBContent.push_back(keyName+fSep+std::string("yError"));
66  } else if (quantity == "user_A") {
67  userDBContent.push_back(keyName+fSep+std::string("NTracksPixOverAll"));
68  userDBContent.push_back(keyName+fSep+std::string("NTracksPixOverAllError"));
69  } else if (quantity == "user_B") {
70  userDBContent.push_back(keyName+fSep+std::string("NTracksFPixOverBPix"));
71  userDBContent.push_back(keyName+fSep+std::string("NTracksFPixOverBPixError"));
72  } else {
73  edm::LogError("SiPixelHistoryDQMService") << "ERROR: quantity does not exist in SiPixelHistoryDQMService::setDBValuesForUser(): " << quantity;
74  return false;
75  }
76  return true;
77 }
bool SiPixelHistoryDQMService::setDBValuesForUser ( std::vector< MonitorElement * >::const_iterator  iterMes,
HDQMSummary::InputVector values,
std::string &  quantity 
)
privatevirtual

Reimplemented from DQMHistoryServiceBase.

Definition at line 78 of file SiPixelHistoryDQMService.cc.

References gather_cfg::cout.

78  {
79 
80  if (quantity == "user_ymean") {
81  TH1F* Hist = (TH1F*) (*iterMes)->getTH1F()->Clone();
82  // if( Hist == 0 || Hist->Integral() == 0 ) {
83  // std::cout << "Error: histogram not found or empty!!" << std::endl;
84  // values.push_back( 0. );
85  // values.push_back( 0. );
86  // }
87  // else
88  // if( ) {
89  Hist->Fit("pol0");
90  TF1* Fit = Hist->GetFunction("pol0");
91  float FitValue = Fit ? Fit->GetParameter(0) : 0;
92  float FitError = Fit ? Fit->GetParError(0) : 0;
93  std::cout << "FITERROR: " << FitError << std::endl;
94 
95  values.push_back( FitValue );
96  values.push_back( FitError );
97  // }
98  } else if (quantity == "user_A") {
99  TH1F* Hist = (TH1F*) (*iterMes)->getTH1F();
100  if( Hist->GetBinContent(1) != 0 && Hist->GetBinContent(2) != 0 ) {
101  values.push_back( Hist->GetBinContent(2) / Hist->GetBinContent(1) );
102  values.push_back( TMath::Abs(Hist->GetBinContent(2) / Hist->GetBinContent(1)) * TMath::Sqrt( ( TMath::Power( Hist->GetBinError(1)/Hist->GetBinContent(1), 2) + TMath::Power( Hist->GetBinError(2)/Hist->GetBinContent(2), 2) )) );
103  }
104  else {
105  values.push_back( 0. );
106  values.push_back( 0. );
107  }
108  } else if (quantity == "user_B") {
109  TH1F* Hist = (TH1F*) (*iterMes)->getTH1F();
110  if( Hist->GetBinContent(3) != 0 && Hist->GetBinContent(4) != 0 ) {
111  values.push_back( Hist->GetBinContent(4) / Hist->GetBinContent(3) );
112  values.push_back( TMath::Abs(Hist->GetBinContent(4) / Hist->GetBinContent(3)) * TMath::Sqrt( ( TMath::Power( Hist->GetBinError(3)/Hist->GetBinContent(3), 2) + TMath::Power( Hist->GetBinError(4)/Hist->GetBinContent(4), 2) )) );
113  }
114  else {
115  values.push_back( 0. );
116  values.push_back( 0. );
117  }
118  } else {
119  edm::LogError("SiPixelHistoryDQMService") << "ERROR: quantity does not exist in SiPixelHistoryDQMService::setDBValuesForUser(): " << quantity;
120  return false;
121  }
122 
123  return true;
124 }
Definition: Fit.h:34
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

edm::ParameterSet SiPixelHistoryDQMService::iConfig_
private

Definition at line 27 of file SiPixelHistoryDQMService.h.