Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64383
b: "refs/heads/CMSSW_7_1_X"
c: eb9815e
h: "refs/heads/CMSSW_7_1_X"
i:
  64381: 47ee109
  64379: 539c985
  64375: ef4e534
  64367: f8b04a4
  64351: a5edb2d
  64319: 4109e71
  64255: 9adaea7
v: v3
  • Loading branch information
Domenico Giordano committed Apr 6, 2009
1 parent ee20e73 commit b4b0337
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 82f76fd1a3f5d9423d7c163d852a0c36647fc4ea
"refs/heads/CMSSW_7_1_X": e4aab8d1aac2f2c1c7a725ca66d6c0c71e420a8e
"refs/heads/CMSSW_7_1_X": eb9815ecd7cc51d0106d0d8817a765f9268e8c2a
11 changes: 10 additions & 1 deletion trunk/DQMServices/Diagnostic/interface/DQMHistoryServiceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ class DQMHistoryServiceBase {
virtual void scanTreeAndFillSummary(const std::vector<MonitorElement*>& MEs, HDQMSummary* summary,std::string& histoName, std::vector<std::string>& Quantities);
virtual uint32_t getRunNumber() const;
virtual uint32_t returnDetComponent(std::string& str){return 999999;}


virtual bool setDBLabelsForLandau(std::string& keyName, std::vector<std::string>& userDBContent);
virtual bool setDBLabelsForGauss (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){return false;}

virtual bool setDBValuesForLandau(std::vector<MonitorElement*>::const_iterator iterMes, HDQMSummary::InputVector& values);
virtual bool setDBValuesForGauss(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 ){return false;}

DQMStore* dqmStore_;
edm::ParameterSet iConfig_;
Expand Down
121 changes: 70 additions & 51 deletions trunk/DQMServices/Diagnostic/src/DQMHistoryServiceBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ bool DQMHistoryServiceBase::checkForCompatibility(std::string ss){
return previousRun<getRunNumber();
}


void DQMHistoryServiceBase::createSummary(){

//LOOP OVER THE LIST OF SUMMARY OBJECTS TO INSERT IN DB
Expand All @@ -57,22 +56,14 @@ void DQMHistoryServiceBase::createSummary(){
std::vector<std::string> Quantities = ithistoList->getUntrackedParameter<std::vector<std::string> >("quantitiesToExtract");
for (size_t i=0;i<Quantities.size();++i){

if ( Quantities[i] == "landau" ){
userDBContent.push_back(keyName+std::string("@")+std::string("landauPeak"));
userDBContent.push_back(keyName+std::string("@")+std::string("landauPeakErr"));
userDBContent.push_back(keyName+std::string("@")+std::string("landauSFWHM"));
userDBContent.push_back(keyName+std::string("@")+std::string("landauChi2NDF"));
}
else if ( Quantities[i] == "gauss" ){
userDBContent.push_back(keyName+std::string("@")+std::string("gaussMean"));
userDBContent.push_back(keyName+std::string("@")+std::string("gaussSigma"));
userDBContent.push_back(keyName+std::string("@")+std::string("gaussChi2NDF"));
}
else if ( Quantities[i] == "stat" ){
userDBContent.push_back(keyName+std::string("@")+std::string("entries"));
userDBContent.push_back(keyName+std::string("@")+std::string("mean"));
userDBContent.push_back(keyName+std::string("@")+std::string("rms"));
}
if ( Quantities[i] == "landau" )
setDBLabelsForLandau(keyName, userDBContent);
else if ( Quantities[i] == "gauss" )
setDBLabelsForGauss(keyName, userDBContent);
else if ( Quantities[i] == "stat" )
setDBLabelsForStat(keyName, userDBContent);
else if ( Quantities[i] == "user" )
setDBLabelsForUser(keyName, userDBContent);
else{
edm::LogError("DQMHistoryServiceBase")
<< "Quantity " << Quantities[i]
Expand All @@ -85,7 +76,7 @@ void DQMHistoryServiceBase::createSummary(){
}
}
obj_->setUserDBContent(userDBContent);

std::stringstream ss;
ss << "[DQMHistoryServiceBase::scanTreeAndFillSummary] QUANTITIES TO BE INSERTED IN DB :" << std::endl;
std::vector<std::string> userDBContentA = obj_->getUserDBContent();
Expand Down Expand Up @@ -113,9 +104,6 @@ void DQMHistoryServiceBase::openRequestedFile() {

dqmStore_ = edm::Service<DQMStore>().operator->();

// ** FIXME ** //
dqmStore_->setVerbose(0); //add config param

if( iConfig_.getParameter<bool>("accessDQMFile") ){

std::string fileName = iConfig_.getUntrackedParameter<std::string>("FILE_NAME","");
Expand Down Expand Up @@ -152,38 +140,21 @@ void DQMHistoryServiceBase::scanTreeAndFillSummary(const std::vector<MonitorElem
for(size_t i=0;i<Quantities.size();++i){


if(Quantities[i] == "landau"){
userDBContent.push_back(keyName+std::string("@landauPeak"));
userDBContent.push_back(keyName+std::string("@landauPeakErr"));
userDBContent.push_back(keyName+std::string("@landauSFWHM"));
userDBContent.push_back(keyName+std::string("@landauChi2NDF"));

fitME->doLanGaussFit(*iterMes);
values.push_back( fitME->getLanGaussPar("mpv") );
values.push_back( fitME->getLanGaussParErr("mpv") );
values.push_back( fitME->getLanGaussConv("fwhm") );
if (fitME->getFitnDof()!=0 ) values.push_back( fitME->getFitChi()/fitME->getFitnDof() );
else values.push_back(-99.);
if(Quantities[i] == "landau"){
setDBLabelsForLandau(keyName, userDBContent);
setDBValuesForLandau(iterMes,values);
}
else if(Quantities[i] == "gauss"){
setDBLabelsForGauss(keyName, userDBContent);
setDBValuesForGauss(iterMes,values);
}
else if(Quantities[i] == "gauss"){
userDBContent.push_back(keyName+std::string("@gaussMean"));
userDBContent.push_back(keyName+std::string("@gaussSigma"));
userDBContent.push_back(keyName+std::string("@gaussChi2NDF"));

fitME->doGaussFit(*iterMes);
values.push_back( fitME->getGaussPar("mean") );
values.push_back( fitME->getGaussPar("sigma") );
if (fitME->getFitnDof()!=0 ) values.push_back( fitME->getFitChi()/fitME->getFitnDof() );
else values.push_back(-99.);
else if(Quantities[i] == "stat"){
setDBLabelsForStat(keyName, userDBContent);
setDBValuesForStat(iterMes,values);
}
else if(Quantities[i] == "stat"){
userDBContent.push_back(keyName+std::string("@entries"));
userDBContent.push_back(keyName+std::string("@mean"));
userDBContent.push_back(keyName+std::string("@rms"));

values.push_back( (*iterMes)->getEntries());
values.push_back( (*iterMes)->getMean());
values.push_back( (*iterMes)->getRMS());
else if ( Quantities[i] == "user" ){
setDBLabelsForUser(keyName, userDBContent);
setDBValuesForUser(iterMes,values);
}
}

Expand All @@ -201,6 +172,54 @@ void DQMHistoryServiceBase::scanTreeAndFillSummary(const std::vector<MonitorElem
edm::LogInfo("DQMHistoryServiceBase") << "[DQMHistoryServiceBase::scanTreeAndFillSummary] " << ss.str();
}


bool DQMHistoryServiceBase::setDBLabelsForLandau(std::string& keyName, std::vector<std::string>& userDBContent){
userDBContent.push_back(keyName+std::string("@")+std::string("landauPeak"));
userDBContent.push_back(keyName+std::string("@")+std::string("landauPeakErr"));
userDBContent.push_back(keyName+std::string("@")+std::string("landauSFWHM"));
userDBContent.push_back(keyName+std::string("@")+std::string("landauChi2NDF"));
return true;
}

bool DQMHistoryServiceBase::setDBLabelsForGauss(std::string& keyName, std::vector<std::string>& userDBContent){
userDBContent.push_back(keyName+std::string("@")+std::string("gaussMean"));
userDBContent.push_back(keyName+std::string("@")+std::string("gaussSigma"));
userDBContent.push_back(keyName+std::string("@")+std::string("gaussChi2NDF"));
return true;
}
bool DQMHistoryServiceBase::setDBLabelsForStat(std::string& keyName, std::vector<std::string>& userDBContent){
userDBContent.push_back(keyName+std::string("@")+std::string("entries"));
userDBContent.push_back(keyName+std::string("@")+std::string("mean"));
userDBContent.push_back(keyName+std::string("@")+std::string("rms"));
return true;
}

bool DQMHistoryServiceBase::setDBValuesForLandau(std::vector<MonitorElement*>::const_iterator iterMes, HDQMSummary::InputVector& values){
fitME->doLanGaussFit(*iterMes);
values.push_back( fitME->getLanGaussPar("mpv") );
values.push_back( fitME->getLanGaussParErr("mpv") );
values.push_back( fitME->getLanGaussConv("fwhm") );
if (fitME->getFitnDof()!=0 ) values.push_back( fitME->getFitChi()/fitME->getFitnDof() );
else values.push_back(-99.);
return true;
}

bool DQMHistoryServiceBase::setDBValuesForGauss(std::vector<MonitorElement*>::const_iterator iterMes, HDQMSummary::InputVector& values){
fitME->doGaussFit(*iterMes);
values.push_back( fitME->getGaussPar("mean") );
values.push_back( fitME->getGaussPar("sigma") );
if (fitME->getFitnDof()!=0 ) values.push_back( fitME->getFitChi()/fitME->getFitnDof() );
else values.push_back(-99.);
return true;
}

bool DQMHistoryServiceBase::setDBValuesForStat(std::vector<MonitorElement*>::const_iterator iterMes, HDQMSummary::InputVector& values){
values.push_back( (*iterMes)->getEntries());
values.push_back( (*iterMes)->getMean());
values.push_back( (*iterMes)->getRMS());
return true;
}

uint32_t DQMHistoryServiceBase::getRunNumber() const {
edm::LogInfo("DQMHistoryServiceBase") << "[DQMHistoryServiceBase::getRunNumber] " << iConfig_.getParameter<uint32_t>("RunNb");
return iConfig_.getParameter<uint32_t>("RunNb");
Expand Down

0 comments on commit b4b0337

Please sign in to comment.