1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
24 #include "AliITSdigitSPD.h"
25 #include "AliITSmodule.h"
26 #include "AliITSMapA2.h"
27 #include "AliITSpList.h"
28 #include "AliITSsimulationSPD.h"
33 ClassImp(AliITSsimulationSPD)
34 ////////////////////////////////////////////////////////////////////////
36 // Written by Rocco Caliandro
37 // from a model developed with T. Virgili and R.A. Fini
40 // AliITSsimulationSPD is the simulation of SPDs
42 //______________________________________________________________________
43 AliITSsimulationSPD::AliITSsimulationSPD() : AliITSsimulation(),
46 // Default constructor
52 // A default constructed AliITSsimulationSPD class.
54 //______________________________________________________________________
55 AliITSsimulationSPD::AliITSsimulationSPD(AliITSDetTypeSim *dettyp):
56 AliITSsimulation(dettyp),
59 // Standard constructor
61 // AliITSsegmentation *seg Segmentation class to be used
62 // AliITSresonse *res Response class to be used
66 // A standard constructed AliITSsimulationSPD class.
70 //______________________________________________________________________
71 void AliITSsimulationSPD::Init() {
72 // Initilizes the variables of AliITSsimulation SPD.
81 if(fMapA2) delete fMapA2;
82 AliITSsegmentationSPD* seg = (AliITSsegmentationSPD*)GetSegmentationModel(0);
83 fMapA2 = new AliITSMapA2(seg);
84 if(fpList) delete fpList;
85 fpList = new AliITSpList(GetNPixelsZ()+1,GetNPixelsX()+1);
88 //______________________________________________________________________
89 void AliITSsimulationSPD::Init(AliITSsegmentationSPD *seg,
90 AliITSCalibrationSPD *resp) {
91 // Initilizes the variables of AliITSsimulation SPD.
93 // AliITSsegmentationSPD replacement segmentation class to be used
94 // aliITSresponseSPD replacement response class to be used
105 if(fResponse) delete fResponse;
107 if(GetSegmentationModel(0)) delete GetSegmentationModel(0);
108 GetSegmentationModel(0) = seg;
109 if(fMapA2) delete fMapA2;
110 fMapA2 = new AliITSMapA2(GetSegmentationModel(0));
111 if(fpList) delete fpList;
112 fpList = new AliITSpList(GetNPixelsZ()+1,GetNPixelsX()+1);
115 //______________________________________________________________________
116 AliITSsimulationSPD::~AliITSsimulationSPD() {
125 if(fMapA2) delete fMapA2;
131 //______________________________________________________________________
132 AliITSsimulationSPD::AliITSsimulationSPD(const AliITSsimulationSPD &source) :
133 AliITSsimulation(source){
140 // A new AliITSsimulationSPD class with the same parameters as source.
142 if(&source == this) return;
144 this->fMapA2 = source.fMapA2;
145 this->fHis = source.fHis;
148 //______________________________________________________________________
149 AliITSsimulationSPD& AliITSsimulationSPD::operator=(const AliITSsimulationSPD
151 // Assignment operator
157 // A new AliITSsimulationSPD class with the same parameters as source.
159 if(&source == this) return *this;
161 this->fMapA2 = source.fMapA2;
162 this->fHis = source.fHis;
165 //______________________________________________________________________
166 AliITSsimulation& AliITSsimulationSPD::operator=(const AliITSsimulation
168 // Assignment operator
174 // A new AliITSsimulationSPD class with the same parameters as source.
176 if(&source == this) return *this;
177 Error("AliITSsimulationSPD","Not allowed to make a = with "
178 "AliITSsimulationSPD Using default creater instead");
183 //______________________________________________________________________
184 void AliITSsimulationSPD::InitSimulationModule(Int_t module,Int_t event){
185 // Creates maps to build the list of tracks for each sumable digit
187 // Int_t module // Module number to be simulated
188 // Int_t event // Event number to be simulated
199 //______________________________________________________________________
200 void AliITSsimulationSPD::FinishSDigitiseModule(){
201 // Does the Sdigits to Digits work
209 SDigitsToDigits(fModule,fpList);
211 //______________________________________________________________________
212 void AliITSsimulationSPD::SDigitiseModule(AliITSmodule *mod, Int_t dummy0,
214 // Sum digitize module
216 // AliITSmodule *mod The module to be SDgitized
217 // Int_t dummy0 Not used kept for general compatibility
218 // Int_t dummy1 Not used kept for general compatibility
223 if (!(mod->GetNhits())) return; // if module has no hits then no Sdigits.
224 Int_t number = 10000;
225 Int_t *frowpixel = new Int_t[number];
226 Int_t *fcolpixel = new Int_t[number];
227 Double_t *fenepixel = new Double_t[number];
229 dummy0 = dummy1; // remove unsued variable warning.
230 fModule = mod->GetIndex();
232 // Array of pointers to store the track index of the digits
233 // leave +1, otherwise pList crashes when col=256, row=192
235 HitsToAnalogDigits(mod,frowpixel,fcolpixel,fenepixel,fpList);
237 WriteSDigits(fpList);
246 //______________________________________________________________________
247 void AliITSsimulationSPD::DigitiseModule(AliITSmodule *mod, Int_t,Int_t) {
248 // digitize module. Also need to digitize modules with only noise.
250 // AliITSmodule *mod The module to be SDgitized
256 Int_t number = 10000;
257 Int_t *frowpixel = new Int_t[number];
258 Int_t *fcolpixel = new Int_t[number];
259 Double_t *fenepixel = new Double_t[number];
261 // Array of pointers to store the track index of the digits
262 // leave +1, otherwise pList crashes when col=256, row=192
263 fModule = mod->GetIndex();
265 SetFluctuations(fpList,fModule);
267 HitsToAnalogDigits(mod,frowpixel,fcolpixel,fenepixel,fpList);
269 // apply mask to SPD module
272 CreateDigit(fModule,fpList);
281 //______________________________________________________________________
282 void AliITSsimulationSPD::SDigitsToDigits(Int_t module,AliITSpList *pList) {
283 // sum digits to Digits.
285 // AliITSmodule *mod The module to be SDgitized
286 // AliITSpList *pList the array of SDigits
288 // AliITSpList *pList the array of SDigits
292 AliDebug(1,Form("Entering AliITSsimulatinSPD::SDigitsToDigits for module=%d",
297 SetFluctuations(pList,module);
299 fMapA2->ClearMap(); // since noise is in pList aready. Zero Map so that
300 // noise is not doubled when calling FillMapFrompList.
302 FillMapFrompList(pList);
304 // apply mask to SPD module
307 CreateDigit(module,pList);
312 //______________________________________________________________________
313 void AliITSsimulationSPD::UpdateMapSignal(Int_t row,Int_t col,Int_t trk,
314 Int_t hit,Int_t mod,Double_t ene,
315 AliITSpList *pList) {
316 // updates the Map of signal, adding the energy (ene) released by
319 // Int_t row pixel row number
320 // Int_t col pixel column number
321 // Int_t trk track number which contributed
322 // Int_t hit hit number which contributed
323 // Int_t mod module number
324 // Double_t ene the energy associated with this contribution
325 // AliITSpList *pList the array of SDigits
327 // AliITSpList *pList the array of SDigits
331 fMapA2->AddSignal(row,col,ene);
332 pList->AddSignal(row,col,trk,hit,mod,ene);
334 //______________________________________________________________________
335 void AliITSsimulationSPD::UpdateMapNoise(Int_t row,Int_t col,Int_t mod,
336 Double_t ene,AliITSpList *pList) {
337 // updates the Map of noise, adding the energy (ene) give my noise
339 // Int_t row pixel row number
340 // Int_t col pixel column number
341 // Int_t mod module number
342 // Double_t ene the energy associated with this contribution
343 // AliITSpList *pList the array of SDigits
345 // AliITSpList *pList the array of SDigits
349 fMapA2->AddSignal(row,col,ene);
350 pList->AddNoise(row,col,mod,ene);
352 //______________________________________________________________________
353 void AliITSsimulationSPD::HitsToAnalogDigits(AliITSmodule *mod,
354 Int_t *frowpixel,Int_t *fcolpixel,
356 AliITSpList *pList) {
357 // Loops over all hits to produce Analog/floting point digits. This
358 // is also the first task in producing standard digits.
360 // AliITSmodule *mod module class
361 // Int_t *frowpixel array of pixel rows
362 // Int_t *fcolpixel array of pixel columns
363 // Double_t *fenepiexel array of pixel energies
364 // AliITSpList *pList the array of SDigits
366 // AliITSpList *pList the array of SDigits
370 // loop over hits in the module
371 Int_t hitpos,nhits = mod->GetNhits();
372 for (hitpos=0;hitpos<nhits;hitpos++) {
373 HitToDigit(mod,hitpos,frowpixel,fcolpixel,fenepixel,pList);
374 }// end loop over digits
376 //______________________________________________________________________
377 void AliITSsimulationSPD::HitToDigit(AliITSmodule *mod,Int_t hitpos,
378 Int_t *frowpixel,Int_t *fcolpixel,
379 Double_t *fenepixel,AliITSpList *pList) {
380 // Steering function to determine the digits associated to a given
382 // The digits are created by charge sharing (ChargeSharing) and by
383 // capacitive coupling (SetCoupling). At all the created digits is
384 // associated the track number of the hit (ntrack)
386 // AliITSmodule *mod module class
387 // Int_t hitpos hit index value
388 // Int_t *frowpixel array of pixel rows
389 // Int_t *fcolpixel array of pixel columns
390 // Double_t *fenepiexel array of pixel energies
391 // AliITSpList *pList the array of SDigits
393 // AliITSpList *pList the array of SDigits
396 Double_t x1l=0.0,y1l=0.0,z1l=0.0,x2l=0.0,y2l=0.0,z2l=0.0;
397 Int_t r1,r2,c1,c2,row,col,npixel = 0;
399 Double_t ene=0.0,etot=0.0;
400 const Float_t kconv = 10000.; // cm -> microns
401 const Float_t kconv1= 0.277e9; // GeV -> electrons equivalent
403 if(!(mod->LineSegmentL(hitpos,x1l,x2l,y1l,y2l,z1l,z2l,etot,ntrack)))return;
405 x2l += x1l; y2l += y1l; z2l += z1l; // Convert to ending coordinate.
406 // positions shifted and converted in microns
407 x1l = x1l*kconv + GetSegmentationModel(0)->Dx()/2.;
408 z1l = z1l*kconv + GetSegmentationModel(0)->Dz()/2.;
409 // positions shifted and converted in microns
410 x2l = x2l*kconv + GetSegmentationModel(0)->Dx()/2.;
411 z2l = z2l*kconv + GetSegmentationModel(0)->Dz()/2.;
412 etot *= kconv1; // convert from GeV to electrons equivalent.
413 Int_t module = mod->GetIndex();
415 // to account for the effective sensitive area
416 // introduced in geometry
417 if (z1l<0 || z1l>GetSegmentationModel(0)->Dz()) return;
418 if (z2l<0 || z2l>GetSegmentationModel(0)->Dz()) return;
419 if (x1l<0 || x1l>GetSegmentationModel(0)->Dx()) return;
420 if (x2l<0 || x2l>GetSegmentationModel(0)->Dx()) return;
422 //Get the col and row number starting from 1
423 // the x direction is not inverted for the second layer!!!
424 GetSegmentationModel(0)->GetPadIxz(x1l, z1l, c1, r1);
425 GetSegmentationModel(0)->GetPadIxz(x2l, z2l, c2, r2);
427 // to account for unexpected equal entrance and
429 if (x1l==x2l) x2l=x2l+x2l*0.1;
430 if (z1l==z2l) z2l=z2l+z2l*0.1;
432 if ((r1==r2) && (c1==c2)){
435 frowpixel[npixel-1] = r1;
436 fcolpixel[npixel-1] = c1;
437 fenepixel[npixel-1] = etot;
440 ChargeSharing(x1l,z1l,x2l,z2l,c1,r1,c2,r2,etot,
441 npixel,frowpixel,fcolpixel,fenepixel);
442 } // end if r1==r2 && c1==c2.
444 for (Int_t npix=0;npix<npixel;npix++){
445 row = frowpixel[npix];
446 col = fcolpixel[npix];
447 ene = fenepixel[npix];
448 UpdateMapSignal(row,col,ntrack,hitpos,module,ene,pList);
449 // Starting capacitive coupling effect
450 SetCoupling(row,col,ntrack,hitpos,module,pList);
453 //______________________________________________________________________
454 void AliITSsimulationSPD::ChargeSharing(Float_t x1l,Float_t z1l,Float_t x2l,
455 Float_t z2l,Int_t c1,Int_t r1,Int_t c2,
456 Int_t r2,Float_t etot,
457 Int_t &npixel,Int_t *frowpixel,
458 Int_t *fcolpixel,Double_t *fenepixel){
459 // Take into account the geometrical charge sharing when the track
460 // crosses more than one pixel.
472 // Int_t *frowpixel array of pixel rows
473 // Int_t *fcolpixel array of pixel columns
474 // Double_t *fenepiexel array of pixel energies
482 <img src="picts/ITS/barimodel_2.gif">
485 <font size=+2 color=red>
486 <a href="mailto:Rocco.Caliandro@ba.infn.it"></a>.
492 Float_t xa,za,xb,zb,dx,dz,dtot,refr,refm,refc;
494 Float_t arefm, arefr, arefn, arefc, azb, az2l, axb, ax2l;
495 Int_t dirx,dirz,rb,cb;
496 Int_t flag,flagrow,flagcol;
506 dtot = TMath::Sqrt((dx*dx)+(dz*dz));
507 if (dtot==0.0) dtot = 0.01;
508 dirx = (Int_t) TMath::Sign((Float_t)1,dx);
509 dirz = (Int_t) TMath::Sign((Float_t)1,dz);
511 // calculate the x coordinate of the pixel in the next column
512 // and the z coordinate of the pixel in the next row
515 GetSegmentationModel(0)->GetPadCxz(c1, r1-1, xpos, zpos);
517 Float_t xsize = GetSegmentationModel(0)->Dpx(0);
518 Float_t zsize = GetSegmentationModel(0)->Dpz(r1-1);
520 if (dirx == 1) refr = xpos+xsize/2.;
521 else refr = xpos-xsize/2.;
523 if (dirz == 1) refn = zpos+zsize/2.;
524 else refn = zpos-zsize/2.;
530 // calculate the x coordinate of the intersection with the pixel
531 // in the next cell in row direction
533 refm = dx*((refn - z1l)/dz) + x1l;
535 refm = refr+dirx*xsize;
537 // calculate the z coordinate of the intersection with the pixel
538 // in the next cell in column direction
540 refc = dz*((refr - x1l)/dx) + z1l;
542 refc = refn+dirz*zsize;
549 if ((arefm < arefr) && (arefn < arefc)){
550 // the track goes in the pixel in the next cell in row direction
557 if (rb == r2) flagrow=1;
562 // shift to the pixel in the next cell in row direction
563 Float_t zsizeNext = GetSegmentationModel(0)->Dpz(rb-1);
564 //to account for cell at the borders of the detector
565 if(zsizeNext==0) zsizeNext = zsize;
566 refn += zsizeNext*dirz;
568 // the track goes in the pixel in the next cell in column direction
575 if (cb == c2) flagcol=1;
579 } // end ifaxb > ax2l
581 // shift to the pixel in the next cell in column direction
582 Float_t xsizeNext = GetSegmentationModel(0)->Dpx(cb-1);
583 //to account for cell at the borders of the detector
584 if(xsizeNext==0) xsizeNext = xsize;
585 refr += xsizeNext*dirx;
586 } // end if (arefm < arefr) && (arefn < arefc)
588 //calculate the energy lost in the crossed pixel
589 epar = TMath::Sqrt((xb-xa)*(xb-xa)+(zb-za)*(zb-za));
590 epar = etot*(epar/dtot);
592 //store row, column and energy lost in the crossed pixel
593 frowpixel[npixel] = r1;
594 fcolpixel[npixel] = c1;
595 fenepixel[npixel] = epar;
598 // the exit point of the track is reached
599 if (epar == 0) flag = 1;
600 if ((r1 == r2) && (c1 == c2)) flag = 1;
609 //______________________________________________________________________
610 void AliITSsimulationSPD::SetCoupling(Int_t row, Int_t col, Int_t ntrack,
611 Int_t idhit,Int_t module,
612 AliITSpList *pList) {
613 // Take into account the coupling between adiacent pixels.
614 // The parameters probcol and probrow are the probability of the
615 // signal in one pixel shared in the two adjacent pixels along
616 // the column and row direction, respectively.
618 // Int_t row pixel row number
619 // Int_t col pixel column number
620 // Int_t ntrack track number of track contributing to this signal
621 // Int_t idhit hit number of hit contributing to this signal
622 // Int_t module module number
623 // AliITSpList *pList the array of SDigits
625 // AliITSpList *pList the array of SDigits
631 <img src="picts/ITS/barimodel_3.gif">
634 <font size=+2 color=red>
635 <a href="mailto:tiziano.virgili@cern.ch"></a>.
641 Double_t pulse1,pulse2;
642 Double_t couplR=0.0,couplC=0.0;
645 GetCouplings(couplR,couplC);
648 pulse1 = fMapA2->GetSignal(row,col);
650 for (Int_t isign=-1;isign<=1;isign+=2){// loop in row direction
654 xr = gRandom->Rndm();
655 //if ((j1<0) || (j1>GetNPixelsZ()-1) || (pulse1<GetThreshold())){
656 if ((j1<0) || (j1>GetNPixelsZ()-1) || (xr>couplR)){
660 UpdateMapSignal(j1,col,ntrack,idhit,module,pulse1,pList);
662 flag = 1; // only first next!!
665 // loop in column direction
669 xr = gRandom->Rndm();
670 //if ((j2<0) || (j2>(GetNPixelsX()-1)) || (pulse2<GetThreshold())){
671 if ((j2<0) || (j2>GetNPixelsX()-1) || (xr>couplC)){
675 UpdateMapSignal(row,j2,ntrack,idhit,module,pulse2,pList);
677 flag = 1; // only first next!!
682 //______________________________________________________________________
683 void AliITSsimulationSPD::SetCouplingOld(Int_t row, Int_t col, Int_t ntrack,
684 Int_t idhit,Int_t module,
685 AliITSpList *pList) {
686 // Take into account the coupling between adiacent pixels.
687 // The parameters probcol and probrow are the fractions of the
688 // signal in one pixel shared in the two adjacent pixels along
689 // the column and row direction, respectively.
691 // Int_t row pixel row number
692 // Int_t col pixel column number
693 // Int_t ntrack track number of track contributing to this pixel
694 // Int_t idhit hit index number of hit contributing to this pixel
695 // Int_t module module number
696 // AliITSpList *pList the array of SDigits
698 // AliITSpList *pList the array of SDigits
704 <img src="picts/ITS/barimodel_3.gif">
707 <font size=+2 color=red>
708 <a href="mailto:Rocco.Caliandro@ba.infn.it"></a>.
714 Double_t pulse1,pulse2;
715 Double_t couplR=0.0,couplC=0.0;
717 GetCouplings(couplR,couplC);
720 pulse1 = fMapA2->GetSignal(row,col);
722 for (Int_t isign=-1;isign<=1;isign+=2){// loop in row direction
726 if ((j1<0) || (j1>GetNPixelsZ()-1) || (pulse1<GetThreshold())){
727 pulse1 = fMapA2->GetSignal(row,col);
731 UpdateMapSignal(j1,col,ntrack,idhit,module,pulse1,pList);
735 // loop in column direction
739 if ((j2<0) || (j2>(GetNPixelsX()-1)) || (pulse2<GetThreshold())){
740 pulse2 = fMapA2->GetSignal(row,col);
744 UpdateMapSignal(row,j2,ntrack,idhit,module,pulse2,pList);
750 //______________________________________________________________________
751 void AliITSsimulationSPD::CreateDigit(Int_t module,AliITSpList *pList) {
752 // The pixels are fired if the energy deposited inside them is above
753 // the threshold parameter ethr. Fired pixed are interpreted as digits
754 // and stored in the file digitfilename. One also needs to write out
755 // cases when there is only noise (nhits==0).
758 // AliITSpList *pList the array of SDigits
760 // AliITSpList *pList the array of SDigits
764 static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
766 Int_t size = AliITSdigitSPD::GetNTracks();
767 Int_t * digits = new Int_t[size];
768 Int_t * tracks = new Int_t[size];
769 Int_t * hits = new Int_t[size];
770 Float_t * charges = new Float_t[size];
773 module=0; // remove unused variable warning.
774 for(j1=0;j1<size;j1++){tracks[j1]=-3;hits[j1]=-1;charges[j1]=0.0;}
775 for (Int_t r=1;r<=GetNPixelsZ();r++) {
776 for (Int_t c=1;c<=GetNPixelsX();c++) {
777 // check if the deposited energy in a pixel is above the
779 Float_t signal = (Float_t) fMapA2->GetSignal(r,c);
780 if ( signal > GetThreshold()) {
781 digits[0] = r-1; // digits starts from 0
782 digits[1] = c-1; // digits starts from 0
784 digits[2] = (Int_t) signal; // the signal is stored in
786 for(j1=0;j1<size;j1++){
787 if(j1<pList->GetNEntries()){
788 tracks[j1] = pList->GetTrack(r,c,j1);
789 hits[j1] = pList->GetHit(r,c,j1);
797 aliITS->AddSimDigit(0,phys,digits,tracks,hits,charges);
798 AliDebug(1,Form("mod=%d r,c=%d,%d sig=%f noise=%f Msig=%d Thres=%f",
799 fModule,r,c,fpList->GetSignalOnly(r,c),fpList->GetNoise(r,c),
800 signal,GetThreshold()));
801 } // end if of threshold condition
809 //______________________________________________________________________
810 void AliITSsimulationSPD::SetFluctuations(AliITSpList *pList,Int_t module) {
811 // Set the electronic noise and threshold non-uniformities to all the
812 // pixels in a detector.
813 // The parameter fSigma is the squared sum of the sigma due to noise
814 // and the sigma of the threshold distribution among pixels.
816 // Int_t module modulel number
817 // AliITSpList *pList the array of SDigits
819 // AliITSpList *pList the array of SDigits
825 <img src="picts/ITS/barimodel_1.gif">
828 <font size=+2 color=red>
829 <a href="mailto:Rocco.Caliandro@ba.infn.it"></a>.
834 Double_t thr=0.0,sigm=0.0;
835 Double_t signal,sigma;
838 GetThresholds(thr,sigm);
839 sigma = (Double_t) sigm;
840 for(iz=1;iz<=GetNPixelsZ();iz++){
841 for(ix=1;ix<=GetNPixelsX();ix++){
842 signal = sigma*gRandom->Gaus();
843 fMapA2->SetHit(iz,ix,signal);
844 // insert in the label-signal-hit list the pixels fired
846 pList->AddNoise(iz,ix,module,signal);
847 } // end of loop on pixels
848 } // end of loop on pixels
853 //______________________________________________________________________
854 void AliITSsimulationSPD::SetMask(Int_t mod) {
855 // Apply a mask to the SPD module. 1% of the pixel channels are
856 // masked. When the database will be ready, the masked pixels
857 // should be read from it.
867 Float_t perc = ((AliITSCalibrationSPD*)GetCalibrationModel(mod))->GetFractionDead();
868 // in this way we get the same set of random numbers for all runs.
869 // This is a cluge for now.
870 static TRandom *rnd = new TRandom();
872 totMask= perc*GetNPixelsZ()*GetNPixelsX();
873 for(im=1;im<totMask;im++){
875 ix=(Int_t)(rnd->Rndm()*(GetNPixelsX()-1.) + 1.);
876 } while(ix<=0 || ix>GetNPixelsX());
878 iz=(Int_t)(rnd->Rndm()*(GetNPixelsZ()-1.) + 1.);
879 } while(iz<=0 || iz>GetNPixelsZ());
881 fMapA2->SetHit(iz,ix,signal);
882 } // end loop on masked pixels
884 //______________________________________________________________________
885 void AliITSsimulationSPD::CreateHistograms() {
895 fHis=new TObjArray(GetNPixelsZ());
896 for(i=0;i<GetNPixelsZ();i++) {
897 TString spdname("spd_");
899 sprintf(candnum,"%d",i+1);
900 spdname.Append(candnum);
901 (*fHis)[i] = new TH1F(spdname.Data(),"SPD maps",
902 GetNPixelsX(),0.,(Float_t) GetNPixelsX());
905 //______________________________________________________________________
906 void AliITSsimulationSPD::ResetHistograms() {
907 // Reset histograms for this detector
916 for(i=0;i<GetNPixelsZ();i++ ) {
917 if ((*fHis)[i]) ((TH1F*)(*fHis)[i])->Reset();
920 //______________________________________________________________________
921 void AliITSsimulationSPD::WriteSDigits(AliITSpList *pList){
922 // Fills the Summable digits Tree
924 // AliITSpList *pList the array of SDigits
926 // AliITSpList *pList the array of SDigits
930 static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
932 pList->GetMaxMapIndex(ni,nj);
933 for(i=0;i<ni;i++)for(j=0;j<nj;j++){
934 if(pList->GetSignalOnly(i,j)>0.0){
935 aliITS->AddSumDigit(*(pList->GetpListItem(i,j)));
936 if(AliDebugLevel()>0){
937 cout << "pListSPD: " << *(pList->GetpListItem(i,j)) << endl;
938 AliDebug(1,Form("mod=%d r,c=%d %d sig=%f noise=%f",
939 fModule,i,j,fpList->GetSignalOnly(i,j),fpList->GetNoise(i,j)))
945 //______________________________________________________________________
946 void AliITSsimulationSPD::FillMapFrompList(AliITSpList *pList){
947 // Fills fMap2A from the pList of Summable digits
949 // AliITSpList *pList the array of SDigits
951 // AliITSpList *pList the array of SDigits
956 for(iz=0;iz<GetNPixelsZ();iz++)for(ix=0;ix<GetNPixelsX();ix++)
957 fMapA2->AddSignal(iz,ix,pList->GetSignal(iz,ix));