Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Tracker_SiLinearChargeDivider_H
0002 #define Tracker_SiLinearChargeDivider_H
0003 
0004 #include <memory>
0005 
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 
0008 #include "SiChargeDivider.h"
0009 #include "SimTracker/Common/interface/SiG4UniversalFluctuation.h"
0010 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0011 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
0012 #include "Geometry/CommonTopologies/interface/StripTopology.h"
0013 
0014 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0015 
0016 namespace CLHEP {
0017   class HepRandomEngine;
0018 }
0019 
0020 /**
0021  * Concrete implementation of SiChargeDivider. 
0022  * It divides the charge on the line connecting entry and exit point of the SimTrack in the Silicon.
0023  * Effects that are considered here are:
0024  * - fluctuations of the charge deposit fronm segment to segment
0025  * - pulse shape ( in peak of deconvolution mode)
0026  */
0027 class SiLinearChargeDivider : public SiChargeDivider {
0028 public:
0029   // constructor
0030   SiLinearChargeDivider(const edm::ParameterSet& conf);
0031 
0032   // destructor
0033   ~SiLinearChargeDivider() override;
0034 
0035   // main method: divide the charge (from the PSimHit) into several energy deposits in the bulk
0036   SiChargeDivider::ionization_type divide(
0037       const PSimHit*, const LocalVector&, double, const StripGeomDetUnit& det, CLHEP::HepRandomEngine*) override;
0038 
0039   // set the ParticleDataTable (used to fluctuate the charge properly)
0040   void setParticleDataTable(const ParticleDataTable* pdt) override { theParticleDataTable = pdt; }
0041 
0042 private:
0043   // configuration data
0044   const bool peakMode;
0045   const bool fluctuateCharge;
0046   const int chargedivisionsPerStrip;
0047   const double deltaCut;
0048   const double cosmicShift;
0049   const ParticleDataTable* theParticleDataTable;
0050   double pulseResolution;
0051   unsigned int pulset0Idx;
0052   std::vector<double> pulseValues;
0053 
0054   // Geant4 engine used by fluctuateEloss()
0055   std::unique_ptr<SiG4UniversalFluctuation> fluctuate;
0056   // utility: drifts the charge to the surface to estimate the number of relevant strips
0057   inline float driftXPos(const Local3DPoint& pos, const LocalVector& drift, double thickness) {
0058     return pos.x() + (thickness / 2. - pos.z()) * drift.x() / drift.z();
0059   }
0060   // fluctuate the Eloss
0061   void fluctuateEloss(double const particleMass,
0062                       float momentum,
0063                       float eloss,
0064                       float length,
0065                       int NumberOfSegmentation,
0066                       float elossVector[],
0067                       CLHEP::HepRandomEngine*);
0068   // time response (from the pulse shape)
0069   float TimeResponse(const PSimHit* hit, const StripGeomDetUnit& det);
0070   void readPulseShape(const std::string& pulseShapeFileName);
0071 };
0072 
0073 #endif