CMS 3D CMS Logo

Public Member Functions | Private Member Functions

SiStripThresholdGenerator Class Reference

#include <SiStripThresholdGenerator.h>

Inheritance diagram for SiStripThresholdGenerator:
SiStripCondObjBuilderBase< SiStripThreshold >

List of all members.

Public Member Functions

void getObj (SiStripThreshold *&obj)
 SiStripThresholdGenerator (const edm::ParameterSet &, const edm::ActivityRegistry &)
 ~SiStripThresholdGenerator ()

Private Member Functions

void createObject ()

Detailed Description

Definition at line 10 of file SiStripThresholdGenerator.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file SiStripThresholdGenerator.cc.

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

Definition at line 14 of file SiStripThresholdGenerator.cc.

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

Member Function Documentation

void SiStripThresholdGenerator::createObject ( ) [private]

Definition at line 19 of file SiStripThresholdGenerator.cc.

References SiStripCondObjBuilderBase< SiStripThreshold >::_pset, edm::FileInPath::fullPath(), SiStripDetInfoFileReader::getAllData(), edm::ParameterSet::getParameter(), LogDebug, SiStripCondObjBuilderBase< SiStripThreshold >::obj_, SiStripThreshold::printDebug(), SiStripThreshold::put(), SiStripThreshold::setData(), and strip().

Referenced by getObj().

                                            {
    
  obj_ = new SiStripThreshold();

  edm::FileInPath fp_ = _pset.getParameter<edm::FileInPath>("file");
  float lTh_ = _pset.getParameter<double>("LowTh");
  float hTh_ = _pset.getParameter<double>("HighTh");
  float cTh_ = _pset.getParameter<double>("ClusTh");

  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 Thresholds for det detid
    SiStripThreshold::Container theSiStripVector;   
    uint16_t strip=0;

    obj_->setData(strip,lTh_,hTh_,cTh_,theSiStripVector);
    LogDebug("SiStripThresholdFakeESSource::produce") <<"detid: "  << it->first << " \t"
                                                      << "firstStrip: " << strip << " \t" << theSiStripVector.back().getFirstStrip() << " \t"
                                                      << "lTh: " << lTh_       << " \t" << theSiStripVector.back().getLth() << " \t"
                                                      << "hTh: " << hTh_       << " \t" << theSiStripVector.back().getHth() << " \t"
                                                      << "FirstStrip_and_Hth: " << theSiStripVector.back().FirstStrip_and_Hth << " \t"
                                                      << std::endl;         
    
    if ( ! obj_->put(it->first,theSiStripVector) )
      edm::LogError("SiStripThresholdFakeESSource::produce ")<<" detid already exists"<<std::endl;
  }
  
  std::stringstream ss;
  obj_->printDebug(ss);
  LogDebug("SiStripThresholdFakeESSource::produce") <<"printDebug\n" << ss.str() << std::endl;

}
void SiStripThresholdGenerator::getObj ( SiStripThreshold *&  obj) [inline, virtual]