CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

SiStripQualityESProducer Class Reference

#include <CalibTracker/SiStripESProducers/plugins/real/SiStripQualityESProducer.cc>

Inheritance diagram for SiStripQualityESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

boost::shared_ptr< SiStripQualityproduce (const SiStripQualityRcd &)
 SiStripQualityESProducer (const edm::ParameterSet &)
 ~SiStripQualityESProducer ()

Private Types

typedef std::vector
< edm::ParameterSet
Parameters

Private Attributes

edm::FileInPath fp_
bool MergeList_
edm::ParameterSet pset_
boost::shared_ptr< SiStripQualityquality
Parameters toGet

Detailed Description

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

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

Definition at line 21 of file SiStripQualityESProducer.h.


Member Typedef Documentation

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

Definition at line 34 of file SiStripQualityESProducer.h.


Constructor & Destructor Documentation

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

Definition at line 26 of file SiStripQualityESProducer.cc.

References quality, edm::ESProducer::setWhatProduced(), and AlCaHarvesting_cff::SiStripQuality.

                                                                                :
  pset_(iConfig),
  toGet(iConfig.getParameter<Parameters>("ListOfRecordToMerge"))
{
  
  setWhatProduced(this);
  
  edm::LogInfo("SiStripQualityESProducer") << "ctor" << std::endl;

  quality.reset(new SiStripQuality());
}
SiStripQualityESProducer::~SiStripQualityESProducer ( ) [inline]

Definition at line 24 of file SiStripQualityESProducer.h.

{};

Member Function Documentation

boost::shared_ptr< SiStripQuality > SiStripQualityESProducer::produce ( const SiStripQualityRcd iRecord)

Definition at line 39 of file SiStripQualityESProducer.cc.

References edm::ParameterSet::getParameter(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), VarParsing::obj, edm::ESHandle< T >::product(), pset_, quality, ecalTPGAnalyzer_cfg::recordName, corrections_cfg::tagName, and toGet.

{
  
  edm::LogInfo("SiStripQualityESProducer") << "produce called" << std::endl;

  quality->clear();

  edm::ESHandle<SiStripBadStrip> obj;
  edm::ESHandle<SiStripDetCabling> cabling;
  edm::ESHandle<SiStripDetVOff> Voff;
  edm::ESHandle<RunInfo> runInfo;

  std::string tagName;  
  std::string recordName;

  bool doRunInfo = false;
  std::string runInfoTagName = "";

  // Set the debug output level
  quality->setPrintDebugOutput( pset_.getParameter<bool>("PrintDebugOutput") );
  // Set the protection against empty RunInfo objects
  quality->setUseEmptyRunInfo( pset_.getParameter<bool>("UseEmptyRunInfo") );

  for( Parameters::iterator itToGet = toGet.begin(); itToGet != toGet.end(); ++itToGet ) {
    tagName = itToGet->getParameter<std::string>("tag");
    recordName = itToGet->getParameter<std::string>("record");

    edm::LogInfo("SiStripQualityESProducer") << "[SiStripQualityESProducer::produce] Getting data from record " << recordName << " with tag " << tagName << std::endl;

    if (recordName=="SiStripBadModuleRcd"){
      iRecord.getRecord<SiStripBadModuleRcd>().get(tagName,obj); 
      quality->add( obj.product() );
    } else if (recordName=="SiStripBadFiberRcd"){
      iRecord.getRecord<SiStripBadFiberRcd>().get(tagName,obj); 
      quality->add( obj.product() );    
    } else if (recordName=="SiStripBadChannelRcd"){
      iRecord.getRecord<SiStripBadChannelRcd>().get(tagName,obj);
      quality->add( obj.product() );    
    } else if (recordName=="SiStripBadStripRcd"){
      iRecord.getRecord<SiStripBadStripRcd>().get(tagName,obj); 
      quality->add( obj.product() );    
    } else if (recordName=="SiStripDetCablingRcd"){
      iRecord.getRecord<SiStripDetCablingRcd>().get(tagName,cabling);
      quality->add( cabling.product() );
    } else if (recordName=="SiStripDetVOffRcd"){
      iRecord.getRecord<SiStripDetVOffRcd>().get(tagName,Voff);
      quality->add( Voff.product() );
    } else if (recordName=="RunInfoRcd") {
      runInfoTagName = tagName;
      doRunInfo = true;
    } else {
      edm::LogError("SiStripQualityESProducer") << "[SiStripQualityESProducer::produce] Skipping the requested data for unexisting record " << recordName << " with tag " << tagName << std::endl;
      continue;
    }
  }
  // We do this after all the others so we know it is done after the DetCabling (if any)
  if( doRunInfo ) {
    iRecord.getRecord<RunInfoRcd>().get(runInfoTagName,runInfo);
    quality->add( runInfo.product() );
  }

  quality->cleanUp();

  if(pset_.getParameter<bool>("ReduceGranularity")){
      quality->ReduceGranularity(pset_.getParameter<double>("ThresholdForReducedGranularity"));
      quality->cleanUp(true);
  }

  quality->fillBadComponents();
  
  return quality;
}

Member Data Documentation

Definition at line 31 of file SiStripQualityESProducer.h.

Definition at line 32 of file SiStripQualityESProducer.h.

Definition at line 30 of file SiStripQualityESProducer.h.

Referenced by produce().

boost::shared_ptr<SiStripQuality> SiStripQualityESProducer::quality [private]

Definition at line 37 of file SiStripQualityESProducer.h.

Referenced by produce(), and SiStripQualityESProducer().

Definition at line 35 of file SiStripQualityESProducer.h.

Referenced by produce().