CMS 3D CMS Logo

SiPixelFakeQualityESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiPixelESProducers
4 // Class: SiPixelFakeQualityESSource
5 //
13 //
14 // Original Author: Bernadette Heyburn
15 // Created: Oct 21 2008
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
37 
38 //
39 // class decleration
40 //
41 
43 public:
45  ~SiPixelFakeQualityESSource() override = default;
46 
47  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
48 
49  virtual std::unique_ptr<SiPixelQuality> produce(const SiPixelQualityFromDbRcd&);
50 
51 protected:
53  const edm::IOVSyncValue&,
54  edm::ValidityInterval&) override;
55 
56 private:
58 };
59 
60 //
61 // constructors and destructor
62 //
64  : fp_(conf_.getParameter<edm::FileInPath>("file")) {
65  edm::LogInfo("SiPixelFakeQualityESSource::SiPixelFakeQualityESSource");
66  //the following line is needed to tell the framework what
67  // data is being produced
68  setWhatProduced(this);
69  findingRecord<SiPixelQualityFromDbRcd>();
70 }
71 
72 std::unique_ptr<SiPixelQuality> SiPixelFakeQualityESSource::produce(const SiPixelQualityFromDbRcd&) {
74  // errortype "whole" = int 0 in DB BadRocs = 65535 //
75  // errortype "tbmA" = int 1 in DB BadRocs = 255 //
76  // errortype "tbmB" = int 2 in DB Bad Rocs = 65280 //
77  // errortype "none" = int 3 in DB //
79 
81 
83  BadModule.DetID = 1;
84  BadModule.errorType = 0;
85  BadModule.BadRocs = 65535;
86  obj->addDisabledModule(BadModule);
87 
88  return std::unique_ptr<SiPixelQuality>(obj);
89 }
90 
92  const edm::IOVSyncValue& iosv,
93  edm::ValidityInterval& oValidity) {
95  oValidity = infinity;
96 }
97 
100  desc.add<edm::FileInPath>("file", edm::FileInPath("CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt"));
101  descriptions.addWithDefaultLabel(desc);
102 }
103 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiPixelFakeQualityESSource(const edm::ParameterSet &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
virtual std::unique_ptr< SiPixelQuality > produce(const SiPixelQualityFromDbRcd &)
const double infinity
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Log< level::Info, false > LogInfo
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
HLT enums.
~SiPixelFakeQualityESSource() override=default