BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcRecSeedEThreshold.cxx
Go to the documentation of this file.
1//
2// Seed finder
3// 1. local max (the same with EmcRecSeedLocalMax)
4// 2. energy of hit > EThresholdSeed
5//
6// Zhe Wang 2004, 8, 31
7//
8#include <iostream>
9
11
13{
15}
16
18{}
19
21 RecEmcIDVector& aMaxVec)
22{
23 RecEmcHitMap::const_iterator ciHitMap;
24 RecEmcHitMap::const_iterator ciNeigh;
25 RecEmcHit aHit;
26
27 bool max;
28
29 RecEmcIDVector NeighVec;
30 RecEmcIDVector::const_iterator ciNeighVec;
31
32 aMaxVec.clear();
33
34 vector<RecEmcHit> aHitVec,tmpHitVec;
35 vector<RecEmcHit>::const_iterator ciHitVec;
36
38
39 for(ciHitMap=aCluster.Begin();
40 ciHitMap!=aCluster.End();
41 ++ciHitMap) {
42 //++++++++++++++++++++++++++++++++++++++++++++++++++
43 //prepare a hit
44 max=true;
45 aHit=ciHitMap->second;
46
47 if(aHit.getEnergy()>fEThresholdSeed) {
48 //prepare its neighbours
49 NeighVec.clear();
50 NeighVec=nhb.GetNeighbors(aHit.getCellId());
51
52 //to see if it is energy max
53 for(ciNeighVec=NeighVec.begin();
54 ciNeighVec!=NeighVec.end();
55 ++ciNeighVec) {
56 //find it
57 ciNeigh=aCluster.Find(*ciNeighVec);
58 if(ciNeigh!=aCluster.End()) {
59 //largest!!!
60 if(ciNeigh->second.getEnergy()>aHit.getEnergy()) {
61 max=false;
62 }
63 }
64 }
65 } else {
66 max=false;
67 }
68
69 //avoid 2 equal neighbor seeds
70 for(ciHitVec=aHitVec.begin();
71 ciHitVec!=aHitVec.end();
72 ciHitVec++) {
73 if(nhb.IsNeighbor(ciHitVec->getCellId(),aHit.getCellId())) {
74 max=false;
75 break;
76 }
77 }
78
79 //once max hit is found
80 if(max==true) {
81 aHitVec.push_back(aHit);
82 }
83 //++++++++++++++++++++++++++++++++++++++++++++++++++
84 }
85
86 sort(aHitVec.begin(),aHitVec.end(),greater<RecEmcHit>());
87
88 for(ciHitVec=aHitVec.begin();
89 ciHitVec!=aHitVec.end();
90 ciHitVec++) {
91 aMaxVec.push_back(ciHitVec->getCellId());
92 }
93}
94
vector< RecEmcID > RecEmcIDVector
RecEmcIDVector GetNeighbors(const Identifier &id)
bool IsNeighbor(const Identifier &id1, const Identifier &id2)
static EmcRecParameter & GetInstance()
double EThresholdSeed() const
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
RecEmcEnergy getEnergy() const
Definition: RecEmcHit.h:48
RecEmcID getCellId() const
Definition: RecEmcHit.h:47