CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/SimTracker/SiStripDigitizer/src/SiLinearChargeCollectionDrifter.cc

Go to the documentation of this file.
00001 #include "SimTracker/SiStripDigitizer/interface/SiLinearChargeCollectionDrifter.h"
00002 
00003 SiLinearChargeCollectionDrifter::SiLinearChargeCollectionDrifter(double dc,
00004                                                                  double cdr,
00005                                                                  double dv,
00006                                                                  double av){
00007   // Everything which does not depend on the specific det
00008   diffusionConstant = dc;
00009   chargeDistributionRMS = cdr;
00010   depletionVoltage = dv;
00011   appliedVoltage = av;
00012 }
00013 
00014 SiChargeCollectionDrifter::collection_type SiLinearChargeCollectionDrifter::drift(const SiChargeCollectionDrifter::ionization_type ion, 
00015                                                                                   const LocalVector& driftDir,double mt, double tn) {
00016   // set some variables used in the main method
00017   moduleThickness = mt;
00018   timeNormalisation = tn;
00019   // prepare output
00020   collection_type _temp;
00021   _temp.resize(ion.size());
00022   // call the drift method for each deposit
00023   for (size_t i=0; i<ion.size(); i++){
00024     _temp[i] = drift(ion[i], driftDir);
00025   }
00026   return _temp;
00027 }
00028 
00029 SignalPoint SiLinearChargeCollectionDrifter::drift
00030 (const EnergyDepositUnit& edu, const LocalVector& drift) {
00031   // computes the fraction of the module the charge has to drift through,
00032   // ensuring it is bounded in [0,1]
00033   double depth = (moduleThickness/2.-edu.z());
00034   double thicknessFraction = depth/moduleThickness ; 
00035   thicknessFraction = thicknessFraction>0. ? thicknessFraction : 0. ;
00036   thicknessFraction = thicknessFraction<1. ? thicknessFraction : 1. ;
00037   
00038   // computes the drift time in the sensor
00039   double driftTime = -timeNormalisation*
00040     log(1.-2*depletionVoltage*thicknessFraction/
00041         (depletionVoltage+appliedVoltage))
00042     +chargeDistributionRMS;  
00043   
00044   // returns the signal: an energy on the surface, with a size due to diffusion.
00045   return SignalPoint(edu.x() + depth*drift.x()/drift.z(),
00046                      edu.y() + depth*drift.y()/drift.z(),
00047                      sqrt(2.*diffusionConstant*driftTime),
00048                      edu.energy());
00049 }
00050