19 const std::pair<std::string, std::string> & recordLabelPair)
23 if( (factor != 1) && (factor != 0) ) {
44 edm::FileInPath fp(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
46 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo> DetInfos = reader.
getAllData();
49 std::vector<uint32_t> detIds;
51 std::vector<uint32_t>::const_iterator it = detIds.begin();
52 for( ; it != detIds.end(); ++it ) {
54 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator detInfoIt = DetInfos.find(*it);
55 if( detInfoIt != DetInfos.end() ) {
57 std::vector<float> theSiStripVector;
67 for(
int apv = 0; apv < detInfoIt->second.nApvs; ++apv ) {
68 float apvGainValue = apvgain->
getApvGain( apv, range )/factor;
70 if( (apvgain2 != 0) && (factor2 != 0.) ) {
71 apvGainValue *= apvgain2->
getApvGain( apv, range2 )/factor2;
74 theSiStripVector.push_back(apvGainValue);
78 edm::LogError(
"SiStripGain") <<
"detid already exists" << std::endl;
90 edm::LogError(
"SiStripGain::getStripGain") <<
"ERROR: no gain available. Returning gain = 1." << std::endl;
101 edm::LogError(
"SiStripGain::getStripGain") <<
"ERROR: no gain available. Returning gain = 1." << std::endl;
108 edm::LogError(
"SiStripGain::getApvGain") <<
"ERROR: no gain available. Returning gain = 1." << std::endl;
119 edm::LogError(
"SiStripGain::getApvGain") <<
"ERROR: no gain available. Returning gain = 1." << std::endl;
141 std::vector<unsigned int> detIds;
143 std::vector<unsigned int>::const_iterator
detid = detIds.begin();
144 ss <<
"Number of detids " << detIds.size() << std::endl;
146 for( ; detid != detIds.end(); ++
detid ) {
149 for(
int it=0; it < range.second - range.first; ++it ) {
150 ss <<
"detid " << *detid <<
" \t"
151 <<
" apv " << apv++ <<
" \t"
162 std::vector<unsigned int> detIds;
164 std::vector<uint32_t>::const_iterator
detid = detIds.begin();
165 for( ; detid != detIds.end(); ++
detid ) {
167 for(
int it=0; it < range.second - range.first; ++it ) {
171 ss <<
"Summary of gain values:" << std::endl;
172 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.
std::vector< const SiStripApvGain * > apvgainVector_
float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range) const
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
float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range) const
const SiStripApvGain * apvgain_
bool put(const uint32_t &detID, Range input)
float getStripGain(const uint16_t &strip, const Range &range) const
const std::map< uint32_t, DetInfo > & getAllData() const
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
const SiStripApvGain::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...
float getApvGain(const uint16_t &apv, const Range &range) const