Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:36

0001 #ifndef _TRACKER_SiHitDigitizer_H_
0002 #define _TRACKER_SiHitDigitizer_H_
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 
0006 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
0007 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0008 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
0009 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0010 #include "SiChargeCollectionDrifter.h"
0011 #include "SiChargeDivider.h"
0012 #include "SiInduceChargeOnStrips.h"
0013 #include "SimTracker/SiStripDigitizer/interface/SiPileUpSignals.h"
0014 
0015 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0016 
0017 #include <map>
0018 #include <memory>
0019 
0020 class TrackerTopology;
0021 
0022 class SiStripDetType;
0023 
0024 namespace CLHEP {
0025   class HepRandomEngine;
0026 }
0027 
0028 /**
0029 * Digitizes the response for a single SimHit.
0030 */
0031 class SiHitDigitizer {
0032 public:
0033   SiHitDigitizer(const edm::ParameterSet& conf);
0034 
0035   ~SiHitDigitizer();
0036 
0037   void setChargeDivider(SiChargeDivider* cd) { theSiChargeDivider.reset(cd); }
0038 
0039   void setChargeCollectionDrifter(SiChargeCollectionDrifter* cd) { theSiChargeCollectionDrifter.reset(cd); }
0040 
0041   void setInduceChargeOnStrips(SiInduceChargeOnStrips* cd) { theSiInduceChargeOnStrips.reset(cd); }
0042 
0043   void setParticleDataTable(const ParticleDataTable* pdt) { theSiChargeDivider->setParticleDataTable(pdt); }
0044 
0045   void processHit(const PSimHit*,
0046                   const StripGeomDetUnit&,
0047                   GlobalVector,
0048                   float,
0049                   std::vector<float>&,
0050                   size_t&,
0051                   size_t&,
0052                   const TrackerTopology* tTopo,
0053                   CLHEP::HepRandomEngine*);
0054 
0055 private:
0056   const double depletionVoltage;
0057   const double chargeMobility;
0058   std::unique_ptr<SiChargeDivider> theSiChargeDivider;
0059   std::unique_ptr<SiChargeCollectionDrifter> theSiChargeCollectionDrifter;
0060   std::unique_ptr<const SiInduceChargeOnStrips> theSiInduceChargeOnStrips;
0061 
0062   typedef GloballyPositioned<double> Frame;
0063 
0064   LocalVector DriftDirection(const StripGeomDetUnit* _detp, GlobalVector _bfield, float langle) {
0065     LocalVector Bfield = Frame(_detp->surface().position(), _detp->surface().rotation()).toLocal(_bfield);
0066     return LocalVector(-langle * Bfield.y(), langle * Bfield.x(), 1.);
0067   }
0068 };
0069 
0070 #endif