4 #include <pdbcalbase/PdbApplication.h>
5 #include <pdbcalbase/PdbBankID.h>
6 #include <pdbcalbase/PdbBankManager.h>
7 #include <pdbcalbase/PdbCalBank.h>
8 #include <pdbcalbase/PdbParameterMap.h>
9 #include <pdbcalbase/PdbParameterMapContainer.h>
17 #include <TBufferXML.h>
22 #pragma GCC diagnostic push
23 #pragma GCC diagnostic ignored "-Wshadow"
24 #include <boost/stacktrace.hpp>
25 #pragma GCC diagnostic pop
36 : superdetectorname(name)
91 std::cout <<
PHWHERE <<
" detector id " << detid <<
" already exists for "
92 << (
parametermap.find(detid))->second->Name() << std::endl;
101 std::map<int, PHParameters *>::const_iterator iter =
parametermap.find(detid);
104 std::cout <<
"could not find parameters for detector id " << detid
106 std::cout <<
"Here is the stacktrace: " << std::endl;
107 std::cout << boost::stacktrace::stacktrace();
108 std::cout << std::endl
109 <<
"DO NOT PANIC - this is not a segfault" << std::endl;
110 std::cout <<
"Check the stacktrace for the guilty party (typically #2)" << std::endl;
120 std::map<int, PHParameters *>::iterator iter =
parametermap.find(detid);
130 std::ostringstream fullpath;
131 std::ostringstream fnamestream;
137 if (*(dir.rbegin()) !=
'/')
146 std::transform(fname.begin(), fname.end(), fname.begin(), ::tolower);
149 std::cout <<
"PHParameters::WriteToFile - save to " << fullpath.str() << std::endl;
153 TFile *
f = TFile::Open(fullpath.str().c_str(),
"recreate");
156 std::string floatformat = TBufferXML::GetFloatFormat();
157 TBufferXML::SetFloatFormat(
"%.15e");
161 TBufferXML::SetFloatFormat(floatformat.c_str());
162 std::cout <<
"sleeping 1 second to prevent duplicate inserttimes" << std::endl;
173 std::cout <<
PHWHERE <<
" Aborting, Database not writable" << std::endl;
174 application->
abort();
184 std::transform(tablename.begin(), tablename.end(), tablename.begin(),
187 "Geometry Parameters", TStart, TStop, tablename);
193 application->
commit(NewBank);
198 std::cout <<
PHWHERE " Committing to DB failed" << std::endl;
206 std::map<int, PHParameters *>::const_iterator iter;
210 iter->second->CopyToPdbParameterMap(myparm);
218 std::map<int, PHParameters *>::const_iterator iter;
222 iter->second->CopyToPdbParameterMap(nodeparams);
229 std::cout <<
"Name: " <<
Name() << std::endl;
230 std::map<int, PHParameters *>::const_iterator iter;
233 std::cout <<
"parameter detid: " << iter->first << std::endl;
234 iter->second->Print();
247 topNode->addNode(newnode);
262 std::cout <<
PHWHERE <<
" could not find PdbParameterMapContainer " << nodename
263 <<
" which must exist" << std::endl;