11 #include "TDirectory.h"
12 #include "TProcessID.h"
46 disableChildren(false),
61 std::cout <<
"Parameter " <<
name <<
"\n"
62 <<
" Input " <<
input <<
"\n"
66 std::cout <<
" Algorithm " <<
algorithm <<
"\n";
68 std::cout <<
" Reference " <<
reference <<
"\n"
69 <<
" Weight " <<
weight <<
"\n"
73 std::cout <<
" shape " <<
shape <<
"\n"
87 std::cout <<
"Region " <<
name << std::endl;
89 std::cout <<
"# daughter parameters: " <<
subparameters.size()
94 int uid = TProcessID::AssignID(&daughter);
95 if (!(TProcessID::GetPID()->GetObjectWithID(uid))) {
96 TProcessID::GetPID()->PutObjectWithID(&daughter);
99 if (
name !=
"top_level") {
100 uid = TProcessID::AssignID(
this);
101 if (!(TProcessID::GetPID()->GetObjectWithID(uid))) {
102 TProcessID::GetPID()->PutObjectWithID(
this);
112 std::cerr <<
"ERROR: attempt to access invalid subparameter " <<
i
121 std::cout <<
" Status: " <<
status << std::endl;
122 for (std::vector<std::pair<std::string, float> >::const_iterator ri =
results.begin();
124 std::cout <<
" " << ri->first <<
" " << ri->second << std::endl;
129 std::cout <<
" Algorithm name " <<
name <<
"\n"
130 <<
" library " <<
library <<
"\n"
131 <<
" parameters: " <<
"\n";
132 for (std::map<std::string, std::vector<float> >::const_iterator pit =
parameters.begin();
135 std::cout <<
" " << pit->first <<
" ";
136 for (std::vector<float>::const_iterator p2it = pit->second.begin();
137 p2it != pit->second.end(); ++p2it) {
138 std::cout << *p2it <<
" ";
140 std::cout << std::endl;
142 std::cout <<
" Green thresholds: " <<
"\n";
143 for (std::map<std::string, float>::const_iterator thit =
greenThresholds.begin();
145 std::cout <<
" " << thit->first <<
" " << thit->second << std::endl;
147 std::cout <<
" Red thresholds: " <<
"\n";
148 for (std::map<std::string, float>::const_iterator thit =
redThresholds.begin();
150 std::cout <<
" " << thit->first <<
" " << thit->second << std::endl;
155 for (std::map<std::string, std::string >::const_iterator pit =
data.begin();
156 pit !=
data.end(); ++pit) {
157 std::cout <<
" " << pit->first <<
" " << pit->second <<
"\n";
166 TString option =
opt; option.ToLower();
167 if (option.Contains(
"r")) {
169 std::cout <<
"Subparameter " << region->
subparameters[
i] << std::endl;
174 std::cerr <<
"ERROR: can't find subparameter "
176 <<
" from top-level directory "
187 TProcessID*
pid = TProcessID::GetPID();
190 TObject* subobj =
pid->GetObjectWithID(subparam);
193 std::cerr <<
"ERROR: can't retrieve parameter " << subparam
203 paramdir.WriteTObject(subobj, uid.c_str());
206 std::string daughterpath = (
path !=
"") ? (
path+
"/"+preg->
name) : (preg->
name) ;
214 TDirectory* paramdir = topdir.GetDirectory(
"Parameters");
216 paramdir = topdir.mkdir(
"Parameters");
218 std::cerr <<
"ERROR: can't make Parameters subdirectory for storage"
225 topdir.WriteTObject(&top_level,
"top_level");
226 topdir.WriteTObject(&topmap,
"object_map");
231 if (nodename ==
"top_level") {
232 rv =
dynamic_cast<PParameter*
>(topdir.Get(
"top_level"));
237 std::string
key = pmd->
data[nodename];
239 std::cerr <<
"ERROR: can't find node " << nodename <<
" in object_map"
243 rv =
dynamic_cast<PParameter*
>(topdir.Get((
"Parameters/" +
key).c_str()));
244 if (
rv) {
rv->SetUniqueID(
rv->GetUniqueID() & 0xffffff); }
248 std::cerr <<
"ERROR: can't retrieve object_map from file!" << std::endl;
255 return dynamic_cast<PParameter*
>(topdir.Get(
"top_level"));
258 if (
rv) {
rv->SetUniqueID(
rv->GetUniqueID() & 0xffffff); }