4 #include <pdbcalbase/PdbBankManager.h>
5 #include <pdbcalbase/PdbApplication.h>
6 #include <pdbcalbase/PdbBankList.h>
7 #include <pdbcalbase/PdbCalBank.h>
8 #include <pdbcalbase/PdbParameterMap.h>
9 #include <pdbcalbase/PdbParameterMapContainer.h>
15 #include <TBufferXML.h>
26 superdetectorname(name)
84 cout <<
PHWHERE <<
" layer " << layer <<
" already exists for "
94 map<int, PHG4Parameters *>::const_iterator iter =
parametermap.find(layer);
97 cout <<
"could not find parameters for layer " << layer
107 map<int, PHG4Parameters *>::iterator iter =
parametermap.find(layer);
118 ostringstream fullpath;
119 ostringstream fnamestream;
125 if (*(dir.rbegin()) !=
'/')
130 <<
"-" << TStart.
getTics() <<
"-" << TStop.
getTics() <<
"-" << time(0)
132 string fname = fnamestream.str();
133 std::transform(fname.begin(), fname.end(), fname.begin(), ::tolower);
136 cout <<
"PHG4Parameters::WriteToFile - save to "<<fullpath.str()<<endl;
140 TFile *f = TFile::Open(fullpath.str().c_str(),
"recreate");
143 string floatformat = TBufferXML::GetFloatFormat();
144 TBufferXML::SetFloatFormat(
"%.15e");
148 TBufferXML::SetFloatFormat(floatformat.c_str());
149 cout <<
"sleeping 1 second to prevent duplicate inserttimes" << endl;
161 cout <<
PHWHERE <<
" Aborting, Database not writable" << endl;
162 application->
abort();
172 std::transform(tablename.begin(), tablename.end(), tablename.begin(),
175 "Geometry Parameters", TStart, TStop, tablename);
181 application->
commit(NewBank);
186 cout <<
PHWHERE " Committing to DB failed" << endl;
195 std::map<int, PHG4Parameters *>::const_iterator iter;
199 iter->second->CopyToPdbParameterMap(myparm);
208 cout <<
"Name: " <<
Name() << endl;
209 map<int, PHG4Parameters *>::const_iterator iter;
212 cout <<
"parameter detid: " << iter->first << endl;
213 iter->second->Print();
PHBoolean addNode(PHNode *)
PHG4ParametersContainer(const std::string &name="NONE")
int WriteToFile(const std::string &extension, const std::string &dir)
std::map< int, PHG4Parameters * > parametermap
void CreateAndFillFrom(const PdbParameterMapContainer *saveparamcontainer, const std::string &name)
void AddPHG4Parameters(const int layer, PHG4Parameters *params)
int ExistDetid(const int detid) const
void CopyToPdbParameterMapContainer(PdbParameterMapContainer *myparm)
const PHG4Parameters * GetParameters(const int layer) const
void FillFrom(const PdbParameterMapContainer *saveparamcontainer)
std::string superdetectorname
void SaveToNodeTree(PHCompositeNode *topNode, const std::string &nodename)
virtual ~PHG4ParametersContainer()
PHG4Parameters * GetParametersToModify(const int layer)
void FillFrom(const PdbParameterMap *saveparams)
virtual PdbStatus abort()=0
virtual PdbStatus commit()=0
virtual PdbStatus startUpdate()=0
int getInternalValue() const
static PdbBankManager * instance()
virtual PdbApplication * getApplication()=0
virtual PdbCalBank * createBank(const std::string &, PdbBankID, const std::string &, PHTimeStamp &, PHTimeStamp &, const std::string &)=0
virtual void setLength(size_t val)=0
virtual PdbCalChan & getEntry(size_t)=0
parConstRange get_ParameterMaps() const
void AddPdbParameterMap(const int layer, PdbParameterMap *params)
parMap::const_iterator parIter
std::pair< parIter, parIter > parConstRange