- if(!mod->LineSegmentL(ii,xL[0],dxL[0],xL[1],dxL[1],xL[2],dxL[2],
- depEnergy,itrack)) continue;
- 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",
- "This particle has passed without losing energy!");
- 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 %e",drPath);
- 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","Warning: negative drift path %e",
- driftPath);
- 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","Z = %e",
- xAnode*anodePitch);
- iAnode = (Int_t) (1.+xAnode); // xAnode?
- if(iAnode < 1 || iAnode > nofAnodes) {
- Warning("HitToAnalogDigits","Wrong iAnode: %d",iAnode);
- 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) :
+ 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) {
+ AliDebug(1,
+ Form("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) {
+ AliDebug(1, // this should be fixed at geometry level
+ Form("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) {
+ AliDebug(1, // this should be fixed at geometry level
+ Form("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 (xanode=%e)",
+ iAnode,nofAnodes, xAnode);
+ 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) :