- // Turns hits in SSD module into one or more digits.
- Float_t tang[2] = {0.0,0.0};
- GetSegmentation()->Angles(tang[0], tang[1]);//stereo<<->tan(stereo)~=stereo
- Double_t x, y, z;
- Double_t dex=0.0, dey=0.0, dez=0.0;
- Double_t pairs; // pair generation energy per step.
- Double_t sigma[2] = {0.,0.};// standard deviation of the diffusion gaussian
- Double_t tdrift[2] = {0.,0.}; // time of drift
- Double_t w;
- Double_t inf[2], sup[2], par0[2];
-
- // Steps in the module are determined "manually" (i.e. No Geant)
- // NumOfSteps divide path between entering and exiting hits in steps
- Int_t numOfSteps = NumOfSteps(x1, y1, z1, dex, dey, dez);
- // Enery loss is equally distributed among steps
- de = de/numOfSteps;
- pairs = de/GetIonizeE(); // e-h pairs generated
- for(Int_t j=0; j<numOfSteps; j++) { // stepping
- x = x0 + (j+0.5)*dex;
- y = y0 + (j+0.5)*dey;
- if ( y > (GetSegmentation()->Dy()/2+10)*1.0E-4 ) {
- // check if particle is within the detector
- Warning("HitToDigit",
- "hit out of detector y0=%e,y=%e,dey=%e,j =%e module=%d",
- y0,y,dey,j,module);
- return;
- } // end if
- z = z0 + (j+0.5)*dez;
- if(GetDebug(4)) cout <<"HitToDigit "<<x<<" "<<y<<" "<<z<< " "
- <<dex<<" "<<dey<<" "<<dez<<endl;
- // calculate drift time
- // y is the minimum path
- tdrift[0] = (y+(GetSegmentation()->Dy()*1.0E-4)/2)/GetDriftVelocity(0);
- tdrift[1] = ((GetSegmentation()->Dy()*1.0E-4)/2-y)/GetDriftVelocity(1);
-
- for(Int_t k=0; k<2; k++) { // both sides remember: 0=Pside 1=Nside
-
- tang[k]=TMath::Tan(tang[k]);
-
- // w is the coord. perpendicular to the strips
- /*
- if(k==0) {
- w = (x+(GetSegmentation()->Dx()*1.0E-4)/2) -
- (z+(GetSegmentation()->Dz()*1.0E-4)/2)*tang[k];
- }else{
- w = (x+(GetSegmentation()->Dx()*1.0E-4)/2) +
- (z-(GetSegmentation()->Dz()*1.0E-4)/2)*tang[k];
- } // end if
- w /= (GetStripPitch()*1.0E-4); //w is converted in units of pitch
- */
- { // replacement block for the above.
- Float_t xp=x*1.e+4,zp=z*1.e+4; // microns
- GetSegmentation()->GetPadTxz(xp,zp);
- if(k==0) w = xp; // P side strip number
- else w = zp; // N side strip number
- } // end test block
-
- if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
- // this check rejects hits in regions not covered by strips
- // 0.5 takes into account boundaries
- if(GetDebug(4)) cout << "x,z="<<x<<","<<z<<" w="<<w
- <<" Nstrips="<<GetNStrips()<<endl;
- return; // There are dead region on the SSD sensitive volume.
- } // end if
-
- // sigma is the standard deviation of the diffusion gaussian
- if(tdrift[k]<0) return;
- sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
- sigma[k] /= (GetStripPitch()*1.0E-4); //units of Pitch
- if(sigma[k]==0.0) {
- Error("HitToDigit"," sigma[%d]=0",k);
- exit(0);
- } // end if
-
- par0[k] = pairs;
- // we integrate the diffusion gaussian from -3sigma to 3sigma
- inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average
- sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
- // IntegrateGaussian does the actual
- // integration of diffusion gaussian
- IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
- } // end for loop over side (0=Pside, 1=Nside)
- } // end stepping
+
+ // hit to digit conversion
+
+ AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
+ // Turns hits in SSD module into one or more digits.
+ //Float_t tang[2] = {0.0,0.0};
+ //seg->Angles(tang[0], tang[1]);//stereo<<->tan(stereo)~=stereo
+ Double_t x, y, z;
+ Double_t dex=0.0, dey=0.0, dez=0.0;
+ Double_t pairs; // pair generation energy per step.
+ Double_t sigma[2] = {0.,0.};// standard deviation of the diffusion gaussian
+ Double_t tdrift[2] = {0.,0.}; // time of drift
+ Double_t w;
+ Double_t inf[2], sup[2], par0[2];
+
+ // Steps in the module are determined "manually" (i.e. No Geant)
+ // NumOfSteps divide path between entering and exiting hits in steps
+ Int_t numOfSteps = NumOfSteps(x1, y1, z1, dex, dey, dez);
+ // Enery loss is equally distributed among steps
+ de = de/numOfSteps;
+ pairs = de/GetIonizeE(); // e-h pairs generated
+
+ //-----------------------------------------------------
+ // stepping
+ //-----------------------------------------------------
+ for(Int_t j=0; j<numOfSteps; j++) { // stepping
+
+ x = x0 + (j+0.5)*dex;
+ y = y0 + (j+0.5)*dey;
+ if ( y > (seg->Dy()/2+10)*1.0E-4 ) {
+ // check if particle is within the detector
+ Warning("HitToDigit",
+ "hit out of detector y0=%e,y=%e,dey=%e,j =%d module=%d, exceed=%e",
+ y0,y,dey,j,module, y-(seg->Dy()/2+10)*1.0E-4);
+ return;
+ } // end if
+ z = z0 + (j+0.5)*dez;
+
+ if(GetDebug(4)) cout <<"HitToDigit "<<x<<" "<<y<<" "<<z<< " "
+ <<dex<<" "<<dey<<" "<<dez<<endl;
+
+ if(seg->GetLayer()==6) {
+ y=-y; // Lay6 module has sensor up-side-down!!!
+ }
+
+ // w is the coord. perpendicular to the strips
+ // Float_t xp=x*1.e+4,zp=z*1.e+4; // microns
+ Float_t xp=x,zp=z;
+ seg->GetPadTxz(xp,zp);
+
+ Int_t k;
+ //---------------------------------------------------------
+ // Pside
+ //------------------------------------------------------------
+ k=0;
+
+ // calculate drift time
+ // y is the minimum path
+ tdrift[0] = (y+(seg->Dy()*1.0E-4)/2)/GetDriftVelocity(0);
+
+ w = xp; // P side strip number
+
+ if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
+ // this check rejects hits in regions not covered by strips
+ // 0.5 takes into account boundaries
+ if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
+ return; // There are dead region on the SSD sensitive volume!!!
+ } // end if
+
+ // sigma is the standard deviation of the diffusion gaussian
+ if(tdrift[k]<0) return;
+
+ sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
+ sigma[k] /= (GetStripPitch()*1.0E-4); //units of Pitch
+
+ if(sigma[k]==0.0) {
+ Error("HitToDigit"," sigma[%d]=0",k);
+ exit(0);
+ } // end if
+
+ par0[k] = pairs;
+ // we integrate the diffusion gaussian from -3sigma to 3sigma
+ inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average
+ sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
+ // IntegrateGaussian does the actual
+ // integration of diffusion gaussian
+ IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
+
+ //------------------------------------------------------
+ // end Pside
+ //-------------------------------------------------------
+
+ //------------------------------------------------------
+ // Nside
+ //-------------------------------------------------------
+ k=1;
+ tdrift[1] = ((seg->Dy()*1.0E-4)/2-y)/GetDriftVelocity(1);
+
+ //tang[k]=TMath::Tan(tang[k]);
+
+ w = zp; // N side strip number
+
+ if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
+ // this check rejects hits in regions not covered by strips
+ // 0.5 takes into account boundaries
+ if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
+ return; // There are dead region on the SSD sensitive volume.
+ } // end if
+
+ // sigma is the standard deviation of the diffusion gaussian
+ if(tdrift[k]<0) return;
+
+ sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
+ sigma[k] /= (GetStripPitch()*1.0E-4); //units of Pitch
+
+ if(sigma[k]==0.0) {
+ Error("HitToDigit"," sigma[%d]=0",k);
+ exit(0);
+ } // end if
+
+ par0[k] = pairs;
+ // we integrate the diffusion gaussian from -3sigma to 3sigma
+ inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average
+ sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
+ // IntegrateGaussian does the actual
+ // integration of diffusion gaussian
+ IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
+
+ //-------------------------------------------------
+ // end Nside
+ //-------------------------------------------------
+
+
+ } // end stepping