Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:30

0001 // -*- C++ -*-
0002 //
0003 // Package:    SiPixelFakeQualityESSource
0004 // Class:      SiPixelFakeQualityESSource
0005 //
0006 /**\class SiPixelFakeQualityESSource SiPixelFakeQualityESSource.h CalibTracker/SiPixelESProducer/src/SiPixelFakeQualityESSource.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Bernadette Heyburn
0015 //         Created:  Oct 21 2008
0016 //
0017 //
0018 
0019 // user include files
0020 
0021 #include "CalibTracker/SiPixelESProducers/interface/SiPixelFakeQualityESSource.h"
0022 #include "CalibTracker/SiPixelESProducers/interface/SiPixelDetInfoFileReader.h"
0023 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0024 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0025 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0026 //
0027 // constructors and destructor
0028 //
0029 SiPixelFakeQualityESSource::SiPixelFakeQualityESSource(const edm::ParameterSet& conf_)
0030     : fp_(conf_.getParameter<edm::FileInPath>("file")) {
0031   edm::LogInfo("SiPixelFakeQualityESSource::SiPixelFakeQualityESSource");
0032   //the following line is needed to tell the framework what
0033   // data is being produced
0034   setWhatProduced(this);
0035   findingRecord<SiPixelQualityFromDbRcd>();
0036 }
0037 
0038 SiPixelFakeQualityESSource::~SiPixelFakeQualityESSource() {
0039   // do anything here that needs to be done at desctruction time
0040   // (e.g. close files, deallocate resources etc.)
0041 }
0042 
0043 std::unique_ptr<SiPixelQuality> SiPixelFakeQualityESSource::produce(const SiPixelQualityFromDbRcd&) {
0044   ///////////////////////////////////////////////////////
0045   //  errortype "whole" = int 0 in DB  BadRocs = 65535 //
0046   //  errortype "tbmA" = int 1 in DB  BadRocs = 255    //
0047   //  errortype "tbmB" = int 2 in DB  Bad Rocs = 65280 //
0048   //  errortype "none" = int 3 in DB                   //
0049   ///////////////////////////////////////////////////////
0050 
0051   SiPixelQuality* obj = new SiPixelQuality();
0052 
0053   SiPixelQuality::disabledModuleType BadModule;
0054   BadModule.DetID = 1;
0055   BadModule.errorType = 0;
0056   BadModule.BadRocs = 65535;
0057   obj->addDisabledModule(BadModule);
0058 
0059   return std::unique_ptr<SiPixelQuality>(obj);
0060 }
0061 
0062 void SiPixelFakeQualityESSource::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0063                                                 const edm::IOVSyncValue& iosv,
0064                                                 edm::ValidityInterval& oValidity) {
0065   edm::ValidityInterval infinity(iosv.beginOfTime(), iosv.endOfTime());
0066   oValidity = infinity;
0067 }