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>
21 #include <boost/stacktrace.hpp>
34 : superdetectorname(name)
89 cout <<
PHWHERE <<
" detector id " << detid <<
" already exists for "
99 map<int, PHParameters *>::const_iterator iter =
parametermap.find(detid);
102 cout <<
"could not find parameters for detector id " << detid
104 cout <<
"Here is the stacktrace: " << endl;
105 cout << boost::stacktrace::stacktrace();
107 <<
"DO NOT PANIC - this is not a segfault" << endl;
108 cout <<
"Check the stacktrace for the guilty party (typically #2)" << endl;
118 map<int, PHParameters *>::iterator iter =
parametermap.find(detid);
128 ostringstream fullpath;
129 ostringstream fnamestream;
135 if (*(dir.rbegin()) !=
'/')
143 string fname = fnamestream.str();
144 std::transform(fname.begin(), fname.end(), fname.begin(), ::tolower);
147 cout <<
"PHParameters::WriteToFile - save to " << fullpath.str() << endl;
151 TFile *
f = TFile::Open(fullpath.str().c_str(),
"recreate");
154 string floatformat = TBufferXML::GetFloatFormat();
155 TBufferXML::SetFloatFormat(
"%.15e");
159 TBufferXML::SetFloatFormat(floatformat.c_str());
160 cout <<
"sleeping 1 second to prevent duplicate inserttimes" << endl;
171 cout <<
PHWHERE <<
" Aborting, Database not writable" << endl;
172 application->
abort();
182 std::transform(tablename.begin(), tablename.end(), tablename.begin(),
185 "Geometry Parameters", TStart, TStop, tablename);
191 application->
commit(NewBank);
196 cout <<
PHWHERE " Committing to DB failed" << endl;
204 std::map<int, PHParameters *>::const_iterator iter;
208 iter->second->CopyToPdbParameterMap(myparm);
216 std::map<int, PHParameters *>::const_iterator iter;
220 iter->second->CopyToPdbParameterMap(nodeparams);
227 cout <<
"Name: " <<
Name() << endl;
228 map<int, PHParameters *>::const_iterator iter;
231 cout <<
"parameter detid: " << iter->first << endl;
232 iter->second->Print();
245 topNode->addNode(newnode);
260 cout <<
PHWHERE <<
" could not find PdbParameterMapContainer " << nodename
261 <<
" which must exist" << endl;