CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiPixelHistoryDQMService Class Reference

#include <SiPixelHistoryDQMService.h>

Inheritance diagram for SiPixelHistoryDQMService:
DQMHistoryServiceBase

List of all members.

Public Member Functions

 SiPixelHistoryDQMService (const edm::ParameterSet &, const edm::ActivityRegistry &)
 ~SiPixelHistoryDQMService ()

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_

Detailed Description

Author:
Dean Andrew Hidas <dhidas@cern.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.

: DQMHistoryServiceBase::DQMHistoryServiceBase(iConfig, aReg), iConfig_(iConfig)
{
  //setSeperator("@@#@@"); // Change the seperator used in DB
  edm::LogInfo("SiPixelHistoryDQMService") <<  "[SiPixelHistoryDQMService::SiPixelHistoryDQMService]";
}
SiPixelHistoryDQMService::~SiPixelHistoryDQMService ( )

Definition at line 16 of file SiPixelHistoryDQMService.cc.

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

Member Function Documentation

uint32_t SiPixelHistoryDQMService::returnDetComponent ( const MonitorElement ME) [private, virtual]

Reimplemented from DQMHistoryServiceBase.

Definition at line 21 of file SiPixelHistoryDQMService.cc.

References sipixelsummary::Barrel, 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, and sistripsummary::TRACKER.

                                                                             {
  LogTrace("SiPixelHistoryDQMService") <<  "[SiPixelHistoryDQMService::returnDetComponent]";
  std::string str=ME->getName();
  size_t __key_length__=7;
  size_t __detid_length__=9;


  if(str.find("__det__")!= std::string::npos){
    return atoi(str.substr(str.find("__det__")+__key_length__,__detid_length__).c_str());
  }
  else if(str.find("Barrel")!= std::string::npos)
  {return sipixelsummary::Barrel;}
  else if(str.find("Shell_mI")!= std::string::npos)
  {return sipixelsummary::Shell_mI;}
  else if(str.find("Shell_mO")!= std::string::npos)
  {return sipixelsummary::Shell_mO;}
  else if(str.find("Shell_pI")!= std::string::npos)
  {return sipixelsummary::Shell_pI;}
  else if(str.find("Shell_pO")!= std::string::npos)
  {return sipixelsummary::Shell_pO;}
  else if(str.find("Endcap")!= std::string::npos)
  {return sipixelsummary::Endcap;}
  else if(str.find("HalfCylinder_mI")!= std::string::npos)
  {return sipixelsummary::HalfCylinder_mI;}
  else if(str.find("HalfCylinder_mO")!= std::string::npos)
  {return sipixelsummary::HalfCylinder_mO;}
  else if(str.find("HalfCylinder_pI")!= std::string::npos)
  {return sipixelsummary::HalfCylinder_pI;}
  else if(str.find("HalfCylinder_pO")!= std::string::npos)
  {return sipixelsummary::HalfCylinder_pO;}
  else {
    return sipixelsummary::TRACKER; //Full Tracker
  }

}
bool SiPixelHistoryDQMService::setDBLabelsForUser ( std::string &  keyName,
std::vector< std::string > &  userDBContent,
std::string &  quantity 
) [private, virtual]

Reimplemented from DQMHistoryServiceBase.

Definition at line 62 of file SiPixelHistoryDQMService.cc.

References DQMHistoryServiceBase::fSep.

                                                                                                                               {
  if (quantity == "user_ymean") {
    userDBContent.push_back(keyName+fSep+std::string("yMean"));
    userDBContent.push_back(keyName+fSep+std::string("yError"));
  } else if (quantity == "user_A") {
    userDBContent.push_back(keyName+fSep+std::string("NTracksPixOverAll"));
    userDBContent.push_back(keyName+fSep+std::string("NTracksPixOverAllError"));
  } else if (quantity == "user_B") {
    userDBContent.push_back(keyName+fSep+std::string("NTracksFPixOverBPix"));
    userDBContent.push_back(keyName+fSep+std::string("NTracksFPixOverBPixError"));
  } else {
    edm::LogError("SiPixelHistoryDQMService") << "ERROR: quantity does not exist in SiPixelHistoryDQMService::setDBValuesForUser(): " << quantity;
    return false;
  }
  return true;
}
bool SiPixelHistoryDQMService::setDBValuesForUser ( std::vector< MonitorElement * >::const_iterator  iterMes,
HDQMSummary::InputVector values,
std::string &  quantity 
) [private, virtual]

Reimplemented from DQMHistoryServiceBase.

Definition at line 78 of file SiPixelHistoryDQMService.cc.

References gather_cfg::cout.

                                                                                                                                                        {

  if (quantity == "user_ymean") {
    TH1F* Hist = (TH1F*) (*iterMes)->getTH1F()->Clone();
    // if( Hist == 0 || Hist->Integral() == 0 ) {
    //   std::cout << "Error: histogram not found or empty!!" << std::endl;
    //   values.push_back( 0. );
    //   values.push_back( 0. );
    // }
    // else
    // if(  ) {
    Hist->Fit("pol0");
    TF1* Fit = Hist->GetFunction("pol0");
    float FitValue = Fit ? Fit->GetParameter(0) : 0;
    float FitError = Fit ? Fit->GetParError(0) : 0;
    std::cout << "FITERROR: " << FitError << std::endl;

    values.push_back( FitValue );
    values.push_back( FitError );
    // }
  } else if (quantity == "user_A") {
    TH1F* Hist = (TH1F*) (*iterMes)->getTH1F();
    if( Hist->GetBinContent(1) != 0 && Hist->GetBinContent(2) != 0 ) {
      values.push_back( Hist->GetBinContent(2) / Hist->GetBinContent(1) );
      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) )) );
    }
    else {
      values.push_back( 0. );
      values.push_back( 0. );
    }
  } else if (quantity == "user_B") {
    TH1F* Hist = (TH1F*) (*iterMes)->getTH1F();
    if( Hist->GetBinContent(3) != 0 && Hist->GetBinContent(4) != 0 ) {
      values.push_back( Hist->GetBinContent(4) / Hist->GetBinContent(3) );
      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) )) );
    }
    else {
      values.push_back( 0. );
      values.push_back( 0. );
    }
  } else {
    edm::LogError("SiPixelHistoryDQMService") << "ERROR: quantity does not exist in SiPixelHistoryDQMService::setDBValuesForUser(): " << quantity;
    return false;
  }

  return true;
}

Member Data Documentation

Reimplemented from DQMHistoryServiceBase.

Definition at line 27 of file SiPixelHistoryDQMService.h.