36 std::map<std::string, TMatrixT<Double_t>*>
::iterator it_here;
41 it_here->second =
new TMatrixT<Double_t>[
fNhits];
42 for (
int i = 0; i <
fNhits; ++i) {
43 (it_here->second)[i] = (it->second)[i];
52 it_here->second =
new TMatrixT<Double_t>[
fNhits];
53 for (
int i = 0; i <
fNhits; ++i) {
54 (it_here->second)[i] = (it->second)[i];
65 while (ip != bk.
fPlanes.end()) {
67 for (
int i = 0; i <
fNhits; ++i) {
68 (ip_here->second)[i] = ((ip->second)[i]);
79 if (R__b.IsReading()) {
82 TObject::Streamer(R__b);
91 TMatrixT<Double_t>
mat;
96 for (
unsigned int i = 0; i < nkeys; ++i) {
100 for (
int j = 0; j <
fNhits; ++j) {
108 for (
unsigned int i = 0; i < nkeys; ++i) {
112 for (
int j = 0; j <
fNhits; ++j) {
120 for (
unsigned int i = 0; i < nkeys; ++i) {
124 for (
int j = 0; j <
fNhits; ++j) {
132 unsigned int nFailedHits;
134 unsigned int aFailedHit;
135 for (
unsigned int i = 0; i < nFailedHits; ++i) {
143 TObject::Streamer(R__b);
148 std::vector<std::string> keys;
151 R__b << (
unsigned int)(keys.size());
152 for (
unsigned int i = 0; i < keys.size(); ++i) {
153 TString s(keys.at(i));
155 for (
int j = 0; j <
fNhits; ++j) {
156 ((
fMatrices[keys.at(i)])[j]).Streamer(R__b);
163 R__b << (
unsigned int)(keys.size());
164 for (
unsigned int i = 0; i < keys.size(); ++i) {
165 TString s(keys.at(i));
167 for (
int j = 0; j <
fNhits; ++j) {
168 ((
fPlanes[keys.at(i)])[j]).Streamer(R__b);
175 R__b << (
unsigned int)(keys.size());
176 for (
unsigned int i = 0; i < keys.size(); ++i) {
177 TString s(keys.at(i));
179 for (
int j = 0; j <
fNhits; ++j) {
180 ((
fNumbers[keys.at(i)])[j]).Streamer(R__b);
186 for (
unsigned int i = 0; i <
fFailedHits.size(); ++i) {
196 GFException exc(
"fNhits not defined", __LINE__, __FILE__);
200 std::ostringstream ostr;
201 ostr <<
"The key " << key <<
" is already occupied in genf::GFBookkeeping::bookMatrices()";
211 GFException exc(
"fNhits not defined", __LINE__, __FILE__);
215 std::ostringstream ostr;
216 ostr <<
"The key " << key <<
" is already occupied in genf::GFBookkeeping::bookGFDetPlanes()";
227 GFException exc(
"fNhits not defined", __LINE__, __FILE__);
231 std::ostringstream ostr;
232 ostr <<
"The key " << key <<
" is already occupied in genf::GFBookkeeping::bookNumbers()";
237 for (
int i = 0; i <
fNhits; ++i) {
238 ((
fNumbers[key])[i]).ResizeTo(1, 1);
245 const TMatrixT<Double_t>&
mat)
248 std::ostringstream ostr;
249 ostr <<
"The key " << key <<
" is unknown in genf::GFBookkeeping::setMatrix()";
253 if (index >= (
unsigned int)
fNhits) {
254 std::ostringstream ostr;
255 ostr <<
"The index " << index <<
" is out of range in genf::GFBookkeeping::setMatrix()";
267 std::ostringstream ostr;
268 ostr <<
"The key " << key <<
" is unknown in genf::GFBookkeeping::setGFDetPlane()";
272 if (index >= (
unsigned int)
fNhits) {
273 std::ostringstream ostr;
274 ostr <<
"The index " << index <<
" is out of range in genf::GFBookkeeping::setGFDetPlane()";
283 std::ostringstream ostr;
284 ostr <<
"The key " << key <<
" is unknown in genf::GFBookkeeping::setNumber()";
288 if (index >= (
unsigned int)
fNhits) {
289 std::ostringstream ostr;
290 ostr <<
"The index " << index <<
" is out of range in genf::GFBookkeeping::setNumber()";
294 ((
fNumbers[key])[index])[0][0] = num;
299 TMatrixT<Double_t>&
mat)
const 303 std::ostringstream ostr;
304 ostr <<
"The key " << key <<
" is unknown in genf::GFBookkeeping::getMatrix()";
308 if (index >= (
unsigned int)
fNhits) {
309 std::ostringstream ostr;
310 ostr <<
"The index " << index <<
" is out of range in genf::GFBookkeeping::getMatrix()";
314 mat.ResizeTo(iMatrix->second[index]);
315 mat = iMatrix->second[index];
323 auto iPlane =
fPlanes.find(key);
325 std::ostringstream ostr;
326 ostr <<
"The key " << key <<
" is unknown in genf::GFBookkeeping::getGFDetPlane()";
330 if (index >= (
unsigned int)
fNhits) {
331 std::ostringstream ostr;
332 ostr <<
"The index " << index <<
" is out of range in genf::GFBookkeeping::getGFDetPlane()";
336 pl = iPlane->second[index];
343 std::ostringstream ostr;
344 ostr <<
"The key " << key <<
" is unknown in genf::GFBookkeeping::getNumber()";
348 if (index >= (
unsigned int)
fNhits) {
349 std::ostringstream ostr;
350 ostr <<
"The index " << index <<
" is out of range in genf::GFBookkeeping::getNumber()";
354 num = iNumber->second[index][0][0];
370 unsigned int retVal = 0;
371 for (
unsigned int i = 0; i <
fFailedHits.size(); ++i) {
391 for (
unsigned int i = 0; i < matKeys.size(); ++i) {
394 for (
unsigned int i = 0; i < planeKeys.size(); ++i) {
397 for (
unsigned int i = 0; i < numKeys.size(); ++i) {
404 std::map<std::string, TMatrixT<Double_t>*>
::iterator itMat;
406 if (itMat->second != NULL)
delete[] itMat->second;
410 if (itPl->second != NULL)
delete[] itPl->second;
412 std::map<std::string, TMatrixT<Double_t>*>
::iterator itNum;
414 if (itNum->second != NULL)
delete[] itNum->second;
423 std::vector<std::string> keys;
426 if (it->second != NULL) keys.push_back(it->first);
432 std::vector<std::string> keys;
435 if (it->second != NULL) keys.push_back(it->first);
441 std::vector<std::string> keys;
444 if (it->second != NULL) keys.push_back(it->first);
451 out <<
"=============genf::GFBookkeeping::print()==============" << std::endl;
452 out <<
"-----printing all matrices:------" << std::endl;
454 for (
unsigned int i = 0; i < keys.size(); ++i) {
455 out <<
"key " << keys.at(i) <<
" has " <<
fNhits <<
" entries:" << std::endl;
456 for (
int j = 0; j <
fNhits; ++j) {
457 TMatrixT<Double_t> m;
462 out <<
"-----printing all GFDetPlanes:------" << std::endl;
464 for (
unsigned int i = 0; i < keys.size(); ++i) {
465 out <<
"key " << keys.at(i) <<
" has " <<
fNhits <<
" entries:" << std::endl;
466 for (
int j = 0; j <
fNhits; ++j) {
472 out <<
"-----printing all numbers:------" << std::endl;
474 for (
unsigned int i = 0; i < keys.size(); ++i) {
475 out <<
"key " << keys.at(i) <<
" has " <<
fNhits <<
" entries:" << std::endl;
476 for (
int j = 0; j <
fNhits; ++j) {
479 out << n << std::endl;
482 out <<
"-----failed hits:------" << std::endl;
483 for (
unsigned int i = 0; i <
fFailedHits.size(); ++i) {
void setDetPlane(std::string key, unsigned int index, const GFDetPlane &pl)
void Print(std::ostream &out=std::cout) const
std::map< std::string, GFDetPlane * > fPlanes
void setNumber(std::string key, unsigned int index, const double &num)
void Print(std::ostream &out=std::cout) const
void setMatrix(std::string key, unsigned int index, const TMatrixT< Double_t > &mat)
void addFailedHit(unsigned int)
void bookGFDetPlanes(std::string key)
unsigned int hitFailed(unsigned int)
bool getNumber(std::string key, unsigned int index, double &num) const
std::map< std::string, TMatrixT< Double_t > * > fNumbers
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
void bookMatrices(std::string key)
std::vector< std::string > getMatrixKeys() const
std::vector< std::string > getGFDetPlaneKeys() const
bool getMatrix(std::string key, unsigned int index, TMatrixT< Double_t > &mat) const
void bookNumbers(std::string key, double val=0.)
std::vector< std::string > getNumberKeys() const
bool getDetPlane(std::string key, unsigned int index, GFDetPlane &pl) const
std::vector< unsigned int > fFailedHits
std::map< std::string, TMatrixT< Double_t > * > fMatrices
unsigned int getNumFailed()