35 std::map<std::string,TMatrixT<double>*>::const_iterator
it;
36 std::map<std::string,TMatrixT<double>*>::iterator it_here;
41 it_here->second =
new TMatrixT<double>[
fNhits];
43 (it_here->second)[i].ResizeTo((it->second)[i]);
44 (it_here->second)[i] = (it->second)[i];
53 it_here->second =
new TMatrixT<double>[
fNhits];
55 (it_here->second)[i].ResizeTo((it->second)[i]);
56 (it_here->second)[i] = (it->second)[i];
62 std::map<std::string,GFDetPlane*>::const_iterator
ip;
63 std::map<std::string,GFDetPlane*>::iterator ip_here;
70 (ip_here->second)[i] = ((ip->second)[i]);
80 void GFBookkeeping::Streamer(TBuffer &R__b)
85 if (R__b.IsReading()) {
88 TObject::Streamer(R__b);
102 for(
unsigned int i=0;i<nkeys;++i){
106 for(
int j=0;j<
fNhits;++j){
114 for(
unsigned int i=0;i<nkeys;++i){
118 for(
int j=0;j<
fNhits;++j){
126 for(
unsigned int i=0;i<nkeys;++i){
130 for(
int j=0;j<
fNhits;++j){
138 unsigned int nFailedHits;
140 unsigned int aFailedHit;
141 for(
unsigned int i=0;i<nFailedHits;++i){
148 TObject::Streamer(R__b);
153 std::vector<std::string> keys;
156 R__b << (
unsigned int)(keys.size());
157 for(
unsigned int i=0;i<keys.size();++i){
158 TString
s(keys.at(i));
160 for(
int j=0;j<
fNhits;++j){
161 ((
fMatrices[keys.at(i)])[j]).Streamer(R__b);
168 R__b << (
unsigned int)(keys.size());
169 for(
unsigned int i=0;i<keys.size();++i){
170 TString
s(keys.at(i));
172 for(
int j=0;j<
fNhits;++j){
173 ((
fPlanes[keys.at(i)])[j]).Streamer(R__b);
180 R__b << (
unsigned int)(keys.size());
181 for(
unsigned int i=0;i<keys.size();++i){
182 TString
s(keys.at(i));
184 for(
int j=0;j<
fNhits;++j){
185 ((
fNumbers[keys.at(i)])[j]).Streamer(R__b);
201 GFException exc(
"fNhits not defined",__LINE__,__FILE__);
205 std::ostringstream ostr;
206 ostr <<
"The key " << key
207 <<
" is already occupied in GFBookkeeping::bookMatrices()";
216 GFException exc(
"fNhits not defined",__LINE__,__FILE__);
220 std::ostringstream ostr;
221 ostr <<
"The key " << key
222 <<
" is already occupied in GFBookkeeping::bookGFDetPlanes()";
232 GFException exc(
"fNhits not defined",__LINE__,__FILE__);
236 std::ostringstream ostr;
237 ostr <<
"The key " << key
238 <<
" is already occupied in GFBookkeeping::bookNumbers()";
243 for(
int i=0;i<
fNhits;++i){
251 const TMatrixT<double>& mat){
253 std::ostringstream ostr;
254 ostr <<
"The key " << key <<
" is unknown in GFBookkeeping::setMatrix()";
258 if(index>=(
unsigned int)
fNhits){
259 std::ostringstream ostr;
260 ostr <<
"The index " << index
261 <<
" is out of range in GFBookkeeping::setMatrix()";
271 std::ostringstream ostr;
272 ostr <<
"The key " << key <<
" is unknown in GFBookkeeping::setGFDetPlane()";
276 if(index>=(
unsigned int)
fNhits){
277 std::ostringstream ostr;
278 ostr <<
"The index " << index
279 <<
" is out of range in GFBookkeeping::setGFDetPlane()";
288 std::ostringstream ostr;
289 ostr <<
"The key " << key <<
" is unknown in GFBookkeeping::setNumber()";
293 if(index>=(
unsigned int)
fNhits){
294 std::ostringstream ostr;
295 ostr <<
"The index " << index
296 <<
" is out of range in GFBookkeeping::setNumber()";
305 TMatrixT<double>& mat)
const {
306 std::map<std::string, TMatrixT<double>* >::const_iterator
it;
309 std::ostringstream ostr;
310 ostr <<
"The key " << key <<
" is unknown in GFBookkeeping::getMatrix()";
314 if(index>=(
unsigned int)
fNhits){
315 std::ostringstream ostr;
316 ostr <<
"The index " << index
317 <<
" is out of range in GFBookkeeping::getMatrix()";
321 mat.ResizeTo(((*it).second)[index]);
322 mat = ((*it).second)[index];
328 std::map<std::string, GFDetPlane* >::const_iterator
it;
331 std::ostringstream ostr;
332 ostr <<
"The key " << key <<
" is unknown in GFBookkeeping::getGFDetPlane()";
336 if(index>=(
unsigned int)
fNhits){
337 std::ostringstream ostr;
338 ostr <<
"The index " << index
339 <<
" is out of range in GFBookkeeping::getGFDetPlane()";
343 pl = ((*it).second)[index];
349 std::map<std::string, TMatrixT<double>* >::const_iterator
it;
352 std::ostringstream ostr;
353 ostr <<
"The key " << key <<
" is unknown in GFBookkeeping::getNumber()";
357 if(index>=(
unsigned int)
fNhits){
358 std::ostringstream ostr;
359 ostr <<
"The index " << index
360 <<
" is out of range in GFBookkeeping::getNumber()";
364 num = (((*it).second)[index])(0,0);
377 unsigned int retVal = 0;
398 for(
unsigned int i=0;i<matKeys.size();++i){
401 for(
unsigned int i=0;i<planeKeys.size();++i){
404 for(
unsigned int i=0;i<numKeys.size();++i){
411 std::map<std::string, TMatrixT<double>* >::iterator itMat;
413 if(itMat->second!=NULL)
delete [] itMat->second;
415 std::map<std::string, GFDetPlane* >::iterator itPl;
417 if(itPl->second!=NULL)
delete [] itPl->second;
419 std::map<std::string, TMatrixT<double>* >::iterator itNum;
421 if(itNum->second!=NULL)
delete [] itNum->second;
429 std::vector< std::string > keys;
430 std::map<std::string, TMatrixT<double>* >::const_iterator
it;
432 if(it->second!=NULL) keys.push_back(it->first);
437 std::vector< std::string > keys;
438 std::map<std::string, GFDetPlane* >::const_iterator
it;
440 if(it->second!=NULL) keys.push_back(it->first);
445 std::vector< std::string > keys;
446 std::map<std::string, TMatrixT<double>* >::const_iterator
it;
448 if(it->second!=NULL) keys.push_back(it->first);
455 std::cout <<
"=============GFBookkeeping::print()==============" << std::endl;
456 std::cout <<
"-----printing all matrices:------" << std::endl;
458 for(
unsigned int i=0;i<keys.size();++i){
459 std::cout <<
"key " << keys.at(i) <<
" has " << fNhits
460 <<
" entries:" << std::endl;
461 for(
int j=0;j<
fNhits;++j){
467 std::cout <<
"-----printing all GFDetPlanes:------" << std::endl;
469 for(
unsigned int i=0;i<keys.size();++i){
470 std::cout <<
"key " << keys.at(i) <<
" has " << fNhits
471 <<
" entries:" << std::endl;
472 for(
int j=0;j<
fNhits;++j){
478 std::cout <<
"-----printing all numbers:------" << std::endl;
480 for(
unsigned int i=0;i<keys.size();++i){
481 std::cout <<
"key " << keys.at(i) <<
" has " << fNhits
482 <<
" entries:" << std::endl;
483 for(
int j=0;j<
fNhits;++j){
486 std::cout << n << std::endl;
489 std::cout <<
"-----failed hits:------" << std::endl;
493 std::cout << std::endl;