Increase speed of SDD cluster finder (F. Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SDD.cxx
CommitLineData
04366a57 1/**************************************************************************
2 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
d76cb3ad 15
16/* $Id$*/
17
04366a57 18////////////////////////////////////////////////////////////////////////////
19// Implementation of the ITS clusterer V2 class //
20// //
21// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //
22// //
23///////////////////////////////////////////////////////////////////////////
24
25
04366a57 26
ae485645 27#include <TClonesArray.h>
add58ef6 28#include <TBits.h>
04366a57 29#include "AliITSClusterFinderV2SDD.h"
00a7cc50 30#include "AliITSRecPoint.h"
7d62fb64 31#include "AliITSDetTypeRec.h"
04366a57 32#include "AliRawReader.h"
0599a018 33#include "AliITSRawStreamSDD.h"
2f8ed7ab 34#include "AliITSRawStreamSDDCompressed.h"
5bfe44ce 35#include "AliITSCalibrationSDD.h"
253e68a0 36#include "AliITSresponseSDD.h"
5bfe44ce 37#include "AliITSDetTypeRec.h"
debf7b78 38#include "AliITSReconstructor.h"
5bfe44ce 39#include "AliITSsegmentationSDD.h"
04366a57 40#include "AliITSdigitSDD.h"
b4704be3 41#include "AliITSgeomTGeo.h"
debf7b78 42
04366a57 43ClassImp(AliITSClusterFinderV2SDD)
44
add58ef6 45AliITSClusterFinderV2SDD::AliITSClusterFinderV2SDD(AliITSDetTypeRec* dettyp):AliITSClusterFinder(dettyp),
46 fNAnodes(0),
47 fNTimeBins(0),
48 fNZbins(0),
49 fNXbins(0)
a66a0eb6 50{
04366a57 51 //Default constructor
52
add58ef6 53 fNAnodes = GetSeg()->NpzHalf();
54 fNZbins = fNAnodes+2;
55 fNTimeBins = GetSeg()->Npx();
56 fNXbins = fNTimeBins+2;
57 AliDebug(2,Form("Cells in SDD cluster finder: Andoes=%d TimeBins=%d",fNAnodes,fNTimeBins));
58 const Int_t kMaxBin=fNZbins*fNXbins;
59 for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){
60 fDDLBins[iHyb]=new AliBin[kMaxBin];
61 }
04366a57 62}
63
64
add58ef6 65//______________________________________________________________________
66AliITSClusterFinderV2SDD::~AliITSClusterFinderV2SDD()
67{
68 //Destructor
69 for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){
70 delete [] fDDLBins[iHyb];
71 }
72}
73
74//______________________________________________________________________
04366a57 75void AliITSClusterFinderV2SDD::FindRawClusters(Int_t mod){
76
77 //Find clusters V2
78 SetModule(mod);
79 FindClustersSDD(fDigits);
80
81}
82
add58ef6 83//______________________________________________________________________
04366a57 84void AliITSClusterFinderV2SDD::FindClustersSDD(TClonesArray *digits) {
85 //------------------------------------------------------------
86 // Actual SDD cluster finder
87 //------------------------------------------------------------
04366a57 88
add58ef6 89 const Int_t kMaxBin=fNZbins*fNXbins;
04366a57 90 AliBin *bins[2];
4952f440 91 bins[0]=new AliBin[kMaxBin];
92 bins[1]=new AliBin[kMaxBin];
add58ef6 93 TBits *anodeFired[2];
94 anodeFired[0]=new TBits(fNAnodes);
95 anodeFired[1]=new TBits(fNAnodes);
96 anodeFired[0]->ResetAllBits();
97 anodeFired[1]->ResetAllBits();
404c1c29 98 AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
9c7f5947 99 if(cal==0){
100 AliError(Form("Calibration object not present for SDD module %d\n",fModule));
101 return;
102 }
83ec5e27 103
04366a57 104 AliITSdigitSDD *d=0;
105 Int_t i, ndigits=digits->GetEntriesFast();
106 for (i=0; i<ndigits; i++) {
107 d=(AliITSdigitSDD*)digits->UncheckedAt(i);
20f3f947 108 Int_t ian=d->GetCoord1();
109 Int_t itb=d->GetCoord2();
110 Int_t iSide=0;
add58ef6 111 if (ian >= fNAnodes) iSide=1;
75065a60 112 Float_t gain=cal->GetChannelGain(ian)/fDetTypeRec->GetAverageGainSDD();
83ec5e27 113 Float_t charge=d->GetSignal(); // returns expanded signal
114 // (10 bit, low threshold already added)
20f3f947 115 Float_t baseline = cal->GetBaseline(ian);
116 if(charge>baseline) charge-=baseline;
117 else charge=0;
5683bd96 118
9c7f5947 119 if(gain>0.){ // Bad channels have gain=0.
120 charge/=gain;
20f3f947 121 if(charge<cal->GetThresholdAnode(ian)) continue;
9c7f5947 122 Int_t q=(Int_t)(charge+0.5);
20f3f947 123 Int_t y=itb+1;
124 Int_t z=ian+1;
add58ef6 125 if (z <= fNAnodes){
126 bins[0][y*fNZbins+z].SetQ(q);
127 bins[0][y*fNZbins+z].SetMask(1);
128 bins[0][y*fNZbins+z].SetIndex(i);
129 anodeFired[0]->SetBitNumber(ian);
9c7f5947 130 } else {
add58ef6 131 z-=fNAnodes;
132 bins[1][y*fNZbins+z].SetQ(q);
133 bins[1][y*fNZbins+z].SetMask(1);
134 bins[1][y*fNZbins+z].SetIndex(i);
135 anodeFired[1]->SetBitNumber(ian-fNAnodes);
9c7f5947 136 }
04366a57 137 }
138 }
139
add58ef6 140 FindClustersSDD(bins, anodeFired, digits);
04366a57 141
142 delete[] bins[0];
143 delete[] bins[1];
add58ef6 144 delete anodeFired[0];
145 delete anodeFired[1];
04366a57 146
147}
148
add58ef6 149//______________________________________________________________________
04366a57 150void AliITSClusterFinderV2SDD::
add58ef6 151FindClustersSDD(AliBin* bins[2], TBits* anodeFired[2],
de075dae 152 TClonesArray *digits, TClonesArray *clusters, Int_t jitter) {
04366a57 153 //------------------------------------------------------------
154 // Actual SDD cluster finder
155 //------------------------------------------------------------
b4704be3 156
debf7b78 157 static AliITSRecoParam *repa = NULL;
158 if(!repa){
159 repa = (AliITSRecoParam*) AliITSReconstructor::GetRecoParam();
160 if(!repa){
ed446fa3 161 repa = AliITSRecoParam::GetHighFluxParam();
debf7b78 162 AliWarning("Using default AliITSRecoParam class");
163 }
164 }
b4704be3 165 const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(fModule);
404c1c29 166 AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
9c7f5947 167 if(cal==0){
168 AliError(Form("Calibration object not present for SDD module %d\n",fModule));
169 return;
170 }
add58ef6 171 const Int_t kMaxBin=fNZbins*fNXbins;
04366a57 172 Int_t ncl=0;
173 TClonesArray &cl=*clusters;
add58ef6 174 for (Int_t s=0; s<2; s++){
175 for(Int_t iAnode=0; iAnode<GetSeg()->NpzHalf(); iAnode++){
176 if(anodeFired[s]->TestBitNumber(iAnode)==kFALSE) continue;
177 for(Int_t iTimeBin=0; iTimeBin<GetSeg()->Npx(); iTimeBin++){
178 Int_t index=(iTimeBin+1)*fNZbins+(iAnode+1);
179 if (bins[s][index].IsUsed()) continue;
180 if(NoiseSuppress(index,s,bins[s],cal)) continue;
181 Int_t idx[32]; UInt_t msk[32]; Int_t npeaks=0;
182 FindPeaks(index, fNZbins, bins[s], idx, msk, npeaks);
183
184 if (npeaks>30) continue;
185 if (npeaks==0) continue;
186
187 Int_t k,l;
188 for (k=0; k<npeaks-1; k++){//mark adjacent peaks
189 if (idx[k] < 0) continue; //this peak is already removed
190 for (l=k+1; l<npeaks; l++) {
191 if (idx[l] < 0) continue; //this peak is already removed
192 Int_t ki=idx[k]/fNZbins, kj=idx[k] - ki*fNZbins;
193 Int_t li=idx[l]/fNZbins, lj=idx[l] - li*fNZbins;
194 Int_t di=TMath::Abs(ki - li);
195 Int_t dj=TMath::Abs(kj - lj);
196 if (di>1 || dj>1) continue;
197 if (bins[s][idx[k]].GetQ() > bins[s][idx[l]].GetQ()) {
198 msk[l]=msk[k];
199 idx[l]*=-1;
200 } else {
201 msk[k]=msk[l];
202 idx[k]*=-1;
203 break;
204 }
205 }
206 }
04366a57 207
add58ef6 208 for (k=0; k<npeaks; k++) {
209 if(repa->GetUseUnfoldingInClusterFinderSDD()==kFALSE) msk[k]=msk[0];
210 MarkPeak(TMath::Abs(idx[k]), fNZbins, bins[s], msk[k]);
f6b6d58e 211 }
add58ef6 212
213 for (k=0; k<npeaks; k++) {
214 if (idx[k] < 0) continue; //removed peak
215 AliITSRecPoint c;
216 MakeCluster(idx[k], fNZbins, bins[s], msk[k], c);
217 //mi change
218 Int_t milab[10];
219 for (Int_t ilab=0;ilab<10;ilab++){
220 milab[ilab]=-2;
221 }
222 Int_t maxi=0,mini=0,maxj=0,minj=0;
223
224 for (Int_t di=-5; di<=5;di++){
225 for (Int_t dj=-10;dj<=10;dj++){
226 Int_t index = idx[k]+di+dj*fNZbins;
227 if (index<0) continue;
228 if (index>=kMaxBin) continue;
229 AliBin *b=&bins[s][index];
230 Int_t iAnode=index%fNZbins-1;
231 Int_t adcSignal=b->GetQ();
232 if(adcSignal>cal->GetThresholdAnode(iAnode)){
233 if (di>maxi) maxi=di;
234 if (di<mini) mini=di;
235 if (dj>maxj) maxj=dj;
236 if (dj<minj) minj=dj;
237 }
238 //
239 if(digits) {
240 if (TMath::Abs(di)<2&&TMath::Abs(dj)<2){
241 AliITSdigitSDD* d=(AliITSdigitSDD*)digits->UncheckedAt(b->GetIndex());
242 for (Int_t itrack=0;itrack<10;itrack++){
243 Int_t track = (d->GetTracks())[itrack];
244 if (track>=0) {
245 AddLabel(milab, track);
246 }
f6b6d58e 247 }
248 }
249 }
250 }
251 }
add58ef6 252 Int_t clSizAnode=maxi-mini+1;
253 Int_t clSizTb=maxj-minj+1;
254 if(repa->GetUseSDDClusterSizeSelection()){
255 if(clSizTb==1) continue; // cut common mode noise spikes
256 if(clSizAnode>3) continue; // cut common mode noise spikes
257 if(clSizTb>10) continue; // cut clusters on noisy anodes
f6b6d58e 258 }
add58ef6 259
260 AliITSresponseSDD* rsdd = fDetTypeRec->GetResponseSDD();
261 Float_t y=c.GetY(),z=c.GetZ(), q=c.GetQ();
262 y/=q; z/=q;
263 Float_t zAnode=z-0.5; // to have anode in range 0.-255. and centered on the mid of the pitch
264 Float_t timebin=y-0.5; // to have time bin in range 0.-255. amd centered on the mid of the bin
265 if(s==1) zAnode += GetSeg()->NpzHalf(); // right side has anodes from 256. to 511.
266 Float_t zdet = GetSeg()->GetLocalZFromAnode(zAnode);
267 Float_t driftTimeUncorr = GetSeg()->GetDriftTimeFromTb(timebin)+jitter*rsdd->GetCarlosRXClockPeriod();
268 Float_t driftTime=driftTimeUncorr-rsdd->GetTimeZero(fModule);
269 Float_t driftSpeed = cal->GetDriftSpeedAtAnode(zAnode) + rsdd->GetDeltaVDrift(fModule);
270 Float_t driftPathMicron = driftTime*driftSpeed;
271 const Double_t kMicronTocm = 1.0e-4;
272 Float_t xdet=(driftPathMicron-GetSeg()->Dx())*kMicronTocm; // xdet is negative
273 if (s==0) xdet=-xdet; // left side has positive local x
274
275 if(repa->GetUseSDDCorrectionMaps()){
276 Float_t corrx=0, corrz=0;
277 cal->GetCorrections(zdet,xdet,corrz,corrx,GetSeg());
278 zdet+=corrz;
279 xdet+=corrx;
280 }
281
282 Double_t loc[3]={xdet,0.,zdet},trk[3]={0.,0.,0.};
283 mT2L->MasterToLocal(loc,trk);
284 y=trk[1];
285 z=trk[2];
286
287 q/=rsdd->GetADC2keV();
288 q+=(driftTime*rsdd->GetChargevsTime()); // correction for zero supp.
289 if(cal-> IsAMAt20MHz()) q*=2.; // account for 1/2 sampling freq.
290 if(q<repa->GetMinClusterChargeSDD()) continue; // remove noise clusters
291
292 Float_t hit[5] = {y, z, 0.0030*0.0030, 0.0020*0.0020, q};
293 Int_t info[3] = {clSizTb, clSizAnode, fNlayer[fModule]};
294 if (digits) CheckLabels2(milab);
295 milab[3]=fNdet[fModule];
296 AliITSRecPoint cc(milab,hit,info);
297 cc.SetType(npeaks);
298 cc.SetDriftTime(driftTimeUncorr);
299 if(clusters) new (cl[ncl]) AliITSRecPoint(cc);
300 else {
301 fDetTypeRec->AddRecPoint(cc);
302 }
303 ncl++;
f6b6d58e 304 }
04366a57 305 }
306 }
add58ef6 307 }
24c98369 308
04366a57 309}
f6b6d58e 310//______________________________________________________________________
04366a57 311void AliITSClusterFinderV2SDD::RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters){
312 //------------------------------------------------------------
313 // This function creates ITS clusters from raw data
314 //------------------------------------------------------------
d9ed1779 315
316 AliITSRawStream* inputSDD=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
317 AliDebug(1,Form("%s is used",inputSDD->ClassName()));
2f8ed7ab 318
979b5a5f 319 AliITSDDLModuleMapSDD *ddlmap=(AliITSDDLModuleMapSDD*)fDetTypeRec->GetDDLModuleMapSDD();
2f8ed7ab 320 inputSDD->SetDDLModuleMap(ddlmap);
83ec5e27 321 for(Int_t iddl=0; iddl<AliITSDDLModuleMapSDD::GetNDDLs(); iddl++){
322 for(Int_t icar=0; icar<AliITSDDLModuleMapSDD::GetNModPerDDL();icar++){
323 Int_t iMod=ddlmap->GetModuleNumber(iddl,icar);
324 if(iMod==-1) continue;
325 AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(iMod);
326 if(cal==0){
327 AliError(Form("Calibration object not present for SDD module %d\n",iMod));
328 continue;
329 }
253e68a0 330 Bool_t isZeroSupp=cal->GetZeroSupp();
331 if(isZeroSupp){
2f8ed7ab 332 for(Int_t iSid=0; iSid<2; iSid++) inputSDD->SetZeroSuppLowThreshold(iMod-240,iSid,cal->GetZSLowThreshold(iSid));
83ec5e27 333 }else{
2f8ed7ab 334 for(Int_t iSid=0; iSid<2; iSid++) inputSDD->SetZeroSuppLowThreshold(iMod-240,iSid,0);
83ec5e27 335 }
336 }
337 }
2f8ed7ab 338 FindClustersSDD(inputSDD,clusters);
339 delete inputSDD;
04366a57 340}
341
342void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
343 TClonesArray** clusters)
344{
345 //------------------------------------------------------------
346 // Actual SDD cluster finder for raw data
347 //------------------------------------------------------------
348 Int_t nClustersSDD = 0;
ae485645 349 AliBin *bins[2];
add58ef6 350 TBits* anodeFired[2];
351 TBits* ddlAnodeFired[kHybridsPerDDL];
352 for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){
353 ddlAnodeFired[iHyb]=new TBits(fNAnodes);
354 ddlAnodeFired[iHyb]->ResetAllBits();
355 }
de075dae 356 Int_t vectModId[kModulesPerDDL];
357 for(Int_t iMod=0; iMod<kModulesPerDDL; iMod++) vectModId[iMod]=-1;
358
04366a57 359 // read raw data input stream
14dceddf 360 while (input->Next()) {
e4da2288 361 Int_t iModule = input->GetModuleID();
93a93288 362 if(iModule<0){
363 AliWarning(Form("Invalid SDD module number %d\n", iModule));
364 continue;
365 }
6297cc01 366 Int_t iCarlos =input->GetCarlosId();
367 Int_t iSide = input->GetChannel();
14dceddf 368 Int_t iHybrid=iCarlos*2+iSide;
de075dae 369
14dceddf 370 if (input->IsCompletedModule()) {
de075dae 371 // store the module number
372 vectModId[iCarlos]=iModule;
373 }
374 else if (input->IsCompletedDDL()) {
375 // when all data from a DDL was read, search for clusters
376 Int_t jitter=input->GetJitter();
377 for(Int_t iMod=0; iMod<kModulesPerDDL; iMod++){
378 if(vectModId[iMod]>=0){
379 fModule = vectModId[iMod];
380 clusters[fModule] = new TClonesArray("AliITSRecPoint");
add58ef6 381 bins[0]=fDDLBins[iMod*2]; // first hybrid of the module
382 bins[1]=fDDLBins[iMod*2+1]; // second hybrid of the module
383 anodeFired[0]=ddlAnodeFired[iMod*2];
384 anodeFired[1]=ddlAnodeFired[iMod*2+1];
385 FindClustersSDD(bins, anodeFired, NULL, clusters[fModule],jitter);
de075dae 386 Int_t nClusters = clusters[fModule]->GetEntriesFast();
387 nClustersSDD += nClusters;
388 vectModId[iMod]=-1;
389 }
add58ef6 390 for (Int_t s=0; s<2; s++){
391 Int_t indexHyb=iMod*2+s;
392 for(Int_t iAnode=0; iAnode<GetSeg()->NpzHalf(); iAnode++){
393 if(ddlAnodeFired[indexHyb]->TestBitNumber(iAnode)==kFALSE) continue;
394 for(Int_t iTimeBin=0; iTimeBin<GetSeg()->Npx(); iTimeBin++){
395 Int_t index=(iTimeBin+1)*fNZbins+(iAnode+1);
396 fDDLBins[indexHyb][index].Reset();
397 }
398 }
de075dae 399 }
add58ef6 400 ddlAnodeFired[iMod*2]->ResetAllBits();
401 ddlAnodeFired[iMod*2+1]->ResetAllBits();
44c5b268 402 }
5dfa68c5 403 }else{
04366a57 404 // fill the current digit into the bins array
44c5b268 405 if(iHybrid<0 || iHybrid>=kHybridsPerDDL){
406 AliWarning(Form("Invalid SDD hybrid number %d on module %d\n", iHybrid,iModule));
407 continue;
408 }
e4da2288 409 AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(iModule);
9c7f5947 410 if(cal==0){
411 AliError(Form("Calibration object not present for SDD module %d\n",iModule));
412 continue;
413 }
5683bd96 414 Float_t charge=input->GetSignal();
add58ef6 415 Int_t chan=input->GetCoord1()+fNAnodes*iSide;
75065a60 416 Float_t gain=cal->GetChannelGain(chan)/fDetTypeRec->GetAverageGainSDD();;
20f3f947 417 Float_t baseline = cal->GetBaseline(chan);
418 if(charge>baseline) charge-=baseline;
419 else charge=0;
9c7f5947 420 if(gain>0.){ // Bad channels have gain=0
421 charge/=gain;
422 if(charge>=cal->GetThresholdAnode(chan)) {
423 Int_t q=(Int_t)(charge+0.5);
424 Int_t iz = input->GetCoord1();
425 Int_t itb = input->GetCoord2();
add58ef6 426 Int_t index = (itb+1) * fNZbins + (iz+1);
427 if((itb < fNTimeBins) && (iz < fNAnodes)) {
428 fDDLBins[iHybrid][index].SetQ(q);
429 fDDLBins[iHybrid][index].SetMask(1);
430 fDDLBins[iHybrid][index].SetIndex(index);
431 ddlAnodeFired[iHybrid]->SetBitNumber(iz);
9c7f5947 432 }else{
433 AliWarning(Form("Invalid SDD cell: Anode=%d TimeBin=%d",iz,itb));
434 }
93a93288 435 }
5dfa68c5 436 }
04366a57 437 }
438 }
add58ef6 439 for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){
440 delete ddlAnodeFired[iHyb];
441 }
442 Info("FindClustersSDD", "found clusters in ITS SDD: %d", nClustersSDD);
04366a57 443}
444
e3ee4984 445//______________________________________________________________________
add58ef6 446Bool_t AliITSClusterFinderV2SDD::NoiseSuppress(Int_t k, Int_t sid, AliBin* bins, AliITSCalibrationSDD* cal) const {
e3ee4984 447 // applies zero suppression using the measured noise of each anode
448 // threshold values from ALICE-INT-1999-28 V10
2b025386 449 // returns kTRUE if the digit should eb noise suppressed, kFALSE if it should be kept
83ec5e27 450 Float_t xfactL=2.2;
451 Float_t xfactH=4.0;
e3ee4984 452 //
453
add58ef6 454 Int_t iAn=(k%fNZbins)-1;
2b025386 455 if(iAn<0 || iAn>255) return kTRUE;
e3ee4984 456 if(sid==1) iAn+=256;
457 Int_t nLow=0, nHigh=0;
458 Float_t noise=cal->GetNoiseAfterElectronics(iAn);
459 Float_t noisem1=noise;
460 if(iAn>1) noisem1=cal->GetNoiseAfterElectronics(iAn-1);
461 Float_t noisep1=noise;
462 if(iAn<511) noisep1=cal->GetNoiseAfterElectronics(iAn+1);
83ec5e27 463 Float_t tL=noise*xfactL;
464 Float_t tH=noise*xfactH;
465 Float_t tLp1=noisep1*xfactL;
466 Float_t tHp1=noisep1*xfactH;
467 Float_t tLm1=noisem1*xfactL;
468 Float_t tHm1=noisem1*xfactH;
2b025386 469 Int_t cC=bins[k].GetQ();
e3ee4984 470 if(cC<=tL){
471 bins[k].SetQ(0);
472 bins[k].SetMask(0xFFFFFFFE);
2b025386 473 return kTRUE;;
e3ee4984 474 }
475 nLow++; // cC is greater than tL
476 if(cC>tH) nHigh++;
477 Int_t sS=bins[k-1].GetQ();
478 if(sS>tLm1) nLow++;
479 if(sS>tHm1) nHigh++;
480 Int_t nN=bins[k+1].GetQ();
481 if(nN>tLp1) nLow++;
482 if(nN>tHp1) nHigh++;
add58ef6 483 Int_t eE=bins[k-fNZbins].GetQ();
e3ee4984 484 if(eE>tL) nLow++;
485 if(eE>tH) nHigh++;
add58ef6 486 Int_t wW=bins[k+fNZbins].GetQ();
e3ee4984 487 if(wW>tL) nLow++;
488 if(wW>tH) nHigh++;
2b025386 489 if(nLow<3 || nHigh<1) return kTRUE;
490 else return kFALSE;
e3ee4984 491}
492
04366a57 493
d97eb3fe 494