10 #include <gear/TPCParameters.h>
11 #include <EVENT/LCEvent.h>
12 #include <IMPL/TrackerHitImpl.h>
14 #include <kaldet/GearTPCKalDetector.h>
15 #include <kaldet/GearTPCCylinderMeasLayer.h>
32 EVENT::TrackerHit* hit;
35 MarlinTPCHit(EVENT::TrackerHit* _hit_ = 0,
bool _isUsed_ =
false)
36 : hit(_hit_), isUsed(_isUsed_)
45 if( sqrt(hit->getPosition()[2]) == sqrt(h.hit->getPosition()[2]) )
51 return sqrt(hit->getPosition()[2]) < sqrt(h.hit->getPosition()[2]);
69 typedef std::set< MarlinTPCHit >::iterator HitSetIter;
70 typedef std::pair<int, int> ModuleRow;
71 typedef std::map< ModuleRow, std::set< MarlinTPCHit > > HitContainer;
85 ModuleRowHit(
int _module_ = std::numeric_limits<int>::max(),
86 int _row_ = std::numeric_limits<int>::max(),
88 : module(_module_), row(_row_), tpcHit(_tpcHit_)
93 return module == h.module && row == h.row && tpcHit == h.tpcHit;
96 double const * getHitPosition()
const {
return tpcHit.hit->getPosition(); }
97 EVENT::TrackerHit* getTrackerHit()
const {
return tpcHit.hit;}
99 bool isUsed()
const {
return tpcHit.isUsed;}
113 TVector3 _referencePosition;
119 TPCHitMap(gear::TPCParameters
const * tpcParameters,
120 kaldet::GearTPCKalDetector
const * det,
121 std::string modulesNotUsed = std::string(
"-1"));
139 void removeHits(std::vector<ModuleRowHit>& hitlist);
151 size_t size()
const ;
163 std::list<ModuleRowHit>
getHitsInDomain(std::set< ModuleRow >
const & moduleRowsInDomain);
165 ModuleRowHit getHitInDomain(std::set< ModuleRow >
const & moduleRowsInDomain,
183 int getLayerIndex(
int module,
int row);
190 std::map< int, std::set<ModuleRow> > _indexModuleRow;
192 gear::TPCParameters
const *_tpcParameters;
196 kaldet::GearTPCKalDetector
const * _kalDetector;
198 std::set<int> _modulesNotUsedSet;
std::set< MarlinTPCHit > const & getHitsInModuleRow(int module, int row)
Get all hits in one moduleRow.
size_t _nHits
The total number of hits currently stored in the container.
Definition: TPCHitMap.h:194
This is hits management class for TPC.
Definition: TPCHitMap.h:30
Struct to hold module and row and a hit in this row.
Definition: TPCHitMap.h:79
void fillEventHits(EVENT::LCCollection const *inputHits)
Fill hits to this data container and arrange them by module and row.
A helper function to allow sorting of a std::list of ModuleRowHits according to their distance to a r...
Definition: TPCHitMap.h:104
void setHitUsed(const ModuleRowHit &hit, bool used=true)
Set the used flag in the hits container.
Definition: TPCHitMap.h:116
void removeHit(ModuleRowHit hit)
Remove a hit from the container.
bool isEmpty() const
Check if the container is empty.
void clear()
Clear all hits.
void removeHits(std::vector< ModuleRowHit > &hitlist)
Remove hits from the container and empties the input hit list as the ModuleRowHits in it are invalida...
HitContainer _hitContainer
The hits container.
Definition: TPCHitMap.h:188
std::list< ModuleRow > getActiveModuleRows()
Get a list of all the module/rows pairs which have at least one hit.
std::list< ModuleRowHit > getHitsInDomain(std::set< ModuleRow > const &moduleRowsInDomain)
Get Hits from a TPC domain.
size_t size() const
Get hit size of container.
ModuleRowHit getFirstHit(int mode=0)
Get the first hit from the container.