- Int_t ix0,Int_t iz0,
- Double_t el,Double_t sigx,Double_t sigz,
- Int_t t,Int_t hi){
- // Spreads the charge over neighboring cells. Assume charge is distributed
- // as charge(x,z) = (el/2*pi*sigx*sigz)*exp(-arg)
- // arg=((x-x0)*(x-x0)/2*sigx*sigx)+((z-z0*z-z0)/2*sigz*sigz)
- // Defined this way, the integral over all x and z is el.
- // Inputs:
- // Double_t x0 x position of point where charge is liberated
- // Double_t y0 y position of point where charge is liberated
- // Double_t z0 z position of point where charge is liberated
- // Int_t ix0 row of cell corresponding to point x0
- // Int_t iz0 columb of cell corresponding to point z0
- // Double_t el number of electrons liberated in this step
- // Double_t sigx Sigma difusion along x for this step (y0 dependent)
- // Double_t sigz Sigma difusion along z for this step (y0 dependent)
- // Int_t t track number
- // Int_t ti hit track index number
- // Int_t hi hit "hit" index number
- // Outputs:
- // none.
- // Return:
- // none.
- const Int_t knx = 3,knz = 2;
- const Double_t kRoot2 = 1.414213562; // Sqrt(2).
- const Double_t kmictocm = 1.0e-4; // convert microns to cm.
- Int_t ix,iz,ixs,ixe,izs,ize;
- Float_t x,z;
- Double_t x1,x2,z1,z2,s,spx,spz;
- AliITSsegmentationSPD* seg = (AliITSsegmentationSPD*)GetSegmentationModel(0);
-
-
- if(GetDebug(4)) Info("SpreadCharge","(x0=%e,z0=%e,ix0=%d,iz0=%d,el=%e,"
- "sig=%e,t=%d,i=%d)",x0,z0,ix0,iz0,el,sigx,sigz,t,hi);
- if(sigx<=0.0 || sigz<=0.0) { // if sig<=0 No diffusion to simulate.
- GetMap()->AddSignal(iz0,ix0,t,hi,GetModuleNumber(),el);
- if(GetDebug(2)){
- cout << "sigx<=0.0=" << sigx << endl;
- cout << "sigz<=0.0=" << sigz << endl;
- } // end if GetDebug
- return;
- } // end if
- spx = 1.0/(sigx*kRoot2); spz = 1.0/(sigz*kRoot2);
- if(GetDebug(2)){
- cout << "sigx=" << sigx << " spx=" << spx << endl;
- cout << "sigz=" << sigz << " spz=" << spz << endl;
- } // end if GetDebug
- ixs = TMath::Max(-knx+ix0,0);
- ixe = TMath::Min(knx+ix0,seg->Npx()-1);
- izs = TMath::Max(-knz+iz0,0);
- ize = TMath::Min(knz+iz0,seg->Npz()-1);
- for(ix=ixs;ix<=ixe;ix++) for(iz=izs;iz<=ize;iz++){
- seg->DetToLocal(ix,iz,x,z); // pixel center
- x1 = x;
- z1 = z;
- x2 = x1 + 0.5*kmictocm*seg->Dpx(ix); // Upper
- x1 -= 0.5*kmictocm*seg->Dpx(ix); // Lower
- z2 = z1 + 0.5*kmictocm*seg->Dpz(iz); // Upper
- z1 -= 0.5*kmictocm*seg->Dpz(iz); // Lower
- x1 -= x0; // Distance from where track traveled
- x2 -= x0; // Distance from where track traveled
- z1 -= z0; // Distance from where track traveled
- z2 -= z0; // Distance from where track traveled
- s = 0.25; // Correction based on definision of Erfc
- s *= TMath::Erfc(spx*x1) - TMath::Erfc(spx*x2);
- if(GetDebug(3)){
- cout <<"el="<<el<<" ix0="<<ix0<<" ix="<<ix<<" x0="<<x<<
- " iz0="<<iz0<<" iz="<<iz<<" z0="<<z<<
- " spx*x1="<<spx*x1<<" spx*x2="<<spx*x2<<" s="<<s;
- } // end if GetDebug
- s *= TMath::Erfc(spz*z1) - TMath::Erfc(spz*z2);
- if(GetDebug(3)){
- cout<<" spz*z1="<<spz*z1<<" spz*z2="<<spz*z2<<" s="<<s<< endl;
- } // end if GetDebug
- GetMap()->AddSignal(iz,ix,t,hi,GetModuleNumber(),s*el);
- } // end for ix, iz
+ Int_t ix0,Int_t iz0,
+ Double_t el,Double_t sigx,Double_t sigz,
+ Double_t ld,Int_t t,Int_t hi){
+ // Spreads the charge over neighboring cells. Assume charge is distributed
+ // as charge(x,z) = (el/2*pi*sigx*sigz)*exp(-arg)
+ // arg=((x-x0)*(x-x0)/2*sigx*sigx)+((z-z0*z-z0)/2*sigz*sigz)
+ // if fLorentz=kTRUE, then x0=x0+ld (Lorentz drift taken into account)
+ // Defined this way, the integral over all x and z is el.
+ // Inputs:
+ // Double_t x0 x position of point where charge is liberated
+ // Double_t z0 z position of point where charge is liberated
+ // Int_t ix0 row of cell corresponding to point x0
+ // Int_t iz0 columb of cell corresponding to point z0
+ // Double_t el number of electrons liberated in this step
+ // Double_t sigx Sigma difusion along x for this step (y0 dependent)
+ // Double_t sigz Sigma difusion along z for this step (y0 dependent)
+ // Double_t ld lorentz drift in x for this stip (y0 dependent)
+ // Int_t t track number
+ // Int_t ti hit track index number
+ // Int_t hi hit "hit" index number
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ const Int_t knx = 3,knz = 2;
+ const Double_t kRoot2 = 1.414213562; // Sqrt(2).
+ const Double_t kmictocm = 1.0e-4; // convert microns to cm.
+ Int_t ix,iz,ixs,ixe,izs,ize;
+ Float_t x,z;
+ Double_t x1,x2,z1,z2,s,spx,spz;
+ AliITSsegmentationSPD* seg = (AliITSsegmentationSPD*)GetSegmentationModel(0);
+
+
+ if(GetDebug(4)) Info("SpreadChargeAsym","(x0=%e,z0=%e,ix0=%d,iz0=%d,el=%e,"
+ "sigx=%e, sigz=%e, t=%d,i=%d)",x0,z0,ix0,iz0,el,sigx,sigz,t,hi);
+ if(sigx<=0.0 || sigz<=0.0) { // if sig<=0 No diffusion to simulate.
+ GetMap()->AddSignal(iz0,ix0,t,hi,GetModuleNumber(),el);
+ if(GetDebug(2)){
+ cout << "sigx<=0.0=" << sigx << endl;
+ cout << "sigz<=0.0=" << sigz << endl;
+ } // end if GetDebug
+ return;
+ } // end if
+ spx = 1.0/(sigx*kRoot2); spz = 1.0/(sigz*kRoot2);
+ if(GetDebug(2)){
+ cout << "sigx=" << sigx << " spx=" << spx << endl;
+ cout << "sigz=" << sigz << " spz=" << spz << endl;
+ } // end if GetDebug
+ ixs = TMath::Max(-knx+ix0,0);
+ ixe = TMath::Min(knx+ix0,seg->Npx()-1);
+ izs = TMath::Max(-knz+iz0,0);
+ ize = TMath::Min(knz+iz0,seg->Npz()-1);
+ for(ix=ixs;ix<=ixe;ix++) for(iz=izs;iz<=ize;iz++){
+ seg->DetToLocal(ix,iz,x,z); // pixel center
+ x1 = x;
+ z1 = z;
+ x2 = x1 + 0.5*kmictocm*seg->Dpx(ix); // Upper
+ x1 -= 0.5*kmictocm*seg->Dpx(ix); // Lower
+ z2 = z1 + 0.5*kmictocm*seg->Dpz(iz); // Upper
+ z1 -= 0.5*kmictocm*seg->Dpz(iz); // Lower
+ x1 -= x0+ld; // Distance from where track traveled (taking into account the Lorentz drift)
+ x2 -= x0+ld; // Distance from where track traveled (taking into account the Lorentz drift)
+ z1 -= z0; // Distance from where track traveled
+ z2 -= z0; // Distance from where track traveled
+ s = 0.25; // Correction based on definision of Erfc
+ s *= AliMathBase::ErfcFast(spx*x1) - AliMathBase::ErfcFast(spx*x2);
+ if(GetDebug(3)){
+ cout <<"el="<<el<<" ix0="<<ix0<<" ix="<<ix<<" x0="<<x<<
+ " iz0="<<iz0<<" iz="<<iz<<" z0="<<z<<
+ " spx*x1="<<spx*x1<<" spx*x2="<<spx*x2<<" s="<<s;
+ } // end if GetDebug
+ s *= AliMathBase::ErfcFast(spz*z1) - AliMathBase::ErfcFast(spz*z2);
+ if(GetDebug(3)){
+ cout<<" spz*z1="<<spz*z1<<" spz*z2="<<spz*z2<<" s="<<s<< endl;
+ } // end if GetDebug
+ GetMap()->AddSignal(iz,ix,t,hi,GetModuleNumber(),s*el);
+ } // end for ix, iz