5 #include <phparameter/PHParameters.h>
6 #include <phparameter/PHParametersContainer.h>
8 #include <pdbcalbase/PdbParameterMapContainer.h>
19 #include <boost/format.hpp>
22 #pragma GCC diagnostic push
23 #pragma GCC diagnostic ignored "-Wshadow"
24 #include <boost/stacktrace.hpp>
25 #pragma GCC diagnostic pop
39 std::ostringstream nam;
40 nam << name <<
"_" << lyr;
61 int isSuperDetector = 0;
65 m_ParamsContainer = findNode::getClass<PHParametersContainer>(parNode, g4geonodename);
73 parNode->addNode(DetNode);
153 std::cout <<
Name() << std::endl;
175 std::cout <<
PHWHERE <<
" no parameters for detid " << detid << std::endl;
190 std::cout <<
PHWHERE <<
" no parameters for detid " << detid << std::endl;
206 std::cout <<
PHWHERE <<
" no parameters for detid " << detid << std::endl;
217 std::cout <<
"called like set_double_param(" << detid <<
", \""
218 << name <<
"\", " << dval <<
")" << std::endl;
219 std::cout <<
"detid " << detid <<
" not implemented" << std::endl;
220 std::cout <<
"implemented detector ids: " << std::endl;
223 std::cout <<
"detid: " << iter2.first << std::endl;
227 if (iter->second.find(name) == iter->second.end())
229 std::cout <<
"double parameter " << name <<
" not implemented for detid "
230 << detid << std::endl;
231 std::cout <<
"implemented double parameters are:" << std::endl;
232 for (
auto &iter2 : iter->second)
234 std::cout << iter2.first << std::endl;
244 std::map<const std::string, double> newdmap;
251 ret.first->second[
name] = dval;
260 std::cout <<
"called like set_int_param(" << detid <<
", \""
261 << name <<
"\", " << ival <<
")" << std::endl;
262 std::cout <<
"detid " << detid <<
" not implemented" << std::endl;
263 std::cout <<
"implemented detector ids: " << std::endl;
266 std::cout <<
"detid: " << iter2.first << std::endl;
270 if (iter->second.find(name) == iter->second.end())
272 std::cout <<
"int parameter " << name <<
" not implemented for detid"
273 << detid << std::endl;
274 std::cout <<
"implemented int parameters are:" << std::endl;
275 for (
auto &iter2 : iter->second)
277 std::cout << iter2.first << std::endl;
283 std::map<const std::string, int> newintmap;
290 ret.first->second[
name] = ival;
298 std::cout <<
"called like set_string_param(" << detid <<
", \""
299 << name <<
"\", " << sval <<
")" << std::endl;
300 std::cout <<
"detid " << detid <<
" not implemented" << std::endl;
301 std::cout <<
"implemented detector ids: " << std::endl;
304 std::cout <<
"detid: " << iter2.first << std::endl;
308 if (iter->second.find(name) == iter->second.end())
310 std::cout <<
"string parameter " << name <<
" not implemented for detid "
311 << detid << std::endl;
312 std::cout <<
"implemented string parameters are:" << std::endl;
313 for (
auto &iter2 : iter->second)
315 std::cout << iter2.first << std::endl;
326 std::map<const std::string, std::string> newdmap;
333 ret.first->second[
name] = sval;
342 for (
auto &iter2 : iter1.second)
351 for (
auto &iter2 : iter1.second)
360 for (
auto &iter2 : iter1.second)
382 std::map<const std::string, double> newdoublemap;
384 auto ret2 = ret.first->second.insert(make_pair(name, dval));
385 if (ret2.second ==
false)
387 std::cout <<
PHWHERE <<
"Default double Parameter " << name
388 <<
" for detid " << detid <<
" already set to "
389 << ret.first->second[
name] <<
" will not overwrite with " << dval << std::endl;
390 std::cout <<
"Means: You are calling set_default_double_param twice for the same parameter" << std::endl;
391 std::cout <<
"Please make up your mind and call it only once using the correct default" << std::endl;
400 std::map<const std::string, int> newintmap;
402 auto ret2 = ret.first->second.insert(make_pair(name, ival));
403 if (ret2.second ==
false)
405 std::cout <<
PHWHERE <<
"Default integer Parameter " << name
406 <<
" for detid " << detid <<
" already set to "
407 << ret.first->second[
name] <<
" will not overwrite with " << ival << std::endl;
408 std::cout <<
"Means: You are calling set_default_int_param twice for the same parameter" << std::endl;
409 std::cout <<
"Please make up your mind and call it only once using the correct default" << std::endl;
418 std::map<const std::string, std::string> newstringmap;
420 auto ret2 = ret.first->second.insert(make_pair(name, sval));
421 if (ret2.second ==
false)
423 std::cout <<
PHWHERE <<
"Default String Parameter " << name
424 <<
" for detid " << detid <<
" already set to "
425 << ret.first->second[
name] <<
" will not overwrite with " << sval << std::endl;
426 std::cout <<
"Means: You are calling set_default_string_param twice for the same parameter" << std::endl;
427 std::cout <<
"Please make up your mind and call it only once using the correct default" << std::endl;
453 for (
auto &iter2 : iter1.second)
467 for (
auto &iter2 : iter1.second)
481 for (
auto &iter2 : iter1.second)
495 std::cout <<
"problem committing to DB" << std::endl;
512 std::cout << boost::stacktrace::stacktrace();
513 std::cout << std::endl
514 <<
"DO NOT PANIC - this is not a segfault" << std::endl;
515 std::cout <<
"This method is a dummy, tell the offline gurus about it and give this stack trace" << std::endl;
517 std::cout <<
"problem reading from DB" << std::endl;
535 std::cout <<
PHWHERE <<
"filetype " << ftyp <<
" not implemented" << std::endl;
543 std::cout <<
"problem saving to " << extension <<
" file " << std::endl;
560 std::cout <<
PHWHERE <<
"filetype " << ftyp <<
" not implemented" << std::endl;
566 std::cout << boost::stacktrace::stacktrace();
567 std::cout << std::endl
568 <<
"DO NOT PANIC - this is not a segfault" << std::endl;
569 std::cout <<
"This method is a dummy, tell the offline gurus about it and give this stack trace" << std::endl;
570 std::cout <<
"problem reading from " << extension <<
" file " << std::endl;
571 std::cout <<
"problem reading from DB" << std::endl;
643 std::cout <<
"Default Parameters: " << std::endl;
644 std::cout <<
"int values: " << std::endl;
647 std::cout <<
"Detector id: " << iter1.first << std::endl;
648 for (
auto &iter2 : iter1.second)
650 std::cout << iter2.first <<
" : " << iter2.second << std::endl;
653 std::cout <<
"double values: " << std::endl;
656 std::cout <<
"Detector id: " << iter1.first << std::endl;
657 for (
auto &iter2 : iter1.second)
659 std::cout << iter2.first <<
" : " << iter2.second << std::endl;
662 std::cout <<
"string values: " << std::endl;
665 std::cout <<
"Detector id: " << iter1.first << std::endl;
666 for (
auto &iter2 : iter1.second)
668 std::cout << iter2.first <<
" : " << iter2.second << std::endl;
676 std::cout <<
"Macro Parameters: " << std::endl;
677 std::cout <<
"int values: " << std::endl;
680 std::cout <<
"Detector id: " << iter1.first << std::endl;
681 for (
auto &iter2 : iter1.second)
683 std::cout << iter2.first <<
" : " << iter2.second << std::endl;
686 std::cout <<
"double values: " << std::endl;
689 std::cout <<
"Detector id: " << iter1.first << std::endl;
690 for (
auto &iter2 : iter1.second)
692 std::cout << iter2.first <<
" : " << iter2.second << std::endl;
695 std::cout <<
"string values: " << std::endl;
698 std::cout <<
"Detector id: " << iter1.first << std::endl;
699 for (
auto &iter2 : iter1.second)
701 std::cout << iter2.first <<
" : " << iter2.second << std::endl;