Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8967 from bartokm/SiPixelDynamicInefficiencyDB
SiPixelDynamicInefficiency DB object
- Loading branch information
Showing
19 changed files
with
1,544 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
CondFormats/DataRecord/interface/SiPixelDynamicInefficiencyRcd.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef SiPixelDynamicInefficiencyRcd_SiPixelDynamicInefficiencyRcd_h | ||
#define SiPixelDynamicInefficiencyRcd_SiPixelDynamicInefficiencyRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : SiPixelDynamicInefficiencyRcd | ||
// | ||
/**\class SiPixelDynamicInefficiencyRcd SiPixelDynamicInefficiencyRcd.h CondFormats/DataRecord/interface/SiPixelDynamicInefficiencyRcd.h | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Author: bartok.marton@wigner.mta.hu | ||
// Created: Wed, 18 Mar 2015 11:40:37 GMT | ||
// | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
||
class SiPixelDynamicInefficiencyRcd : public edm::eventsetup::EventSetupRecordImplementation<SiPixelDynamicInefficiencyRcd> {}; | ||
|
||
#endif |
15 changes: 15 additions & 0 deletions
15
CondFormats/DataRecord/src/SiPixelDynamicInefficiencyRcd.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : SiPixelDynamicInefficiencyRcd | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Author: bartok.marton@wigner.mta.hu | ||
// Created: Wed, 18 Mar 2015 11:40:37 GMT | ||
|
||
#include "CondFormats/DataRecord/interface/SiPixelDynamicInefficiencyRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(SiPixelDynamicInefficiencyRcd); |
66 changes: 66 additions & 0 deletions
66
CondFormats/SiPixelObjects/interface/SiPixelDynamicInefficiency.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#ifndef SiPixelDynamicInefficiency_h | ||
#define SiPixelDynamicInefficiency_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
|
||
#include<vector> | ||
#include<map> | ||
#include<iostream> | ||
#include<boost/cstdint.hpp> | ||
|
||
|
||
class SiPixelDynamicInefficiency { | ||
|
||
public: | ||
|
||
SiPixelDynamicInefficiency(); | ||
~SiPixelDynamicInefficiency(){}; | ||
|
||
inline void putPixelGeomFactors (std::map<unsigned int,double>& PixelGeomFactors){m_PixelGeomFactors=PixelGeomFactors;} | ||
inline const std::map<unsigned int,double>& getPixelGeomFactors () const {return m_PixelGeomFactors;} | ||
|
||
inline void putColGeomFactors (std::map<unsigned int,double>& ColGeomFactors){m_ColGeomFactors=ColGeomFactors;} | ||
inline const std::map<unsigned int,double>& getColGeomFactors () const {return m_ColGeomFactors;} | ||
|
||
inline void putChipGeomFactors (std::map<unsigned int,double>& ChipGeomFactors){m_ChipGeomFactors=ChipGeomFactors;} | ||
inline const std::map<unsigned int,double>& getChipGeomFactors () const {return m_ChipGeomFactors;} | ||
|
||
inline void putPUFactors (std::map<unsigned int,std::vector<double> >& PUFactors){m_PUFactors=PUFactors;} | ||
inline const std::map<unsigned int,std::vector<double> >& getPUFactors () const {return m_PUFactors;} | ||
|
||
inline void puttheInstLumiScaleFactor_(double& InstLumiScaleFactor){theInstLumiScaleFactor_=InstLumiScaleFactor;} | ||
inline const double gettheInstLumiScaleFactor_() const {return theInstLumiScaleFactor_;} | ||
|
||
inline void putDetIdmasks(std::vector<uint32_t>& masks){v_DetIdmasks=masks;} | ||
inline const std::vector<uint32_t> getDetIdmasks() const {return v_DetIdmasks;} | ||
|
||
bool putPixelGeomFactor (const uint32_t&, double&); | ||
double getPixelGeomFactor (const uint32_t&) const; | ||
|
||
bool putColGeomFactor (const uint32_t&, double&); | ||
double getColGeomFactor (const uint32_t&) const; | ||
|
||
bool putChipGeomFactor (const uint32_t&, double&); | ||
double getChipGeomFactor (const uint32_t&) const; | ||
|
||
bool putPUFactor (const uint32_t&, std::vector<double>&); | ||
std::vector<double> getPUFactor (const uint32_t&) const; | ||
|
||
bool putDetIdmask(uint32_t&); | ||
uint32_t getDetIdmask(unsigned int&) const; | ||
|
||
bool puttheInstLumiScaleFactor(double&); | ||
double gettheInstLumiScaleFactor() const; | ||
|
||
private: | ||
std::map<unsigned int,double> m_PixelGeomFactors; | ||
std::map<unsigned int,double> m_ColGeomFactors; | ||
std::map<unsigned int,double> m_ChipGeomFactors; | ||
std::map<unsigned int,std::vector<double> > m_PUFactors; | ||
std::vector<uint32_t> v_DetIdmasks; | ||
double theInstLumiScaleFactor_; | ||
|
||
COND_SERIALIZABLE; | ||
}; | ||
|
||
#endif |
113 changes: 113 additions & 0 deletions
113
CondFormats/SiPixelObjects/src/SiPixelDynamicInefficiency.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#include "CondFormats/SiPixelObjects/interface/SiPixelDynamicInefficiency.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
SiPixelDynamicInefficiency::SiPixelDynamicInefficiency(){theInstLumiScaleFactor_=-9999;} | ||
|
||
bool SiPixelDynamicInefficiency::putPixelGeomFactor (const uint32_t& detid, double& value){ | ||
std::map<unsigned int,double>::const_iterator id=m_PixelGeomFactors.find(detid); | ||
if(id!=m_PixelGeomFactors.end()){ | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PixelGeomFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl; | ||
return false; | ||
} | ||
else m_PixelGeomFactors[detid]=value; | ||
return true; | ||
} | ||
|
||
double SiPixelDynamicInefficiency::getPixelGeomFactor (const uint32_t& detid) const { | ||
std::map<unsigned int,double>::const_iterator id=m_PixelGeomFactors.find(detid); | ||
if(id!=m_PixelGeomFactors.end()) return id->second; | ||
else { | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PixelGeomFactor for DetID " << detid << " is not stored" << std::endl; | ||
} | ||
return 0; | ||
} | ||
|
||
bool SiPixelDynamicInefficiency::putColGeomFactor (const uint32_t& detid, double& value){ | ||
std::map<unsigned int,double>::const_iterator id=m_ColGeomFactors.find(detid); | ||
if(id!=m_ColGeomFactors.end()){ | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl; | ||
return false; | ||
} | ||
else m_ColGeomFactors[detid]=value; | ||
return true; | ||
} | ||
|
||
double SiPixelDynamicInefficiency::getColGeomFactor (const uint32_t& detid) const { | ||
std::map<unsigned int,double>::const_iterator id=m_ColGeomFactors.find(detid); | ||
if(id!=m_ColGeomFactors.end()) return id->second; | ||
else { | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid << " is not stored" << std::endl; | ||
} | ||
return 0; | ||
} | ||
|
||
bool SiPixelDynamicInefficiency::putChipGeomFactor (const uint32_t& detid, double& value){ | ||
std::map<unsigned int,double>::const_iterator id=m_ChipGeomFactors.find(detid); | ||
if(id!=m_ChipGeomFactors.end()){ | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl; | ||
return false; | ||
} | ||
else m_ChipGeomFactors[detid]=value; | ||
return true; | ||
} | ||
|
||
double SiPixelDynamicInefficiency::getChipGeomFactor (const uint32_t& detid) const { | ||
std::map<unsigned int,double>::const_iterator id=m_ChipGeomFactors.find(detid); | ||
if(id!=m_ChipGeomFactors.end()) return id->second; | ||
else { | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid << " is not stored" << std::endl; | ||
} | ||
return 0; | ||
} | ||
|
||
bool SiPixelDynamicInefficiency::putPUFactor (const uint32_t& detid, std::vector<double>& v_value){ | ||
std::map<unsigned int,std::vector<double> >::const_iterator id=m_PUFactors.find(detid); | ||
if(id!=m_PUFactors.end()){ | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PUFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl; | ||
return false; | ||
} | ||
else m_PUFactors[detid]=v_value; | ||
return true; | ||
} | ||
|
||
std::vector<double> SiPixelDynamicInefficiency::getPUFactor (const uint32_t& detid) const { | ||
std::map<unsigned int,std::vector<double> >::const_iterator id=m_PUFactors.find(detid); | ||
if(id!=m_PUFactors.end()) return id->second; | ||
else { | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PUFactor for DetID " << detid << " is not stored" << std::endl; | ||
} | ||
std::vector<double> empty; | ||
return empty; | ||
} | ||
|
||
bool SiPixelDynamicInefficiency::putDetIdmask(uint32_t& mask){ | ||
for (unsigned int i=0;i<v_DetIdmasks.size();i++) if (mask == v_DetIdmasks.at(i)) return false; | ||
v_DetIdmasks.push_back(mask); | ||
return true; | ||
} | ||
uint32_t SiPixelDynamicInefficiency::getDetIdmask(unsigned int& i) const{ | ||
if (v_DetIdmasks.size() <= i) { | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency DetIdmask "<<i<<" is not stored!" << std::endl; | ||
return 0; | ||
} | ||
else return v_DetIdmasks.at(i); | ||
} | ||
|
||
bool SiPixelDynamicInefficiency::puttheInstLumiScaleFactor(double& theInstLumiScaleFactor){ | ||
if (theInstLumiScaleFactor_ != -9999){ | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency theInstLumiScaleFactor is already stored! Skippig this put!" << std::endl; | ||
return false; | ||
} | ||
else { | ||
theInstLumiScaleFactor_ = theInstLumiScaleFactor; | ||
return true; | ||
} | ||
} | ||
|
||
double SiPixelDynamicInefficiency::gettheInstLumiScaleFactor() const { | ||
if (theInstLumiScaleFactor_ == -9999) { | ||
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency theInstLumiScaleFactor is not stored!" << std::endl; | ||
return 0; | ||
} | ||
else return theInstLumiScaleFactor_; | ||
} |
7 changes: 7 additions & 0 deletions
7
CondFormats/SiPixelObjects/src/T_EventSetup_SiPixelDynamicInefficiency.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// system include files | ||
|
||
// user include files | ||
#include "CondFormats/SiPixelObjects/interface/SiPixelDynamicInefficiency.h" | ||
#include "FWCore/Utilities/interface/typelookup.h" | ||
|
||
TYPELOOKUP_DATA_REG(SiPixelDynamicInefficiency); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.