BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcRecSeedLocalMax.cxx
Go to the documentation of this file.
1//
2// Seed finder abstract base class
3// Use local max to determine a seed
4//
5// Zhe Wang 2004, 8, 31
6//
7#include <iostream>
8
9#include "EmcRec/EmcRecSeedLocalMax.h"
10
12
14
15void EmcRecSeedLocalMax::Seed( const RecEmcCluster& aCluster, RecEmcIDVector& aMaxVec ) {
16 RecEmcHitMap::const_iterator ciHitMap;
17 RecEmcHitMap::const_iterator ciNeigh;
18 RecEmcHit aHit;
19
20 bool max;
21
22 RecEmcIDVector NeighVec;
23 RecEmcIDVector::const_iterator ciNeighVec;
24
25 aMaxVec.clear();
26
28
29 for ( ciHitMap = aCluster.Begin(); ciHitMap != aCluster.End(); ++ciHitMap )
30 {
31 //++++++++++++++++++++++++++++++++++++++++++++++++++
32 // prepare a hit
33 max = true;
34 aHit = ciHitMap->second;
35 // prepare its neighbours
36 NeighVec.clear();
37 NeighVec = nhb.GetNeighbors( aHit.getCellId() );
38
39 // to see if it is energy max
40 for ( ciNeighVec = NeighVec.begin(); ciNeighVec != NeighVec.end(); ++ciNeighVec )
41 {
42 // find it
43 ciNeigh = aCluster.Find( *ciNeighVec );
44 if ( ciNeigh != aCluster.End() )
45 {
46 // largest!!!
47 if ( ciNeigh->second.getEnergy() >= aHit.getEnergy() ) { max = false; }
48 }
49 }
50
51 // once max hit is found
52 if ( max == true ) { aMaxVec.push_back( aHit.getCellId() ); }
53 //++++++++++++++++++++++++++++++++++++++++++++++++++
54 }
55}
#define max(a, b)
RecEmcIDVector GetNeighbors(const Identifier &id)
virtual void Seed(const RecEmcCluster &aCluster, RecEmcIDVector &aMaxVec)
RecEmcHitMap::const_iterator Find(const RecEmcID &CellId) const
RecEmcHitMap::const_iterator Begin() const
RecEmcHitMap::const_iterator End() const