1 #include "StEmcOldFinder.h"
3 #include "StEventTypes.h"
6 #include "StEmcUtil/others/emcDetectorName.h"
7 #include "StEmcPreCluster.h"
10 #include <TTableSorter.h>
16 #include "StMessMgr.h"
23 Float_t seed[] = {0.7, 0.1, 0.4, 0.4};
27 0.001, 0.001, 0.001, 0.001
37 for(Int_t i = 0; i < MAXDETBARREL; i++)
39 mEnergySeed[i] = seed[i];
42 mEnergyThresholdAll[i] = all[i];
43 mSizeMax[i] = size[i];
44 if(mEnergyThresholdAll[i]<mEnergySeed[i])
45 mEnergyThresholdAll[i]=mEnergySeed[i];
49 StEmcOldFinder::~StEmcOldFinder()
57 for(Int_t i = 0; i<MAXDETBARREL; i++)
60 StDetectorId
id =
static_cast<StDetectorId
>(det-1+kBarrelEmcTowerId);
71 Int_t det = (Int_t)(detector->detectorId()-kBarrelEmcTowerId)+1;
72 Int_t NM = detector->numberOfModules();
73 for(Int_t m = 1; m<=NM; m++)
75 LOG_DEBUG <<
"Number of clusters found for detector "<<det<<
" = "<<mColl[det-1]->GetSize()<<endm;
84 StSPtrVecEmcRawHit& hits=module->hits();
103 for(ih=mFirst; ih<mLast; ih++)
106 Int_t cal = hits[ih]->calibrationType();
109 mEnergy[jh] = hits[ih]->energy();
110 mEW[jh]=hits[ih]->eta();
111 mSW[jh]=abs(hits[ih]->sub());
116 mEW[jh]=hits[ih]->eta();
117 mSW[jh]=abs(hits[ih]->sub());
124 if(mEnergy[0] > mEnergyThresholdAll[det-1])
137 TMath::Sort(mNH,mEnergy.GetArray(),index.GetArray(),0);
142 Int_t loop = (det==BTOW)?2:1;
145 for(i=mNH-1; i>=0; i--)
148 Int_t j = index.GetIndex(i);
152 if(mEnergy[j] < mEnergySeed[det-1])
163 if(mSizeMax[det-1] == 1)
166 for(l=0; l<loop; l++)
168 for(ii=i-1; ii>=0; ii--)
171 int jj = index.GetIndex(ii);
175 if(mEnergy[jj] < mEnergyAdd[det-1])
185 if(mNHit == mSizeMax[det-1])
194 if(eClW > mEnergyThresholdAll[det-1])
197 for(Int_t H = 0; H<mNHit; H++)
198 cl->
addHit(hits[mHitsId[H]+mFirst]);
205 for(Int_t i1=0; i1<mNHit; i1++)
225 mEtaFirst=mEW[mHitsId[0]];
227 mEnergyFirst=mEnergy[mHitsId[0]];
228 mEnergyLast=mEnergyFirst;
231 if (mEtaFirst-mEW[jn] == 1)
233 if (mEnergy[jn]<mEnergyFirst)
236 mEnergyFirst=mEnergy[jn];
243 else if (mEW[jn]-mEtaLast == 1)
245 if (mEnergy[jn]<mEnergyLast)
248 mEnergyLast=mEnergy[jn];
263 mEtaSeed=mEW[mHitsId[0]];
264 mPhiFirst=mSW[mHitsId[0]];
266 mEnergyFirst=mEnergy[mHitsId[0]];
267 mEnergyLast=mEnergyFirst;
270 if(mEtaSeed == mEW[jn])
272 if(mPhiFirst-mSW[jn] == 1)
274 if (mEnergy[jn]<mEnergyFirst)
277 mEnergyFirst=mEnergy[jn];
283 else if(mSW[jn]-mPhiLast == 1)
285 if (mEnergy[jn]<mEnergyLast)
288 mEnergyLast=mEnergy[jn];
303 Int_t mNb[5] = {0,0,0,0,0};
304 Int_t js = mHitsId[0];
306 if (mEW[js] == mEW[jn] && abs(mSW[js]-mSW[jn]) == 1 && mNb[2] == 0)
311 else if(mSW[js] == mSW[jn] && abs(mEW[js]-mEW[jn]) == 1)
313 if ((mEW[js]-mEW[jn]) == -1 && mNb[0] == 0)
318 else if ((mEW[js]-mEW[jn]) == 1 && mNb[1] == 0)
326 else if(abs(mSW[js]-mSW[jn]) == 1 && abs(mEW[js]-mEW[jn]) == 1)
328 if ((mEW[js]-mEW[jn]) == -1 && mNb[3] == 0)
333 else if ((mEW[js]-mEW[jn]) == 1 && mNb[4] == 0)
Bool_t findClustersInModule(Int_t, StEmcModule *)
finds clusters in a BEMC module
StEmcPreCluster * newCluster()
creates a new cluster in the collection. Returns its pointer
void addHit(StEmcRawHit *)
add a hit to the cluster
Bool_t testOnNeighbor(Int_t, Int_t)
test for hits in neighbor strips
void update()
updates cluster information. Calculates eta,phi, ernergy, etc from the hits added to the cluster ...
virtual Bool_t findClusters(StEvent *)
finds clusters in a StEvent object
Bool_t findClustersInDetector(StEmcDetector *)
finds clusters in a given detector