CMS 3D CMS Logo

Public Member Functions | Private Member Functions

SiStripPedestalsGenerator Class Reference

#include <SiStripPedestalsGenerator.h>

Inheritance diagram for SiStripPedestalsGenerator:
SiStripCondObjBuilderBase< SiStripPedestals >

List of all members.

Public Member Functions

void getObj (SiStripPedestals *&obj)
 SiStripPedestalsGenerator (const edm::ParameterSet &, const edm::ActivityRegistry &)
 ~SiStripPedestalsGenerator ()

Private Member Functions

void createObject ()

Detailed Description

Definition at line 10 of file SiStripPedestalsGenerator.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file SiStripPedestalsGenerator.cc.

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

Definition at line 14 of file SiStripPedestalsGenerator.cc.

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

Member Function Documentation

void SiStripPedestalsGenerator::createObject ( ) [private]

Definition at line 19 of file SiStripPedestalsGenerator.cc.

References SiStripCondObjBuilderBase< SiStripPedestals >::_pset, prof2calltree::count, SiStripDetInfoFileReader::getAllData(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), j, SiStripCondObjBuilderBase< SiStripPedestals >::obj_, SiStripPedestals::put(), and SiStripPedestals::setData().

Referenced by getObj().

                                            {
    
  obj_ = new SiStripPedestals();

  uint32_t PedestalValue_ = _pset.getParameter<uint32_t>("PedestalsValue");  
  edm::FileInPath fp_ = _pset.getParameter<edm::FileInPath>("file");
  uint32_t  printdebug_ = _pset.getUntrackedParameter<uint32_t>("printDebug", 5);
  uint32_t count=0;

  SiStripDetInfoFileReader reader(fp_.fullPath());

  const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > DetInfos  = reader.getAllData();
  
  for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++){    
    //Generate Noises for det detid
    SiStripPedestals::InputVector theSiStripVector;
    for(unsigned short j=0; j<128*it->second.nApvs; j++){
  
      if (count<printdebug_) {
        edm::LogInfo("SiStripPedestalsFakeESSource::makePedestals(): ") << "detid: " << it->first  << " strip: " << j <<  " ped: " << PedestalValue_  << std::endl;         
      }
      obj_->setData(PedestalValue_,theSiStripVector);
    }
    count++;
    if ( ! obj_->put(it->first, theSiStripVector) )
      edm::LogError("SiStripPedestalsFakeESSource::produce ")<<" detid already exists"<<std::endl;
  }
}
void SiStripPedestalsGenerator::getObj ( SiStripPedestals *&  obj) [inline, virtual]