-
- TObjArray *fHits = mod->GetHits();
- Int_t nhits = fHits->GetEntriesFast();
-// Int_t arg[6] = {0,0,0,0,0,0};
- Int_t dummy = 0;
- Int_t nofAnodes = fNofMaps/2;
- Float_t sddLength = fSegmentation->Dx();
- Float_t sddWidth = fSegmentation->Dz();
- Float_t anodePitch = fSegmentation->Dpz(dummy);
- Float_t timeStep = fSegmentation->Dpx(dummy);
- Float_t driftSpeed = fResponse->DriftSpeed();
- Float_t maxadc = fResponse->MaxAdc();
- Float_t topValue = fResponse->DynamicRange();
- Float_t cHloss = fResponse->ChargeLoss();
- Float_t norm = maxadc/topValue;
- Float_t dfCoeff, s1; fResponse->DiffCoeff(dfCoeff,s1); // Signal 2d Shape
- Double_t eVpairs = 3.6; // electron pair energy eV.
- Float_t nsigma = fResponse->NSigmaIntegration(); //
- Int_t nlookups = fResponse->GausNLookUp(); //
- Float_t jitter = ((AliITSresponseSDD*)fResponse)->JitterError(); //
-
- // Piergiorgio's part (apart for few variables which I made float
- // when i thought that can be done
- // Fill detector maps with GEANT hits
- // loop over hits in the module
-
- const Float_t kconv = 1.0e+6; // GeV->KeV
- Int_t itrack = 0;
- Int_t hitDetector; // detector number (lay,lad,hitDetector)
- Int_t iWing; // which detector wing/side.
- Int_t detector; // 2*(detector-1)+iWing
- Int_t ii,kk,ka,kt; // loop indexs
- Int_t ia,it,index; // sub-pixel integration indexies
- Int_t iAnode; // anode number.
- Int_t timeSample; // time buckett.
- Int_t anodeWindow; // anode direction charge integration width
- Int_t timeWindow; // time direction charge integration width
- Int_t jamin,jamax; // anode charge integration window
- Int_t jtmin,jtmax; // time charge integration window
- Int_t ndiv; // Anode window division factor.
- Int_t nsplit; // the number of splits in anode and time windows==1.
- Int_t nOfSplits; // number of times track length is split into
- Float_t nOfSplitsF; // Floating point version of nOfSplits.
- Float_t kkF; // Floating point version of loop index kk.
- Float_t pathInSDD; // Track length in SDD.
- Float_t drPath; // average position of track in detector. in microns
- Float_t drTime; // Drift time
- Float_t nmul; // drift time window multiplication factor.
- Float_t avDrft; // x position of path length segment in cm.
- Float_t avAnode; // Anode for path length segment in Anode number (float)
- Float_t xAnode; // Floating point anode number.
- Float_t driftPath; // avDrft in microns.
- Float_t width; // width of signal at anodes.
- Double_t depEnergy; // Energy deposited in this GEANT step.
- Double_t xL[3],dxL[3]; // local hit coordinates and diff.
- Double_t sigA; // sigma of signal at anode.
- Double_t sigT; // sigma in time/drift direction for track segment
- Double_t aStep,aConst; // sub-pixel size and offset anode
- Double_t tStep,tConst; // sub-pixel size and offset time
- Double_t amplitude; // signal amplitude for track segment in nanoAmpere
- Double_t chargeloss; // charge loss for track segment.
- Double_t anodeAmplitude; // signal amplitude in anode direction
- Double_t aExpo; // exponent of Gaussian anode direction
- Double_t timeAmplitude; // signal amplitude in time direction
- Double_t tExpo; // exponent of Gaussian time direction
-// Double_t tof; // Time of flight in ns of this step.
-
- for(ii=0; ii<nhits; ii++) {
- if(!mod->LineSegmentL(ii,xL[0],dxL[0],xL[1],dxL[1],xL[2],dxL[2],
- depEnergy,itrack)) continue;
- xL[0] += 0.0001*gRandom->Gaus( 0, jitter ); //
- depEnergy *= kconv;
- hitDetector = mod->GetDet();
- //tof = 1.E+09*(mod->GetHit(ii)->GetTOF()); // tof in ns.
- //if(tof>sddLength/driftSpeed) continue; // hit happed too late.
-
- // scale path to simulate a perpendicular track
- // continue if the particle did not lose energy
- // passing through detector
- if (!depEnergy) {
- Warning("HitsToAnalogDigits",
- "fTrack = %d hit=%d module=%d This particle has"
- " passed without losing energy!",
- itrack,ii,mod->GetIndex());
- continue;
- } // end if !depEnergy
-
- pathInSDD = TMath::Sqrt(dxL[0]*dxL[0]+dxL[1]*dxL[1]+dxL[2]*dxL[2]);
-
- if (fFlag && pathInSDD) { depEnergy *= (0.03/pathInSDD); }
- drPath = 10000.*(dxL[0]+2.*xL[0])*0.5;
- if(drPath < 0) drPath = -drPath;
- drPath = sddLength-drPath;
- if(drPath < 0) {
- Warning("HitsToAnalogDigits",
- "negative drift path drPath=%e sddLength=%e dxL[0]=%e "
- "xL[0]=%e",
- drPath,sddLength,dxL[0],xL[0]);
- continue;
- } // end if drPath < 0
-
- // Compute number of segments to brake step path into
- drTime = drPath/driftSpeed; // Drift Time
- sigA = TMath::Sqrt(2.*dfCoeff*drTime+s1*s1);// Sigma along the anodes
- // calcuate the number of time the path length should be split into.
- nOfSplits = (Int_t) (1. + 10000.*pathInSDD/sigA);
- if(fFlag) nOfSplits = 1;
-
- // loop over path segments, init. some variables.
- depEnergy /= nOfSplits;
- nOfSplitsF = (Float_t) nOfSplits;
- for(kk=0;kk<nOfSplits;kk++) { // loop over path segments
- kkF = (Float_t) kk + 0.5;
- avDrft = xL[0]+dxL[0]*kkF/nOfSplitsF;
- avAnode = xL[2]+dxL[2]*kkF/nOfSplitsF;
- driftPath = 10000.*avDrft;
-
- iWing = 2; // Assume wing is 2
- if(driftPath < 0) { // if wing is not 2 it is 1.
- iWing = 1;
- driftPath = -driftPath;
- } // end if driftPath < 0
- driftPath = sddLength-driftPath;
- detector = 2*(hitDetector-1) + iWing;
- if(driftPath < 0) {
- Warning("HitsToAnalogDigits","negative drift path "
- "driftPath=%e sddLength=%e avDrft=%e dxL[0]=%e "
- "xL[0]=%e",driftPath,sddLength,avDrft,dxL[0],xL[0]);
- continue;
- } // end if driftPath < 0
-
- // Drift Time
- drTime = driftPath/driftSpeed; // drift time for segment.
- timeSample = (Int_t) (fScaleSize*drTime/timeStep + 1);
- // compute time Sample including tof information. The tof only
- // effects the time of the signal is recoreded and not the
- // the defusion.
- // timeSample = (Int_t) (fScaleSize*(drTime+tof)/timeStep + 1);
- if(timeSample > fScaleSize*fMaxNofSamples) {
- Warning("HitsToAnalogDigits","Wrong Time Sample: %e",
- timeSample);
- continue;
- } // end if timeSample > fScaleSize*fMaxNoofSamples
-
- // Anode
- xAnode = 10000.*(avAnode)/anodePitch + nofAnodes/2; // +1?
- if(xAnode*anodePitch > sddWidth || xAnode*anodePitch < 0.)
- Warning("HitsToAnalogDigits",
- "Exceedubg sddWidth=%e Z = %e",
- sddWidth,xAnode*anodePitch);
- iAnode = (Int_t) (1.+xAnode); // xAnode?
- if(iAnode < 1 || iAnode > nofAnodes) {
- Warning("HitToAnalogDigits","Wrong iAnode: 1<%d>%d",
- iAnode,nofAnodes);
- continue;
- } // end if iAnode < 1 || iAnode > nofAnodes
-
- // store straight away the particle position in the array
- // of particles and take idhit=ii only when part is entering (this
- // requires FillModules() in the macro for analysis) :
+ AliITSsegmentationSDD* seg = (AliITSsegmentationSDD*)GetSegmentationModel(1);
+ AliITSCalibrationSDD* res = (AliITSCalibrationSDD*)GetCalibrationModel(fModule);
+ AliITSSimuParam* simpar = fDetType->GetSimuParam();
+ TObjArray *hits = mod->GetHits();
+ Int_t nhits = hits->GetEntriesFast();
+
+ // Int_t arg[6] = {0,0,0,0,0,0};
+ Int_t nofAnodes = fNofMaps/2;
+ Double_t sddLength = seg->Dx();
+ Double_t anodePitch = seg->Dpz(0);
+ Double_t timeStep = seg->Dpx(0);
+ Double_t driftSpeed ; // drift velocity (anode dependent)
+ Double_t nanoampToADC = simpar->GetSDDMaxAdc()/simpar->GetSDDDynamicRange(); // maxadc/topValue;
+ Double_t cHloss = simpar->GetSDDChargeLoss();
+ Float_t dfCoeff, s1;
+ simpar->GetSDDDiffCoeff(dfCoeff,s1); // Signal 2d Shape
+ Double_t eVpairs = simpar->GetGeVToCharge()*1.0E9; // 3.6 eV by def.
+ Double_t nsigma = simpar->GetNSigmaIntegration(); //
+ Int_t nlookups = simpar->GetGausNLookUp(); //
+ Float_t jitter = simpar->GetSDDJitterError(); //
+ Float_t mapsmear = simpar->GetSDDCorrMapPrecision(); //
+ Float_t trigDelay = simpar->GetSDDTrigDelay(); // compensation for MC time zero
+ if(res->IsAMAt20MHz()) trigDelay+=12.5; // compensation for discretization step
+
+ Float_t timeZero=fDetType->GetResponseSDD()->GetTimeZero(fModule);
+ Float_t adcscale = fDetType->GetResponseSDD()->GetADCtokeV(fModule);
+ adcscale/=simpar->GetSDDkeVtoADC();
+
+ // Piergiorgio's part (apart for few variables which I made float
+ // when i thought that can be done
+ // Fill detector maps with GEANT hits
+ // loop over hits in the module
+
+ const Float_t kconv = 1.0e+6; // GeV->KeV
+ Int_t itrack = 0;
+ Int_t iWing; // which detector wing/side.
+ Int_t ii,kk,ka,kt; // loop indexs
+ Int_t ia,it,index; // sub-pixel integration indexies
+ Int_t iAnode; // anode number.
+ Int_t timeSample; // time buckett.
+ Int_t anodeWindow; // anode direction charge integration width
+ Int_t timeWindow; // time direction charge integration width
+ Int_t jamin,jamax; // anode charge integration window
+ Int_t jtmin,jtmax; // time charge integration window
+ Int_t nsplitAn; // the number of splits in anode and time windows
+ Int_t nsplitTb; // the number of splits in anode and time windows
+ Int_t nOfSplits; // number of times track length is split into
+ Float_t nOfSplitsF; // Floating point version of nOfSplits.
+ Float_t kkF; // Floating point version of loop index kk.
+ Double_t pathInSDD; // Track length in SDD.
+ Double_t drPath; // average position of track in detector. in microns
+ Double_t drTime; // Drift time
+ Double_t avDrft; // x position of path length segment in cm.
+ Double_t avAnode; // Anode for path length segment in Anode number (float)
+ Double_t zAnode; // Floating point anode number.
+ Double_t driftPath; // avDrft in microns.
+ Double_t width; // width of signal at anodes.
+ Double_t depEnergy; // Energy deposited in this GEANT step.
+ Double_t xL[3],dxL[3]; // local hit coordinates and diff.
+ Double_t sigA; // sigma of signal at anode.
+ Double_t sigT; // sigma in time/drift direction for track segment
+ Double_t aStep,aConst; // sub-pixel size and offset anode
+ Double_t tStep,tConst; // sub-pixel size and offset time
+ Double_t amplitude; // signal amplitude for track segment in nanoAmpere
+ Double_t chargeloss; // charge loss for track segment.
+ Double_t anodeAmplitude; // signal amplitude in anode direction
+ Double_t aExpo; // exponent of Gaussian anode direction
+ Double_t timeAmplitude; // signal amplitude in time direction
+ Double_t tExpo; // exponent of Gaussian time direction
+ Double_t tof; // Time of flight in ns of this step.
+
+ for(ii=0; ii<nhits; ii++) {
+ if(!mod->LineSegmentL(ii,xL[0],dxL[0],xL[1],dxL[1],xL[2],dxL[2],
+ depEnergy,itrack)) continue;
+ Float_t xloc=xL[0];
+ if(xloc>0) iWing=0; // left side, carlos channel 0
+ else iWing=1; // right side