37 ss <<
"[SiStripGainFromAsciiFile::getNewObject]\n Reading Ascii File\n";
40 if (infile.is_open()){
41 while (infile.good()){
42 infile >> detid >> FG.fiber[0] >> FG.fiber[1] >> FG.fiber[2];
43 ss << detid <<
" " << FG.fiber[0] <<
" " << FG.fiber[1] <<
" " << FG.fiber[2] << std::endl;
44 GainsMap.insert(std::pair<unsigned int,FibersGain>(detid,FG));
49 edm::LogError(
"SiStripGainFromAsciiFile")<<
" [SiStripGainFromAsciiFile::getNewObject] Error opening file " <<
Asciifilename_ << std::endl;
57 const std::vector<uint32_t> DetIds =
reader.getAllDetIds();
60 ss <<
"[SiStripGainFromAsciiFile::getNewObject]\n Filling SiStripApvGain object";
62 for(std::vector<uint32_t>::const_iterator it=DetIds.begin(); it!=DetIds.end(); it++){
67 nApvPair=
reader.getNumberOfApvsAndStripLength(*it).first/2;
69 ss <<
"Looking at detid " << *it <<
" nApvPairs " << nApvPair << std::endl;
71 __gnu_cxx::hash_map< unsigned int,FibersGain>::const_iterator iter=
GainsMap.find(*it);
75 ss <<
" " << FG.fiber[0] <<
" " << FG.fiber[1] <<
" " << FG.fiber[2] << std::endl;
78 ss <<
"Hard reset for detid " << *it << std::endl;
82 std::vector<float> DetGainsVector;
89 }
else if (nApvPair==3){
97 edm::LogError(
"SiStripGainFromAsciiFile") <<
" SiStripGainFromAsciiFile::getNewObject] ERROR for detid " << *it <<
" not expected number of APV pairs " << nApvPair <<std::endl;
101 if ( ! obj->
put(*it,range) ){
102 edm::LogError(
"SiStripGainFromAsciiFile")<<
" [SiStripGainFromAsciiFile::getNewObject] detid already exists"<<std::endl;
103 ss <<
" [SiStripGainFromAsciiFile::getNewObject] detid already exists"<<std::endl;
std::string Asciifilename_
__gnu_cxx::hash_map< unsigned int, FibersGain > GainsMap
bool put(const uint32_t &detID, Range input)
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
Detector det() const
get the detector field from this detid