88// Created: Wed Mar 22 12:24:33 CET 2006
99
1010#include " CalibFormats/SiStripObjects/interface/SiStripGain.h"
11- #include " CalibTracker/SiStripCommon /interface/SiStripDetInfoFileReader .h"
11+ #include " CalibFormats/SiStripObjects /interface/SiStripDetInfo .h"
1212#include " CondFormats/SiStripObjects/interface/SiStripDetSummary.h"
1313#include " FWCore/MessageLogger/interface/MessageLogger.h"
1414#include " FWCore/Utilities/interface/typelookup.h"
1515#include < sstream>
1616
1717void SiStripGain::multiply (const SiStripApvGain &apvgain,
1818 const double &factor,
19- const std::pair<std::string, std::string> &recordLabelPair) {
19+ const std::pair<std::string, std::string> &recordLabelPair,
20+ const SiStripDetInfo &detInfo) {
2021 // When inserting the first ApvGain
2122 if (apvgain_ == nullptr ) {
2223 if ((factor != 1 ) && (factor != 0 )) {
23- fillNewGain (&apvgain, factor);
24+ fillNewGain (&apvgain, factor, detInfo );
2425 } else {
2526 // If the normalization factor is one, no need to create a new
2627 // SiStripApvGain
@@ -29,7 +30,7 @@ void SiStripGain::multiply(const SiStripApvGain &apvgain,
2930 } else {
3031 // There is already an ApvGain inside the SiStripGain. Multiply it by the
3132 // new one and save the new pointer.
32- fillNewGain (apvgain_, 1 ., &apvgain, factor);
33+ fillNewGain (apvgain_, 1 ., detInfo, &apvgain, factor);
3334 }
3435 recordLabelPair_.push_back (recordLabelPair);
3536 apvgainVector_.push_back (&apvgain);
@@ -38,20 +39,19 @@ void SiStripGain::multiply(const SiStripApvGain &apvgain,
3839
3940void SiStripGain::fillNewGain (const SiStripApvGain *apvgain,
4041 const double &factor,
42+ const SiStripDetInfo &detInfo,
4143 const SiStripApvGain *apvgain2,
4244 const double &factor2) {
4345 SiStripApvGain *newApvGain = new SiStripApvGain;
44- edm::FileInPath fp (" CalibTracker/SiStripCommon/data/SiStripDetInfo.dat" );
45- SiStripDetInfoFileReader reader (fp.fullPath ());
46- const std::map<uint32_t , SiStripDetInfoFileReader::DetInfo> &DetInfos = reader.getAllData ();
46+ const auto &DetInfos = detInfo.getAllData ();
4747
4848 // Loop on the apvgain in input and fill the newApvGain with the
4949 // values/factor.
5050 std::vector<uint32_t > detIds;
5151 apvgain->getDetIds (detIds);
5252 std::vector<uint32_t >::const_iterator it = detIds.begin ();
5353 for (; it != detIds.end (); ++it) {
54- std::map< uint32_t , SiStripDetInfoFileReader::DetInfo>::const_iterator detInfoIt = DetInfos.find (*it);
54+ auto detInfoIt = DetInfos.find (*it);
5555 if (detInfoIt != DetInfos.end ()) {
5656 std::vector<float > theSiStripVector;
5757
0 commit comments