18 const std::pair<std::string, std::string> & recordLabelPair)
22 if( (factor != 1) && (factor != 0) ) {
45 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo> DetInfos =
reader.getAllData();
48 std::vector<uint32_t> detIds;
50 std::vector<uint32_t>::const_iterator it = detIds.begin();
51 for( ; it != detIds.end(); ++it ) {
53 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator detInfoIt = DetInfos.find(*it);
54 if( detInfoIt != DetInfos.end() ) {
56 std::vector<float> theSiStripVector;
66 for(
int apv = 0; apv < detInfoIt->second.nApvs; ++apv ) {
69 if( (apvgain2 != 0) && (factor2 != 0.) ) {
70 apvGainValue *= apvgain2->
getApvGain( apv, range2 )/factor2;
73 theSiStripVector.push_back(apvGainValue);
77 edm::LogError(
"SiStripGain") <<
"detid already exists" << std::endl;
93 edm::LogError(
"SiStripGain::getStripGain") <<
"ERROR: no gain available. Returning gain = 1." << std::endl;
104 edm::LogError(
"SiStripGain::getApvGain") <<
"ERROR: no gain available. Returning gain = 1." << std::endl;
122 std::vector<unsigned int> detIds;
124 std::vector<unsigned int>::const_iterator detid = detIds.begin();
125 ss <<
"Number of detids " << detIds.size() << std::endl;
127 for( ; detid != detIds.end(); ++detid ) {
130 for(
int it=0; it < range.second - range.first; ++it ) {
131 ss <<
"detid " << *detid <<
" \t"
132 <<
" apv " << apv++ <<
" \t"
143 std::vector<unsigned int> detIds;
145 std::vector<uint32_t>::const_iterator detid = detIds.begin();
146 for( ; detid != detIds.end(); ++detid ) {
148 for(
int it=0; it < range.second - range.first; ++it ) {
152 ss <<
"Summary of gain values:" << std::endl;
153 summaryGain.
print(ss,
true);
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.
void printDebug(std::stringstream &ss) const
inputRange
Get input source.
static float getApvGain(uint16_t apv, const Range &range)
std::vector< const SiStripApvGain * > apvgainVector_
std::auto_ptr< SiStripApvGain > apvgainAutoPtr_
std::vector< double > normVector_
std::vector< std::pair< std::string, std::string > > recordLabelPair_
void getDetIds(std::vector< uint32_t > &DetIds_) const
const SiStripApvGain * apvgain_
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
bool put(const uint32_t &detID, Range input)
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
std::pair< ContainerIterator, ContainerIterator > Range
void getDetIds(std::vector< uint32_t > &DetIds_) const
ATTENTION: we assume the detIds are the same as those from the first gain.
void print(std::stringstream &ss, const bool mean=true) const
void printSummary(std::stringstream &ss) const
void fillNewGain(const SiStripApvGain *apvgain, const double &factor, const SiStripApvGain *apvgain2=0, const double &factor2=1.)
const Range getRange(const uint32_t detID) const
std::string fullPath() const
void add(const DetId &detid, const float &value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
const SiStripApvGain::Range getRange(uint32_t detID) const