CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Types | Private Attributes

SiPixelQualityESProducer Class Reference

#include <CalibTracker/SiPixelESProducer/src/SiPixelQualityESProducer.cc>

Inheritance diagram for SiPixelQualityESProducer:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

std::auto_ptr< SiPixelQualityproduce (const SiPixelQualityRcd &iRecord)
 SiPixelQualityESProducer (const edm::ParameterSet &iConfig)
 ~SiPixelQualityESProducer ()

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Types

typedef std::vector
< edm::ParameterSet
Parameters

Private Attributes

edm::FileInPath fp_
Parameters toGet

Detailed Description

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

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

Definition at line 40 of file SiPixelQualityESProducer.h.


Member Typedef Documentation

typedef std::vector< edm::ParameterSet > SiPixelQualityESProducer::Parameters [private]

Definition at line 59 of file SiPixelQualityESProducer.h.


Constructor & Destructor Documentation

SiPixelQualityESProducer::SiPixelQualityESProducer ( const edm::ParameterSet iConfig)

Definition at line 38 of file SiPixelQualityESProducer.cc.

References edm::ESProducer::setWhatProduced().

  : //fp_(conf_.getParameter<edm::FileInPath>("file")),
    toGet(conf_.getParameter<Parameters>("ListOfRecordToMerge"))
{
   edm::LogInfo("SiPixelQualityESProducer::SiPixelQualityESProducer");
  //the following line is needed to tell the framework what
  // data is being produced
  setWhatProduced(this);
  findingRecord<SiPixelQualityRcd>();
}
SiPixelQualityESProducer::~SiPixelQualityESProducer ( )

Definition at line 50 of file SiPixelQualityESProducer.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

std::auto_ptr< SiPixelQuality > SiPixelQualityESProducer::produce ( const SiPixelQualityRcd iRecord)

Definition at line 58 of file SiPixelQualityESProducer.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandle< T >::product(), ecalTPGAnalyzer_cfg::recordName, and toGet.

{
  
  std::string recordName;

  //  errortype "whole" = int 0 in DB  BadRocs = 65535 //
  //  errortype "tbmA" = int 1 in DB  BadRocs = 255    //
  //  errortype "tbmB" = int 2 in DB  Bad Rocs = 65280 //
  //  errortype "none" = int 3 in DB                   //
  
  //if I have understood this is the one got from the DB or file, but in any case the ORIGINAL(maybe i need to get the record for it)
  //SiPixelQuality * obj = new SiPixelQuality();
  //SiPixelQuality::disabledModuleType BadModule;
  //BadModule.DetID = 1; BadModule.errorType = 0; BadModule.BadRocs = 65535; obj->addDisabledModule(BadModule);
  
    //start with the record thta existed already to decouple the debugging
  //here i can do whatever i need with the detVoff
 
  edm::ESHandle<SiStripDetVOff> Voff;
  edm::ESHandle<SiPixelQuality> dbobject;
  
  for( Parameters::iterator itToGet = toGet.begin(); itToGet != toGet.end(); ++itToGet ) {

    recordName = itToGet->getParameter<std::string>("record");
    
    if (recordName=="SiPixelDetVOffRcd")
      iRecord.getRecord<SiPixelDetVOffRcd>().get(Voff); 
    if (recordName=="SiPixelQualityFromDbRcd")
      iRecord.getRecord<SiPixelQualityFromDbRcd>().get(dbobject);
  } //end getting the records from the parameters
  
  //now the dbobject is the one copied from the db
  //here make a copy of dbobject, but now the label has to be empty not to interfeare with the Reco
  std::auto_ptr<SiPixelQuality> dbptr(new SiPixelQuality(*(dbobject)));
  
  //here is the magic line in which it switches off Bad Modules
  dbptr->add(Voff.product());

  return dbptr;
}
void SiPixelQualityESProducer::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
) [protected, virtual]

Member Data Documentation

Definition at line 58 of file SiPixelQualityESProducer.h.

Definition at line 60 of file SiPixelQualityESProducer.h.

Referenced by produce().