CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripQualityESProducer Class Reference
Inheritance diagram for SiStripQualityESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

std::unique_ptr< SiStripQualityproduce (const SiStripQualityRcd &)
 
 SiStripQualityESProducer (const edm::ParameterSet &)
 
 ~SiStripQualityESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

const bool printDebugOutput_
 
std::vector< std::unique_ptr< const ProductAdder > > productAdders_
 
const bool reduceGranularity_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
const double thresholdForReducedGranularity_
 
const bool useEmptyRunInfo_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 62 of file SiStripQualityESProducer.cc.

Constructor & Destructor Documentation

◆ SiStripQualityESProducer()

SiStripQualityESProducer::SiStripQualityESProducer ( const edm::ParameterSet iConfig)

Definition at line 79 of file SiStripQualityESProducer.cc.

References edm::ParameterSet::getParameter().

80  : thresholdForReducedGranularity_{iConfig.getParameter<double>("ThresholdForReducedGranularity")},
81  printDebugOutput_{iConfig.getParameter<bool>("PrintDebugOutput")},
82  useEmptyRunInfo_{iConfig.getParameter<bool>("UseEmptyRunInfo")},
83  reduceGranularity_{iConfig.getParameter<bool>("ReduceGranularity")} {
84  auto cc = setWhatProduced(this);
85 
86  edm::LogInfo("SiStripQualityESProducer") << "ctor";
87 
88  bool doRunInfo = false;
89  std::string runInfoTagName = "";
90 
91  auto toGet = iConfig.getParameter<std::vector<edm::ParameterSet>>("ListOfRecordToMerge");
92 
93  for (const auto& toGetPSet : toGet) {
94  auto tagName = toGetPSet.getParameter<std::string>("tag");
95  auto recordName = toGetPSet.getParameter<std::string>("record");
96 
97  edm::LogInfo("SiStripQualityESProducer")
98  << "[SiStripQualityESProducer::ctor] Going to get data from record " << recordName << " with tag " << tagName;
99 
100  if (recordName == "SiStripBadModuleRcd") {
101  productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadModuleRcd>(cc, tagName));
102  } else if (recordName == "SiStripBadFiberRcd") {
103  productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadFiberRcd>(cc, tagName));
104  } else if (recordName == "SiStripBadChannelRcd") {
105  productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadChannelRcd>(cc, tagName));
106  } else if (recordName == "SiStripBadStripRcd") {
107  productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadStripRcd>(cc, tagName));
108  } else if (recordName == "SiStripDetCablingRcd") {
109  productAdders_.emplace_back(make_ProductAdder<SiStripDetCabling, SiStripDetCablingRcd>(cc, tagName));
110  } else if (recordName == "SiStripDetVOffRcd") {
111  productAdders_.emplace_back(make_ProductAdder<SiStripDetVOff, SiStripDetVOffRcd>(cc, tagName));
112  } else if (recordName == "RunInfoRcd") {
113  runInfoTagName = tagName;
114  doRunInfo = true;
115  } else {
116  // Would it make sense to elevate this to an exception?
117  edm::LogError("SiStripQualityESProducer")
118  << "[SiStripQualityESProducer::ctor] Skipping the requested data for unexisting record " << recordName
119  << " with tag " << tagName << std::endl;
120  continue;
121  }
122  }
123 
124  if (doRunInfo) {
125  runInfoToken_ = cc.consumes(edm::ESInputTag{"", runInfoTagName});
126  }
127 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Log< level::Error, false > LogError
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Log< level::Info, false > LogInfo
std::vector< std::unique_ptr< const ProductAdder > > productAdders_

◆ ~SiStripQualityESProducer()

SiStripQualityESProducer::~SiStripQualityESProducer ( )
inlineoverride

Definition at line 65 of file SiStripQualityESProducer.cc.

65 {};

Member Function Documentation

◆ produce()

std::unique_ptr< SiStripQuality > SiStripQualityESProducer::produce ( const SiStripQualityRcd iRecord)

Definition at line 129 of file SiStripQualityESProducer.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::ESGetToken< ESProduct, ESRecord >::isInitialized(), SiStripDetInfoFileReader::kDefaultFile, printDebugOutput_, productAdders_, quality, SiStripDetInfoFileReader::read(), reduceGranularity_, runInfoToken_, thresholdForReducedGranularity_, and useEmptyRunInfo_.

129  {
130  const auto detInfo =
132  auto quality = std::make_unique<SiStripQuality>(detInfo);
133  edm::LogInfo("SiStripQualityESProducer") << "produce called";
134 
135  // Set the debug output level
136  quality->setPrintDebugOutput(printDebugOutput_);
137  // Set the protection against empty RunInfo objects
138  quality->setUseEmptyRunInfo(useEmptyRunInfo_);
139 
140  for (const auto& adder : productAdders_) {
141  adder->add(iRecord, *quality);
142  }
143 
144  // We do this after all the others so we know it is done after the DetCabling (if any)
146  quality->add(&iRecord.get(runInfoToken_));
147  }
148 
149  quality->cleanUp();
150 
151  if (reduceGranularity_) {
152  quality->ReduceGranularity(thresholdForReducedGranularity_);
153  quality->cleanUp(true);
154  }
155 
156  quality->fillBadComponents();
157 
158  return quality;
159 }
constexpr bool isInitialized() const noexcept
Definition: ESGetToken.h:72
SiStripDetInfo read(std::string filePath)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Log< level::Info, false > LogInfo
std::vector< std::unique_ptr< const ProductAdder > > productAdders_
static constexpr char const *const kDefaultFile
string quality
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ printDebugOutput_

const bool SiStripQualityESProducer::printDebugOutput_
private

Definition at line 74 of file SiStripQualityESProducer.cc.

Referenced by produce().

◆ productAdders_

std::vector<std::unique_ptr<const ProductAdder> > SiStripQualityESProducer::productAdders_
private

Definition at line 70 of file SiStripQualityESProducer.cc.

Referenced by produce().

◆ reduceGranularity_

const bool SiStripQualityESProducer::reduceGranularity_
private

Definition at line 76 of file SiStripQualityESProducer.cc.

Referenced by produce().

◆ runInfoToken_

edm::ESGetToken<RunInfo, RunInfoRcd> SiStripQualityESProducer::runInfoToken_
private

Definition at line 71 of file SiStripQualityESProducer.cc.

Referenced by produce().

◆ thresholdForReducedGranularity_

const double SiStripQualityESProducer::thresholdForReducedGranularity_
private

Definition at line 73 of file SiStripQualityESProducer.cc.

Referenced by produce().

◆ useEmptyRunInfo_

const bool SiStripQualityESProducer::useEmptyRunInfo_
private

Definition at line 75 of file SiStripQualityESProducer.cc.

Referenced by produce().