CMS 3D CMS Logo

/afs/cern.ch/work/c/cnuttens/private/SiStripDev/DocumentationProduction/CMSSW_6_1_0/src/SimTracker/SiStripDigitizer/plugins/SiLinearChargeCollectionDrifter.cc

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