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