CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

StripCPEESProducer Class Reference

#include <StripCPEESProducer.h>

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

List of all members.

Public Member Functions

boost::shared_ptr
< StripClusterParameterEstimator
produce (const TkStripCPERecord &)
 StripCPEESProducer (const edm::ParameterSet &)

Private Types

enum  CPE_t { SIMPLE, TRACKANGLE, GEOMETRIC, TEMPLATE }

Private Attributes

boost::shared_ptr
< StripClusterParameterEstimator
cpe
CPE_t cpeNum
std::map< std::string, CPE_tenumMap
edm::ParameterSet pset

Detailed Description

Definition at line 14 of file StripCPEESProducer.h.


Member Enumeration Documentation

enum StripCPEESProducer::CPE_t [private]
Enumerator:
SIMPLE 
TRACKANGLE 
GEOMETRIC 
TEMPLATE 

Definition at line 23 of file StripCPEESProducer.h.


Constructor & Destructor Documentation

StripCPEESProducer::StripCPEESProducer ( const edm::ParameterSet p)

Definition at line 14 of file StripCPEESProducer.cc.

References cpeNum, enumMap, edm::ParameterSet::exists(), GEOMETRIC, edm::ParameterSet::getParameter(), mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, pset, edm::ESProducer::setWhatProduced(), SIMPLE, AlCaHLTBitMon_QueryRunRegistry::string, TEMPLATE, and TRACKANGLE.

{
  std::string name = p.getParameter<std::string>("ComponentName");
  std::string type=name;
  if (!p.exists("ComponentType"))
    edm::LogWarning("StripCPEESProducer")<<" the CPE producer should contain a ComponentType, probably identical to ComponentName in the first step of migration. Falling back to:"<<type;
  else
    type=p.getParameter<std::string>("ComponentType");

  enumMap[std::string("SimpleStripCPE")]=SIMPLE;
  enumMap[std::string("StripCPEfromTrackAngle")]=TRACKANGLE;
  enumMap[std::string("StripCPEgeometric")]=GEOMETRIC;
  enumMap[std::string("StripCPEfromTemplate")]=TEMPLATE;
  if(enumMap.find(type)==enumMap.end()) 
    throw cms::Exception("Unknown StripCPE type") << type;

  cpeNum = enumMap[type];
  pset = p;
  setWhatProduced(this,name);
}

Member Function Documentation

boost::shared_ptr< StripClusterParameterEstimator > StripCPEESProducer::produce ( const TkStripCPERecord iRecord)

Definition at line 36 of file StripCPEESProducer.cc.

References cond::ecalcond::bad(), cpe, cpeNum, GEOMETRIC, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), HLT_ES_cff::magfield, pset, SIMPLE, TEMPLATE, and TRACKANGLE.

{ 
  edm::ESHandle<TrackerGeometry> pDD;  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
  edm::ESHandle<MagneticField> magfield;  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
  edm::ESHandle<SiStripLorentzAngle> lorentzAngle;   iRecord.getRecord<SiStripLorentzAngleDepRcd>().get(lorentzAngle);
  edm::ESHandle<SiStripBackPlaneCorrection> backPlaneCorrection; iRecord.getRecord<SiStripBackPlaneCorrectionDepRcd>().get(backPlaneCorrection);
  edm::ESHandle<SiStripConfObject> confObj;  iRecord.getRecord<SiStripConfObjectRcd>().get(confObj);
  edm::ESHandle<SiStripLatency> latency;  iRecord.getRecord<SiStripLatencyRcd>().get(latency);
  edm::ESHandle<SiStripNoises> noise;  iRecord.getRecord<SiStripNoisesRcd>().get(noise);
  edm::ESHandle<SiStripApvGain> gain;  iRecord.getRecord<SiStripApvGainRcd>().get(gain);
  edm::ESHandle<SiStripBadStrip> bad;  iRecord.getRecord<SiStripBadChannelRcd>().get(bad);
 
  
  switch(cpeNum) {

  case SIMPLE:     
    cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPE( pset, *magfield, *pDD, *lorentzAngle, *backPlaneCorrection, *confObj, *latency ));  
    break;
    
  case TRACKANGLE: 
    cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle( pset, *magfield, *pDD, *lorentzAngle, *backPlaneCorrection, *confObj, *latency )); 
    break;
    
  case GEOMETRIC:  
    cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEgeometric(pset, *magfield, *pDD, *lorentzAngle, *backPlaneCorrection, *confObj, *latency )); 
    break;  

  case TEMPLATE: 
    cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTemplate( pset, *magfield, *pDD, *lorentzAngle, *backPlaneCorrection, *confObj, *latency )); 
    break;


  }

  return cpe;
}

Member Data Documentation

Definition at line 28 of file StripCPEESProducer.h.

Referenced by produce().

Definition at line 26 of file StripCPEESProducer.h.

Referenced by produce(), and StripCPEESProducer().

std::map<std::string,CPE_t> StripCPEESProducer::enumMap [private]

Definition at line 24 of file StripCPEESProducer.h.

Referenced by StripCPEESProducer().

Definition at line 27 of file StripCPEESProducer.h.

Referenced by produce(), and StripCPEESProducer().