12 edm::LogInfo(
"SiPixelHistoryDQMService") <<
"[SiPixelHistoryDQMService::SiPixelHistoryDQMService]";
17 edm::LogInfo(
"SiPixelHistoryDQMService") <<
"[SiPixelHistoryDQMService::~SiPixelHistoryDQMService]";
22 LogTrace(
"SiPixelHistoryDQMService") <<
"[SiPixelHistoryDQMService::returnDetComponent]";
24 size_t __key_length__=7;
25 size_t __detid_length__=9;
28 if(str.find(
"__det__")!= std::string::npos){
29 return atoi(str.substr(str.find(
"__det__")+__key_length__,__detid_length__).c_str());
31 else if(str.find(
"Barrel")!= std::string::npos)
33 else if(str.find(
"Shell_mI")!= std::string::npos)
35 else if(str.find(
"Shell_mO")!= std::string::npos)
37 else if(str.find(
"Shell_pI")!= std::string::npos)
39 else if(str.find(
"Shell_pO")!= std::string::npos)
41 else if(str.find(
"Endcap")!= std::string::npos)
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)
63 if (quantity ==
"user_ymean") {
66 }
else if (quantity ==
"user_A") {
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"));
73 edm::LogError(
"SiPixelHistoryDQMService") <<
"ERROR: quantity does not exist in SiPixelHistoryDQMService::setDBValuesForUser(): " << quantity;
80 if (quantity ==
"user_ymean") {
81 TH1F* Hist = (TH1F*) (*iterMes)->getTH1F()->Clone();
89 TF1
Fit(
"mypol0",
"pol0");
91 float FitValue = Fit.GetParameter(0) ;
92 float FitError = Fit.GetParError(0) ;
93 std::cout <<
"FITERROR: " << FitError << std::endl;
95 values.push_back( FitValue );
96 values.push_back( FitError );
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) )) );
105 values.push_back( 0. );
106 values.push_back( 0. );
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) )) );
115 values.push_back( 0. );
116 values.push_back( 0. );
119 edm::LogError(
"SiPixelHistoryDQMService") <<
"ERROR: quantity does not exist in SiPixelHistoryDQMService::setDBValuesForUser(): " << quantity;
const std::string & getName(void) const
get name of ME
SiPixelHistoryDQMService(const edm::ParameterSet &, const edm::ActivityRegistry &)
std::vector< float > InputVector
~SiPixelHistoryDQMService()
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)