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