template<typename TDependentRecord, typename TInputRecord>
class SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >
Definition at line 25 of file SiStripGainESProducerTemplate.h.
template<typename TDependentRecord , typename TInputRecord >
Definition at line 142 of file SiStripGainESProducerTemplate.h.
References SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::automaticMode_, NGains, SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::norm_, SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::pDD, and SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::printdebug_.
Referenced by SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::SiStripGainNormalizationFunction(), and SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::~SiStripGainESProducerTemplate().
147 std::vector<uint32_t> DetIds;
148 pDD[apvGainIndex]->getDetIds(DetIds);
150 double SumOfGains=0.;
153 for(std::vector<uint32_t>::const_iterator detit=DetIds.begin(); detit!=DetIds.end(); detit++){
159 for(std::vector<float>::const_iterator apvit=detRange.first; apvit!=detRange.second; apvit++){
161 SumOfGains+=(*apvit);
164 edm::LogInfo(
"SiStripGainESProducer::produce()")<<
"detid/component: " << *detit <<
"/"<<iComp<<
" gain factor " <<*apvit ;
170 if(SumOfGains>0 && NGains>0){
171 NFactor=SumOfGains/
NGains;
174 edm::LogError(
"SiStripGainESProducer::produce() - ERROR: empty set of gain values received. Cannot compute normalization factor. Assuming 1 for such factor") << std::endl;
181 NFactor=
norm_[apvGainIndex];
184 if (
printdebug_)
edm::LogInfo(
"SiStripGainESProducer")<<
" putting A SiStrip Gain object in eventSetup with normalization factor " << NFactor ;
std::vector< edm::ESHandle< SiStripApvGain > > pDD
std::vector< double > norm_
std::pair< ContainerIterator, ContainerIterator > Range
template<typename TDependentRecord , typename TInputRecord >
Definition at line 97 of file SiStripGainESProducerTemplate.h.
References a, SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::apvgain_, SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::fillApvGain(), muonCSCDigis_cfi::gain, SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::getNFactor(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mps_fire::i, SiStripGain::multiply(), SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::pDD, and edm::second().
Referenced by SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::produce(), and SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >::~SiStripGainESProducerTemplate().
137 edm::LogError(
"SiStripGainESProducer") <<
"[SiStripGainNormalizationFunction] - ERROR: asking for a pair of records different from <SiStripGainRcd,SiStripApvGainRcd> and <SiStripGainSimRcd,SiStripApvGainSimRcd>" << std::endl;
void multiply(const SiStripApvGain &apvgain, const double &factor, const std::pair< std::string, std::string > &recordLabelPair)
Used to input additional gain values that will be multiplied to the first one.
std::vector< edm::ESHandle< SiStripApvGain > > pDD
void fillApvGain(const SiStripGainRcd &a, const std::pair< std::string, std::string > &recordLabelPair, std::vector< edm::ESHandle< SiStripApvGain > > &pDD)
U second(std::pair< T, U > const &p)
const DepRecordT & getRecord() const
double getNFactor(const int apvGainIndex)
std::vector< std::pair< std::string, std::string > > apvgain_