CMS 3D CMS Logo

Public Member Functions | Private Member Functions

SiStripBackPlaneCorrectionGenerator Class Reference

#include <SiStripBackPlaneCorrectionGenerator.h>

Inheritance diagram for SiStripBackPlaneCorrectionGenerator:
SiStripCondObjBuilderBase< SiStripBackPlaneCorrection >

List of all members.

Public Member Functions

void getObj (SiStripBackPlaneCorrection *&obj)
 SiStripBackPlaneCorrectionGenerator (const edm::ParameterSet &, const edm::ActivityRegistry &)
 ~SiStripBackPlaneCorrectionGenerator ()

Private Member Functions

void createObject ()

Detailed Description

Generator of the ideal/fake conditions for the BackPlaneCorrection.
It receives input values for each module geometry type and it creates a per detIt reccord.

Definition at line 16 of file SiStripBackPlaneCorrectionGenerator.h.


Constructor & Destructor Documentation

SiStripBackPlaneCorrectionGenerator::SiStripBackPlaneCorrectionGenerator ( const edm::ParameterSet iConfig,
const edm::ActivityRegistry aReg 
) [explicit]

Definition at line 15 of file SiStripBackPlaneCorrectionGenerator.cc.

                                                                                                                                      :
  SiStripCondObjBuilderBase<SiStripBackPlaneCorrection>::SiStripCondObjBuilderBase(iConfig)
{
  edm::LogInfo("SiStripBackPlaneCorrectionGenerator") <<  "[SiStripBackPlaneCorrectionGenerator::SiStripBackPlaneCorrectionGenerator]";
}
SiStripBackPlaneCorrectionGenerator::~SiStripBackPlaneCorrectionGenerator ( )

Definition at line 22 of file SiStripBackPlaneCorrectionGenerator.cc.

                                                                          { 
  edm::LogInfo("SiStripBackPlaneCorrectionGenerator") <<  "[SiStripBackPlaneCorrectionGenerator::~SiStripBackPlaneCorrectionGenerator]";
}

Member Function Documentation

void SiStripBackPlaneCorrectionGenerator::createObject ( ) [private]

Definition at line 26 of file SiStripBackPlaneCorrectionGenerator.cc.

References SiStripCondObjBuilderBase< SiStripBackPlaneCorrection >::_pset, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), SiStripDetId::moduleGeometry(), SiStripCondObjBuilderBase< SiStripBackPlaneCorrection >::obj_, SiStripBackPlaneCorrection::putBackPlaneCorrection(), matplotRender::reader, and relativeConstraints::value.

Referenced by getObj().

{
  obj_ = new SiStripBackPlaneCorrection();

  edm::FileInPath fp_                 = _pset.getParameter<edm::FileInPath>("file");
  std::vector<double> valuePerModuleGeometry(_pset.getParameter<std::vector<double> >("BackPlaneCorrection_PerModuleGeometry"));
  
  SiStripDetInfoFileReader reader(fp_.fullPath());
  const std::vector<uint32_t> DetIds = reader.getAllDetIds();
  for(std::vector<uint32_t>::const_iterator detit=DetIds.begin(); detit!=DetIds.end(); detit++){
    SiStripDetId SSdetId(*detit);
    unsigned int moduleGeometry = (SSdetId.moduleGeometry()-1);
    if(moduleGeometry>valuePerModuleGeometry.size())edm::LogError("SiStripBackPlaneCorrectionGenerator")<<" BackPlaneCorrection_PerModuleGeometry only contains "<< valuePerModuleGeometry.size() << "elements and module is out of range"<<std::endl;
    float value =     valuePerModuleGeometry[moduleGeometry];
  
    if (!obj_->putBackPlaneCorrection(*detit, value) ) {
      edm::LogError("SiStripBackPlaneCorrectionGenerator")<<" detid already exists"<<std::endl;
    }
  }
}
void SiStripBackPlaneCorrectionGenerator::getObj ( SiStripBackPlaneCorrection *&  obj) [inline, virtual]