For Pythia with tune don't switch off MI in ConfigHeavyFlavor
[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++){
85bdbebe 226 index = idx[k]+di+dj*fNZbins;
add58ef6 227 if (index<0) continue;
228 if (index>=kMaxBin) continue;
229 AliBin *b=&bins[s][index];
85bdbebe 230 Int_t jAnode=index%fNZbins-1;
add58ef6 231 Int_t adcSignal=b->GetQ();
85bdbebe 232 if(adcSignal>cal->GetThresholdAnode(jAnode)){
add58ef6 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
710d11ac 256 if(clSizAnode>5) continue; // cut common mode noise spikes
add58ef6 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);
e71a6286 269 Float_t driftSpeed = cal->GetDriftSpeedAtAnode(zAnode) + rsdd->GetDeltaVDrift(fModule,zAnode>255);
add58ef6 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
57019696 287 q/=rsdd->GetADCtokeV(fModule);
add58ef6 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);
8f6140ad 299 cc.SetDriftSide(s);
add58ef6 300 if(clusters) new (cl[ncl]) AliITSRecPoint(cc);
301 else {
302 fDetTypeRec->AddRecPoint(cc);
303 }
304 ncl++;
f6b6d58e 305 }
04366a57 306 }
307 }
add58ef6 308 }
85bdbebe 309
310}
f6b6d58e 311//______________________________________________________________________
04366a57 312void AliITSClusterFinderV2SDD::RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters){
313 //------------------------------------------------------------
314 // This function creates ITS clusters from raw data
315 //------------------------------------------------------------
d9ed1779 316
317 AliITSRawStream* inputSDD=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
318 AliDebug(1,Form("%s is used",inputSDD->ClassName()));
2f8ed7ab 319
979b5a5f 320 AliITSDDLModuleMapSDD *ddlmap=(AliITSDDLModuleMapSDD*)fDetTypeRec->GetDDLModuleMapSDD();
2f8ed7ab 321 inputSDD->SetDDLModuleMap(ddlmap);
83ec5e27 322 for(Int_t iddl=0; iddl<AliITSDDLModuleMapSDD::GetNDDLs(); iddl++){
323 for(Int_t icar=0; icar<AliITSDDLModuleMapSDD::GetNModPerDDL();icar++){
324 Int_t iMod=ddlmap->GetModuleNumber(iddl,icar);
325 if(iMod==-1) continue;
326 AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(iMod);
327 if(cal==0){
328 AliError(Form("Calibration object not present for SDD module %d\n",iMod));
329 continue;
330 }
253e68a0 331 Bool_t isZeroSupp=cal->GetZeroSupp();
332 if(isZeroSupp){
2f8ed7ab 333 for(Int_t iSid=0; iSid<2; iSid++) inputSDD->SetZeroSuppLowThreshold(iMod-240,iSid,cal->GetZSLowThreshold(iSid));
83ec5e27 334 }else{
2f8ed7ab 335 for(Int_t iSid=0; iSid<2; iSid++) inputSDD->SetZeroSuppLowThreshold(iMod-240,iSid,0);
83ec5e27 336 }
337 }
338 }
2f8ed7ab 339 FindClustersSDD(inputSDD,clusters);
340 delete inputSDD;
04366a57 341}
342
343void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
344 TClonesArray** clusters)
345{
346 //------------------------------------------------------------
347 // Actual SDD cluster finder for raw data
348 //------------------------------------------------------------
349 Int_t nClustersSDD = 0;
ae485645 350 AliBin *bins[2];
add58ef6 351 TBits* anodeFired[2];
352 TBits* ddlAnodeFired[kHybridsPerDDL];
353 for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){
354 ddlAnodeFired[iHyb]=new TBits(fNAnodes);
355 ddlAnodeFired[iHyb]->ResetAllBits();
356 }
de075dae 357 Int_t vectModId[kModulesPerDDL];
358 for(Int_t iMod=0; iMod<kModulesPerDDL; iMod++) vectModId[iMod]=-1;
359
04366a57 360 // read raw data input stream
14dceddf 361 while (input->Next()) {
e4da2288 362 Int_t iModule = input->GetModuleID();
93a93288 363 if(iModule<0){
364 AliWarning(Form("Invalid SDD module number %d\n", iModule));
365 continue;
366 }
6297cc01 367 Int_t iCarlos =input->GetCarlosId();
368 Int_t iSide = input->GetChannel();
14dceddf 369 Int_t iHybrid=iCarlos*2+iSide;
de075dae 370
14dceddf 371 if (input->IsCompletedModule()) {
de075dae 372 // store the module number
373 vectModId[iCarlos]=iModule;
374 }
375 else if (input->IsCompletedDDL()) {
376 // when all data from a DDL was read, search for clusters
377 Int_t jitter=input->GetJitter();
378 for(Int_t iMod=0; iMod<kModulesPerDDL; iMod++){
379 if(vectModId[iMod]>=0){
380 fModule = vectModId[iMod];
381 clusters[fModule] = new TClonesArray("AliITSRecPoint");
add58ef6 382 bins[0]=fDDLBins[iMod*2]; // first hybrid of the module
383 bins[1]=fDDLBins[iMod*2+1]; // second hybrid of the module
384 anodeFired[0]=ddlAnodeFired[iMod*2];
385 anodeFired[1]=ddlAnodeFired[iMod*2+1];
386 FindClustersSDD(bins, anodeFired, NULL, clusters[fModule],jitter);
de075dae 387 Int_t nClusters = clusters[fModule]->GetEntriesFast();
388 nClustersSDD += nClusters;
389 vectModId[iMod]=-1;
390 }
add58ef6 391 for (Int_t s=0; s<2; s++){
392 Int_t indexHyb=iMod*2+s;
393 for(Int_t iAnode=0; iAnode<GetSeg()->NpzHalf(); iAnode++){
394 if(ddlAnodeFired[indexHyb]->TestBitNumber(iAnode)==kFALSE) continue;
395 for(Int_t iTimeBin=0; iTimeBin<GetSeg()->Npx(); iTimeBin++){
396 Int_t index=(iTimeBin+1)*fNZbins+(iAnode+1);
397 fDDLBins[indexHyb][index].Reset();
398 }
399 }
de075dae 400 }
add58ef6 401 ddlAnodeFired[iMod*2]->ResetAllBits();
402 ddlAnodeFired[iMod*2+1]->ResetAllBits();
44c5b268 403 }
5dfa68c5 404 }else{
04366a57 405 // fill the current digit into the bins array
44c5b268 406 if(iHybrid<0 || iHybrid>=kHybridsPerDDL){
407 AliWarning(Form("Invalid SDD hybrid number %d on module %d\n", iHybrid,iModule));
408 continue;
409 }
e4da2288 410 AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(iModule);
9c7f5947 411 if(cal==0){
412 AliError(Form("Calibration object not present for SDD module %d\n",iModule));
413 continue;
414 }
5683bd96 415 Float_t charge=input->GetSignal();
add58ef6 416 Int_t chan=input->GetCoord1()+fNAnodes*iSide;
75065a60 417 Float_t gain=cal->GetChannelGain(chan)/fDetTypeRec->GetAverageGainSDD();;
20f3f947 418 Float_t baseline = cal->GetBaseline(chan);
419 if(charge>baseline) charge-=baseline;
420 else charge=0;
9c7f5947 421 if(gain>0.){ // Bad channels have gain=0
422 charge/=gain;
423 if(charge>=cal->GetThresholdAnode(chan)) {
424 Int_t q=(Int_t)(charge+0.5);
425 Int_t iz = input->GetCoord1();
426 Int_t itb = input->GetCoord2();
add58ef6 427 Int_t index = (itb+1) * fNZbins + (iz+1);
428 if((itb < fNTimeBins) && (iz < fNAnodes)) {
429 fDDLBins[iHybrid][index].SetQ(q);
430 fDDLBins[iHybrid][index].SetMask(1);
431 fDDLBins[iHybrid][index].SetIndex(index);
432 ddlAnodeFired[iHybrid]->SetBitNumber(iz);
9c7f5947 433 }else{
434 AliWarning(Form("Invalid SDD cell: Anode=%d TimeBin=%d",iz,itb));
435 }
93a93288 436 }
5dfa68c5 437 }
04366a57 438 }
439 }
add58ef6 440 for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){
441 delete ddlAnodeFired[iHyb];
442 }
443 Info("FindClustersSDD", "found clusters in ITS SDD: %d", nClustersSDD);
04366a57 444}
445
e3ee4984 446//______________________________________________________________________
add58ef6 447Bool_t AliITSClusterFinderV2SDD::NoiseSuppress(Int_t k, Int_t sid, AliBin* bins, AliITSCalibrationSDD* cal) const {
e3ee4984 448 // applies zero suppression using the measured noise of each anode
449 // threshold values from ALICE-INT-1999-28 V10
2b025386 450 // returns kTRUE if the digit should eb noise suppressed, kFALSE if it should be kept
83ec5e27 451 Float_t xfactL=2.2;
452 Float_t xfactH=4.0;
e3ee4984 453 //
454
add58ef6 455 Int_t iAn=(k%fNZbins)-1;
2b025386 456 if(iAn<0 || iAn>255) return kTRUE;
e3ee4984 457 if(sid==1) iAn+=256;
458 Int_t nLow=0, nHigh=0;
459 Float_t noise=cal->GetNoiseAfterElectronics(iAn);
460 Float_t noisem1=noise;
461 if(iAn>1) noisem1=cal->GetNoiseAfterElectronics(iAn-1);
462 Float_t noisep1=noise;
463 if(iAn<511) noisep1=cal->GetNoiseAfterElectronics(iAn+1);
83ec5e27 464 Float_t tL=noise*xfactL;
465 Float_t tH=noise*xfactH;
466 Float_t tLp1=noisep1*xfactL;
467 Float_t tHp1=noisep1*xfactH;
468 Float_t tLm1=noisem1*xfactL;
469 Float_t tHm1=noisem1*xfactH;
2b025386 470 Int_t cC=bins[k].GetQ();
e3ee4984 471 if(cC<=tL){
472 bins[k].SetQ(0);
473 bins[k].SetMask(0xFFFFFFFE);
2b025386 474 return kTRUE;;
e3ee4984 475 }
476 nLow++; // cC is greater than tL
477 if(cC>tH) nHigh++;
478 Int_t sS=bins[k-1].GetQ();
479 if(sS>tLm1) nLow++;
480 if(sS>tHm1) nHigh++;
481 Int_t nN=bins[k+1].GetQ();
482 if(nN>tLp1) nLow++;
483 if(nN>tHp1) nHigh++;
add58ef6 484 Int_t eE=bins[k-fNZbins].GetQ();
e3ee4984 485 if(eE>tL) nLow++;
486 if(eE>tH) nHigh++;
add58ef6 487 Int_t wW=bins[k+fNZbins].GetQ();
e3ee4984 488 if(wW>tL) nLow++;
489 if(wW>tH) nHigh++;
ad98389f 490 if(nLow<2 || nHigh<1) return kTRUE;
2b025386 491 else return kFALSE;
e3ee4984 492}
493
04366a57 494
d97eb3fe 495