CMS 3D CMS Logo

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

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