#include <PartToHitTable.h>
Public Types | |
| typedef std::vector< const FLSHit * > | HitList |
Public Member Functions | |
| PartToHitTable (const ParticleList &plist, const FLSHitList &hitlist) | |
| const HitList & | operator[] (unsigned int i) const |
Private Attributes | |
| std::vector< HitList > | fHitLists |
| Table of hits by particle index. | |
Definition at line 20 of file PartToHitTable.h.
|
|
Definition at line 25 of file PartToHitTable.h. |
|
||||||||||||
|
Definition at line 8 of file PartToHitTable.cxx. References fHitLists, sim::FLSHitList::fHits, and sim::ParticleList::fParticles. 00009 : 00010 fHitLists(plist.fParticles.size()) 00011 { 00012 unsigned register int i; 00013 // 00014 // The sizes can be large, so try to do this as efficiently as 00015 // possible. The following makes only two passes over the lists 00016 // 00017 // First build a look up table to map trackIds to an index inside 00018 // the particle list 00019 std::map<int,int> trk2indx; 00020 for (i=0; i<plist.fParticles.size(); ++i) { 00021 trk2indx[plist.fParticles[i].fTrackId] = i; 00022 } 00023 00024 // Now, use that map to build the lists 00025 for (i=0; i<hitlist.fHits.size(); ++i) { 00026 int indx = trk2indx[hitlist.fHits[i].fTrackId]; 00027 fHitLists[indx].push_back(&hitlist.fHits[i]); 00028 } 00029 }
|
|
|
Return the vector of hits for the particle who's index is i
Definition at line 41 of file PartToHitTable.cxx. References fHitLists.
|
|
|
Table of hits by particle index.
Definition at line 30 of file PartToHitTable.h. Referenced by operator[](), and PartToHitTable(). |
1.3.9.1