15 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug",1)),
43 std::vector<uint32_t> inputDetIds;
51 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >& DetInfos = reader->
getAllData();
52 for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++) {
56 size_t inputRangeSize = 0;
57 if(
find( inputDetIds.begin(), inputDetIds.end(), it->first ) != inputDetIds.end() ) {
58 inputRange = inputApvGain->
getRange(it->first);
59 inputRangeSize =
distance(inputRange.first, inputRange.second);
62 std::vector<float> theSiStripVector;
63 for(
unsigned short j=0; j<it->second.nApvs; j++){
65 double gainValue = meanGain_;
67 if( j < inputRangeSize ) {
68 gainValue = inputApvGain->
getApvGain(j, inputRange);
77 uint32_t detId = it->first;
81 double correction = correct.get(sl);
82 gainValue *= correction;
86 if (genMode ==
"gaussian") {
87 gainValue = CLHEP::RandGauss::shoot(gainValue, sigmaGain_);
88 if(gainValue<=minimumPosValue_) gainValue=minimumPosValue_;
90 else if( genMode !=
"default" ) {
91 LogDebug(
"SiStripApvGain") <<
"ERROR: wrong genMode specifier : " << genMode <<
", please select one of \"default\" or \"gaussian\"" << std::endl;
95 if (count<printdebug_) {
96 edm::LogInfo(
"SiStripApvGainGeneratorFromTag") <<
"detid: " << it->first <<
" Apv: " << j <<
" gain: " << gainValue << std::endl;
98 theSiStripVector.push_back(gainValue);
102 if ( ! obj->
put(it->first,range) )
103 edm::LogError(
"SiStripApvGainGeneratorFromTag")<<
" detid already exists"<<std::endl;
118 edm::LogError(
"SiStripApvGainBuilderFromTag")<<
"Service is unavailable"<<std::endl;
std::pair< int, int > index
T getParameter(std::string const &) const
SiStripApvGainBuilderFromTag(const edm::ParameterSet &iConfig)
T getUntrackedParameter(std::string const &, T const &) const
static float getApvGain(uint16_t apv, const Range &range)
static index getIndex(const TrackerTopology *tTopo, DetId id)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void getDetIds(std::vector< uint32_t > &DetIds_) const
bool put(const uint32_t &detID, Range input)
const std::map< uint32_t, DetInfo > & getAllData() const
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
std::pair< ContainerIterator, ContainerIterator > Range
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
cond::Time_t endOfTime() const
inputRange
Get input source.
cond::Time_t currentTime() const
const Range getRange(const uint32_t detID) const
void analyze(const edm::Event &, const edm::EventSetup &) override
T const * product() const