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 **************************************************************************/
20 #include <Riostream.h>
21 #include <TObjArray.h>
24 #include "AliITSmodule.h"
25 #include "AliITSMapA2.h"
26 #include "AliITSpList.h"
27 #include "AliITSCalibrationSSD.h"
28 #include "AliITSsegmentationSSD.h"
29 //#include "AliITSdcsSSD.h"
31 #include "AliITShit.h"
32 #include "AliITSdigitSSD.h"
34 #include "AliITSgeom.h"
35 #include "AliITSsimulationSSD.h"
36 #include "AliITSTableSSD.h"
38 #include "AliMathBase.h"
40 ClassImp(AliITSsimulationSSD)
41 ////////////////////////////////////////////////////////////////////////
43 // Author: Enrico Fragiacomo //
44 // enrico.fragiacomo@ts.infn.it //
45 // Last revised: june 2008 //
47 // AliITSsimulationSSD is the simulation of SSD. //
48 ////////////////////////////////////////////////////////////////////////
50 //----------------------------------------------------------------------
51 AliITSsimulationSSD::AliITSsimulationSSD():AliITSsimulation(),
64 // A default construction AliITSsimulationSSD class
66 //----------------------------------------------------------------------
67 AliITSsimulationSSD::AliITSsimulationSSD(AliITSDetTypeSim* dettyp):
68 AliITSsimulation(dettyp),
77 // AliITSDetTypeSim Pointer to the SSD dettype to be used
81 // A standard constructed AliITSsimulationSSD class
83 fTimeResponse = new TF1("ftimeresponse",".5*x*exp(1.-.5*x)");
86 //----------------------------------------------------------------------
87 void AliITSsimulationSSD::Init(){
88 // Inilizer, Inilizes all of the variable as needed in a standard place.
90 // AliITSsegmentationSSD *seg Pointer to the SSD segmentation to be used
91 // AliITSCalibrationSSD *resp Pointer to the SSD responce class to be used
96 AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
98 SetDriftVelocity(); // use default values in .h file
99 SetIonizeE(); // use default values in .h file
100 SetDiffConst(); // use default values in .h file
101 fpList = new AliITSpList(2,GetNStrips());
102 fMapA2 = new AliITSMapA2(seg);
104 //______________________________________________________________________
105 AliITSsimulationSSD& AliITSsimulationSSD::operator=(
106 const AliITSsimulationSSD &s){
109 if(this==&s) return *this;
111 // this->fDCS = new AliITSdcsSSD(*(s.fDCS));
112 this->fMapA2 = s.fMapA2;
113 this->fIonE = s.fIonE;
114 this->fDifConst[0] = s.fDifConst[0];
115 this->fDifConst[1] = s.fDifConst[1];
116 this->fDriftVel[0] = s.fDriftVel[0];
117 this->fDriftVel[1] = s.fDriftVel[1];
118 this->fTimeResponse = s.fTimeResponse;
122 //______________________________________________________________________
123 AliITSsimulation& AliITSsimulationSSD::operator=(
124 const AliITSsimulation &s){
127 if(this==&s) return *this;
128 Error("AliITSsimulationSSD","Not allowed to make a = with "
129 "AliITSsimulationSSD Using default creater instead");
134 //______________________________________________________________________
135 AliITSsimulationSSD::AliITSsimulationSSD(const AliITSsimulationSSD &source):
136 AliITSsimulation(source),
137 fMapA2(source.fMapA2),
141 fTimeResponse(source.fTimeResponse){
143 fDifConst[0] = source.fDifConst[0];
144 fDifConst[1] = source.fDifConst[1];
145 fDriftVel[0] = source.fDriftVel[0];
146 fDriftVel[1] = source.fDriftVel[1];
148 //______________________________________________________________________
149 AliITSsimulationSSD::~AliITSsimulationSSD() {
152 delete fTimeResponse;
155 //______________________________________________________________________
156 void AliITSsimulationSSD::InitSimulationModule(Int_t module,Int_t event){
157 // Creates maps to build the list of tracks for each sumable digit
159 // Int_t module // Module number to be simulated
160 // Int_t event // Event number to be simulated
166 SetModuleNumber(module);
167 SetEventNumber(event);
171 //______________________________________________________________________
172 void AliITSsimulationSSD::FinishSDigitiseModule(){
173 // Does the Sdigits to Digits work
181 FillMapFrompList(fpList); // need to check if needed here or not????
182 SDigitToDigit(fModule,fpList);
186 //______________________________________________________________________
187 void AliITSsimulationSSD::DigitiseModule(AliITSmodule *mod,Int_t,Int_t) {
188 // Digitizes hits for one SSD module
189 SetModuleNumber(mod->GetIndex());
191 HitsToAnalogDigits(mod,fpList);
192 SDigitToDigit(GetModuleNumber(),fpList);
197 //______________________________________________________________________
198 void AliITSsimulationSSD::SDigitiseModule(AliITSmodule *mod,Int_t,Int_t) {
199 // Produces Summable/Analog digits and writes them to the SDigit tree.
201 HitsToAnalogDigits(mod,fpList);
203 WriteSDigits(fpList);
208 //______________________________________________________________________
209 void AliITSsimulationSSD::SDigitToDigit(Int_t module,AliITSpList *pList){
210 // Takes the pList and finishes the digitization.
212 ApplyNoise(pList,module);
213 ApplyCoupling(pList,module);
214 ApplyDeadChannels(module);
216 ChargeToSignal(module,pList);
218 //______________________________________________________________________
219 void AliITSsimulationSSD::HitsToAnalogDigits(AliITSmodule *mod,
221 // Loops over all hits to produce Analog/floating point digits. This
222 // is also the first task in producing standard digits.
223 Int_t lasttrack = -2;
225 Double_t x0=0.0, y0=0.0, z0=0.0;
226 Double_t x1=0.0, y1=0.0, z1=0.0;
228 Int_t module = mod->GetIndex();
232 AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
234 TObjArray *hits = mod->GetHits();
235 Int_t nhits = hits->GetEntriesFast();
236 if (nhits<=0) return;
237 AliITSTableSSD * tav = new AliITSTableSSD(GetNStrips());
238 module = mod->GetIndex();
239 if ( mod->GetLayer() == 6 ) seg->SetLayer(6);
240 if ( mod->GetLayer() == 5 ) seg->SetLayer(5);
241 for(Int_t i=0; i<nhits; i++) {
242 // LineSegmentL returns 0 if the hit is entering
243 // If hits is exiting returns positions of entering and exiting hits
244 // Returns also energy loss
247 cout << mod->GetHit(i)->GetXL() << " "<<mod->GetHit(i)->GetYL();
248 cout << " " << mod->GetHit(i)->GetZL();
251 if (mod->LineSegmentL(i, x0, x1, y0, y1, z0, z1, de, idtrack)) {
253 // Scale down dE/dx according to the hit's TOF wrt to the trigger
254 // Necessary for pileup simulation
256 tof = mod->GetHit(i)->GetTOF();
257 tof *= 1.E+6; // convert time in microsecond
258 if(tof<2.) de = de * fTimeResponse->Eval(-1.*tof+2.);
262 HitToDigit(module, x0, y0, z0, x1, y1, z1, de,tav);
263 if (lasttrack != idtrack || i==(nhits-1)) {
264 GetList(idtrack,i,module,pList,tav);
268 } // end loop over hits
272 //----------------------------------------------------------------------
273 void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
274 Double_t z0, Double_t x1, Double_t y1,
275 Double_t z1, Double_t de,
276 AliITSTableSSD *tav) {
278 // hit to digit conversion
280 AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
281 // Turns hits in SSD module into one or more digits.
282 //Float_t tang[2] = {0.0,0.0};
283 //seg->Angles(tang[0], tang[1]);//stereo<<->tan(stereo)~=stereo
285 Double_t dex=0.0, dey=0.0, dez=0.0;
286 Double_t pairs; // pair generation energy per step.
287 Double_t sigma[2] = {0.,0.};// standard deviation of the diffusion gaussian
288 Double_t tdrift[2] = {0.,0.}; // time of drift
290 Double_t inf[2], sup[2], par0[2];
292 // Steps in the module are determined "manually" (i.e. No Geant)
293 // NumOfSteps divide path between entering and exiting hits in steps
294 Int_t numOfSteps = NumOfSteps(x1, y1, z1, dex, dey, dez);
295 // Enery loss is equally distributed among steps
297 pairs = de/GetIonizeE(); // e-h pairs generated
299 //-----------------------------------------------------
301 //-----------------------------------------------------
302 for(Int_t j=0; j<numOfSteps; j++) { // stepping
304 x = x0 + (j+0.5)*dex;
305 y = y0 + (j+0.5)*dey;
306 if ( y > (seg->Dy()/2+10)*1.0E-4 ) {
307 // check if particle is within the detector
308 Warning("HitToDigit",
309 "hit out of detector y0=%e,y=%e,dey=%e,j =%d module=%d, exceed=%e",
310 y0,y,dey,j,module, y-(seg->Dy()/2+10)*1.0E-4);
313 z = z0 + (j+0.5)*dez;
315 if(GetDebug(4)) cout <<"HitToDigit "<<x<<" "<<y<<" "<<z<< " "
316 <<dex<<" "<<dey<<" "<<dez<<endl;
318 if(seg->GetLayer()==6) {
319 y=-y; // Lay6 module has sensor up-side-down!!!
322 // w is the coord. perpendicular to the strips
323 // Float_t xp=x*1.e+4,zp=z*1.e+4; // microns
325 seg->GetPadTxz(xp,zp);
328 //---------------------------------------------------------
330 //------------------------------------------------------------
333 // calculate drift time
334 // y is the minimum path
335 tdrift[0] = (y+(seg->Dy()*1.0E-4)/2)/GetDriftVelocity(0);
337 w = xp; // P side strip number
339 if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
340 // this check rejects hits in regions not covered by strips
341 // 0.5 takes into account boundaries
342 if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
343 return; // There are dead region on the SSD sensitive volume!!!
346 // sigma is the standard deviation of the diffusion gaussian
347 if(tdrift[k]<0) return;
349 sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
350 sigma[k] /= (GetStripPitch()*1.0E-4); //units of Pitch
353 Error("HitToDigit"," sigma[%d]=0",k);
358 // we integrate the diffusion gaussian from -3sigma to 3sigma
359 inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average
360 sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
361 // IntegrateGaussian does the actual
362 // integration of diffusion gaussian
363 IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
365 //------------------------------------------------------
367 //-------------------------------------------------------
369 //------------------------------------------------------
371 //-------------------------------------------------------
373 tdrift[1] = ((seg->Dy()*1.0E-4)/2-y)/GetDriftVelocity(1);
375 //tang[k]=TMath::Tan(tang[k]);
377 w = zp; // N side strip number
379 if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
380 // this check rejects hits in regions not covered by strips
381 // 0.5 takes into account boundaries
382 if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
383 return; // There are dead region on the SSD sensitive volume.
386 // sigma is the standard deviation of the diffusion gaussian
387 if(tdrift[k]<0) return;
389 sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
390 sigma[k] /= (GetStripPitch()*1.0E-4); //units of Pitch
393 Error("HitToDigit"," sigma[%d]=0",k);
398 // we integrate the diffusion gaussian from -3sigma to 3sigma
399 inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average
400 sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
401 // IntegrateGaussian does the actual
402 // integration of diffusion gaussian
403 IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
405 //-------------------------------------------------
407 //-------------------------------------------------
413 //______________________________________________________________________
414 void AliITSsimulationSSD::ApplyNoise(AliITSpList *pList,Int_t module){
417 Double_t signal,noise;
418 AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
421 for(ix=0;ix<GetNStrips();ix++){ // loop over strips
424 noise = (Double_t) gRandom->Gaus(0,res->GetNoiseP(ix));
426 // need to calibrate noise
427 // NOTE. noise from the calibration database comes uncalibrated,
428 // it needs to be calibrated in order to be added
429 // to the signal. It will be decalibrated later on together with the noise
430 noise *= (Double_t) res->GetGainP(ix);
432 // noise comes in ADC channels from the calibration database
433 // It needs to be converted back to electronVolts
434 noise /= res->GetSSDDEvToADC(1.);
436 // Finally, noise is added to the signal
437 signal = noise + fMapA2->GetSignal(0,ix);//get signal from map
438 fMapA2->SetHit(0,ix,signal); // give back signal to map
439 if(signal>0.0) pList->AddNoise(0,ix,module,noise);
443 for(ix=0;ix<GetNStrips();ix++){ // loop over strips
444 noise = (Double_t) gRandom->Gaus(0,res->GetNoiseN(ix));// give noise to signal
445 noise *= (Double_t) res->GetGainN(ix);
446 noise /= res->GetSSDDEvToADC(1.);
447 signal = noise + fMapA2->GetSignal(1,ix);//get signal from map
448 fMapA2->SetHit(1,ix,signal); // give back signal to map
449 if(signal>0.0) pList->AddNoise(1,ix,module,noise);
453 //______________________________________________________________________
454 void AliITSsimulationSSD::ApplyCoupling(AliITSpList *pList,Int_t module) {
455 // Apply the effect of electronic coupling between channels
458 //AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
459 AliITSSimuParam* res = fDetType->GetSimuParam();
461 Double_t *contrLeft = new Double_t[GetNStrips()];
462 Double_t *contrRight = new Double_t[GetNStrips()];
465 for(ix=0;ix<GetNStrips();ix++){
466 if(ix>0) contrLeft[ix] = fMapA2->GetSignal(0,ix-1)*res->GetSSDCouplingPL();
467 else contrLeft[ix] = 0.0;
468 if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(0,ix+1)*res->GetSSDCouplingPR();
469 else contrRight[ix] = 0.0;
470 } // loop over strips
472 for(ix=0;ix<GetNStrips();ix++){
473 signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingPL() * fMapA2->GetSignal(0,ix)
474 - res->GetSSDCouplingPR() * fMapA2->GetSignal(0,ix);
475 fMapA2->AddSignal(0,ix,signal);
476 if(signal>0.0) pList->AddNoise(0,ix,module,signal);
477 } // loop over strips
480 for(ix=0;ix<GetNStrips();ix++){
481 if(ix>0) contrLeft[ix] = fMapA2->GetSignal(1,ix-1)*res->GetSSDCouplingNL();
482 else contrLeft[ix] = 0.0;
483 if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(1,ix+1)*res->GetSSDCouplingNR();
484 else contrRight[ix] = 0.0;
485 } // loop over strips
487 for(ix=0;ix<GetNStrips();ix++){
488 signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingNL() * fMapA2->GetSignal(0,ix)
489 - res->GetSSDCouplingNR() * fMapA2->GetSignal(0,ix);
490 fMapA2->AddSignal(1,ix,signal);
491 if(signal>0.0) pList->AddNoise(1,ix,module,signal);
492 } // loop over strips
496 delete [] contrRight;
499 //______________________________________________________________________
500 void AliITSsimulationSSD::ApplyDeadChannels(Int_t module) {
501 // Kill dead channels setting gain to zero
503 AliITSCalibrationSSD* res = (AliITSCalibrationSSD*)GetCalibrationModel(module);
505 for(Int_t i=0;i<GetNStrips();i++){
507 if(res->IsPChannelBad(i)) res->SetGainP(i,0.0);
508 if(res->IsNChannelBad(i)) res->SetGainN(i,0.0);
510 } // loop over strips
514 //______________________________________________________________________
515 Float_t AliITSsimulationSSD::F(Float_t av, Float_t x, Float_t s) {
516 // Computes the integral of a gaussian using Error Function
517 Float_t sqrt2 = TMath::Sqrt(2.0);
518 Float_t sigm2 = sqrt2*s;
521 integral = 0.5 * AliMathBase::ErfFast( (x - av) / sigm2);
524 //______________________________________________________________________
525 void AliITSsimulationSSD::IntegrateGaussian(Int_t k,Double_t par, Double_t w,
527 Double_t inf, Double_t sup,
528 AliITSTableSSD *tav) {
529 // integrate the diffusion gaussian
530 // remind: inf and sup are w-3sigma and w+3sigma
531 // we could define them here instead of passing them
532 // this way we are free to introduce asimmetry
534 Double_t a=0.0, b=0.0;
535 Double_t dXCharge1 = 0.0, dXCharge2 = 0.0;
536 // dXCharge1 and 2 are the charge to two neighbouring strips
537 // Watch that we only involve at least two strips
538 // Numbers greater than 2 of strips in a cluster depend on
539 // geometry of the track and delta rays, not charge diffusion!
541 Double_t strip = TMath::Floor(w); // closest strip on the left
543 if ( TMath::Abs((strip - w)) < 0.5) {
544 // gaussian mean is closer to strip on the left
545 a = inf; // integration starting point
546 if((strip+0.5)<=sup) {
547 // this means that the tail of the gaussian goes beyond
548 // the middle point between strips ---> part of the signal
549 // is given to the strip on the right
550 b = strip + 0.5; // integration stopping point
551 dXCharge1 = F( w, b, sigma) - F(w, a, sigma);
552 dXCharge2 = F( w, sup, sigma) - F(w ,b, sigma);
554 // this means that all the charge is given to the strip on the left
556 dXCharge1 = 0.9973; // gaussian integral at 3 sigmas
559 dXCharge1 = par * dXCharge1;// normalize by mean of number of carriers
560 dXCharge2 = par * dXCharge2;
562 // for the time being, signal is the charge
563 // in ChargeToSignal signal is converted in ADC channel
564 fMapA2->AddSignal(k,(Int_t)strip,dXCharge1);
565 tav->Add(k,(Int_t)strip);
566 if(((Int_t) strip) < (GetNStrips()-1)) {
567 // strip doesn't have to be the last (remind: last=GetNStrips()-1)
568 // otherwise part of the charge is lost
569 fMapA2->AddSignal(k,((Int_t)strip+1),dXCharge2);
570 tav->Add(k,((Int_t)(strip+1)));
573 // gaussian mean is closer to strip on the right
574 strip++; // move to strip on the rigth
575 b = sup; // now you know where to stop integrating
576 if((strip-0.5)>=inf) {
577 // tail of diffusion gaussian on the left goes left of
578 // middle point between strips
579 a = strip - 0.5; // integration starting point
580 dXCharge1 = F(w, b, sigma) - F(w, a, sigma);
581 dXCharge2 = F(w, a, sigma) - F(w, inf, sigma);
584 dXCharge1 = 0.9973; // gaussian integral at 3 sigmas
587 dXCharge1 = par * dXCharge1; // normalize by means of carriers
588 dXCharge2 = par * dXCharge2;
589 // for the time being, signal is the charge
590 // in ChargeToSignal signal is converted in ADC channel
591 fMapA2->AddSignal(k,(Int_t)strip,dXCharge1);
592 tav->Add(k,(Int_t)strip);
593 if(((Int_t) strip) > 0) {
594 // strip doesn't have to be the first
595 // otherwise part of the charge is lost
596 fMapA2->AddSignal(k,((Int_t)strip-1),dXCharge2);
597 tav->Add(k,((Int_t)(strip-1)));
601 //______________________________________________________________________
602 Int_t AliITSsimulationSSD::NumOfSteps(Double_t x, Double_t y, Double_t z,
603 Double_t &dex,Double_t &dey,
606 // it also returns steps for each coord
607 //AliITSsegmentationSSD *seg = new AliITSsegmentationSSD();
609 Double_t step = 25E-4;
610 //step = (Double_t) seg->GetStepSize(); // step size (cm)
611 Int_t numOfSteps = (Int_t) (TMath::Sqrt(x*x+y*y+z*z)/step);
613 if (numOfSteps < 1) numOfSteps = 1; // one step, at least
616 // we could condition the stepping depending on the incident angle
624 //----------------------------------------------------------------------
625 void AliITSsimulationSSD::GetList(Int_t label,Int_t hit,Int_t mod,
626 AliITSpList *pList,AliITSTableSSD *tav) {
627 // loop over nonzero digits
631 for(Int_t k=0; k<2; k++) {
634 signal = fMapA2->GetSignal(k,ix);
638 } // end if signal==0.0
639 // check the signal magnitude
640 for(i=0;i<pList->GetNSignals(k,ix);i++){
641 signal -= pList->GetTSignal(k,ix,i);
643 // compare the new signal with already existing list
644 if(signal>0)pList->AddSignal(k,ix,label,hit,mod,signal);
646 } // end of loop on strips
647 } // end of loop on P/N side
650 //----------------------------------------------------------------------
651 void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) {
653 static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
654 Float_t threshold = 0.;
655 Int_t size = AliITSdigitSSD::GetNTracks();
656 Int_t * digits = new Int_t[size];
657 Int_t * tracks = new Int_t[size];
658 Int_t * hits = new Int_t[size];
660 Float_t charges[3] = {0.0,0.0,0.0};
662 AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
663 AliITSSimuParam* simpar = fDetType->GetSimuParam();
665 for(Int_t k=0;k<2;k++){ // both sides (0=Pside, 1=Nside)
666 for(Int_t ix=0;ix<GetNStrips();ix++){ // loop over strips
668 // if strip is dead -> gain=0
669 if( ((k==0)&&(res->GetGainP(ix)==0)) || ((k==1)&&(res->GetGainN(ix)==0))) continue;
671 signal = fMapA2->GetSignal(k,ix);
672 // signal has to be uncalibrated
673 // In real life, gains are supposed to be calculated from calibration runs,
674 // stored in the calibration DB and used in the reconstruction
675 // (see AliITSClusterFinderSSD.cxx)
676 if(k==0) signal /= res->GetGainP(ix);
677 else signal /= res->GetGainN(ix);
679 // signal is converted in unit of ADC
680 signal = res->GetSSDDEvToADC(signal);
681 if(signal>4095.) signal = 4095.;//if exceeding, accumulate last one
683 // threshold for zero suppression is set on the basis of the noise
684 // A good value is 3*sigma_noise
685 if(k==0) threshold = res->GetNoiseP(ix);
686 else threshold = res->GetNoiseN(ix);
688 threshold *= simpar->GetSSDZSThreshold(); // threshold at 3 sigma noise
690 if(signal < threshold) continue;
691 //cout<<signal<<" "<<threshold<<endl;
695 digits[2] = TMath::Nint(signal);
696 for(j1=0;j1<size;j1++)if(j1<pList->GetNEntries()){
697 // only three in digit.
698 tracks[j1] = pList->GetTrack(k,ix,j1);
699 hits[j1] = pList->GetHit(k,ix,j1);
705 aliITS->AddSimDigit(2,0,digits,tracks,hits,charges);
712 //______________________________________________________________________
713 void AliITSsimulationSSD::WriteSDigits(AliITSpList *pList){
714 // Fills the Summable digits Tree
716 static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
718 pList->GetMaxMapIndex(ni,nj);
719 for(i=0;i<ni;i++)for(j=0;j<nj;j++){
720 if(pList->GetSignalOnly(i,j)>0.0){
721 aliITS->AddSumDigit(*(pList->GetpListItem(i,j)));
722 if(GetDebug(4)) cout << "pListSSD: "<<*(pList->GetpListItem(i,j))
728 //______________________________________________________________________
729 void AliITSsimulationSSD::FillMapFrompList(AliITSpList *pList){
730 // Fills fMap2A from the pList of Summable digits
733 for(k=0;k<2;k++)for(ix=0;ix<GetNStrips();ix++)
734 fMapA2->AddSignal(k,ix,pList->GetSignal(k,ix));
737 //______________________________________________________________________
738 void AliITSsimulationSSD::Print(ostream *os){
739 //Standard output format for this class
741 //AliITSsimulation::Print(os);
743 *os << fDifConst[0] <<","<< fDifConst[1] <<",";
744 *os << fDriftVel[0] <<","<< fDriftVel[1];
745 //*os <<","; fDCS->Print(os);
746 //*os <<","; fMapA2->Print(os);
748 //______________________________________________________________________
749 void AliITSsimulationSSD::Read(istream *is){
750 // Standard output streaming function.
752 //AliITSsimulation::Read(is);
754 *is >> fDifConst[0] >> fDifConst[1];
755 *is >> fDriftVel[0] >> fDriftVel[1];
759 //______________________________________________________________________
760 ostream &operator<<(ostream &os,AliITSsimulationSSD &source){
761 // Standard output streaming function.
766 //______________________________________________________________________
767 istream &operator>>(istream &os,AliITSsimulationSSD &source){
768 // Standard output streaming function.
773 //______________________________________________________________________