]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, 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 | **************************************************************************/ | |
48058160 | 15 | /* |
16 | $Id$ | |
17 | $Log$ | |
5c5273c2 | 18 | Revision 1.35 2002/09/09 17:23:28 nilsen |
19 | Minor changes in support of changes to AliITSdigitS?D class'. | |
20 | ||
ee86d557 | 21 | Revision 1.34 2002/06/07 16:32:28 nilsen |
22 | Latest SDD changes to speed up the SDD simulation code. | |
23 | ||
43217ad9 | 24 | Revision 1.33 2002/04/24 22:02:31 nilsen |
25 | New SDigits and Digits routines, and related changes, (including new | |
26 | noise values). | |
27 | ||
48058160 | 28 | */ |
b0f5e3fc | 29 | |
b0f5e3fc | 30 | #include <iostream.h> |
31 | #include <stdlib.h> | |
32 | #include <stdio.h> | |
1ca7869b | 33 | #include <string.h> |
34 | ||
94de3818 | 35 | #include <TSystem.h> |
36 | #include <TROOT.h> | |
608f25d8 | 37 | #include <TStopwatch.h> |
ece86d9a | 38 | #include <TCanvas.h> |
39 | #include <TF1.h> | |
40 | #include <TRandom.h> | |
1ca7869b | 41 | #include <TH1.h> |
42 | #include <TFile.h> | |
43 | #include <TVector.h> | |
44 | #include <TArrayI.h> | |
45 | #include <TArrayF.h> | |
ece86d9a | 46 | |
b0f5e3fc | 47 | #include "AliRun.h" |
e8189707 | 48 | #include "AliITS.h" |
ece86d9a | 49 | #include "AliITShit.h" |
50 | #include "AliITSdigit.h" | |
51 | #include "AliITSmodule.h" | |
c7a4dac0 | 52 | #include "AliITSpList.h" |
e8189707 | 53 | #include "AliITSMapA1.h" |
54 | #include "AliITSMapA2.h" | |
e8189707 | 55 | #include "AliITSetfSDD.h" |
56 | #include "AliITSRawData.h" | |
b0f5e3fc | 57 | #include "AliITSHuffman.h" |
50d05d7b | 58 | #include "AliITSgeom.h" |
ece86d9a | 59 | #include "AliITSsegmentation.h" |
60 | #include "AliITSresponse.h" | |
c7a4dac0 | 61 | #include "AliITSsegmentationSDD.h" |
62 | #include "AliITSresponseSDD.h" | |
1ca7869b | 63 | #include "AliITSsimulationSDD.h" |
b0f5e3fc | 64 | |
b0f5e3fc | 65 | ClassImp(AliITSsimulationSDD) |
66 | //////////////////////////////////////////////////////////////////////// | |
67 | // Version: 0 | |
68 | // Written by Piergiorgio Cerello | |
69 | // November 23 1999 | |
70 | // | |
71 | // AliITSsimulationSDD is the simulation of SDDs. | |
72 | // | |
73 | //Begin_Html | |
74 | /* | |
75 | <img src="picts/ITS/AliITShit_Class_Diagram.gif"> | |
76 | </pre> | |
77 | <br clear=left> | |
78 | <font size=+2 color=red> | |
79 | <p>This show the relasionships between the ITS hit class and the rest of Aliroot. | |
80 | </font> | |
81 | <pre> | |
82 | */ | |
83 | //End_Html | |
8a33ae9e | 84 | //______________________________________________________________________ |
b0f5e3fc | 85 | Int_t power(Int_t b, Int_t e) { |
8a33ae9e | 86 | // compute b to the e power, where both b and e are Int_ts. |
87 | Int_t power = 1,i; | |
b0f5e3fc | 88 | |
8a33ae9e | 89 | for(i=0; i<e; i++) power *= b; |
90 | return power; | |
91 | } | |
92 | //______________________________________________________________________ | |
b0f5e3fc | 93 | void FastFourierTransform(AliITSetfSDD *alisddetf,Double_t *real, |
94 | Double_t *imag,Int_t direction) { | |
8a33ae9e | 95 | // Do a Fast Fourier Transform |
8a33ae9e | 96 | |
97 | Int_t samples = alisddetf->GetSamples(); | |
98 | Int_t l = (Int_t) ((log((Float_t) samples)/log(2.))+0.5); | |
99 | Int_t m1 = samples; | |
100 | Int_t m = samples/2; | |
101 | Int_t m2 = samples/m1; | |
102 | Int_t i,j,k; | |
103 | for(i=1; i<=l; i++) { | |
50d05d7b | 104 | for(j=0; j<samples; j += m1) { |
105 | Int_t p = 0; | |
106 | for(k=j; k<= j+m-1; k++) { | |
107 | Double_t wsr = alisddetf->GetWeightReal(p); | |
108 | Double_t wsi = alisddetf->GetWeightImag(p); | |
109 | if(direction == -1) wsi = -wsi; | |
110 | Double_t xr = *(real+k+m); | |
111 | Double_t xi = *(imag+k+m); | |
112 | *(real+k+m) = wsr*(*(real+k)-xr) - wsi*(*(imag+k)-xi); | |
113 | *(imag+k+m) = wsr*(*(imag+k)-xi) + wsi*(*(real+k)-xr); | |
114 | *(real+k) += xr; | |
115 | *(imag+k) += xi; | |
116 | p += m2; | |
117 | } // end for k | |
118 | } // end for j | |
119 | m1 = m; | |
120 | m /= 2; | |
121 | m2 += m2; | |
8a33ae9e | 122 | } // end for i |
b0f5e3fc | 123 | |
8a33ae9e | 124 | for(j=0; j<samples; j++) { |
50d05d7b | 125 | Int_t j1 = j; |
126 | Int_t p = 0; | |
127 | Int_t i1; | |
128 | for(i1=1; i1<=l; i1++) { | |
129 | Int_t j2 = j1; | |
130 | j1 /= 2; | |
131 | p = p + p + j2 - j1 - j1; | |
132 | } // end for i1 | |
133 | if(p >= j) { | |
134 | Double_t xr = *(real+j); | |
135 | Double_t xi = *(imag+j); | |
136 | *(real+j) = *(real+p); | |
137 | *(imag+j) = *(imag+p); | |
138 | *(real+p) = xr; | |
139 | *(imag+p) = xi; | |
140 | } // end if p>=j | |
8a33ae9e | 141 | } // end for j |
142 | if(direction == -1) { | |
50d05d7b | 143 | for(i=0; i<samples; i++) { |
144 | *(real+i) /= samples; | |
145 | *(imag+i) /= samples; | |
146 | } // end for i | |
8a33ae9e | 147 | } // end if direction == -1 |
50d05d7b | 148 | return; |
b0f5e3fc | 149 | } |
8a33ae9e | 150 | //______________________________________________________________________ |
b0f5e3fc | 151 | AliITSsimulationSDD::AliITSsimulationSDD(){ |
8a33ae9e | 152 | // Default constructor |
153 | ||
154 | fResponse = 0; | |
155 | fSegmentation = 0; | |
156 | fHis = 0; | |
50d05d7b | 157 | // fpList = 0; |
8a33ae9e | 158 | fHitMap2 = 0; |
48058160 | 159 | fHitSigMap2 = 0; |
160 | fHitNoiMap2 = 0; | |
8a33ae9e | 161 | fElectronics = 0; |
162 | fStream = 0; | |
163 | fInZR = 0; | |
164 | fInZI = 0; | |
165 | fOutZR = 0; | |
166 | fOutZI = 0; | |
167 | fNofMaps = 0; | |
168 | fMaxNofSamples = 0; | |
169 | fITS = 0; | |
8604b270 | 170 | fTreeB = 0; |
43217ad9 | 171 | fAnodeFire = 0; |
8a33ae9e | 172 | SetScaleFourier(); |
173 | SetPerpendTracksFlag(); | |
50d05d7b | 174 | SetCrosstalkFlag(); |
8a33ae9e | 175 | SetDoFFT(); |
176 | SetCheckNoise(); | |
b0f5e3fc | 177 | } |
8a33ae9e | 178 | //______________________________________________________________________ |
179 | AliITSsimulationSDD::AliITSsimulationSDD(AliITSsimulationSDD &source){ | |
180 | // Copy constructor to satify Coding roules only. | |
181 | ||
182 | if(this==&source) return; | |
c7a4dac0 | 183 | Error("AliITSsimulationSSD","Not allowed to make a copy of " |
50d05d7b | 184 | "AliITSsimulationSDD Using default creater instead"); |
8a33ae9e | 185 | AliITSsimulationSDD(); |
b0f5e3fc | 186 | } |
8a33ae9e | 187 | //______________________________________________________________________ |
c7a4dac0 | 188 | AliITSsimulationSDD& AliITSsimulationSDD::operator=(AliITSsimulationSDD &src){ |
8a33ae9e | 189 | // Assignment operator to satify Coding roules only. |
190 | ||
c7a4dac0 | 191 | if(this==&src) return *this; |
192 | Error("AliITSsimulationSSD","Not allowed to make a = with " | |
50d05d7b | 193 | "AliITSsimulationSDD Using default creater instead"); |
8a33ae9e | 194 | return *this ; |
b0f5e3fc | 195 | } |
8a33ae9e | 196 | //______________________________________________________________________ |
c7a4dac0 | 197 | AliITSsimulationSDD::AliITSsimulationSDD(AliITSsegmentation *seg, |
50d05d7b | 198 | AliITSresponse *resp){ |
c7a4dac0 | 199 | // Standard Constructor |
200 | ||
c7a4dac0 | 201 | fResponse = 0; |
202 | fSegmentation = 0; | |
203 | fHis = 0; | |
50d05d7b | 204 | // fpList = 0; |
c7a4dac0 | 205 | fHitMap2 = 0; |
48058160 | 206 | fHitSigMap2 = 0; |
207 | fHitNoiMap2 = 0; | |
c7a4dac0 | 208 | fElectronics = 0; |
209 | fStream = 0; | |
210 | fInZR = 0; | |
211 | fInZI = 0; | |
212 | fOutZR = 0; | |
213 | fOutZI = 0; | |
214 | fNofMaps = 0; | |
215 | fMaxNofSamples = 0; | |
216 | fITS = 0; | |
217 | fTreeB = 0; | |
218 | ||
219 | Init((AliITSsegmentationSDD*)seg,(AliITSresponseSDD*)resp); | |
220 | } | |
221 | //______________________________________________________________________ | |
222 | void AliITSsimulationSDD::Init(AliITSsegmentationSDD *seg, | |
50d05d7b | 223 | AliITSresponseSDD *resp){ |
38867c90 | 224 | // Standard Constructor |
ece86d9a | 225 | |
38867c90 | 226 | fResponse = resp; |
227 | fSegmentation = seg; | |
228 | SetScaleFourier(); | |
229 | SetPerpendTracksFlag(); | |
50d05d7b | 230 | SetCrosstalkFlag(); |
38867c90 | 231 | SetDoFFT(); |
232 | SetCheckNoise(); | |
b0f5e3fc | 233 | |
50d05d7b | 234 | fpList = new AliITSpList( fSegmentation->Npz(), |
235 | fScaleSize*fSegmentation->Npx() ); | |
48058160 | 236 | fHitSigMap2 = new AliITSMapA2(fSegmentation,fScaleSize,1); |
237 | fHitNoiMap2 = new AliITSMapA2(fSegmentation,fScaleSize,1); | |
238 | fHitMap2 = fHitSigMap2; | |
b0f5e3fc | 239 | |
8a33ae9e | 240 | fNofMaps = fSegmentation->Npz(); |
241 | fMaxNofSamples = fSegmentation->Npx(); | |
43217ad9 | 242 | fAnodeFire = new Bool_t [fNofMaps]; |
243 | ||
38867c90 | 244 | Float_t sddLength = fSegmentation->Dx(); |
8a33ae9e | 245 | Float_t sddWidth = fSegmentation->Dz(); |
b0f5e3fc | 246 | |
8a33ae9e | 247 | Int_t dummy = 0; |
38867c90 | 248 | Float_t anodePitch = fSegmentation->Dpz(dummy); |
8a33ae9e | 249 | Double_t timeStep = (Double_t)fSegmentation->Dpx(dummy); |
250 | Float_t driftSpeed = fResponse->DriftSpeed(); | |
b0f5e3fc | 251 | |
38867c90 | 252 | if(anodePitch*(fNofMaps/2) > sddWidth) { |
50d05d7b | 253 | Warning("AliITSsimulationSDD", |
254 | "Too many anodes %d or too big pitch %f \n", | |
255 | fNofMaps/2,anodePitch); | |
38867c90 | 256 | } // end if |
b0f5e3fc | 257 | |
38867c90 | 258 | if(timeStep*fMaxNofSamples < sddLength/driftSpeed) { |
50d05d7b | 259 | Error("AliITSsimulationSDD", |
260 | "Time Interval > Allowed Time Interval: exit\n"); | |
261 | return; | |
38867c90 | 262 | } // end if |
b0f5e3fc | 263 | |
38867c90 | 264 | fElectronics = new AliITSetfSDD(timeStep/fScaleSize, |
50d05d7b | 265 | fResponse->Electronics()); |
b0f5e3fc | 266 | |
38867c90 | 267 | char opt1[20], opt2[20]; |
268 | fResponse->ParamOptions(opt1,opt2); | |
8a33ae9e | 269 | fParam = opt2; |
38867c90 | 270 | char *same = strstr(opt1,"same"); |
271 | if (same) { | |
50d05d7b | 272 | fNoise.Set(0); |
273 | fBaseline.Set(0); | |
38867c90 | 274 | } else { |
50d05d7b | 275 | fNoise.Set(fNofMaps); |
276 | fBaseline.Set(fNofMaps); | |
38867c90 | 277 | } // end if |
b0f5e3fc | 278 | |
38867c90 | 279 | const char *kopt=fResponse->ZeroSuppOption(); |
280 | if (strstr(fParam,"file") ) { | |
50d05d7b | 281 | fD.Set(fNofMaps); |
282 | fT1.Set(fNofMaps); | |
283 | if (strstr(kopt,"2D")) { | |
284 | fT2.Set(fNofMaps); | |
b0f5e3fc | 285 | fTol.Set(0); |
286 | Init2D(); // desactivate if param change module by module | |
50d05d7b | 287 | } else if(strstr(kopt,"1D")) { |
b0f5e3fc | 288 | fT2.Set(2); |
289 | fTol.Set(2); | |
290 | Init1D(); // desactivate if param change module by module | |
50d05d7b | 291 | } // end if strstr |
38867c90 | 292 | } else { |
50d05d7b | 293 | fD.Set(2); |
294 | fTol.Set(2); | |
295 | fT1.Set(2); | |
296 | fT2.Set(2); | |
297 | SetCompressParam(); | |
38867c90 | 298 | } // end if else strstr |
b0f5e3fc | 299 | |
8a33ae9e | 300 | Bool_t write = fResponse->OutputOption(); |
38867c90 | 301 | if(write && strstr(kopt,"2D")) MakeTreeB(); |
b0f5e3fc | 302 | |
38867c90 | 303 | // call here if baseline does not change by module |
304 | // ReadBaseline(); | |
b0f5e3fc | 305 | |
8a33ae9e | 306 | fITS = (AliITS*)gAlice->GetModule("ITS"); |
307 | Int_t size = fNofMaps*fMaxNofSamples; | |
308 | fStream = new AliITSInStream(size); | |
b0f5e3fc | 309 | |
38867c90 | 310 | fInZR = new Double_t [fScaleSize*fMaxNofSamples]; |
311 | fInZI = new Double_t [fScaleSize*fMaxNofSamples]; | |
312 | fOutZR = new Double_t [fScaleSize*fMaxNofSamples]; | |
313 | fOutZI = new Double_t [fScaleSize*fMaxNofSamples]; | |
5d18fa90 | 314 | |
b0f5e3fc | 315 | } |
8a33ae9e | 316 | //______________________________________________________________________ |
b0f5e3fc | 317 | AliITSsimulationSDD::~AliITSsimulationSDD() { |
8a33ae9e | 318 | // destructor |
319 | ||
50d05d7b | 320 | // delete fpList; |
48058160 | 321 | delete fHitSigMap2; |
322 | delete fHitNoiMap2; | |
8a33ae9e | 323 | delete fStream; |
324 | delete fElectronics; | |
325 | ||
8a33ae9e | 326 | fITS = 0; |
327 | ||
328 | if (fHis) { | |
50d05d7b | 329 | fHis->Delete(); |
330 | delete fHis; | |
8a33ae9e | 331 | } // end if fHis |
332 | if(fTreeB) delete fTreeB; | |
333 | if(fInZR) delete [] fInZR; | |
50d05d7b | 334 | if(fInZI) delete [] fInZI; |
8a33ae9e | 335 | if(fOutZR) delete [] fOutZR; |
336 | if(fOutZI) delete [] fOutZI; | |
43217ad9 | 337 | if(fAnodeFire) delete [] fAnodeFire; |
b0f5e3fc | 338 | } |
8a33ae9e | 339 | //______________________________________________________________________ |
50d05d7b | 340 | void AliITSsimulationSDD::InitSimulationModule( Int_t module, Int_t event ) { |
c7a4dac0 | 341 | // create maps to build the lists of tracks for each summable digit |
50d05d7b | 342 | fModule = module; |
343 | fEvent = event; | |
344 | ClearMaps(); | |
43217ad9 | 345 | memset(fAnodeFire,0,sizeof(Bool_t)*fNofMaps); |
50d05d7b | 346 | } |
347 | //______________________________________________________________________ | |
348 | void AliITSsimulationSDD::ClearMaps() { | |
349 | // clear maps | |
350 | fpList->ClearMap(); | |
48058160 | 351 | fHitSigMap2->ClearMap(); |
352 | fHitNoiMap2->ClearMap(); | |
50d05d7b | 353 | } |
354 | //______________________________________________________________________ | |
355 | void AliITSsimulationSDD::SDigitiseModule( AliITSmodule *mod, Int_t md, Int_t ev){ | |
356 | // digitize module using the "slow" detector simulator creating | |
357 | // summable digits. | |
c7a4dac0 | 358 | |
359 | TObjArray *fHits = mod->GetHits(); | |
360 | Int_t nhits = fHits->GetEntriesFast(); | |
50d05d7b | 361 | if( !nhits ) return; |
c7a4dac0 | 362 | |
50d05d7b | 363 | InitSimulationModule( md, ev ); |
364 | HitsToAnalogDigits( mod ); | |
48058160 | 365 | ChargeToSignal( kFALSE ); // - Process signal without add noise |
366 | fHitMap2 = fHitNoiMap2; // - Swap to noise map | |
367 | ChargeToSignal( kTRUE ); // - Process only noise | |
368 | fHitMap2 = fHitSigMap2; // - Return to signal map | |
50d05d7b | 369 | WriteSDigits(); |
370 | ClearMaps(); | |
371 | } | |
372 | //______________________________________________________________________ | |
48058160 | 373 | Bool_t AliITSsimulationSDD::AddSDigitsToModule( TClonesArray *pItemArray, Int_t mask ) { |
50d05d7b | 374 | // Add Summable digits to module maps. |
48058160 | 375 | Int_t nItems = pItemArray->GetEntries(); |
376 | Double_t maxadc = fResponse->MaxAdc(); | |
43217ad9 | 377 | //Bool_t sig = kFALSE; |
48058160 | 378 | |
50d05d7b | 379 | // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl; |
380 | for( Int_t i=0; i<nItems; i++ ) { | |
381 | AliITSpListItem * pItem = (AliITSpListItem *)(pItemArray->At( i )); | |
382 | if( pItem->GetModule() != fModule ) { | |
383 | Error( "AliITSsimulationSDD", | |
384 | "Error reading, SDigits module %d != current module %d: exit\n", | |
385 | pItem->GetModule(), fModule ); | |
43217ad9 | 386 | return kFALSE; |
50d05d7b | 387 | } // end if |
48058160 | 388 | |
43217ad9 | 389 | // if(pItem->GetSignal()>0.0 ) sig = kTRUE; |
390 | ||
48058160 | 391 | fpList->AddItemTo( mask, pItem ); // Add SignalAfterElect + noise |
392 | AliITSpListItem * pItem2 = fpList->GetpListItem( pItem->GetIndex() ); | |
393 | Double_t sigAE = pItem2->GetSignalAfterElect(); | |
394 | if( sigAE >= maxadc ) sigAE = maxadc-1; // avoid overflow signal | |
395 | Int_t ia; | |
396 | Int_t it; | |
397 | fpList->GetMapIndex( pItem->GetIndex(), ia, it ); | |
398 | fHitMap2->SetHit( ia, it, sigAE ); | |
43217ad9 | 399 | fAnodeFire[ia] = kTRUE; |
50d05d7b | 400 | } |
43217ad9 | 401 | return kTRUE; |
48058160 | 402 | } |
50d05d7b | 403 | //______________________________________________________________________ |
404 | void AliITSsimulationSDD::FinishSDigitiseModule() { | |
405 | // digitize module using the "slow" detector simulator from | |
406 | // the sum of summable digits. | |
407 | FinishDigits() ; | |
408 | ClearMaps(); | |
c7a4dac0 | 409 | } |
410 | //______________________________________________________________________ | |
b0f5e3fc | 411 | void AliITSsimulationSDD::DigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev){ |
8a33ae9e | 412 | // create maps to build the lists of tracks for each digit |
b0f5e3fc | 413 | |
414 | TObjArray *fHits = mod->GetHits(); | |
8a33ae9e | 415 | Int_t nhits = fHits->GetEntriesFast(); |
8a33ae9e | 416 | |
50d05d7b | 417 | InitSimulationModule( md, ev ); |
418 | ||
419 | if( !nhits && fCheckNoise ) { | |
48058160 | 420 | ChargeToSignal( kTRUE ); // process noise |
ece86d9a | 421 | GetNoise(); |
50d05d7b | 422 | ClearMaps(); |
ece86d9a | 423 | return; |
50d05d7b | 424 | } else |
425 | if( !nhits ) return; | |
48058160 | 426 | |
50d05d7b | 427 | HitsToAnalogDigits( mod ); |
48058160 | 428 | ChargeToSignal( kTRUE ); // process signal + noise |
429 | ||
430 | for( Int_t i=0; i<fNofMaps; i++ ) { | |
431 | for( Int_t j=0; j<fMaxNofSamples; j++ ) { | |
432 | Int_t jdx = j*fScaleSize; | |
433 | Int_t index = fpList->GetHitIndex( i, j ); | |
434 | AliITSpListItem pItemTmp2( fModule, index, 0. ); | |
435 | // put the fScaleSize analog digits in only one | |
436 | for( Int_t ik=0; ik<fScaleSize; ik++ ) { | |
437 | AliITSpListItem *pItemTmp = fpList->GetpListItem( i, jdx+ik ); | |
438 | if( pItemTmp == 0 ) continue; | |
439 | pItemTmp2.Add( pItemTmp ); | |
440 | } | |
441 | fpList->DeleteHit( i, j ); | |
442 | fpList->AddItemTo( 0, &pItemTmp2 ); | |
443 | } | |
444 | } | |
445 | ||
50d05d7b | 446 | FinishDigits(); |
447 | ClearMaps(); | |
c7a4dac0 | 448 | } |
449 | //______________________________________________________________________ | |
50d05d7b | 450 | void AliITSsimulationSDD::FinishDigits() { |
c7a4dac0 | 451 | // introduce the electronics effects and do zero-suppression if required |
8a33ae9e | 452 | |
50d05d7b | 453 | ApplyDeadChannels(); |
454 | if( fCrosstalkFlag ) ApplyCrosstalk(); | |
455 | ||
456 | const char *kopt = fResponse->ZeroSuppOption(); | |
457 | ZeroSuppression( kopt ); | |
c7a4dac0 | 458 | } |
459 | //______________________________________________________________________ | |
50d05d7b | 460 | void AliITSsimulationSDD::HitsToAnalogDigits( AliITSmodule *mod ) { |
c7a4dac0 | 461 | // create maps to build the lists of tracks for each digit |
462 | ||
463 | TObjArray *fHits = mod->GetHits(); | |
464 | Int_t nhits = fHits->GetEntriesFast(); | |
50d05d7b | 465 | // Int_t arg[6] = {0,0,0,0,0,0}; |
8a33ae9e | 466 | Int_t dummy = 0; |
467 | Int_t nofAnodes = fNofMaps/2; | |
468 | Float_t sddLength = fSegmentation->Dx(); | |
469 | Float_t sddWidth = fSegmentation->Dz(); | |
470 | Float_t anodePitch = fSegmentation->Dpz(dummy); | |
471 | Float_t timeStep = fSegmentation->Dpx(dummy); | |
472 | Float_t driftSpeed = fResponse->DriftSpeed(); | |
473 | Float_t maxadc = fResponse->MaxAdc(); | |
474 | Float_t topValue = fResponse->DynamicRange(); | |
475 | Float_t cHloss = fResponse->ChargeLoss(); | |
476 | Float_t norm = maxadc/topValue; | |
477 | Float_t dfCoeff, s1; fResponse->DiffCoeff(dfCoeff,s1); // Signal 2d Shape | |
478 | Double_t eVpairs = 3.6; // electron pair energy eV. | |
479 | Float_t nsigma = fResponse->NSigmaIntegration(); // | |
480 | Int_t nlookups = fResponse->GausNLookUp(); // | |
48058160 | 481 | Float_t jitter = ((AliITSresponseSDD*)fResponse)->JitterError(); // |
44a312c3 | 482 | |
b0f5e3fc | 483 | // Piergiorgio's part (apart for few variables which I made float |
484 | // when i thought that can be done | |
b0f5e3fc | 485 | // Fill detector maps with GEANT hits |
486 | // loop over hits in the module | |
487 | ||
8a33ae9e | 488 | const Float_t kconv = 1.0e+6; // GeV->KeV |
489 | Int_t itrack = 0; | |
490 | Int_t hitDetector; // detector number (lay,lad,hitDetector) | |
491 | Int_t iWing; // which detector wing/side. | |
492 | Int_t detector; // 2*(detector-1)+iWing | |
493 | Int_t ii,kk,ka,kt; // loop indexs | |
494 | Int_t ia,it,index; // sub-pixel integration indexies | |
495 | Int_t iAnode; // anode number. | |
496 | Int_t timeSample; // time buckett. | |
497 | Int_t anodeWindow; // anode direction charge integration width | |
498 | Int_t timeWindow; // time direction charge integration width | |
499 | Int_t jamin,jamax; // anode charge integration window | |
500 | Int_t jtmin,jtmax; // time charge integration window | |
501 | Int_t ndiv; // Anode window division factor. | |
502 | Int_t nsplit; // the number of splits in anode and time windows==1. | |
503 | Int_t nOfSplits; // number of times track length is split into | |
504 | Float_t nOfSplitsF; // Floating point version of nOfSplits. | |
505 | Float_t kkF; // Floating point version of loop index kk. | |
506 | Float_t pathInSDD; // Track length in SDD. | |
507 | Float_t drPath; // average position of track in detector. in microns | |
508 | Float_t drTime; // Drift time | |
509 | Float_t nmul; // drift time window multiplication factor. | |
510 | Float_t avDrft; // x position of path length segment in cm. | |
511 | Float_t avAnode; // Anode for path length segment in Anode number (float) | |
512 | Float_t xAnode; // Floating point anode number. | |
513 | Float_t driftPath; // avDrft in microns. | |
514 | Float_t width; // width of signal at anodes. | |
515 | Double_t depEnergy; // Energy deposited in this GEANT step. | |
516 | Double_t xL[3],dxL[3]; // local hit coordinates and diff. | |
517 | Double_t sigA; // sigma of signal at anode. | |
518 | Double_t sigT; // sigma in time/drift direction for track segment | |
519 | Double_t aStep,aConst; // sub-pixel size and offset anode | |
520 | Double_t tStep,tConst; // sub-pixel size and offset time | |
521 | Double_t amplitude; // signal amplitude for track segment in nanoAmpere | |
522 | Double_t chargeloss; // charge loss for track segment. | |
523 | Double_t anodeAmplitude; // signal amplitude in anode direction | |
524 | Double_t aExpo; // exponent of Gaussian anode direction | |
525 | Double_t timeAmplitude; // signal amplitude in time direction | |
526 | Double_t tExpo; // exponent of Gaussian time direction | |
527 | // Double_t tof; // Time of flight in ns of this step. | |
44a312c3 | 528 | |
b0f5e3fc | 529 | for(ii=0; ii<nhits; ii++) { |
50d05d7b | 530 | if(!mod->LineSegmentL(ii,xL[0],dxL[0],xL[1],dxL[1],xL[2],dxL[2], |
531 | depEnergy,itrack)) continue; | |
48058160 | 532 | xL[0] += 0.0001*gRandom->Gaus( 0, jitter ); // |
50d05d7b | 533 | depEnergy *= kconv; |
534 | hitDetector = mod->GetDet(); | |
535 | //tof = 1.E+09*(mod->GetHit(ii)->GetTOF()); // tof in ns. | |
536 | //if(tof>sddLength/driftSpeed) continue; // hit happed too late. | |
537 | ||
538 | // scale path to simulate a perpendicular track | |
539 | // continue if the particle did not lose energy | |
540 | // passing through detector | |
541 | if (!depEnergy) { | |
542 | Warning("HitsToAnalogDigits", | |
543 | "fTrack = %d hit=%d module=%d This particle has" | |
544 | " passed without losing energy!", | |
545 | itrack,ii,mod->GetIndex()); | |
546 | continue; | |
547 | } // end if !depEnergy | |
548 | ||
549 | pathInSDD = TMath::Sqrt(dxL[0]*dxL[0]+dxL[1]*dxL[1]+dxL[2]*dxL[2]); | |
550 | ||
551 | if (fFlag && pathInSDD) { depEnergy *= (0.03/pathInSDD); } | |
552 | drPath = 10000.*(dxL[0]+2.*xL[0])*0.5; | |
553 | if(drPath < 0) drPath = -drPath; | |
554 | drPath = sddLength-drPath; | |
555 | if(drPath < 0) { | |
556 | Warning("HitsToAnalogDigits", | |
557 | "negative drift path drPath=%e sddLength=%e dxL[0]=%e " | |
558 | "xL[0]=%e", | |
559 | drPath,sddLength,dxL[0],xL[0]); | |
560 | continue; | |
561 | } // end if drPath < 0 | |
562 | ||
563 | // Compute number of segments to brake step path into | |
564 | drTime = drPath/driftSpeed; // Drift Time | |
565 | sigA = TMath::Sqrt(2.*dfCoeff*drTime+s1*s1);// Sigma along the anodes | |
566 | // calcuate the number of time the path length should be split into. | |
567 | nOfSplits = (Int_t) (1. + 10000.*pathInSDD/sigA); | |
568 | if(fFlag) nOfSplits = 1; | |
569 | ||
570 | // loop over path segments, init. some variables. | |
571 | depEnergy /= nOfSplits; | |
572 | nOfSplitsF = (Float_t) nOfSplits; | |
573 | for(kk=0;kk<nOfSplits;kk++) { // loop over path segments | |
574 | kkF = (Float_t) kk + 0.5; | |
575 | avDrft = xL[0]+dxL[0]*kkF/nOfSplitsF; | |
576 | avAnode = xL[2]+dxL[2]*kkF/nOfSplitsF; | |
577 | driftPath = 10000.*avDrft; | |
578 | ||
579 | iWing = 2; // Assume wing is 2 | |
580 | if(driftPath < 0) { // if wing is not 2 it is 1. | |
581 | iWing = 1; | |
582 | driftPath = -driftPath; | |
583 | } // end if driftPath < 0 | |
584 | driftPath = sddLength-driftPath; | |
585 | detector = 2*(hitDetector-1) + iWing; | |
586 | if(driftPath < 0) { | |
587 | Warning("HitsToAnalogDigits","negative drift path " | |
588 | "driftPath=%e sddLength=%e avDrft=%e dxL[0]=%e " | |
589 | "xL[0]=%e",driftPath,sddLength,avDrft,dxL[0],xL[0]); | |
590 | continue; | |
591 | } // end if driftPath < 0 | |
592 | ||
593 | // Drift Time | |
594 | drTime = driftPath/driftSpeed; // drift time for segment. | |
595 | timeSample = (Int_t) (fScaleSize*drTime/timeStep + 1); | |
596 | // compute time Sample including tof information. The tof only | |
597 | // effects the time of the signal is recoreded and not the | |
598 | // the defusion. | |
599 | // timeSample = (Int_t) (fScaleSize*(drTime+tof)/timeStep + 1); | |
600 | if(timeSample > fScaleSize*fMaxNofSamples) { | |
601 | Warning("HitsToAnalogDigits","Wrong Time Sample: %e", | |
602 | timeSample); | |
603 | continue; | |
604 | } // end if timeSample > fScaleSize*fMaxNoofSamples | |
605 | ||
606 | // Anode | |
607 | xAnode = 10000.*(avAnode)/anodePitch + nofAnodes/2; // +1? | |
608 | if(xAnode*anodePitch > sddWidth || xAnode*anodePitch < 0.) | |
609 | Warning("HitsToAnalogDigits", | |
610 | "Exceedubg sddWidth=%e Z = %e", | |
611 | sddWidth,xAnode*anodePitch); | |
612 | iAnode = (Int_t) (1.+xAnode); // xAnode? | |
613 | if(iAnode < 1 || iAnode > nofAnodes) { | |
614 | Warning("HitToAnalogDigits","Wrong iAnode: 1<%d>%d", | |
615 | iAnode,nofAnodes); | |
616 | continue; | |
617 | } // end if iAnode < 1 || iAnode > nofAnodes | |
618 | ||
619 | // store straight away the particle position in the array | |
620 | // of particles and take idhit=ii only when part is entering (this | |
621 | // requires FillModules() in the macro for analysis) : | |
b0f5e3fc | 622 | |
50d05d7b | 623 | // Sigma along the anodes for track segment. |
624 | sigA = TMath::Sqrt(2.*dfCoeff*drTime+s1*s1); | |
625 | sigT = sigA/driftSpeed; | |
626 | // Peak amplitude in nanoAmpere | |
627 | amplitude = fScaleSize*160.*depEnergy/ | |
628 | (timeStep*eVpairs*2.*acos(-1.)*sigT*sigA); | |
629 | amplitude *= timeStep/25.; // WARNING!!!!! Amplitude scaling to | |
630 | // account for clock variations | |
8a33ae9e | 631 | // (reference value: 40 MHz) |
50d05d7b | 632 | chargeloss = 1.-cHloss*driftPath/1000; |
633 | amplitude *= chargeloss; | |
634 | width = 2.*nsigma/(nlookups-1); | |
635 | // Spread the charge | |
636 | // Pixel index | |
637 | ndiv = 2; | |
638 | nmul = 3.; | |
639 | if(drTime > 1200.) { | |
640 | ndiv = 4; | |
641 | nmul = 1.5; | |
642 | } // end if drTime > 1200. | |
643 | // Sub-pixel index | |
644 | nsplit = 4; // hard-wired //nsplit=4;nsplit = (nsplit+1)/2*2; | |
645 | // Sub-pixel size see computation of aExpo and tExpo. | |
646 | aStep = anodePitch/(nsplit*fScaleSize*sigA); | |
647 | aConst = xAnode*anodePitch/sigA; | |
648 | tStep = timeStep/(nsplit*fScaleSize*sigT); | |
649 | tConst = drTime/sigT; | |
650 | // Define SDD window corresponding to the hit | |
651 | anodeWindow = (Int_t)(fScaleSize*nsigma*sigA/anodePitch+1); | |
652 | timeWindow = (Int_t) (fScaleSize*nsigma*sigT/timeStep+1.); | |
653 | jamin = (iAnode - anodeWindow/ndiv - 1)*fScaleSize*nsplit +1; | |
654 | jamax = (iAnode + anodeWindow/ndiv)*fScaleSize*nsplit; | |
655 | if(jamin <= 0) jamin = 1; | |
656 | if(jamax > fScaleSize*nofAnodes*nsplit) | |
657 | jamax = fScaleSize*nofAnodes*nsplit; | |
658 | // jtmin and jtmax are Hard-wired | |
659 | jtmin = (Int_t)(timeSample-timeWindow*nmul-1)*nsplit+1; | |
660 | jtmax = (Int_t)(timeSample+timeWindow*nmul)*nsplit; | |
661 | if(jtmin <= 0) jtmin = 1; | |
662 | if(jtmax > fScaleSize*fMaxNofSamples*nsplit) | |
663 | jtmax = fScaleSize*fMaxNofSamples*nsplit; | |
664 | // Spread the charge in the anode-time window | |
665 | for(ka=jamin; ka <=jamax; ka++) { | |
666 | ia = (ka-1)/(fScaleSize*nsplit) + 1; | |
667 | if(ia <= 0) { | |
668 | Warning("HitsToAnalogDigits","ia < 1: "); | |
669 | continue; | |
670 | } // end if | |
671 | if(ia > nofAnodes) ia = nofAnodes; | |
672 | aExpo = (aStep*(ka-0.5)-aConst); | |
673 | if(TMath::Abs(aExpo) > nsigma) anodeAmplitude = 0.; | |
674 | else { | |
675 | dummy = (Int_t) ((aExpo+nsigma)/width); | |
676 | anodeAmplitude = amplitude*fResponse->GausLookUp(dummy); | |
677 | } // end if TMath::Abs(aEspo) > nsigma | |
678 | // index starts from 0 | |
679 | index = ((detector+1)%2)*nofAnodes+ia-1; | |
680 | if(anodeAmplitude) for(kt=jtmin; kt<=jtmax; kt++) { | |
681 | it = (kt-1)/nsplit+1; // it starts from 1 | |
682 | if(it<=0){ | |
683 | Warning("HitsToAnalogDigits","it < 1:"); | |
684 | continue; | |
685 | } // end if | |
686 | if(it>fScaleSize*fMaxNofSamples) | |
687 | it = fScaleSize*fMaxNofSamples; | |
688 | tExpo = (tStep*(kt-0.5)-tConst); | |
689 | if(TMath::Abs(tExpo) > nsigma) timeAmplitude = 0.; | |
690 | else { | |
691 | dummy = (Int_t) ((tExpo+nsigma)/width); | |
692 | timeAmplitude = anodeAmplitude* | |
693 | fResponse->GausLookUp(dummy); | |
694 | } // end if TMath::Abs(tExpo) > nsigma | |
695 | // build the list of Sdigits for this module | |
696 | // arg[0] = index; | |
697 | // arg[1] = it; | |
698 | // arg[2] = itrack; // track number | |
699 | // arg[3] = ii-1; // hit number. | |
700 | timeAmplitude *= norm; | |
701 | timeAmplitude *= 10; | |
702 | // ListOfFiredCells(arg,timeAmplitude,alst,padr); | |
48058160 | 703 | Double_t charge = timeAmplitude; |
704 | charge += fHitMap2->GetSignal(index,it-1); | |
705 | fHitMap2->SetHit(index, it-1, charge); | |
50d05d7b | 706 | fpList->AddSignal(index,it-1,itrack,ii-1, |
707 | mod->GetIndex(),timeAmplitude); | |
43217ad9 | 708 | fAnodeFire[index] = kTRUE; |
50d05d7b | 709 | } // end if anodeAmplitude and loop over time in window |
710 | } // loop over anodes in window | |
711 | } // end loop over "sub-hits" | |
44a312c3 | 712 | } // end loop over hits |
b0f5e3fc | 713 | } |
50d05d7b | 714 | |
715 | /* | |
8a33ae9e | 716 | //______________________________________________________________________ |
b0f5e3fc | 717 | void AliITSsimulationSDD::ListOfFiredCells(Int_t *arg,Double_t timeAmplitude, |
8a33ae9e | 718 | TObjArray *alist,TClonesArray *padr){ |
719 | // Returns the list of "fired" cells. | |
720 | ||
721 | Int_t index = arg[0]; | |
722 | Int_t ik = arg[1]; | |
723 | Int_t idtrack = arg[2]; | |
724 | Int_t idhit = arg[3]; | |
725 | Int_t counter = arg[4]; | |
726 | Int_t countadr = arg[5]; | |
727 | Double_t charge = timeAmplitude; | |
728 | charge += fHitMap2->GetSignal(index,ik-1); | |
729 | fHitMap2->SetHit(index, ik-1, charge); | |
730 | ||
731 | Int_t digits[3]; | |
732 | Int_t it = (Int_t)((ik-1)/fScaleSize); | |
733 | digits[0] = index; | |
734 | digits[1] = it; | |
735 | digits[2] = (Int_t)timeAmplitude; | |
736 | Float_t phys; | |
737 | if (idtrack >= 0) phys = (Float_t)timeAmplitude; | |
738 | else phys = 0; | |
739 | ||
740 | Double_t cellcharge = 0.; | |
741 | AliITSTransientDigit* pdigit; | |
742 | // build the list of fired cells and update the info | |
743 | if (!fHitMap1->TestHit(index, it)) { | |
50d05d7b | 744 | new((*padr)[countadr++]) TVector(3); |
745 | TVector &trinfo=*((TVector*) (*padr)[countadr-1]); | |
746 | trinfo(0) = (Float_t)idtrack; | |
747 | trinfo(1) = (Float_t)idhit; | |
748 | trinfo(2) = (Float_t)timeAmplitude; | |
749 | ||
750 | alist->AddAtAndExpand(new AliITSTransientDigit(phys,digits),counter); | |
751 | fHitMap1->SetHit(index, it, counter); | |
752 | counter++; | |
753 | pdigit=(AliITSTransientDigit*)alist->At(alist->GetLast()); | |
754 | // list of tracks | |
755 | TObjArray *trlist=(TObjArray*)pdigit->TrackList(); | |
756 | trlist->Add(&trinfo); | |
8a33ae9e | 757 | } else { |
50d05d7b | 758 | pdigit = (AliITSTransientDigit*) fHitMap1->GetHit(index, it); |
759 | for(Int_t kk=0;kk<fScaleSize;kk++) { | |
760 | cellcharge += fHitMap2->GetSignal(index,fScaleSize*it+kk); | |
761 | } // end for kk | |
762 | // update charge | |
763 | (*pdigit).fSignal = (Int_t)cellcharge; | |
764 | (*pdigit).fPhysics += phys; | |
765 | // update list of tracks | |
766 | TObjArray* trlist = (TObjArray*)pdigit->TrackList(); | |
767 | Int_t lastentry = trlist->GetLast(); | |
768 | TVector *ptrkp = (TVector*)trlist->At(lastentry); | |
769 | TVector &trinfo = *ptrkp; | |
770 | Int_t lasttrack = Int_t(trinfo(0)); | |
771 | Float_t lastcharge=(trinfo(2)); | |
772 | if (lasttrack==idtrack ) { | |
773 | lastcharge += (Float_t)timeAmplitude; | |
774 | trlist->RemoveAt(lastentry); | |
775 | trinfo(0) = lasttrack; | |
776 | trinfo(1) = idhit; | |
777 | trinfo(2) = lastcharge; | |
778 | trlist->AddAt(&trinfo,lastentry); | |
779 | } else { | |
780 | new((*padr)[countadr++]) TVector(3); | |
781 | TVector &trinfo=*((TVector*) (*padr)[countadr-1]); | |
782 | trinfo(0) = (Float_t)idtrack; | |
783 | trinfo(1) = (Float_t)idhit; | |
784 | trinfo(2) = (Float_t)timeAmplitude; | |
785 | trlist->Add(&trinfo); | |
786 | } // end if lasttrack==idtrack | |
b0f5e3fc | 787 | |
788 | #ifdef print | |
50d05d7b | 789 | // check the track list - debugging |
790 | Int_t trk[20], htrk[20]; | |
791 | Float_t chtrk[20]; | |
792 | Int_t nptracks = trlist->GetEntriesFast(); | |
793 | if (nptracks > 2) { | |
794 | Int_t tr; | |
795 | for (tr=0;tr<nptracks;tr++) { | |
796 | TVector *pptrkp = (TVector*)trlist->At(tr); | |
797 | TVector &pptrk = *pptrkp; | |
798 | trk[tr] = Int_t(pptrk(0)); | |
799 | htrk[tr] = Int_t(pptrk(1)); | |
800 | chtrk[tr] = (pptrk(2)); | |
801 | cout << "nptracks "<<nptracks << endl; | |
802 | } // end for tr | |
803 | } // end if nptracks | |
b0f5e3fc | 804 | #endif |
8a33ae9e | 805 | } // end if pdigit |
b0f5e3fc | 806 | |
8a33ae9e | 807 | // update counter and countadr for next call. |
808 | arg[4] = counter; | |
809 | arg[5] = countadr; | |
b0f5e3fc | 810 | } |
50d05d7b | 811 | */ |
812 | ||
b0f5e3fc | 813 | //____________________________________________ |
50d05d7b | 814 | void AliITSsimulationSDD::AddDigit( Int_t i, Int_t j, Int_t signal ) { |
815 | // Adds a Digit. | |
ee86d557 | 816 | Int_t size = AliITSdigitSPD::GetNTracks(); |
5c5273c2 | 817 | Int_t digits[3]; |
818 | Int_t * tracks = new Int_t[size]; | |
819 | Int_t * hits = new Int_t[size]; | |
820 | Float_t phys; | |
821 | Float_t * charges = new Float_t[size]; | |
50d05d7b | 822 | |
823 | if( fResponse->Do10to8() ) signal = Convert8to10( signal ); | |
824 | digits[0] = i; | |
825 | digits[1] = j; | |
826 | digits[2] = signal; | |
827 | ||
48058160 | 828 | AliITSpListItem *pItem = fpList->GetpListItem( i, j ); |
829 | if( pItem == 0 ) { | |
830 | phys = 0.0; | |
ee86d557 | 831 | for( Int_t l=0; l<size; l++ ) { |
48058160 | 832 | tracks[l] = 0; |
833 | hits[l] = 0; | |
834 | charges[l] = 0.0; | |
835 | } | |
836 | } else { | |
837 | Int_t idtrack = pItem->GetTrack( 0 ); | |
838 | if( idtrack >= 0 ) phys = pItem->GetSignal(); | |
839 | else phys = 0.0; | |
840 | ||
ee86d557 | 841 | for( Int_t l=0; l<size; l++ ) if(l<pItem->GetMaxKept()) { |
48058160 | 842 | tracks[l] = pItem->GetTrack( l ); |
843 | hits[l] = pItem->GetHit( l ); | |
844 | charges[l] = pItem->GetSignal( l ); | |
ee86d557 | 845 | }else{ |
846 | tracks[l] = -3; | |
847 | hits[l] = -1; | |
848 | charges[l] = 0.0; | |
849 | }// end for if | |
50d05d7b | 850 | } |
b0f5e3fc | 851 | |
50d05d7b | 852 | fITS->AddSimDigit( 1, phys, digits, tracks, hits, charges ); |
5c5273c2 | 853 | delete [] tracks; |
854 | delete [] hits; | |
855 | delete [] charges; | |
50d05d7b | 856 | } |
857 | ||
858 | /* | |
859 | //____________________________________________ | |
b0f5e3fc | 860 | void AliITSsimulationSDD::AddDigit(Int_t i, Int_t j, Int_t signal){ |
8a33ae9e | 861 | // Adds a Digit. |
b0f5e3fc | 862 | // tag with -1 signals coming from background tracks |
863 | // tag with -2 signals coming from pure electronic noise | |
864 | ||
e8189707 | 865 | Int_t digits[3], tracks[3], hits[3]; |
b0f5e3fc | 866 | Float_t phys, charges[3]; |
867 | ||
e8189707 | 868 | Int_t trk[20], htrk[20]; |
b0f5e3fc | 869 | Float_t chtrk[20]; |
870 | ||
ece86d9a | 871 | Bool_t do10to8=fResponse->Do10to8(); |
872 | ||
873 | if(do10to8) signal=Convert8to10(signal); | |
b0f5e3fc | 874 | AliITSTransientDigit *obj = (AliITSTransientDigit*)fHitMap1->GetHit(i,j); |
8a33ae9e | 875 | digits[0] = i; |
876 | digits[1] = j; | |
877 | digits[2] = signal; | |
b0f5e3fc | 878 | if (!obj) { |
879 | phys=0; | |
880 | Int_t k; | |
e8189707 | 881 | for (k=0;k<3;k++) { |
50d05d7b | 882 | tracks[k]=-2; |
883 | charges[k]=0; | |
884 | hits[k]=-1; | |
885 | } // end for k | |
e8189707 | 886 | fITS->AddSimDigit(1,phys,digits,tracks,hits,charges); |
b0f5e3fc | 887 | } else { |
50d05d7b | 888 | phys=obj->fPhysics; |
889 | TObjArray* trlist=(TObjArray*)obj->TrackList(); | |
890 | Int_t nptracks=trlist->GetEntriesFast(); | |
891 | if (nptracks > 20) { | |
892 | Warning("AddDigit","nptracks=%d > 20 nptracks set to 20",nptracks); | |
893 | nptracks=20; | |
894 | } // end if nptracks > 20 | |
895 | Int_t tr; | |
896 | for (tr=0;tr<nptracks;tr++) { | |
897 | TVector &pp =*((TVector*)trlist->At(tr)); | |
898 | trk[tr]=Int_t(pp(0)); | |
899 | htrk[tr]=Int_t(pp(1)); | |
900 | chtrk[tr]=(pp(2)); | |
901 | } // end for tr | |
902 | if (nptracks > 1) { | |
903 | SortTracks(trk,chtrk,htrk,nptracks); | |
904 | } // end if nptracks > 1 | |
905 | Int_t i; | |
906 | if (nptracks < 3 ) { | |
907 | for (i=0; i<nptracks; i++) { | |
908 | tracks[i]=trk[i]; | |
909 | charges[i]=chtrk[i]; | |
910 | hits[i]=htrk[i]; | |
911 | } // end for i | |
912 | for (i=nptracks; i<3; i++) { | |
913 | tracks[i]=-3; | |
914 | hits[i]=-1; | |
915 | charges[i]=0; | |
916 | } // end for i | |
917 | } else { | |
918 | for (i=0; i<3; i++) { | |
919 | tracks[i]=trk[i]; | |
920 | charges[i]=chtrk[i]; | |
921 | hits[i]=htrk[i]; | |
922 | } // end for i | |
923 | } // end if/else nptracks < 3 | |
924 | ||
925 | fITS->AddSimDigit(1,phys,digits,tracks,hits,charges); | |
b0f5e3fc | 926 | |
8a33ae9e | 927 | } // end if/else !obj |
b0f5e3fc | 928 | } |
50d05d7b | 929 | |
930 | ||
8a33ae9e | 931 | //______________________________________________________________________ |
932 | void AliITSsimulationSDD::SortTracks(Int_t *tracks,Float_t *charges, | |
50d05d7b | 933 | Int_t *hits,Int_t ntr){ |
8a33ae9e | 934 | // Sort the list of tracks contributing to a given digit |
935 | // Only the 3 most significant tracks are acctually sorted | |
936 | // Loop over signals, only 3 times | |
937 | ||
938 | Float_t qmax; | |
939 | Int_t jmax; | |
940 | Int_t idx[3] = {-3,-3,-3}; | |
941 | Float_t jch[3] = {-3,-3,-3}; | |
942 | Int_t jtr[3] = {-3,-3,-3}; | |
943 | Int_t jhit[3] = {-3,-3,-3}; | |
944 | Int_t i,j,imax; | |
945 | ||
946 | if (ntr<3) imax = ntr; | |
947 | else imax = 3; | |
948 | for(i=0;i<imax;i++){ | |
50d05d7b | 949 | qmax = 0; |
950 | jmax = 0; | |
951 | for(j=0;j<ntr;j++){ | |
952 | if((i == 1 && j == idx[i-1] ) | |
953 | ||(i == 2 && (j == idx[i-1] || j == idx[i-2]))) continue; | |
954 | if(charges[j] > qmax) { | |
955 | qmax = charges[j]; | |
956 | jmax=j; | |
957 | } // end if charges[j]>qmax | |
958 | } // end for j | |
959 | if(qmax > 0) { | |
960 | idx[i] = jmax; | |
961 | jch[i] = charges[jmax]; | |
962 | jtr[i] = tracks[jmax]; | |
963 | jhit[i] = hits[jmax]; | |
964 | } // end if qmax > 0 | |
8a33ae9e | 965 | } // end for i |
966 | ||
967 | for(i=0;i<3;i++){ | |
50d05d7b | 968 | if (jtr[i] == -3) { |
969 | charges[i] = 0; | |
970 | tracks[i] = -3; | |
971 | hits[i] = -1; | |
972 | } else { | |
973 | charges[i] = jch[i]; | |
974 | tracks[i] = jtr[i]; | |
975 | hits[i] = jhit[i]; | |
976 | } // end if jtr[i] == -3 | |
8a33ae9e | 977 | } // end for i |
b0f5e3fc | 978 | } |
50d05d7b | 979 | */ |
8a33ae9e | 980 | //______________________________________________________________________ |
48058160 | 981 | void AliITSsimulationSDD::ChargeToSignal(Bool_t bAddNoise) { |
8a33ae9e | 982 | // add baseline, noise, electronics and ADC saturation effects |
b0f5e3fc | 983 | |
8a33ae9e | 984 | char opt1[20], opt2[20]; |
985 | fResponse->ParamOptions(opt1,opt2); | |
986 | char *read = strstr(opt1,"file"); | |
987 | Float_t baseline, noise; | |
988 | ||
989 | if (read) { | |
50d05d7b | 990 | static Bool_t readfile=kTRUE; |
991 | //read baseline and noise from file | |
992 | if (readfile) ReadBaseline(); | |
993 | readfile=kFALSE; | |
8a33ae9e | 994 | } else fResponse->GetNoiseParam(noise,baseline); |
995 | ||
996 | Float_t contrib=0; | |
997 | Int_t i,k,kk; | |
998 | Float_t maxadc = fResponse->MaxAdc(); | |
999 | if(!fDoFFT) { | |
50d05d7b | 1000 | for (i=0;i<fNofMaps;i++) { |
43217ad9 | 1001 | if( !fAnodeFire[i] ) continue; |
50d05d7b | 1002 | if (read && i<fNofMaps) GetAnodeBaseline(i,baseline,noise); |
1003 | for(k=0; k<fScaleSize*fMaxNofSamples; k++) { | |
1004 | fInZR[k] = fHitMap2->GetSignal(i,k); | |
48058160 | 1005 | if( bAddNoise ) { |
1006 | contrib = (baseline + noise*gRandom->Gaus()); | |
1007 | fInZR[k] += contrib; | |
1008 | } | |
50d05d7b | 1009 | } // end for k |
1010 | for(k=0; k<fMaxNofSamples; k++) { | |
1011 | Double_t newcont = 0.; | |
1012 | Double_t maxcont = 0.; | |
1013 | for(kk=0;kk<fScaleSize;kk++) { | |
1014 | newcont = fInZR[fScaleSize*k+kk]; | |
1015 | if(newcont > maxcont) maxcont = newcont; | |
1016 | } // end for kk | |
1017 | newcont = maxcont; | |
1018 | if (newcont >= maxadc) newcont = maxadc -1; | |
1019 | if(newcont >= baseline){ | |
1020 | Warning("","newcont=%d>=baseline=%d",newcont,baseline); | |
1021 | } // end if | |
1022 | // back to analog: ? | |
1023 | fHitMap2->SetHit(i,k,newcont); | |
1024 | } // end for k | |
1025 | } // end for i loop over anodes | |
1026 | return; | |
8a33ae9e | 1027 | } // end if DoFFT |
ece86d9a | 1028 | |
ece86d9a | 1029 | for (i=0;i<fNofMaps;i++) { |
43217ad9 | 1030 | if( !fAnodeFire[i] ) continue; |
50d05d7b | 1031 | if (read && i<fNofMaps) GetAnodeBaseline(i,baseline,noise); |
1032 | for(k=0; k<fScaleSize*fMaxNofSamples; k++) { | |
1033 | fInZR[k] = fHitMap2->GetSignal(i,k); | |
48058160 | 1034 | if( bAddNoise ) { |
1035 | contrib = (baseline + noise*gRandom->Gaus()); | |
1036 | fInZR[k] += contrib; | |
1037 | } | |
50d05d7b | 1038 | fInZI[k] = 0.; |
1039 | } // end for k | |
1040 | FastFourierTransform(fElectronics,&fInZR[0],&fInZI[0],1); | |
1041 | for(k=0; k<fScaleSize*fMaxNofSamples; k++) { | |
1042 | Double_t rw = fElectronics->GetTraFunReal(k); | |
1043 | Double_t iw = fElectronics->GetTraFunImag(k); | |
1044 | fOutZR[k] = fInZR[k]*rw - fInZI[k]*iw; | |
1045 | fOutZI[k] = fInZR[k]*iw + fInZI[k]*rw; | |
1046 | } // end for k | |
1047 | FastFourierTransform(fElectronics,&fOutZR[0],&fOutZI[0],-1); | |
1048 | for(k=0; k<fMaxNofSamples; k++) { | |
1049 | Double_t newcont1 = 0.; | |
1050 | Double_t maxcont1 = 0.; | |
1051 | for(kk=0;kk<fScaleSize;kk++) { | |
1052 | newcont1 = fOutZR[fScaleSize*k+kk]; | |
1053 | if(newcont1 > maxcont1) maxcont1 = newcont1; | |
1054 | } // end for kk | |
1055 | newcont1 = maxcont1; | |
1056 | if (newcont1 >= maxadc) newcont1 = maxadc -1; | |
1057 | fHitMap2->SetHit(i,k,newcont1); | |
1058 | } // end for k | |
8a33ae9e | 1059 | } // end for i loop over anodes |
ece86d9a | 1060 | return; |
b0f5e3fc | 1061 | } |
50d05d7b | 1062 | //____________________________________________________________________ |
1063 | void AliITSsimulationSDD::ApplyDeadChannels() { | |
1064 | // Set dead channel signal to zero | |
1065 | AliITSresponseSDD * response = (AliITSresponseSDD *)fResponse; | |
1066 | ||
1067 | // nothing to do | |
1068 | if( response->GetDeadModules() == 0 && | |
1069 | response->GetDeadChips() == 0 && | |
1070 | response->GetDeadChannels() == 0 ) | |
1071 | return; | |
1072 | ||
1073 | static AliITS *iTS = (AliITS*)gAlice->GetModule( "ITS" ); | |
1074 | ||
1075 | Int_t fMaxNofSamples = fSegmentation->Npx(); | |
1076 | AliITSgeom *geom = iTS->GetITSgeom(); | |
1077 | Int_t firstSDDMod = geom->GetStartDet( 1 ); | |
1078 | // loop over wings | |
1079 | for( Int_t j=0; j<2; j++ ) { | |
1080 | Int_t mod = (fModule-firstSDDMod)*2 + j; | |
1081 | for( Int_t u=0; u<response->Chips(); u++ ) | |
1082 | for( Int_t v=0; v<response->Channels(); v++ ) { | |
1083 | Float_t Gain = response->Gain( mod, u, v ); | |
1084 | for( Int_t k=0; k<fMaxNofSamples; k++ ) { | |
1085 | Int_t i = j*response->Chips()*response->Channels() + | |
1086 | u*response->Channels() + | |
1087 | v; | |
1088 | Double_t signal = Gain * fHitMap2->GetSignal( i, k ); | |
1089 | fHitMap2->SetHit( i, k, signal ); /// | |
1090 | } | |
1091 | } | |
1092 | } | |
1093 | } | |
1094 | //______________________________________________________________________ | |
1095 | void AliITSsimulationSDD::ApplyCrosstalk() { | |
1096 | // function add the crosstalk effect to signal | |
1097 | // temporal function, should be checked...!!! | |
1098 | ||
1099 | Int_t fNofMaps = fSegmentation->Npz(); | |
1100 | Int_t fMaxNofSamples = fSegmentation->Npx(); | |
1101 | ||
1102 | // create and inizialice crosstalk map | |
1103 | Float_t* ctk = new Float_t[fNofMaps*fMaxNofSamples+1]; | |
1104 | if( ctk == NULL ) { | |
1105 | Error( "ApplyCrosstalk", "no memory for temporal map: exit \n" ); | |
1106 | return; | |
1107 | } | |
1108 | memset( ctk, 0, sizeof(Float_t)*(fNofMaps*fMaxNofSamples+1) ); | |
1109 | ||
1110 | Float_t noise, baseline; | |
1111 | fResponse->GetNoiseParam( noise, baseline ); | |
1112 | ||
1113 | for( Int_t z=0; z<fNofMaps; z++ ) { | |
1114 | Bool_t on = kFALSE; | |
1115 | Int_t tstart = 0; | |
1116 | Int_t tstop = 0; | |
1117 | Int_t nTsteps = 0; | |
1118 | ||
1119 | for( Int_t l=0; l<fMaxNofSamples; l++ ) { | |
1120 | Float_t fadc = (Float_t)fHitMap2->GetSignal( z, l ); | |
1121 | if( fadc > baseline ) { | |
1122 | if( on == kFALSE && l<fMaxNofSamples-4 ) { | |
1123 | Float_t fadc1 = (Float_t)fHitMap2->GetSignal( z, l+1 ); | |
1124 | if( fadc1 < fadc ) continue; | |
1125 | on = kTRUE; | |
1126 | nTsteps = 0; | |
1127 | tstart = l; | |
1128 | } | |
1129 | nTsteps++; | |
1130 | } | |
1131 | else { // end fadc > baseline | |
1132 | if( on == kTRUE ) { | |
1133 | if( nTsteps > 2 ) { | |
1134 | tstop = l; | |
1135 | // make smooth derivative | |
1136 | Float_t* dev = new Float_t[fMaxNofSamples+1]; | |
1137 | memset( dev, 0, sizeof(Float_t)*(fMaxNofSamples+1) ); | |
1138 | if( ctk == NULL ) { | |
1139 | Error( "ApplyCrosstalk", | |
1140 | "no memory for temporal array: exit \n" ); | |
1141 | return; | |
1142 | } | |
1143 | for( Int_t i=tstart; i<tstop; i++ ) { | |
1144 | if( i > 2 && i < fMaxNofSamples-2 ) | |
1145 | dev[i] = -0.2*fHitMap2->GetSignal( z,i-2 ) | |
1146 | -0.1*fHitMap2->GetSignal( z,i-1 ) | |
1147 | +0.1*fHitMap2->GetSignal( z,i+1 ) | |
1148 | +0.2*fHitMap2->GetSignal( z,i+2 ); | |
1149 | } | |
1150 | ||
1151 | // add crosstalk contribution to neibourg anodes | |
1152 | for( Int_t i=tstart; i<tstop; i++ ) { | |
1153 | Int_t anode = z - 1; | |
1154 | Int_t i1 = (Int_t)((i-tstart)*.61+tstart+0.5); // | |
1155 | Float_t ctktmp = -dev[i1] * 0.25; | |
1156 | if( anode > 0 ) { | |
1157 | ctk[anode*fMaxNofSamples+i] += ctktmp; | |
1158 | } | |
1159 | anode = z + 1; | |
1160 | if( anode < fNofMaps ) { | |
1161 | ctk[anode*fMaxNofSamples+i] += ctktmp; | |
1162 | } | |
1163 | } | |
1164 | delete [] dev; | |
1165 | ||
1166 | } // if( nTsteps > 2 ) | |
1167 | on = kFALSE; | |
1168 | } // if( on == kTRUE ) | |
1169 | } // else | |
1170 | } | |
1171 | } | |
1172 | ||
1173 | for( Int_t a=0; a<fNofMaps; a++ ) | |
1174 | for( Int_t t=0; t<fMaxNofSamples; t++ ) { | |
1175 | Float_t signal = fHitMap2->GetSignal( a, t ) + ctk[a*fMaxNofSamples+t]; | |
1176 | fHitMap2->SetHit( a, t, signal ); | |
1177 | } | |
1178 | ||
1179 | delete [] ctk; | |
1180 | } | |
8a33ae9e | 1181 | //______________________________________________________________________ |
b0f5e3fc | 1182 | void AliITSsimulationSDD::GetAnodeBaseline(Int_t i,Float_t &baseline, |
1183 | Float_t &noise){ | |
8a33ae9e | 1184 | // Returns the Baseline for a particular anode. |
1185 | baseline = fBaseline[i]; | |
1186 | noise = fNoise[i]; | |
b0f5e3fc | 1187 | } |
8a33ae9e | 1188 | //______________________________________________________________________ |
b0f5e3fc | 1189 | void AliITSsimulationSDD::CompressionParam(Int_t i,Int_t &db,Int_t &tl, |
1190 | Int_t &th){ | |
8a33ae9e | 1191 | // Returns the compression alogirthm parameters |
1192 | Int_t size = fD.GetSize(); | |
1193 | if (size > 2 ) { | |
50d05d7b | 1194 | db=fD[i]; tl=fT1[i]; th=fT2[i]; |
8a33ae9e | 1195 | } else { |
50d05d7b | 1196 | if (size <= 2 && i>=fNofMaps/2) { |
1197 | db=fD[1]; tl=fT1[1]; th=fT2[1]; | |
1198 | } else { | |
1199 | db=fD[0]; tl=fT1[0]; th=fT2[0]; | |
1200 | } // end if size <=2 && i>=fNofMaps/2 | |
8a33ae9e | 1201 | } // end if size >2 |
b0f5e3fc | 1202 | } |
8a33ae9e | 1203 | //______________________________________________________________________ |
b0f5e3fc | 1204 | void AliITSsimulationSDD::CompressionParam(Int_t i,Int_t &db,Int_t &tl){ |
8a33ae9e | 1205 | // returns the compression alogirthm parameters |
1206 | Int_t size = fD.GetSize(); | |
b0f5e3fc | 1207 | |
8a33ae9e | 1208 | if (size > 2 ) { |
50d05d7b | 1209 | db=fD[i]; tl=fT1[i]; |
8a33ae9e | 1210 | } else { |
50d05d7b | 1211 | if (size <= 2 && i>=fNofMaps/2) { |
1212 | db=fD[1]; tl=fT1[1]; | |
1213 | } else { | |
1214 | db=fD[0]; tl=fT1[0]; | |
1215 | } // end if size <=2 && i>=fNofMaps/2 | |
8a33ae9e | 1216 | } // end if size > 2 |
b0f5e3fc | 1217 | } |
8a33ae9e | 1218 | //______________________________________________________________________ |
b0f5e3fc | 1219 | void AliITSsimulationSDD::SetCompressParam(){ |
8a33ae9e | 1220 | // Sets the compression alogirthm parameters |
1221 | Int_t cp[8],i; | |
1222 | ||
1223 | fResponse->GiveCompressParam(cp); | |
1224 | for (i=0; i<2; i++) { | |
50d05d7b | 1225 | fD[i] = cp[i]; |
1226 | fT1[i] = cp[i+2]; | |
1227 | fT2[i] = cp[i+4]; | |
1228 | fTol[i] = cp[i+6]; | |
8a33ae9e | 1229 | } // end for i |
b0f5e3fc | 1230 | } |
8a33ae9e | 1231 | //______________________________________________________________________ |
b0f5e3fc | 1232 | void AliITSsimulationSDD::ReadBaseline(){ |
8a33ae9e | 1233 | // read baseline and noise from file - either a .root file and in this |
1234 | // case data should be organised in a tree with one entry for each | |
1235 | // module => reading should be done accordingly | |
1236 | // or a classic file and do smth. like this: | |
1237 | // Read baselines and noise for SDD | |
b0f5e3fc | 1238 | |
1239 | Int_t na,pos; | |
1240 | Float_t bl,n; | |
e8189707 | 1241 | char input[100], base[100], param[100]; |
b0f5e3fc | 1242 | char *filtmp; |
1243 | ||
e8189707 | 1244 | fResponse->Filenames(input,base,param); |
b0f5e3fc | 1245 | fFileName=base; |
1246 | // | |
1247 | filtmp = gSystem->ExpandPathName(fFileName.Data()); | |
1248 | FILE *bline = fopen(filtmp,"r"); | |
b0f5e3fc | 1249 | na = 0; |
1250 | ||
1251 | if(bline) { | |
50d05d7b | 1252 | while(fscanf(bline,"%d %f %f",&pos, &bl, &n) != EOF) { |
1253 | if (pos != na+1) { | |
1254 | Error("ReadBaseline","Anode number not in increasing order!", | |
1255 | filtmp); | |
1256 | exit(1); | |
1257 | } // end if pos != na+1 | |
1258 | fBaseline[na]=bl; | |
1259 | fNoise[na]=n; | |
1260 | na++; | |
1261 | } // end while | |
b0f5e3fc | 1262 | } else { |
50d05d7b | 1263 | Error("ReadBaseline"," THE BASELINE FILE %s DOES NOT EXIST !",filtmp); |
1264 | exit(1); | |
b0f5e3fc | 1265 | } // end if(bline) |
8a33ae9e | 1266 | |
b0f5e3fc | 1267 | fclose(bline); |
1268 | delete [] filtmp; | |
b0f5e3fc | 1269 | } |
8a33ae9e | 1270 | //______________________________________________________________________ |
1271 | Int_t AliITSsimulationSDD::Convert10to8(Int_t signal) const { | |
1272 | // To the 10 to 8 bit lossive compression. | |
1273 | // code from Davide C. and Albert W. | |
1274 | ||
1275 | if (signal < 128) return signal; | |
1276 | if (signal < 256) return (128+((signal-128)>>1)); | |
1277 | if (signal < 512) return (192+((signal-256)>>3)); | |
1278 | if (signal < 1024) return (224+((signal-512)>>4)); | |
1279 | return 0; | |
b0f5e3fc | 1280 | } |
8a33ae9e | 1281 | //______________________________________________________________________ |
1282 | Int_t AliITSsimulationSDD::Convert8to10(Int_t signal) const { | |
1283 | // Undo the lossive 10 to 8 bit compression. | |
1284 | // code from Davide C. and Albert W. | |
1285 | if (signal < 0 || signal > 255) { | |
50d05d7b | 1286 | Warning("Convert8to10","out of range signal=%d",signal); |
1287 | return 0; | |
8a33ae9e | 1288 | } // end if signal <0 || signal >255 |
1289 | ||
1290 | if (signal < 128) return signal; | |
1291 | if (signal < 192) { | |
50d05d7b | 1292 | if (TMath::Odd(signal)) return (128+((signal-128)<<1)); |
1293 | else return (128+((signal-128)<<1)+1); | |
8a33ae9e | 1294 | } // end if signal < 192 |
1295 | if (signal < 224) { | |
50d05d7b | 1296 | if (TMath::Odd(signal)) return (256+((signal-192)<<3)+3); |
1297 | else return (256+((signal-192)<<3)+4); | |
8a33ae9e | 1298 | } // end if signal < 224 |
1299 | if (TMath::Odd(signal)) return (512+((signal-224)<<4)+7); | |
48058160 | 1300 | return (512+((signal-224)<<4)+8); |
8a33ae9e | 1301 | } |
50d05d7b | 1302 | |
1303 | /* | |
8a33ae9e | 1304 | //______________________________________________________________________ |
b0f5e3fc | 1305 | AliITSMap* AliITSsimulationSDD::HitMap(Int_t i){ |
8a33ae9e | 1306 | //Return the correct map. |
1307 | ||
b0f5e3fc | 1308 | return ((i==0)? fHitMap1 : fHitMap2); |
50d05d7b | 1309 | }*/ |
1310 | ||
8a33ae9e | 1311 | //______________________________________________________________________ |
e8189707 | 1312 | void AliITSsimulationSDD::ZeroSuppression(const char *option) { |
8a33ae9e | 1313 | // perform the zero suppresion |
1314 | ||
1315 | if (strstr(option,"2D")) { | |
50d05d7b | 1316 | //Init2D(); // activate if param change module by module |
1317 | Compress2D(); | |
8a33ae9e | 1318 | } else if (strstr(option,"1D")) { |
50d05d7b | 1319 | //Init1D(); // activate if param change module by module |
1320 | Compress1D(); | |
8a33ae9e | 1321 | } else StoreAllDigits(); |
b0f5e3fc | 1322 | } |
8a33ae9e | 1323 | //______________________________________________________________________ |
b0f5e3fc | 1324 | void AliITSsimulationSDD::Init2D(){ |
8a33ae9e | 1325 | // read in and prepare arrays: fD, fT1, fT2 |
1326 | // savemu[nanodes], savesigma[nanodes] | |
1327 | // read baseline and noise from file - either a .root file and in this | |
1328 | // case data should be organised in a tree with one entry for each | |
1329 | // module => reading should be done accordingly | |
1330 | // or a classic file and do smth. like this ( code from Davide C. and | |
1331 | // Albert W.) : | |
1332 | // Read 2D zero-suppression parameters for SDD | |
b0f5e3fc | 1333 | |
1334 | if (!strstr(fParam,"file")) return; | |
1335 | ||
1336 | Int_t na,pos,tempTh; | |
1337 | Float_t mu,sigma; | |
8a33ae9e | 1338 | Float_t *savemu = new Float_t [fNofMaps]; |
e8189707 | 1339 | Float_t *savesigma = new Float_t [fNofMaps]; |
1340 | char input[100],basel[100],par[100]; | |
b0f5e3fc | 1341 | char *filtmp; |
b0f5e3fc | 1342 | Int_t minval = fResponse->MinVal(); |
1343 | ||
e8189707 | 1344 | fResponse->Filenames(input,basel,par); |
8a33ae9e | 1345 | fFileName = par; |
b0f5e3fc | 1346 | // |
1347 | filtmp = gSystem->ExpandPathName(fFileName.Data()); | |
1348 | FILE *param = fopen(filtmp,"r"); | |
1349 | na = 0; | |
1350 | ||
1351 | if(param) { | |
50d05d7b | 1352 | while(fscanf(param,"%d %f %f",&pos, &mu, &sigma) != EOF) { |
1353 | if (pos != na+1) { | |
1354 | Error("Init2D","Anode number not in increasing order!",filtmp); | |
1355 | exit(1); | |
1356 | } // end if pos != na+1 | |
1357 | savemu[na] = mu; | |
8a33ae9e | 1358 | savesigma[na] = sigma; |
b0f5e3fc | 1359 | if ((2.*sigma) < mu) { |
1360 | fD[na] = (Int_t)floor(mu - 2.0*sigma + 0.5); | |
1361 | mu = 2.0 * sigma; | |
50d05d7b | 1362 | } else fD[na] = 0; |
b0f5e3fc | 1363 | tempTh = (Int_t)floor(mu+2.25*sigma+0.5) - minval; |
1364 | if (tempTh < 0) tempTh=0; | |
1365 | fT1[na] = tempTh; | |
1366 | tempTh = (Int_t)floor(mu+3.0*sigma+0.5) - minval; | |
1367 | if (tempTh < 0) tempTh=0; | |
1368 | fT2[na] = tempTh; | |
1369 | na++; | |
50d05d7b | 1370 | } // end while |
b0f5e3fc | 1371 | } else { |
50d05d7b | 1372 | Error("Init2D","THE FILE %s DOES NOT EXIST !",filtmp); |
1373 | exit(1); | |
b0f5e3fc | 1374 | } // end if(param) |
8a33ae9e | 1375 | |
b0f5e3fc | 1376 | fclose(param); |
1377 | delete [] filtmp; | |
5d18fa90 | 1378 | delete [] savemu; |
e8189707 | 1379 | delete [] savesigma; |
8a33ae9e | 1380 | } |
1381 | //______________________________________________________________________ | |
b0f5e3fc | 1382 | void AliITSsimulationSDD::Compress2D(){ |
8a33ae9e | 1383 | // simple ITS cluster finder -- online zero-suppression conditions |
b0f5e3fc | 1384 | |
b0f5e3fc | 1385 | Int_t db,tl,th; |
8a33ae9e | 1386 | Int_t minval = fResponse->MinVal(); |
1387 | Bool_t write = fResponse->OutputOption(); | |
1388 | Bool_t do10to8 = fResponse->Do10to8(); | |
b0f5e3fc | 1389 | Int_t nz, nl, nh, low, i, j; |
1390 | ||
e8189707 | 1391 | for (i=0; i<fNofMaps; i++) { |
b0f5e3fc | 1392 | CompressionParam(i,db,tl,th); |
8a33ae9e | 1393 | nz = 0; |
1394 | nl = 0; | |
1395 | nh = 0; | |
1396 | low = 0; | |
50d05d7b | 1397 | for (j=0; j<fMaxNofSamples; j++) { |
1398 | Int_t signal=(Int_t)(fHitMap2->GetSignal(i,j)); | |
1399 | signal -= db; // if baseline eq. is done here | |
b0f5e3fc | 1400 | if (signal <= 0) {nz++; continue;} |
50d05d7b | 1401 | if ((signal - tl) < minval) low++; |
b0f5e3fc | 1402 | if ((signal - th) >= minval) { |
50d05d7b | 1403 | nh++; |
1404 | Bool_t cond=kTRUE; | |
1405 | FindCluster(i,j,signal,minval,cond); | |
1406 | if(cond && j && | |
1407 | ((TMath::Abs(fHitMap2->GetSignal(i,j-1))-th)>=minval)){ | |
1408 | if(do10to8) signal = Convert10to8(signal); | |
1409 | AddDigit(i,j,signal); | |
1410 | } // end if cond&&j&&() | |
1411 | } else if ((signal - tl) >= minval) nl++; | |
1412 | } // end for j loop time samples | |
1413 | if (write) TreeB()->Fill(nz,nl,nh,low,i+1); | |
8a33ae9e | 1414 | } //end for i loop anodes |
b0f5e3fc | 1415 | |
8a33ae9e | 1416 | char hname[30]; |
1417 | if (write) { | |
50d05d7b | 1418 | sprintf(hname,"TNtuple%d_%d",fModule,fEvent); |
1419 | TreeB()->Write(hname); | |
1420 | // reset tree | |
b0f5e3fc | 1421 | TreeB()->Reset(); |
8a33ae9e | 1422 | } // end if write |
1423 | } | |
1424 | //______________________________________________________________________ | |
b0f5e3fc | 1425 | void AliITSsimulationSDD::FindCluster(Int_t i,Int_t j,Int_t signal, |
ece86d9a | 1426 | Int_t minval,Bool_t &cond){ |
8a33ae9e | 1427 | // Find clusters according to the online 2D zero-suppression algorithm |
1428 | Bool_t do10to8 = fResponse->Do10to8(); | |
1429 | Bool_t high = kFALSE; | |
b0f5e3fc | 1430 | |
1431 | fHitMap2->FlagHit(i,j); | |
1432 | // | |
1433 | // check the online zero-suppression conditions | |
1434 | // | |
8a33ae9e | 1435 | const Int_t kMaxNeighbours = 4; |
b0f5e3fc | 1436 | Int_t nn; |
1437 | Int_t dbx,tlx,thx; | |
8a33ae9e | 1438 | Int_t xList[kMaxNeighbours], yList[kMaxNeighbours]; |
e8189707 | 1439 | fSegmentation->Neighbours(i,j,&nn,xList,yList); |
ece86d9a | 1440 | Int_t in,ix,iy,qns; |
e8189707 | 1441 | for (in=0; in<nn; in++) { |
50d05d7b | 1442 | ix=xList[in]; |
e8189707 | 1443 | iy=yList[in]; |
b0f5e3fc | 1444 | if (fHitMap2->TestHit(ix,iy)==kUnused) { |
50d05d7b | 1445 | CompressionParam(ix,dbx,tlx,thx); |
1446 | Int_t qn = (Int_t)(fHitMap2->GetSignal(ix,iy)); | |
1447 | qn -= dbx; // if baseline eq. is done here | |
1448 | if ((qn-tlx) < minval) { | |
1449 | fHitMap2->FlagHit(ix,iy); | |
1450 | continue; | |
1451 | } else { | |
1452 | if ((qn - thx) >= minval) high=kTRUE; | |
1453 | if (cond) { | |
1454 | if(do10to8) signal = Convert10to8(signal); | |
1455 | AddDigit(i,j,signal); | |
1456 | } // end if cond | |
1457 | if(do10to8) qns = Convert10to8(qn); | |
1458 | else qns=qn; | |
1459 | if (!high) AddDigit(ix,iy,qns); | |
1460 | cond=kFALSE; | |
1461 | if(!high) fHitMap2->FlagHit(ix,iy); | |
1462 | } // end if qn-tlx < minval | |
1463 | } // end if TestHit | |
8a33ae9e | 1464 | } // end for in loop over neighbours |
b0f5e3fc | 1465 | } |
8a33ae9e | 1466 | //______________________________________________________________________ |
b0f5e3fc | 1467 | void AliITSsimulationSDD::Init1D(){ |
8a33ae9e | 1468 | // this is just a copy-paste of input taken from 2D algo |
1469 | // Torino people should give input | |
1470 | // Read 1D zero-suppression parameters for SDD | |
b0f5e3fc | 1471 | |
1472 | if (!strstr(fParam,"file")) return; | |
1473 | ||
1474 | Int_t na,pos,tempTh; | |
1475 | Float_t mu,sigma; | |
8a33ae9e | 1476 | Float_t *savemu = new Float_t [fNofMaps]; |
e8189707 | 1477 | Float_t *savesigma = new Float_t [fNofMaps]; |
1478 | char input[100],basel[100],par[100]; | |
b0f5e3fc | 1479 | char *filtmp; |
b0f5e3fc | 1480 | Int_t minval = fResponse->MinVal(); |
8a33ae9e | 1481 | |
e8189707 | 1482 | fResponse->Filenames(input,basel,par); |
1483 | fFileName=par; | |
b0f5e3fc | 1484 | |
1485 | // set first the disable and tol param | |
1486 | SetCompressParam(); | |
1487 | // | |
1488 | filtmp = gSystem->ExpandPathName(fFileName.Data()); | |
1489 | FILE *param = fopen(filtmp,"r"); | |
1490 | na = 0; | |
1491 | ||
1492 | if (param) { | |
50d05d7b | 1493 | fscanf(param,"%d %d %d %d ", &fT2[0], &fT2[1], &fTol[0], &fTol[1]); |
1494 | while(fscanf(param,"%d %f %f",&pos, &mu, &sigma) != EOF) { | |
1495 | if (pos != na+1) { | |
1496 | Error("Init1D","Anode number not in increasing order!",filtmp); | |
1497 | exit(1); | |
1498 | } // end if pos != na+1 | |
1499 | savemu[na]=mu; | |
1500 | savesigma[na]=sigma; | |
1501 | if ((2.*sigma) < mu) { | |
1502 | fD[na] = (Int_t)floor(mu - 2.0*sigma + 0.5); | |
1503 | mu = 2.0 * sigma; | |
1504 | } else fD[na] = 0; | |
1505 | tempTh = (Int_t)floor(mu+2.25*sigma+0.5) - minval; | |
1506 | if (tempTh < 0) tempTh=0; | |
1507 | fT1[na] = tempTh; | |
1508 | na++; | |
1509 | } // end while | |
b0f5e3fc | 1510 | } else { |
50d05d7b | 1511 | Error("Init1D","THE FILE %s DOES NOT EXIST !",filtmp); |
1512 | exit(1); | |
b0f5e3fc | 1513 | } // end if(param) |
8a33ae9e | 1514 | |
b0f5e3fc | 1515 | fclose(param); |
1516 | delete [] filtmp; | |
749bd21a | 1517 | delete [] savemu; |
e8189707 | 1518 | delete [] savesigma; |
8a33ae9e | 1519 | } |
1520 | //______________________________________________________________________ | |
b0f5e3fc | 1521 | void AliITSsimulationSDD::Compress1D(){ |
1522 | // 1D zero-suppression algorithm (from Gianluca A.) | |
8a33ae9e | 1523 | Int_t dis,tol,thres,decr,diff; |
b0f5e3fc | 1524 | UChar_t *str=fStream->Stream(); |
8a33ae9e | 1525 | Int_t counter=0; |
1526 | Bool_t do10to8=fResponse->Do10to8(); | |
1527 | Int_t last=0; | |
1528 | Int_t k,i,j; | |
ece86d9a | 1529 | |
ece86d9a | 1530 | for (k=0; k<2; k++) { |
50d05d7b | 1531 | tol = Tolerance(k); |
1532 | dis = Disable(k); | |
1533 | for (i=0; i<fNofMaps/2; i++) { | |
1534 | Bool_t firstSignal=kTRUE; | |
1535 | Int_t idx=i+k*fNofMaps/2; | |
43217ad9 | 1536 | if( !fAnodeFire[idx] ) continue; |
50d05d7b | 1537 | CompressionParam(idx,decr,thres); |
1538 | for (j=0; j<fMaxNofSamples; j++) { | |
1539 | Int_t signal=(Int_t)(fHitMap2->GetSignal(idx,j)); | |
1540 | signal -= decr; // if baseline eq. | |
1541 | if(do10to8) signal = Convert10to8(signal); | |
1542 | if (signal <= thres) { | |
1543 | signal=0; | |
1544 | diff=128; | |
1545 | last=0; | |
1546 | // write diff in the buffer for HuffT | |
1547 | str[counter]=(UChar_t)diff; | |
1548 | counter++; | |
1549 | continue; | |
1550 | } // end if signal <= thres | |
1551 | diff=signal-last; | |
1552 | if (diff > 127) diff=127; | |
1553 | if (diff < -128) diff=-128; | |
1554 | if (signal < dis) { | |
1555 | // tol has changed to 8 possible cases ? - one can write | |
1556 | // this if(TMath::Abs(diff)<tol) ... else ... | |
1557 | if(TMath::Abs(diff)<tol) diff=0; | |
1558 | // or keep it as it was before | |
1559 | /* | |
b0f5e3fc | 1560 | if (tol==1 && (diff >= -2 && diff <= 1)) diff=0; |
1561 | if (tol==2 && (diff >= -4 && diff <= 3)) diff=0; | |
1562 | if (tol==3 && (diff >= -16 && diff <= 15)) diff=0; | |
50d05d7b | 1563 | */ |
ece86d9a | 1564 | AddDigit(idx,j,last+diff); |
50d05d7b | 1565 | } else { |
1566 | AddDigit(idx,j,signal); | |
1567 | } // end if singal < dis | |
1568 | diff += 128; | |
1569 | // write diff in the buffer used to compute Huffman tables | |
1570 | if (firstSignal) str[counter]=(UChar_t)signal; | |
1571 | else str[counter]=(UChar_t)diff; | |
1572 | counter++; | |
1573 | last=signal; | |
1574 | firstSignal=kFALSE; | |
1575 | } // end for j loop time samples | |
1576 | } // end for i loop anodes one half of detector | |
8a33ae9e | 1577 | } // end for k |
b0f5e3fc | 1578 | |
1579 | // check | |
1580 | fStream->CheckCount(counter); | |
1581 | ||
1582 | // open file and write out the stream of diff's | |
b0f5e3fc | 1583 | static Bool_t open=kTRUE; |
e8189707 | 1584 | static TFile *outFile; |
b0f5e3fc | 1585 | Bool_t write = fResponse->OutputOption(); |
9ad8b5dd | 1586 | TDirectory *savedir = gDirectory; |
b0f5e3fc | 1587 | |
1588 | if (write ) { | |
50d05d7b | 1589 | if(open) { |
1590 | SetFileName("stream.root"); | |
1591 | cout<<"filename "<<fFileName<<endl; | |
1592 | outFile=new TFile(fFileName,"recreate"); | |
1593 | cout<<"I have opened "<<fFileName<<" file "<<endl; | |
1594 | } // end if open | |
1595 | open = kFALSE; | |
1596 | outFile->cd(); | |
b0f5e3fc | 1597 | fStream->Write(); |
50d05d7b | 1598 | } // endif write |
b0f5e3fc | 1599 | |
8a33ae9e | 1600 | fStream->ClearStream(); |
b0f5e3fc | 1601 | |
8a33ae9e | 1602 | // back to galice.root file |
9ad8b5dd | 1603 | if(savedir) savedir->cd(); |
8a33ae9e | 1604 | } |
1605 | //______________________________________________________________________ | |
b0f5e3fc | 1606 | void AliITSsimulationSDD::StoreAllDigits(){ |
8a33ae9e | 1607 | // if non-zero-suppressed data |
1608 | Bool_t do10to8 = fResponse->Do10to8(); | |
ece86d9a | 1609 | Int_t i, j, digits[3]; |
8a33ae9e | 1610 | |
e8189707 | 1611 | for (i=0; i<fNofMaps; i++) { |
1612 | for (j=0; j<fMaxNofSamples; j++) { | |
50d05d7b | 1613 | Int_t signal=(Int_t)(fHitMap2->GetSignal(i,j)); |
1614 | if(do10to8) signal = Convert10to8(signal); | |
1615 | if(do10to8) signal = Convert8to10(signal); | |
1616 | digits[0] = i; | |
1617 | digits[1] = j; | |
1618 | digits[2] = signal; | |
1619 | fITS->AddRealDigit(1,digits); | |
1620 | } // end for j | |
8a33ae9e | 1621 | } // end for i |
b0f5e3fc | 1622 | } |
8a33ae9e | 1623 | //______________________________________________________________________ |
ece86d9a | 1624 | void AliITSsimulationSDD::CreateHistograms(Int_t scale){ |
8a33ae9e | 1625 | // Creates histograms of maps for debugging |
1626 | Int_t i; | |
ece86d9a | 1627 | |
1628 | fHis=new TObjArray(fNofMaps); | |
e8189707 | 1629 | for (i=0;i<fNofMaps;i++) { |
50d05d7b | 1630 | TString sddName("sdd_"); |
1631 | Char_t candNum[4]; | |
1632 | sprintf(candNum,"%d",i+1); | |
1633 | sddName.Append(candNum); | |
1634 | fHis->AddAt(new TH1F(sddName.Data(),"SDD maps",scale*fMaxNofSamples, | |
1635 | 0.,(Float_t) scale*fMaxNofSamples), i); | |
8a33ae9e | 1636 | } // end for i |
b0f5e3fc | 1637 | } |
8a33ae9e | 1638 | //______________________________________________________________________ |
ece86d9a | 1639 | void AliITSsimulationSDD::FillHistograms(){ |
8a33ae9e | 1640 | // fill 1D histograms from map |
1641 | ||
1642 | if (!fHis) return; | |
1643 | ||
1644 | for( Int_t i=0; i<fNofMaps; i++) { | |
50d05d7b | 1645 | TH1F *hist =(TH1F *)fHis->UncheckedAt(i); |
1646 | Int_t nsamples = hist->GetNbinsX(); | |
1647 | for( Int_t j=0; j<nsamples; j++) { | |
1648 | Double_t signal=fHitMap2->GetSignal(i,j); | |
1649 | hist->Fill((Float_t)j,signal); | |
1650 | } // end for j | |
8a33ae9e | 1651 | } // end for i |
ece86d9a | 1652 | } |
8a33ae9e | 1653 | //______________________________________________________________________ |
b0f5e3fc | 1654 | void AliITSsimulationSDD::ResetHistograms(){ |
b0f5e3fc | 1655 | // Reset histograms for this detector |
b0f5e3fc | 1656 | Int_t i; |
8a33ae9e | 1657 | |
e8189707 | 1658 | for (i=0;i<fNofMaps;i++ ) { |
50d05d7b | 1659 | if (fHis->At(i)) ((TH1F*)fHis->At(i))->Reset(); |
8a33ae9e | 1660 | } // end for i |
b0f5e3fc | 1661 | } |
8a33ae9e | 1662 | //______________________________________________________________________ |
b0f5e3fc | 1663 | TH1F *AliITSsimulationSDD::GetAnode(Int_t wing, Int_t anode) { |
8a33ae9e | 1664 | // Fills a histogram from a give anode. |
1665 | ||
1666 | if (!fHis) return 0; | |
1667 | ||
1668 | if(wing <=0 || wing > 2) { | |
50d05d7b | 1669 | Warning("GetAnode","Wrong wing number: %d",wing); |
1670 | return NULL; | |
8a33ae9e | 1671 | } // end if wing <=0 || wing >2 |
1672 | if(anode <=0 || anode > fNofMaps/2) { | |
50d05d7b | 1673 | Warning("GetAnode","Wrong anode number: %d",anode); |
1674 | return NULL; | |
8a33ae9e | 1675 | } // end if ampde <=0 || andoe > fNofMaps/2 |
1676 | ||
1677 | Int_t index = (wing-1)*fNofMaps/2 + anode-1; | |
8a33ae9e | 1678 | return (TH1F*)(fHis->At(index)); |
b0f5e3fc | 1679 | } |
8a33ae9e | 1680 | //______________________________________________________________________ |
b0f5e3fc | 1681 | void AliITSsimulationSDD::WriteToFile(TFile *hfile) { |
8a33ae9e | 1682 | // Writes the histograms to a file |
b0f5e3fc | 1683 | |
8a33ae9e | 1684 | if (!fHis) return; |
1685 | ||
1686 | hfile->cd(); | |
1687 | Int_t i; | |
8a33ae9e | 1688 | for(i=0; i<fNofMaps; i++) fHis->At(i)->Write(); //fAdcs[i]->Write(); |
1689 | return; | |
b0f5e3fc | 1690 | } |
8a33ae9e | 1691 | //______________________________________________________________________ |
ece86d9a | 1692 | Float_t AliITSsimulationSDD::GetNoise() { |
8a33ae9e | 1693 | // Returns the noise value |
1694 | //Bool_t do10to8=fResponse->Do10to8(); | |
1695 | //noise will always be in the liniar part of the signal | |
1696 | Int_t decr; | |
1697 | Int_t threshold = fT1[0]; | |
1698 | char opt1[20], opt2[20]; | |
1699 | ||
1700 | fResponse->ParamOptions(opt1,opt2); | |
1701 | fParam=opt2; | |
1702 | char *same = strstr(opt1,"same"); | |
1703 | Float_t noise,baseline; | |
1704 | if (same) { | |
50d05d7b | 1705 | fResponse->GetNoiseParam(noise,baseline); |
8a33ae9e | 1706 | } else { |
50d05d7b | 1707 | static Bool_t readfile=kTRUE; |
1708 | //read baseline and noise from file | |
1709 | if (readfile) ReadBaseline(); | |
1710 | readfile=kFALSE; | |
8a33ae9e | 1711 | } // end if same |
1712 | ||
1713 | TCanvas *c2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("c2"); | |
1714 | if(c2) delete c2->GetPrimitive("noisehist"); | |
1715 | if(c2) delete c2->GetPrimitive("anode"); | |
1716 | else c2=new TCanvas("c2"); | |
1717 | c2->cd(); | |
1718 | c2->SetFillColor(0); | |
1719 | ||
1720 | TH1F *noisehist = new TH1F("noisehist","noise",100,0.,(float)2*threshold); | |
1721 | TH1F *anode = new TH1F("anode","Anode Projection",fMaxNofSamples,0., | |
50d05d7b | 1722 | (float)fMaxNofSamples); |
8a33ae9e | 1723 | Int_t i,k; |
1724 | for (i=0;i<fNofMaps;i++) { | |
50d05d7b | 1725 | CompressionParam(i,decr,threshold); |
1726 | if (!same) GetAnodeBaseline(i,baseline,noise); | |
1727 | anode->Reset(); | |
1728 | for (k=0;k<fMaxNofSamples;k++) { | |
1729 | Float_t signal=(Float_t)fHitMap2->GetSignal(i,k); | |
1730 | //if (signal <= (float)threshold) noisehist->Fill(signal-baseline); | |
1731 | if (signal <= (float)threshold) noisehist->Fill(signal); | |
1732 | anode->Fill((float)k,signal); | |
1733 | } // end for k | |
1734 | anode->Draw(); | |
1735 | c2->Update(); | |
8a33ae9e | 1736 | } // end for i |
1737 | TF1 *gnoise = new TF1("gnoise","gaus",0.,threshold); | |
1738 | noisehist->Fit("gnoise","RQ"); | |
1739 | noisehist->Draw(); | |
ece86d9a | 1740 | c2->Update(); |
8a33ae9e | 1741 | Float_t mnoise = gnoise->GetParameter(1); |
1742 | cout << "mnoise : " << mnoise << endl; | |
1743 | Float_t rnoise = gnoise->GetParameter(2); | |
1744 | cout << "rnoise : " << rnoise << endl; | |
1745 | delete noisehist; | |
1746 | return rnoise; | |
50d05d7b | 1747 | } |
1748 | //______________________________________________________________________ | |
1749 | void AliITSsimulationSDD::WriteSDigits(){ | |
c7a4dac0 | 1750 | // Fills the Summable digits Tree |
c7a4dac0 | 1751 | static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); |
1752 | ||
48058160 | 1753 | for( Int_t i=0; i<fNofMaps; i++ ) { |
43217ad9 | 1754 | if( !fAnodeFire[i] ) continue; |
48058160 | 1755 | for( Int_t j=0; j<fMaxNofSamples; j++ ) { |
1756 | Double_t sig = fHitMap2->GetSignal( i, j ); | |
1757 | if( sig > 0.2 ) { | |
1758 | Int_t jdx = j*fScaleSize; | |
1759 | Int_t index = fpList->GetHitIndex( i, j ); | |
1760 | AliITSpListItem pItemTmp2( fModule, index, 0. ); | |
1761 | // put the fScaleSize analog digits in only one | |
1762 | for( Int_t ik=0; ik<fScaleSize; ik++ ) { | |
1763 | AliITSpListItem *pItemTmp = fpList->GetpListItem( i, jdx+ik ); | |
1764 | if( pItemTmp == 0 ) continue; | |
1765 | pItemTmp2.Add( pItemTmp ); | |
1766 | } | |
1767 | pItemTmp2.AddSignalAfterElect( fModule, index, sig ); | |
1768 | pItemTmp2.AddNoise( fModule, index, fHitNoiMap2->GetSignal( i, j ) ); | |
1769 | aliITS->AddSumDigit( pItemTmp2 ); | |
1770 | } // end if (sig > 0.2) | |
1771 | } | |
1772 | } | |
c7a4dac0 | 1773 | return; |
b0f5e3fc | 1774 | } |
8a33ae9e | 1775 | //______________________________________________________________________ |
44a312c3 | 1776 | void AliITSsimulationSDD::Print() { |
8a33ae9e | 1777 | // Print SDD simulation Parameters |
1778 | ||
1779 | cout << "**************************************************" << endl; | |
1780 | cout << " Silicon Drift Detector Simulation Parameters " << endl; | |
1781 | cout << "**************************************************" << endl; | |
1782 | cout << "Flag for Perpendicular tracks: " << (Int_t) fFlag << endl; | |
1783 | cout << "Flag for noise checking: " << (Int_t) fCheckNoise << endl; | |
1784 | cout << "Flag to switch off electronics: " << (Int_t) fDoFFT << endl; | |
1785 | cout << "Number pf Anodes used: " << fNofMaps << endl; | |
1786 | cout << "Number of Time Samples: " << fMaxNofSamples << endl; | |
1787 | cout << "Scale size factor: " << fScaleSize << endl; | |
1788 | cout << "**************************************************" << endl; | |
44a312c3 | 1789 | } |