3 #include <boost/cstdint.hpp>
7 #include "CLHEP/Random/RandFlat.h"
8 #include "CLHEP/Random/RandGauss.h"
13 edm::LogInfo(
"SiStripApvGainGenerator") <<
"[SiStripApvGainGenerator::SiStripApvGainGenerator]";
17 edm::LogInfo(
"SiStripApvGainGenerator") <<
"[SiStripApvGainGenerator::~SiStripApvGainGenerator]";
36 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > DetInfos =
reader.getAllData();
38 for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++){
40 std::vector<float> theSiStripVector;
41 for(
unsigned short j=0;
j<it->second.nApvs;
j++){
43 if(genMode==
"default")
45 else if (genMode==
"gaussian") {
46 gainValue = CLHEP::RandGauss::shoot(meanGain_, sigmaGain_);
47 if(gainValue<=minimumPosValue_) gainValue=minimumPosValue_;
50 LogDebug(
"SiStripApvGain") <<
"ERROR: wrong genMode specifier : " << genMode <<
", please select one of \"default\" or \"gaussian\"" << std::endl;
54 if (count<printdebug_) {
55 edm::LogInfo(
"SiStripApvGainGenerator") <<
"detid: " << it->first <<
" Apv: " <<
j <<
" gain: " << gainValue << std::endl;
57 theSiStripVector.push_back(gainValue);
61 if ( ! obj->
put(it->first,range) )
62 edm::LogError(
"SiStripApvGainGenerator")<<
" detid already exists"<<std::endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
SiStripApvGainGenerator(const edm::ParameterSet &, const edm::ActivityRegistry &)
~SiStripApvGainGenerator()
bool put(const uint32_t &detID, Range input)
SiStripApvGain * createObject()
std::pair< ContainerIterator, ContainerIterator > Range