ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetRecoEval.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetRecoEval.cc
1 #include "JetRecoEval.h"
2 
3 #include "CaloEvalStack.h"
4 #include "CaloRawClusterEval.h"
5 #include "CaloRawTowerEval.h" // for CaloRawTowerEval
6 #include "JetTruthEval.h"
7 #include "SvtxEvalStack.h"
8 #include "SvtxTrackEval.h"
9 
10 #include <calobase/RawCluster.h>
11 #include <calobase/RawClusterContainer.h>
12 #include <calobase/RawTower.h>
13 #include <calobase/RawTowerContainer.h>
14 
15 #include <g4jets/Jet.h>
16 #include <g4jets/JetMap.h>
17 
18 #include <g4main/PHG4Particle.h>
19 
22 
23 #include <phool/getClass.h>
24 #include <phool/phool.h>
25 
26 #include <cassert>
27 #include <cfloat>
28 #include <cmath>
29 #include <cstdlib>
30 #include <iostream>
31 #include <map>
32 #include <set>
33 #include <string>
34 
35 using namespace std;
36 
38  const std::string& recojetname,
39  const std::string& truthjetname)
40  : _jettrutheval(topNode, truthjetname)
41  , _recojetname(recojetname)
42  , _truthjetname(truthjetname)
43  , _recojets(nullptr)
44  , _truthjets(nullptr)
45  , _trackmap(nullptr)
46  , _cemctowers(nullptr)
47  , _cemcclusters(nullptr)
48  , _hcalintowers(nullptr)
49  , _hcalinclusters(nullptr)
50  , _hcalouttowers(nullptr)
51  , _hcaloutclusters(nullptr)
52  , _femctowers(nullptr)
53  , _femcclusters(nullptr)
54  , _fhcaltowers(nullptr)
55  , _fhcalclusters(nullptr)
56  , _eemctowers(nullptr)
57  , _eemcclusters(nullptr)
58  , _strict(false)
59  , _verbosity(1)
60  , _errors(0)
61  , _do_cache(true)
62  , _cache_all_truth_showers()
63  , _cache_all_truth_particles()
64  , _cache_all_truth_jets()
65  , _cache_max_truth_jet_by_energy()
66  , _cache_all_jets_from()
67  , _cache_best_jet_from()
68  , _cache_get_energy_contribution()
69  , _cache_get_energy_contribution_src()
70  , _cache_all_truth_hits()
71 {
72  get_node_pointers(topNode);
73 }
74 
76 {
77  if (_verbosity > 0)
78  {
79  if ((_errors > 0) || (_verbosity > 1))
80  {
81  cout << "JetRecoEval::~JetRecoEval() - Error Count: " << _errors << endl;
82  }
83  }
84 }
85 
87 {
90  _cache_all_truth_jets.clear();
92  _cache_all_jets_from.clear();
93  _cache_best_jet_from.clear();
96  _cache_all_truth_hits.clear();
97 
98  _jettrutheval.next_event(topNode);
99 
100  get_node_pointers(topNode);
101 }
102 
104 {
107 }
108 
109 std::set<PHG4Shower*> JetRecoEval::all_truth_showers(Jet* recojet)
110 {
111  if (_strict)
112  {
113  assert(recojet);
114  }
115  else if (!recojet)
116  {
117  ++_errors;
118  return std::set<PHG4Shower*>();
119  }
120 
121  if (_do_cache)
122  {
123  std::map<Jet*, std::set<PHG4Shower*> >::iterator iter =
124  _cache_all_truth_showers.find(recojet);
125  if (iter != _cache_all_truth_showers.end())
126  {
127  return iter->second;
128  }
129  }
130 
131  std::set<PHG4Shower*> truth_showers;
132 
133  // loop over all the jet constituents, backtrack each reco object to the
134  // truth hits and combine with other consituents
135 
136  for (Jet::ConstIter iter = recojet->begin_comp();
137  iter != recojet->end_comp();
138  ++iter)
139  {
140  Jet::SRC source = iter->first;
141  unsigned int index = iter->second;
142 
143  std::set<PHG4Shower*> new_showers;
144 
145  if (source == Jet::TRACK)
146  {
147  if (!_trackmap)
148  {
149  cout << PHWHERE << "ERROR: can't find SvtxTrackMap" << endl;
150  exit(-1);
151  }
152 
153  // SvtxTrack* track = _trackmap->get(index);
154 
155  // if (_strict) {assert(track);}
156  // else if (!track) {++_errors; continue;}
157 
158  // new_showers = get_svtx_eval_stack()->get_track_eval()->all_truth_showers(track);
159  }
160 
161  else if (source == Jet::CEMC_TOWER)
162  {
163  if (!_cemctowers)
164  {
165  cout << PHWHERE << "ERROR: can't find TOWER_CEMC" << endl;
166  exit(-1);
167  }
168 
169  RawTower* tower = _cemctowers->getTower(index);
170 
171  if (_strict)
172  {
173  assert(tower);
174  }
175  else if (!tower)
176  {
177  ++_errors;
178  continue;
179  }
180 
182  }
183  else if (source == Jet::CEMC_CLUSTER)
184  {
185  if (!_cemcclusters)
186  {
187  cout << PHWHERE << "ERROR: can't find CLUSTER_CEMC" << endl;
188  exit(-1);
189  }
190 
191  RawCluster* cluster = _cemcclusters->getCluster(index);
192 
193  if (_strict)
194  {
195  assert(cluster);
196  }
197  else if (!cluster)
198  {
199  ++_errors;
200  continue;
201  }
202 
204  }
205  else if (source == Jet::EEMC_TOWER)
206  {
207  if (!_eemctowers)
208  {
209  cout << PHWHERE << "ERROR: can't find TOWER_EEMC" << endl;
210  exit(-1);
211  }
212 
213  RawTower* tower = _eemctowers->getTower(index);
214 
215  if (_strict)
216  {
217  assert(tower);
218  }
219  else if (!tower)
220  {
221  ++_errors;
222  continue;
223  }
224 
226  }
227  else if (source == Jet::EEMC_CLUSTER)
228  {
229  if (!_eemcclusters)
230  {
231  cout << PHWHERE << "ERROR: can't find CLUSTER_EEMC" << endl;
232  exit(-1);
233  }
234 
235  RawCluster* cluster = _eemcclusters->getCluster(index);
236 
237  if (_strict)
238  {
239  assert(cluster);
240  }
241  else if (!cluster)
242  {
243  ++_errors;
244  continue;
245  }
246 
248  }
249  else if (source == Jet::HCALIN_TOWER)
250  {
251  if (!_hcalintowers)
252  {
253  cout << PHWHERE << "ERROR: can't find TOWER_HCALIN" << endl;
254  exit(-1);
255  }
256 
257  RawTower* tower = _hcalintowers->getTower(index);
258 
259  if (_strict)
260  {
261  assert(tower);
262  }
263  else if (!tower)
264  {
265  ++_errors;
266  continue;
267  }
268 
270  }
271  else if (source == Jet::HCALIN_CLUSTER)
272  {
273  if (!_hcalinclusters)
274  {
275  cout << PHWHERE << "ERROR: can't find CLUSTER_HCALIN" << endl;
276  exit(-1);
277  }
278 
279  RawCluster* cluster = _hcalinclusters->getCluster(index);
280 
281  if (_strict)
282  {
283  assert(cluster);
284  }
285  else if (!cluster)
286  {
287  ++_errors;
288  continue;
289  }
290 
292  }
293  else if (source == Jet::HCALOUT_TOWER)
294  {
295  if (!_hcalouttowers)
296  {
297  cout << PHWHERE << "ERROR: can't find TOWER_HCALOUT" << endl;
298  exit(-1);
299  }
300 
301  RawTower* tower = _hcalouttowers->getTower(index);
302 
303  if (_strict)
304  {
305  assert(tower);
306  }
307  else if (!tower)
308  {
309  ++_errors;
310  continue;
311  }
312 
314  }
315  else if (source == Jet::HCALOUT_CLUSTER)
316  {
317  if (!_hcaloutclusters)
318  {
319  cout << PHWHERE << "ERROR: can't find CLUSTER_HCALOUT" << endl;
320  exit(-1);
321  }
322 
323  RawCluster* cluster = _hcaloutclusters->getCluster(index);
324 
325  if (_strict)
326  {
327  assert(cluster);
328  }
329  else if (!cluster)
330  {
331  ++_errors;
332  continue;
333  }
334 
336  }
337  else if (source == Jet::FEMC_TOWER)
338  {
339  if (!_femctowers)
340  {
341  cout << PHWHERE << "ERROR: can't find TOWER_FEMC" << endl;
342  exit(-1);
343  }
344 
345  RawTower* tower = _femctowers->getTower(index);
346 
347  if (_strict)
348  {
349  assert(tower);
350  }
351  else if (!tower)
352  {
353  ++_errors;
354  continue;
355  }
356 
358  }
359  else if (source == Jet::FEMC_CLUSTER)
360  {
361  if (!_femcclusters)
362  {
363  cout << PHWHERE << "ERROR: can't find CLUSTER_FEMC" << endl;
364  exit(-1);
365  }
366 
367  RawCluster* cluster = _femcclusters->getCluster(index);
368 
369  if (_strict)
370  {
371  assert(cluster);
372  }
373  else if (!cluster)
374  {
375  ++_errors;
376  continue;
377  }
378 
380  }
381  else if (source == Jet::FHCAL_TOWER)
382  {
383  if (!_fhcaltowers)
384  {
385  cout << PHWHERE << "ERROR: can't find TOWER_FHCAL" << endl;
386  exit(-1);
387  }
388 
389  RawTower* tower = _fhcaltowers->getTower(index);
390 
391  if (_strict)
392  {
393  assert(tower);
394  }
395  else if (!tower)
396  {
397  ++_errors;
398  continue;
399  }
400 
402  }
403  else if (source == Jet::FHCAL_CLUSTER)
404  {
405  if (!_fhcalclusters)
406  {
407  cout << PHWHERE << "ERROR: can't find CLUSTER_FHCAL" << endl;
408  exit(-1);
409  }
410 
411  RawCluster* cluster = _fhcalclusters->getCluster(index);
412 
413  if (_strict)
414  {
415  assert(cluster);
416  }
417  else if (!cluster)
418  {
419  ++_errors;
420  continue;
421  }
422 
424  }
425 
426  for (std::set<PHG4Shower*>::iterator jter = new_showers.begin();
427  jter != new_showers.end();
428  ++jter)
429  {
430  truth_showers.insert(*jter);
431  }
432  }
433 
434  if (_do_cache) _cache_all_truth_showers.insert(make_pair(recojet, truth_showers));
435 
436  return truth_showers;
437 }
438 
439 std::set<PHG4Particle*> JetRecoEval::all_truth_particles(Jet* recojet)
440 {
441  if (_strict)
442  {
443  assert(recojet);
444  }
445  else if (!recojet)
446  {
447  ++_errors;
448  return std::set<PHG4Particle*>();
449  }
450 
451  if (_do_cache)
452  {
453  std::map<Jet*, std::set<PHG4Particle*> >::iterator iter =
454  _cache_all_truth_particles.find(recojet);
455  if (iter != _cache_all_truth_particles.end())
456  {
457  return iter->second;
458  }
459  }
460 
461  std::set<PHG4Particle*> truth_particles;
462 
463  // loop over all the jet constituents, backtrack each reco object to the
464  // truth hits and combine with other consituents
465 
466  for (Jet::ConstIter iter = recojet->begin_comp();
467  iter != recojet->end_comp();
468  ++iter)
469  {
470  Jet::SRC source = iter->first;
471  unsigned int index = iter->second;
472 
473  std::set<PHG4Particle*> new_particles;
474 
475  if (source == Jet::TRACK)
476  {
477  if (!_trackmap)
478  {
479  cout << PHWHERE << "ERROR: can't find TrackMap" << endl;
480  exit(-1);
481  }
482 
483  SvtxTrack* track = _trackmap->get(index);
484 
485  if (_strict)
486  {
487  assert(track);
488  }
489  else if (!track)
490  {
491  ++_errors;
492  continue;
493  }
494 
495  new_particles = get_svtx_eval_stack()->get_track_eval()->all_truth_particles(track);
496  }
497  else if (source == Jet::CEMC_TOWER)
498  {
499  if (!_cemctowers)
500  {
501  cout << PHWHERE << "ERROR: can't find TOWER_CEMC" << endl;
502  exit(-1);
503  }
504 
505  RawTower* tower = _cemctowers->getTower(index);
506 
507  if (_strict)
508  {
509  assert(tower);
510  }
511  else if (!tower)
512  {
513  ++_errors;
514  continue;
515  }
516 
518  }
519  else if (source == Jet::CEMC_CLUSTER)
520  {
521  if (!_cemcclusters)
522  {
523  cout << PHWHERE << "ERROR: can't find CLUSTER_CEMC" << endl;
524  exit(-1);
525  }
526 
527  RawCluster* cluster = _cemcclusters->getCluster(index);
528 
529  if (_strict)
530  {
531  assert(cluster);
532  }
533  else if (!cluster)
534  {
535  ++_errors;
536  continue;
537  }
538 
540  }
541  else if (source == Jet::EEMC_TOWER)
542  {
543  if (!_eemctowers)
544  {
545  cout << PHWHERE << "ERROR: can't find TOWER_EEMC" << endl;
546  exit(-1);
547  }
548 
549  RawTower* tower = _eemctowers->getTower(index);
550 
551  if (_strict)
552  {
553  assert(tower);
554  }
555  else if (!tower)
556  {
557  ++_errors;
558  continue;
559  }
560 
562  }
563  else if (source == Jet::EEMC_CLUSTER)
564  {
565  if (!_eemcclusters)
566  {
567  cout << PHWHERE << "ERROR: can't find CLUSTER_EEMC" << endl;
568  exit(-1);
569  }
570 
571  RawCluster* cluster = _eemcclusters->getCluster(index);
572 
573  if (_strict)
574  {
575  assert(cluster);
576  }
577  else if (!cluster)
578  {
579  ++_errors;
580  continue;
581  }
582 
584  }
585  else if (source == Jet::HCALIN_TOWER)
586  {
587  if (!_hcalintowers)
588  {
589  cout << PHWHERE << "ERROR: can't find TOWER_HCALIN" << endl;
590  exit(-1);
591  }
592 
593  RawTower* tower = _hcalintowers->getTower(index);
594 
595  if (_strict)
596  {
597  assert(tower);
598  }
599  else if (!tower)
600  {
601  ++_errors;
602  continue;
603  }
604 
606  }
607  else if (source == Jet::HCALIN_CLUSTER)
608  {
609  if (!_hcalinclusters)
610  {
611  cout << PHWHERE << "ERROR: can't find CLUSTER_HCALIN" << endl;
612  exit(-1);
613  }
614 
615  RawCluster* cluster = _hcalinclusters->getCluster(index);
616 
617  if (_strict)
618  {
619  assert(cluster);
620  }
621  else if (!cluster)
622  {
623  ++_errors;
624  continue;
625  }
626 
628  }
629  else if (source == Jet::HCALOUT_TOWER)
630  {
631  if (!_hcalouttowers)
632  {
633  cout << PHWHERE << "ERROR: can't find TOWER_HCALOUT" << endl;
634  exit(-1);
635  }
636 
637  RawTower* tower = _hcalouttowers->getTower(index);
638 
639  if (_strict)
640  {
641  assert(tower);
642  }
643  else if (!tower)
644  {
645  ++_errors;
646  continue;
647  }
648 
650  }
651  else if (source == Jet::HCALOUT_CLUSTER)
652  {
653  if (!_hcaloutclusters)
654  {
655  cout << PHWHERE << "ERROR: can't find CLUSTER_HCALOUT" << endl;
656  exit(-1);
657  }
658 
659  RawCluster* cluster = _hcaloutclusters->getCluster(index);
660 
661  if (_strict)
662  {
663  assert(cluster);
664  }
665  else if (!cluster)
666  {
667  ++_errors;
668  continue;
669  }
670 
672  }
673  else if (source == Jet::FEMC_TOWER)
674  {
675  if (!_femctowers)
676  {
677  cout << PHWHERE << "ERROR: can't find TOWER_FEMC" << endl;
678  exit(-1);
679  }
680 
681  RawTower* tower = _femctowers->getTower(index);
682 
683  if (_strict)
684  {
685  assert(tower);
686  }
687  else if (!tower)
688  {
689  ++_errors;
690  continue;
691  }
692 
694  }
695  else if (source == Jet::FEMC_CLUSTER)
696  {
697  if (!_femcclusters)
698  {
699  cout << PHWHERE << "ERROR: can't find CLUSTER_FEMC" << endl;
700  exit(-1);
701  }
702 
703  RawCluster* cluster = _femcclusters->getCluster(index);
704 
705  if (_strict)
706  {
707  assert(cluster);
708  }
709  else if (!cluster)
710  {
711  ++_errors;
712  continue;
713  }
714 
716  }
717  else if (source == Jet::FHCAL_TOWER)
718  {
719  if (!_fhcaltowers)
720  {
721  cout << PHWHERE << "ERROR: can't find TOWER_FHCAL" << endl;
722  exit(-1);
723  }
724 
725  RawTower* tower = _fhcaltowers->getTower(index);
726 
727  if (_strict)
728  {
729  assert(tower);
730  }
731  else if (!tower)
732  {
733  ++_errors;
734  continue;
735  }
736 
738  }
739  else if (source == Jet::FHCAL_CLUSTER)
740  {
741  if (!_fhcalclusters)
742  {
743  cout << PHWHERE << "ERROR: can't find CLUSTER_FHCAL" << endl;
744  exit(-1);
745  }
746 
747  RawCluster* cluster = _fhcalclusters->getCluster(index);
748 
749  if (_strict)
750  {
751  assert(cluster);
752  }
753  else if (!cluster)
754  {
755  ++_errors;
756  continue;
757  }
758 
760  }
761 
762  for (std::set<PHG4Particle*>::iterator jter = new_particles.begin();
763  jter != new_particles.end();
764  ++jter)
765  {
766  truth_particles.insert(*jter);
767  }
768  }
769 
770  if (_do_cache) _cache_all_truth_particles.insert(make_pair(recojet, truth_particles));
771 
772  return truth_particles;
773 }
774 
775 std::set<Jet*> JetRecoEval::all_truth_jets(Jet* recojet)
776 {
777  if (_strict)
778  {
779  assert(recojet);
780  }
781  else if (!recojet)
782  {
783  ++_errors;
784  return std::set<Jet*>();
785  }
786 
787  if (_do_cache)
788  {
789  std::map<Jet*, std::set<Jet*> >::iterator iter =
790  _cache_all_truth_jets.find(recojet);
791  if (iter != _cache_all_truth_jets.end())
792  {
793  return iter->second;
794  }
795  }
796 
797  std::set<Jet*> truth_jets;
798 
799  // get all truth particles (this can include muons and other truth excludes)...
800  std::set<PHG4Particle*> particles = all_truth_particles(recojet);
801 
802  // backtrack from the truth particles to the truth jets...
803  for (std::set<PHG4Particle*>::iterator iter = particles.begin();
804  iter != particles.end();
805  ++iter)
806  {
807  PHG4Particle* particle = *iter;
808 
809  if (_strict)
810  {
811  assert(particle);
812  }
813  else if (!particle)
814  {
815  ++_errors;
816  continue;
817  }
818 
819  Jet* truth_jet = _jettrutheval.get_truth_jet(particle);
820  if (!truth_jet) continue;
821 
822  truth_jets.insert(truth_jet);
823  }
824 
825  if (_do_cache) _cache_all_truth_jets.insert(make_pair(recojet, truth_jets));
826 
827  return truth_jets;
828 }
829 
831 {
832  if (_strict)
833  {
834  assert(recojet);
835  }
836  else if (!recojet)
837  {
838  ++_errors;
839  return nullptr;
840  }
841 
842  if (_do_cache)
843  {
844  std::map<Jet*, Jet*>::iterator iter =
845  _cache_max_truth_jet_by_energy.find(recojet);
846  if (iter != _cache_max_truth_jet_by_energy.end())
847  {
848  return iter->second;
849  }
850  }
851 
852  Jet* truthjet = nullptr;
853  float max_energy = FLT_MAX * -1.0;
854 
855  std::set<Jet*> truthjets = all_truth_jets(recojet);
856  for (std::set<Jet*>::iterator iter = truthjets.begin();
857  iter != truthjets.end();
858  ++iter)
859  {
860  Jet* candidate = *iter;
861 
862  if (_strict)
863  {
864  assert(candidate);
865  }
866  else if (!candidate)
867  {
868  ++_errors;
869  continue;
870  }
871 
872  float energy = get_energy_contribution(recojet, candidate);
873  if (energy > max_energy)
874  {
875  truthjet = candidate;
876  max_energy = energy;
877  }
878  }
879 
880  if (_do_cache) _cache_max_truth_jet_by_energy.insert(make_pair(recojet, truthjet));
881 
882  return truthjet;
883 }
884 
885 std::set<Jet*> JetRecoEval::all_jets_from(Jet* truthjet)
886 {
887  if (_strict)
888  {
889  assert(truthjet);
890  }
891  else if (!truthjet)
892  {
893  ++_errors;
894  return std::set<Jet*>();
895  }
896 
897  if (_do_cache)
898  {
899  std::map<Jet*, std::set<Jet*> >::iterator iter =
900  _cache_all_jets_from.find(truthjet);
901  if (iter != _cache_all_jets_from.end())
902  {
903  return iter->second;
904  }
905  }
906 
907  std::set<Jet*> recojets;
908 
909  // loop over all reco jets
910  for (JetMap::Iter iter = _recojets->begin();
911  iter != _recojets->end();
912  ++iter)
913  {
914  Jet* recojet = iter->second;
915 
916  // if this jet back tracks to the truth jet
917  std::set<Jet*> truthcandidates = all_truth_jets(recojet);
918  for (std::set<Jet*>::iterator jter = truthcandidates.begin();
919  jter != truthcandidates.end();
920  ++jter)
921  {
922  Jet* truthcandidate = *jter;
923 
924  if (_strict)
925  {
926  assert(truthcandidate);
927  }
928  else if (!truthcandidate)
929  {
930  ++_errors;
931  continue;
932  }
933 
934  if (truthcandidate->get_id() == truthjet->get_id())
935  {
936  recojets.insert(recojet);
937  }
938  }
939  }
940 
941  if (_do_cache) _cache_all_jets_from.insert(make_pair(truthjet, recojets));
942 
943  return recojets;
944 }
945 
947 {
948  if (_strict)
949  {
950  assert(truthjet);
951  }
952  else if (!truthjet)
953  {
954  ++_errors;
955  return nullptr;
956  }
957 
958  if (_do_cache)
959  {
960  std::map<Jet*, Jet*>::iterator iter =
961  _cache_best_jet_from.find(truthjet);
962  if (iter != _cache_best_jet_from.end())
963  {
964  return iter->second;
965  }
966  }
967 
968  Jet* bestrecojet = nullptr;
969  float max_energy = FLT_MAX * -1.0;
970 
971  std::set<Jet*> recojets = all_jets_from(truthjet);
972  for (std::set<Jet*>::iterator iter = recojets.begin();
973  iter != recojets.end();
974  ++iter)
975  {
976  Jet* recojet = *iter;
977 
978  if (_strict)
979  {
980  assert(recojet);
981  }
982  else if (!recojet)
983  {
984  ++_errors;
985  continue;
986  }
987 
988  float energy = get_energy_contribution(recojet, truthjet);
989  if (energy > max_energy)
990  {
991  bestrecojet = recojet;
992  max_energy = energy;
993  }
994  }
995 
996  if (_do_cache) _cache_best_jet_from.insert(make_pair(truthjet, bestrecojet));
997 
998  return bestrecojet;
999 }
1000 
1002 {
1003  if (_strict)
1004  {
1005  assert(truthjet);
1006  }
1007  else if (!truthjet)
1008  {
1009  ++_errors;
1010  return nullptr;
1011  }
1012 
1013  Jet* recojet = best_jet_from(truthjet);
1014 
1015  if (recojet)
1016  {
1017  Jet* back_matching = max_truth_jet_by_energy(recojet);
1018 
1019  if (back_matching->get_id() == truthjet->get_id())
1020  return recojet; // uniquely matched
1021  else
1022  return nullptr;
1023  }
1024  else
1025  return nullptr;
1026 }
1027 
1029 {
1030  if (_strict)
1031  {
1032  assert(recojet);
1033  }
1034  else if (!recojet)
1035  {
1036  ++_errors;
1037  return nullptr;
1038  }
1039 
1040  Jet* truthjet = max_truth_jet_by_energy(recojet);
1041 
1042  if (truthjet)
1043  {
1044  Jet* back_matching = best_jet_from(truthjet);
1045 
1046  if (back_matching->get_id() == recojet->get_id())
1047  return truthjet; // uniquely matched
1048  else
1049  return nullptr;
1050  }
1051  else
1052  return nullptr;
1053 }
1054 
1055 // overlap calculations
1057 {
1058  if (_strict)
1059  {
1060  assert(recojet);
1061  assert(truthjet);
1062  }
1063  else if (!recojet || !truthjet)
1064  {
1065  ++_errors;
1066  return NAN;
1067  }
1068 
1069  if (_do_cache)
1070  {
1071  std::map<std::pair<Jet*, Jet*>, float>::iterator iter =
1072  _cache_get_energy_contribution.find(make_pair(recojet, truthjet));
1073  if (iter != _cache_get_energy_contribution.end())
1074  {
1075  return iter->second;
1076  }
1077  }
1078 
1079  float energy_contribution = 0.0;
1080 
1081  std::set<PHG4Particle*> truthjetcomp = get_truth_eval()->all_truth_particles(truthjet);
1082  // loop over all truthjet constituents
1083  for (std::set<PHG4Particle*>::iterator iter = truthjetcomp.begin();
1084  iter != truthjetcomp.end();
1085  ++iter)
1086  {
1087  PHG4Particle* truthparticle = *iter;
1088 
1089  if (_strict)
1090  {
1091  assert(truthparticle);
1092  }
1093  else if (!truthparticle)
1094  {
1095  ++_errors;
1096  continue;
1097  }
1098 
1099  // loop over all recojet constituents
1100  for (Jet::ConstIter jter = recojet->begin_comp();
1101  jter != recojet->end_comp();
1102  ++jter)
1103  {
1104  Jet::SRC source = jter->first;
1105  unsigned int index = jter->second;
1106 
1107  float energy = 0.0;
1108 
1109  if (source == Jet::TRACK)
1110  {
1111  SvtxTrack* track = _trackmap->get(index);
1112 
1113  if (_strict)
1114  {
1115  assert(track);
1116  }
1117  else if (!track)
1118  {
1119  ++_errors;
1120  continue;
1121  }
1122 
1124 
1125  if (maxtruthparticle == nullptr)
1126  {
1127  // in extreme rare cases, noise hits can make a track with no maxtruthparticle matched
1128  energy = 0;
1129  }
1130  else if (maxtruthparticle->get_track_id() == truthparticle->get_track_id())
1131  {
1132  energy = track->get_p();
1133  }
1134  }
1135  else if (source == Jet::CEMC_TOWER)
1136  {
1137  RawTower* tower = _cemctowers->getTower(index);
1138 
1139  if (_strict)
1140  {
1141  assert(tower);
1142  }
1143  else if (!tower)
1144  {
1145  ++_errors;
1146  continue;
1147  }
1148 
1149  energy = get_cemc_eval_stack()->get_rawtower_eval()->get_energy_contribution(tower, truthparticle);
1150  }
1151  else if (source == Jet::CEMC_CLUSTER)
1152  {
1153  RawCluster* cluster = _cemcclusters->getCluster(index);
1154 
1155  if (_strict)
1156  {
1157  assert(cluster);
1158  }
1159  else if (!cluster)
1160  {
1161  ++_errors;
1162  continue;
1163  }
1164 
1165  energy = get_cemc_eval_stack()->get_rawcluster_eval()->get_energy_contribution(cluster, truthparticle);
1166  }
1167  else if (source == Jet::EEMC_TOWER)
1168  {
1169  RawTower* tower = _eemctowers->getTower(index);
1170 
1171  if (_strict)
1172  {
1173  assert(tower);
1174  }
1175  else if (!tower)
1176  {
1177  ++_errors;
1178  continue;
1179  }
1180 
1181  energy = get_eemc_eval_stack()->get_rawtower_eval()->get_energy_contribution(tower, truthparticle);
1182  }
1183  else if (source == Jet::EEMC_CLUSTER)
1184  {
1185  RawCluster* cluster = _eemcclusters->getCluster(index);
1186 
1187  if (_strict)
1188  {
1189  assert(cluster);
1190  }
1191  else if (!cluster)
1192  {
1193  ++_errors;
1194  continue;
1195  }
1196 
1197  energy = get_eemc_eval_stack()->get_rawcluster_eval()->get_energy_contribution(cluster, truthparticle);
1198  }
1199  else if (source == Jet::HCALIN_TOWER)
1200  {
1201  RawTower* tower = _hcalintowers->getTower(index);
1202 
1203  if (_strict)
1204  {
1205  assert(tower);
1206  }
1207  else if (!tower)
1208  {
1209  ++_errors;
1210  continue;
1211  }
1212 
1213  energy = get_hcalin_eval_stack()->get_rawtower_eval()->get_energy_contribution(tower, truthparticle);
1214  }
1215  else if (source == Jet::HCALIN_CLUSTER)
1216  {
1217  RawCluster* cluster = _hcalinclusters->getCluster(index);
1218 
1219  if (_strict)
1220  {
1221  assert(cluster);
1222  }
1223  else if (!cluster)
1224  {
1225  ++_errors;
1226  continue;
1227  }
1228 
1229  energy = get_hcalin_eval_stack()->get_rawcluster_eval()->get_energy_contribution(cluster, truthparticle);
1230  }
1231  else if (source == Jet::HCALOUT_TOWER)
1232  {
1233  RawTower* tower = _hcalouttowers->getTower(index);
1234 
1235  if (_strict)
1236  {
1237  assert(tower);
1238  }
1239  else if (!tower)
1240  {
1241  ++_errors;
1242  continue;
1243  }
1244 
1245  energy = get_hcalout_eval_stack()->get_rawtower_eval()->get_energy_contribution(tower, truthparticle);
1246  }
1247  else if (source == Jet::HCALOUT_CLUSTER)
1248  {
1249  RawCluster* cluster = _hcaloutclusters->getCluster(index);
1250 
1251  if (_strict)
1252  {
1253  assert(cluster);
1254  }
1255  else if (!cluster)
1256  {
1257  ++_errors;
1258  continue;
1259  }
1260 
1261  energy = get_hcalout_eval_stack()->get_rawcluster_eval()->get_energy_contribution(cluster, truthparticle);
1262  }
1263  else if (source == Jet::FEMC_TOWER)
1264  {
1265  RawTower* tower = _femctowers->getTower(index);
1266 
1267  if (_strict)
1268  {
1269  assert(tower);
1270  }
1271  else if (!tower)
1272  {
1273  ++_errors;
1274  continue;
1275  }
1276 
1277  energy = get_femc_eval_stack()->get_rawtower_eval()->get_energy_contribution(tower, truthparticle);
1278  }
1279  else if (source == Jet::FEMC_CLUSTER)
1280  {
1281  RawCluster* cluster = _femcclusters->getCluster(index);
1282 
1283  if (_strict)
1284  {
1285  assert(cluster);
1286  }
1287  else if (!cluster)
1288  {
1289  ++_errors;
1290  continue;
1291  }
1292 
1293  energy = get_femc_eval_stack()->get_rawcluster_eval()->get_energy_contribution(cluster, truthparticle);
1294  }
1295  else if (source == Jet::FHCAL_TOWER)
1296  {
1297  RawTower* tower = _fhcaltowers->getTower(index);
1298 
1299  if (_strict)
1300  {
1301  assert(tower);
1302  }
1303  else if (!tower)
1304  {
1305  ++_errors;
1306  continue;
1307  }
1308 
1309  energy = get_fhcal_eval_stack()->get_rawtower_eval()->get_energy_contribution(tower, truthparticle);
1310  }
1311  else if (source == Jet::FHCAL_CLUSTER)
1312  {
1313  RawCluster* cluster = _fhcalclusters->getCluster(index);
1314 
1315  if (_strict)
1316  {
1317  assert(cluster);
1318  }
1319  else if (!cluster)
1320  {
1321  ++_errors;
1322  continue;
1323  }
1324 
1325  energy = get_fhcal_eval_stack()->get_rawcluster_eval()->get_energy_contribution(cluster, truthparticle);
1326  }
1327 
1328  energy_contribution += energy;
1329  }
1330  }
1331 
1332  if (_do_cache) _cache_get_energy_contribution.insert(make_pair(make_pair(recojet, truthjet), energy_contribution));
1333 
1334  return energy_contribution;
1335 }
1336 
1337 // overlap calculations
1339 {
1340  if (_strict)
1341  {
1342  assert(recojet);
1343  }
1344  else if (!recojet)
1345  {
1346  ++_errors;
1347  return NAN;
1348  }
1349 
1350  if (_do_cache)
1351  {
1352  std::map<std::pair<Jet*, Jet::SRC>, float>::iterator iter =
1353  _cache_get_energy_contribution_src.find(make_pair(recojet, src));
1354  if (iter != _cache_get_energy_contribution_src.end())
1355  {
1356  return iter->second;
1357  }
1358  }
1359 
1360  float energy = 0.0;
1361 
1362  // loop over all recojet constituents
1363  for (Jet::ConstIter jter = recojet->lower_bound_comp(src);
1364  jter != recojet->upper_bound_comp(src);
1365  ++jter)
1366  {
1367  Jet::SRC source = jter->first;
1368  assert(source == src); // jet container consistency check
1369  unsigned int index = jter->second;
1370 
1371  if (source == Jet::TRACK)
1372  {
1373  SvtxTrack* track = _trackmap->get(index);
1374  energy += track->get_p();
1375  }
1376  else if (source == Jet::CEMC_TOWER)
1377  {
1378  RawTower* tower = _cemctowers->getTower(index);
1379 
1380  if (_strict)
1381  {
1382  assert(tower);
1383  }
1384  else if (!tower)
1385  {
1386  ++_errors;
1387  continue;
1388  }
1389 
1390  energy += tower->get_energy();
1391  }
1392  else if (source == Jet::CEMC_CLUSTER)
1393  {
1394  RawCluster* cluster = _cemcclusters->getCluster(index);
1395 
1396  if (_strict)
1397  {
1398  assert(cluster);
1399  }
1400  else if (!cluster)
1401  {
1402  ++_errors;
1403  continue;
1404  }
1405 
1406  energy += cluster->get_energy();
1407  }
1408  else if (source == Jet::EEMC_TOWER)
1409  {
1410  RawTower* tower = _eemctowers->getTower(index);
1411 
1412  if (_strict)
1413  {
1414  assert(tower);
1415  }
1416  else if (!tower)
1417  {
1418  ++_errors;
1419  continue;
1420  }
1421 
1422  energy += tower->get_energy();
1423  }
1424  else if (source == Jet::EEMC_CLUSTER)
1425  {
1426  RawCluster* cluster = _eemcclusters->getCluster(index);
1427 
1428  if (_strict)
1429  {
1430  assert(cluster);
1431  }
1432  else if (!cluster)
1433  {
1434  ++_errors;
1435  continue;
1436  }
1437 
1438  energy += cluster->get_energy();
1439  }
1440  else if (source == Jet::HCALIN_TOWER)
1441  {
1442  RawTower* tower = _hcalintowers->getTower(index);
1443 
1444  if (_strict)
1445  {
1446  assert(tower);
1447  }
1448  else if (!tower)
1449  {
1450  ++_errors;
1451  continue;
1452  }
1453 
1454  energy += tower->get_energy();
1455  }
1456  else if (source == Jet::HCALIN_CLUSTER)
1457  {
1458  RawCluster* cluster = _hcalinclusters->getCluster(index);
1459 
1460  if (_strict)
1461  {
1462  assert(cluster);
1463  }
1464  else if (!cluster)
1465  {
1466  ++_errors;
1467  continue;
1468  }
1469 
1470  energy += cluster->get_energy();
1471  }
1472  else if (source == Jet::HCALOUT_TOWER)
1473  {
1474  RawTower* tower = _hcalouttowers->getTower(index);
1475 
1476  if (_strict)
1477  {
1478  assert(tower);
1479  }
1480  else if (!tower)
1481  {
1482  ++_errors;
1483  continue;
1484  }
1485 
1486  energy += tower->get_energy();
1487  }
1488  else if (source == Jet::HCALOUT_CLUSTER)
1489  {
1490  RawCluster* cluster = _hcaloutclusters->getCluster(index);
1491 
1492  if (_strict)
1493  {
1494  assert(cluster);
1495  }
1496  else if (!cluster)
1497  {
1498  ++_errors;
1499  continue;
1500  }
1501 
1502  energy += cluster->get_energy();
1503  }
1504  else if (source == Jet::FEMC_TOWER)
1505  {
1506  RawTower* tower = _femctowers->getTower(index);
1507 
1508  if (_strict)
1509  {
1510  assert(tower);
1511  }
1512  else if (!tower)
1513  {
1514  ++_errors;
1515  continue;
1516  }
1517 
1518  energy += tower->get_energy();
1519  }
1520  else if (source == Jet::FEMC_CLUSTER)
1521  {
1522  RawCluster* cluster = _femcclusters->getCluster(index);
1523 
1524  if (_strict)
1525  {
1526  assert(cluster);
1527  }
1528  else if (!cluster)
1529  {
1530  ++_errors;
1531  continue;
1532  }
1533 
1534  energy += cluster->get_energy();
1535  }
1536  else if (source == Jet::FHCAL_TOWER)
1537  {
1538  RawTower* tower = _fhcaltowers->getTower(index);
1539 
1540  if (_strict)
1541  {
1542  assert(tower);
1543  }
1544  else if (!tower)
1545  {
1546  ++_errors;
1547  continue;
1548  }
1549 
1550  energy += tower->get_energy();
1551  }
1552  else if (source == Jet::FHCAL_CLUSTER)
1553  {
1554  RawCluster* cluster = _fhcalclusters->getCluster(index);
1555 
1556  if (_strict)
1557  {
1558  assert(cluster);
1559  }
1560  else if (!cluster)
1561  {
1562  ++_errors;
1563  continue;
1564  }
1565 
1566  energy += cluster->get_energy();
1567  } // else if (source == Jet::FHCAL_CLUSTER)
1568 
1569  } // for (Jet::ConstIter jter = recojet->lower_bound_comp(src);
1570 
1571  if (_do_cache) _cache_get_energy_contribution_src.insert(make_pair(make_pair(recojet, src), energy));
1572 
1573  return energy;
1574 }
1575 
1576 std::set<PHG4Hit*> JetRecoEval::all_truth_hits(Jet* recojet)
1577 {
1578  if (_strict)
1579  {
1580  assert(recojet);
1581  }
1582  else if (!recojet)
1583  {
1584  ++_errors;
1585  return std::set<PHG4Hit*>();
1586  }
1587 
1588  if (_do_cache)
1589  {
1590  std::map<Jet*, std::set<PHG4Hit*> >::iterator iter =
1591  _cache_all_truth_hits.find(recojet);
1592  if (iter != _cache_all_truth_hits.end())
1593  {
1594  return iter->second;
1595  }
1596  }
1597 
1598  std::set<PHG4Hit*> truth_hits;
1599 
1600  // loop over all the jet constituents, backtrack each reco object to the
1601  // truth hits and combine with other consituents
1602 
1603  for (Jet::ConstIter iter = recojet->begin_comp();
1604  iter != recojet->end_comp();
1605  ++iter)
1606  {
1607  Jet::SRC source = iter->first;
1608  unsigned int index = iter->second;
1609 
1610  std::set<PHG4Hit*> new_hits;
1611 
1612  if (source == Jet::TRACK)
1613  {
1614  if (!_trackmap)
1615  {
1616  cout << PHWHERE << "ERROR: can't find SvtxTrackMap" << endl;
1617  exit(-1);
1618  }
1619 
1620  SvtxTrack* track = _trackmap->get(index);
1621 
1622  if (_strict)
1623  {
1624  assert(track);
1625  }
1626  else if (!track)
1627  {
1628  ++_errors;
1629  continue;
1630  }
1631 
1632  new_hits = get_svtx_eval_stack()->get_track_eval()->all_truth_hits(track);
1633  }
1634  else if (source == Jet::CEMC_TOWER)
1635  {
1636  if (!_cemctowers)
1637  {
1638  cout << PHWHERE << "ERROR: can't find TOWER_CEMC" << endl;
1639  exit(-1);
1640  }
1641 
1642  RawTower* tower = _cemctowers->getTower(index);
1643 
1644  if (_strict)
1645  {
1646  assert(tower);
1647  }
1648  else if (!tower)
1649  {
1650  ++_errors;
1651  continue;
1652  }
1653 
1654  new_hits = get_cemc_eval_stack()->get_rawtower_eval()->all_truth_hits(tower);
1655  }
1656  else if (source == Jet::CEMC_CLUSTER)
1657  {
1658  if (!_cemcclusters)
1659  {
1660  cout << PHWHERE << "ERROR: can't find CLUSTER_CEMC" << endl;
1661  exit(-1);
1662  }
1663 
1664  RawCluster* cluster = _cemcclusters->getCluster(index);
1665 
1666  if (_strict)
1667  {
1668  assert(cluster);
1669  }
1670  else if (!cluster)
1671  {
1672  ++_errors;
1673  continue;
1674  }
1675 
1676  new_hits = get_cemc_eval_stack()->get_rawcluster_eval()->all_truth_hits(cluster);
1677  }
1678  else if (source == Jet::EEMC_TOWER)
1679  {
1680  if (!_eemctowers)
1681  {
1682  cout << PHWHERE << "ERROR: can't find TOWER_EEMC" << endl;
1683  exit(-1);
1684  }
1685 
1686  RawTower* tower = _eemctowers->getTower(index);
1687 
1688  if (_strict)
1689  {
1690  assert(tower);
1691  }
1692  else if (!tower)
1693  {
1694  ++_errors;
1695  continue;
1696  }
1697 
1698  new_hits = get_eemc_eval_stack()->get_rawtower_eval()->all_truth_hits(tower);
1699  }
1700  else if (source == Jet::EEMC_CLUSTER)
1701  {
1702  if (!_eemcclusters)
1703  {
1704  cout << PHWHERE << "ERROR: can't find CLUSTER_EEMC" << endl;
1705  exit(-1);
1706  }
1707 
1708  RawCluster* cluster = _eemcclusters->getCluster(index);
1709 
1710  if (_strict)
1711  {
1712  assert(cluster);
1713  }
1714  else if (!cluster)
1715  {
1716  ++_errors;
1717  continue;
1718  }
1719 
1720  new_hits = get_eemc_eval_stack()->get_rawcluster_eval()->all_truth_hits(cluster);
1721  }
1722  else if (source == Jet::HCALIN_TOWER)
1723  {
1724  if (!_hcalintowers)
1725  {
1726  cout << PHWHERE << "ERROR: can't find TOWER_HCALIN" << endl;
1727  exit(-1);
1728  }
1729 
1730  RawTower* tower = _hcalintowers->getTower(index);
1731 
1732  if (_strict)
1733  {
1734  assert(tower);
1735  }
1736  else if (!tower)
1737  {
1738  ++_errors;
1739  continue;
1740  }
1741 
1742  new_hits = get_hcalin_eval_stack()->get_rawtower_eval()->all_truth_hits(tower);
1743  }
1744  else if (source == Jet::HCALIN_CLUSTER)
1745  {
1746  if (!_hcalinclusters)
1747  {
1748  cout << PHWHERE << "ERROR: can't find CLUSTER_HCALIN" << endl;
1749  exit(-1);
1750  }
1751 
1752  RawCluster* cluster = _hcalinclusters->getCluster(index);
1753 
1754  if (_strict)
1755  {
1756  assert(cluster);
1757  }
1758  else if (!cluster)
1759  {
1760  ++_errors;
1761  continue;
1762  }
1763 
1764  new_hits = get_hcalin_eval_stack()->get_rawcluster_eval()->all_truth_hits(cluster);
1765  }
1766  else if (source == Jet::HCALOUT_TOWER)
1767  {
1768  if (!_hcalouttowers)
1769  {
1770  cout << PHWHERE << "ERROR: can't find TOWER_HCALOUT" << endl;
1771  exit(-1);
1772  }
1773 
1774  RawTower* tower = _hcalouttowers->getTower(index);
1775 
1776  if (_strict)
1777  {
1778  assert(tower);
1779  }
1780  else if (!tower)
1781  {
1782  ++_errors;
1783  continue;
1784  }
1785 
1787  }
1788  else if (source == Jet::HCALOUT_CLUSTER)
1789  {
1790  if (!_hcaloutclusters)
1791  {
1792  cout << PHWHERE << "ERROR: can't find CLUSTER_HCALOUT" << endl;
1793  exit(-1);
1794  }
1795 
1796  RawCluster* cluster = _hcaloutclusters->getCluster(index);
1797 
1798  if (_strict)
1799  {
1800  assert(cluster);
1801  }
1802  else if (!cluster)
1803  {
1804  ++_errors;
1805  continue;
1806  }
1807 
1808  new_hits = get_hcalout_eval_stack()->get_rawcluster_eval()->all_truth_hits(cluster);
1809  }
1810  else if (source == Jet::FEMC_TOWER)
1811  {
1812  if (!_femctowers)
1813  {
1814  cout << PHWHERE << "ERROR: can't find TOWER_FEMC" << endl;
1815  exit(-1);
1816  }
1817 
1818  RawTower* tower = _femctowers->getTower(index);
1819 
1820  if (_strict)
1821  {
1822  assert(tower);
1823  }
1824  else if (!tower)
1825  {
1826  ++_errors;
1827  continue;
1828  }
1829 
1830  new_hits = get_femc_eval_stack()->get_rawtower_eval()->all_truth_hits(tower);
1831  }
1832  else if (source == Jet::FEMC_CLUSTER)
1833  {
1834  if (!_femcclusters)
1835  {
1836  cout << PHWHERE << "ERROR: can't find CLUSTER_FEMC" << endl;
1837  exit(-1);
1838  }
1839 
1840  RawCluster* cluster = _femcclusters->getCluster(index);
1841 
1842  if (_strict)
1843  {
1844  assert(cluster);
1845  }
1846  else if (!cluster)
1847  {
1848  ++_errors;
1849  continue;
1850  }
1851 
1852  new_hits = get_femc_eval_stack()->get_rawcluster_eval()->all_truth_hits(cluster);
1853  }
1854  else if (source == Jet::FHCAL_TOWER)
1855  {
1856  if (!_fhcaltowers)
1857  {
1858  cout << PHWHERE << "ERROR: can't find TOWER_FHCAL" << endl;
1859  exit(-1);
1860  }
1861 
1862  RawTower* tower = _fhcaltowers->getTower(index);
1863 
1864  if (_strict)
1865  {
1866  assert(tower);
1867  }
1868  else if (!tower)
1869  {
1870  ++_errors;
1871  continue;
1872  }
1873 
1874  new_hits = get_fhcal_eval_stack()->get_rawtower_eval()->all_truth_hits(tower);
1875  }
1876  else if (source == Jet::FHCAL_CLUSTER)
1877  {
1878  if (!_fhcalclusters)
1879  {
1880  cout << PHWHERE << "ERROR: can't find CLUSTER_FHCAL" << endl;
1881  exit(-1);
1882  }
1883 
1884  RawCluster* cluster = _fhcalclusters->getCluster(index);
1885 
1886  if (_strict)
1887  {
1888  assert(cluster);
1889  }
1890  else if (!cluster)
1891  {
1892  ++_errors;
1893  continue;
1894  }
1895 
1896  new_hits = get_fhcal_eval_stack()->get_rawcluster_eval()->all_truth_hits(cluster);
1897  }
1898 
1899  for (std::set<PHG4Hit*>::iterator jter = new_hits.begin();
1900  jter != new_hits.end();
1901  ++jter)
1902  {
1903  truth_hits.insert(*jter);
1904  }
1905  }
1906 
1907  if (_do_cache) _cache_all_truth_hits.insert(make_pair(recojet, truth_hits));
1908 
1909  return truth_hits;
1910 }
1911 
1913 {
1914  // need things off of the DST...
1915  _recojets = findNode::getClass<JetMap>(topNode, _recojetname.c_str());
1916  if (!_recojets)
1917  {
1918  cerr << PHWHERE << " ERROR: Can't find " << _recojetname << endl;
1919  exit(-1);
1920  }
1921 
1922  _truthjets = findNode::getClass<JetMap>(topNode, _truthjetname.c_str());
1923  if (!_truthjets)
1924  {
1925  cerr << PHWHERE << " ERROR: Can't find " << _truthjetname << endl;
1926  exit(-1);
1927  }
1928 
1929  _trackmap = findNode::getClass<SvtxTrackMap>(topNode, m_TrackNodeName);
1930  if (!_trackmap)
1931  {
1932  _trackmap = findNode::getClass<SvtxTrackMap>(topNode, "TrackMap");
1933  }
1934  _cemctowers = findNode::getClass<RawTowerContainer>(topNode, "TOWER_CALIB_CEMC");
1935  _hcalintowers = findNode::getClass<RawTowerContainer>(topNode, "TOWER_CALIB_HCALIN");
1936  _hcalouttowers = findNode::getClass<RawTowerContainer>(topNode, "TOWER_CALIB_HCALOUT");
1937  _femctowers = findNode::getClass<RawTowerContainer>(topNode, "TOWER_CALIB_FEMC");
1938  _fhcaltowers = findNode::getClass<RawTowerContainer>(topNode, "TOWER_CALIB_FHCAL");
1939  _eemctowers = findNode::getClass<RawTowerContainer>(topNode, "TOWER_CALIB_EEMC");
1940  _cemcclusters = findNode::getClass<RawClusterContainer>(topNode, "CLUSTER_CEMC");
1941  _hcalinclusters = findNode::getClass<RawClusterContainer>(topNode, "CLUSTER_HCALIN");
1942  _hcaloutclusters = findNode::getClass<RawClusterContainer>(topNode, "CLUSTER_HCALOUT");
1943  _femcclusters = findNode::getClass<RawClusterContainer>(topNode, "CLUSTER_FEMC");
1944  _fhcalclusters = findNode::getClass<RawClusterContainer>(topNode, "CLUSTER_FHCAL");
1945  _eemcclusters = findNode::getClass<RawClusterContainer>(topNode, "CLUSTER_EEMC");
1946 
1947  return;
1948 }