CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef Tracker_SiLinearChargeDivider_H
00002 #define Tracker_SiLinearChargeDivider_H
00003 
00004 #include <memory>
00005 
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 
00008 #include "SiChargeDivider.h"
00009 #include "SimTracker/Common/interface/SiG4UniversalFluctuation.h"
00010 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00011 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
00012 #include "Geometry/CommonTopologies/interface/StripTopology.h"
00013 
00014 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00015 
00016 namespace CLHEP{
00017   class HepRandomEngine;
00018 }
00019 
00027 class SiLinearChargeDivider : public SiChargeDivider{
00028  public:
00029 
00030   // constructor
00031   SiLinearChargeDivider(const edm::ParameterSet& conf, CLHEP::HepRandomEngine&);
00032 
00033   // destructor
00034   virtual ~SiLinearChargeDivider();
00035 
00036   // main method: divide the charge (from the PSimHit) into several energy deposits in the bulk
00037   SiChargeDivider::ionization_type divide(const PSimHit*, const LocalVector&, double, const StripGeomDetUnit& det);
00038 
00039   // set the ParticleDataTable (used to fluctuate the charge properly)
00040   void setParticleDataTable(const ParticleDataTable * pdt) { theParticleDataTable = pdt; }
00041   
00042  private:
00043   // configuration data
00044   const bool   peakMode;
00045   const bool   fluctuateCharge;
00046   const int    chargedivisionsPerStrip;
00047   const double deltaCut ;
00048   const double cosmicShift;
00049 
00050   const ParticleDataTable * theParticleDataTable;
00051   // random generator
00052   CLHEP::HepRandomEngine& rndEngine;
00053   // Geant4 engine used by fluctuateEloss()
00054   std::unique_ptr<SiG4UniversalFluctuation> fluctuate; 
00055   // utility: drifts the charge to the surface to estimate the number of relevant strips
00056   inline float driftXPos(const Local3DPoint& pos, const LocalVector& drift, double thickness) { 
00057     return pos.x()+(thickness/2.-pos.z())*drift.x()/drift.z();
00058   }
00059   // fluctuate the Eloss
00060   void fluctuateEloss(int particleId, float momentum, float eloss, float length, int NumberOfSegmentation, float elossVector[]);
00061   // time response (from the pulse shape)
00062   inline float TimeResponse( const PSimHit* hit, const StripGeomDetUnit& det) {
00063     return (peakMode ? PeakShape(hit,det) : DeconvolutionShape(hit,det));
00064   } 
00065   // pulse shape in peak mode
00066   float PeakShape(const PSimHit*, const StripGeomDetUnit& det);
00067   // pulse shape in deconvolution mode
00068   float DeconvolutionShape( const PSimHit*, const StripGeomDetUnit& det);
00069   // data table for pulse shape in peak mode
00070   static float peakValues[921];
00071   // data table for pulse shape in deconvolution mode
00072   static float decoValues[651];
00073 
00074 };
00075 
00076 #endif