13 #include <calobase/RawTowerDeadMap.h>
14 #include <calobase/RawTowerDeadMapv1.h>
15 #include <calobase/RawTowerDefs.h>
17 #include <phparameter/PHParameters.h>
30 #include <boost/token_iterator.hpp>
31 #include <boost/tokenizer.hpp>
35 #include <boost/version.hpp>
36 #if (__GNUC__ == 4 && __GNUC_MINOR__ == 4 && BOOST_VERSION == 105700)
37 #pragma GCC diagnostic ignored "-Wuninitialized"
38 #pragma message "ignoring bogus gcc warning in boost header lexical_cast.hpp"
39 #include <boost/lexical_cast.hpp>
40 #pragma GCC diagnostic warning "-Wuninitialized"
42 #include <boost/lexical_cast.hpp>
55 :
SubsysReco(
"RawTowerDeadMapLoader_" + detector)
56 , m_detector(detector)
64 "PHCompositeNode",
"RUN"));
67 std::cerr <<
Name() <<
"::" <<
m_detector <<
"::" << __PRETTY_FUNCTION__
68 <<
"Run Node missing, doing nothing." << std::endl;
69 throw std::runtime_error(
70 "Failed to find Run node in RawTowerCalibration::CreateNodes");
85 RawTowerDeadMap *m_deadmap = findNode::getClass<RawTowerDeadMapv1>(DetNode, deadMapName);
92 m_deadmap, deadMapName,
"PHObject");
93 DetNode->addNode(towerNode);
98 cout <<
"RawTowerDeadMapLoader::" <<
m_detector <<
"::InitRun - loading dead map from " <<
m_deadMapPath << endl;
105 for (
auto iter = in_par_ranges.first; iter != in_par_ranges.second; ++iter)
107 const string &deadChanName = iter->first;
111 cout <<
"deadMapParam[" << deadChanName <<
"] = " << iter->second <<
": ";
114 boost::char_separator<char> sep(
"_");
115 boost::tokenizer<boost::char_separator<char> > tok(deadChanName, sep);
116 boost::tokenizer<boost::char_separator<char> >::const_iterator tokeniter;
118 for (tokeniter = tok.begin(); tokeniter != tok.end(); ++tokeniter)
120 if (*tokeniter ==
"deadtower")
125 assert(tokeniter != tok.end());
127 if (*tokeniter ==
"eta")
130 assert(tokeniter != tok.end());
131 const int eta = boost::lexical_cast<
int>(*tokeniter);
134 assert(tokeniter != tok.end());
135 assert(*tokeniter ==
"phi");
138 assert(tokeniter != tok.end());
139 const int phi = boost::lexical_cast<
int>(*tokeniter);
145 cout <<
"add dead channel eta" << eta <<
" phi" <<
phi;
152 cout <<
"skip " << deadChanName;
161 cout <<
"skip " << deadChanName;
176 cout <<
"RawTowerDeadMapLoader::" <<
m_detector <<
"::InitRun - loading dead map completed : ";