CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CalibTracker/SiPixelESProducers/plugins/SiPixelFakeQualityESSource.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    SiPixelFakeQualityESSource
00004 // Class:      SiPixelFakeQualityESSource
00005 // 
00013 //
00014 // Original Author:  Bernadette Heyburn
00015 //         Created:  Oct 21 2008
00016 //
00017 //
00018 
00019 // user include files
00020 
00021 #include "CalibTracker/SiPixelESProducers/interface/SiPixelFakeQualityESSource.h"
00022 #include "CalibTracker/SiPixelESProducers/interface/SiPixelDetInfoFileReader.h"
00023 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00024 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00025 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00026 //
00027 // constructors and destructor
00028 //
00029 SiPixelFakeQualityESSource::SiPixelFakeQualityESSource(const edm::ParameterSet& conf_) : fp_(conf_.getParameter<edm::FileInPath>("file"))
00030 {
00031         edm::LogInfo("SiPixelFakeQualityESSource::SiPixelFakeQualityESSource");
00032         //the following line is needed to tell the framework what
00033         // data is being produced
00034         setWhatProduced(this);
00035         findingRecord<SiPixelQualityFromDbRcd>();
00036 }
00037 
00038 SiPixelFakeQualityESSource::~SiPixelFakeQualityESSource()
00039 {
00040  
00041    // do anything here that needs to be done at desctruction time
00042    // (e.g. close files, deallocate resources etc.)
00043 
00044 }
00045 
00046 std::auto_ptr<SiPixelQuality> SiPixelFakeQualityESSource::produce(const SiPixelQualityFromDbRcd & )
00047 {
00048 
00049 
00051       //  errortype "whole" = int 0 in DB  BadRocs = 65535 //
00052       //  errortype "tbmA" = int 1 in DB  BadRocs = 255    //
00053       //  errortype "tbmB" = int 2 in DB  Bad Rocs = 65280 //
00054       //  errortype "none" = int 3 in DB                   //
00056   
00057     SiPixelQuality * obj = new SiPixelQuality();
00058 
00059     SiPixelQuality::disabledModuleType BadModule;
00060     BadModule.DetID = 1; BadModule.errorType = 0; BadModule.BadRocs = 65535; obj->addDisabledModule(BadModule);
00061 
00062     return std::auto_ptr<SiPixelQuality>(obj);
00063 
00064 }
00065 
00066 void SiPixelFakeQualityESSource::setIntervalFor( const edm::eventsetup::EventSetupRecordKey&, 
00067                                                 const edm::IOVSyncValue& iosv, 
00068                                                 edm::ValidityInterval& oValidity ) {
00069   edm::ValidityInterval infinity( iosv.beginOfTime(), iosv.endOfTime() );
00070   oValidity = infinity;  
00071 }