Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-01-16 23:37:26

0001 #ifndef SimTracker_SiPhase2Digitizer_Pixel3DDigitizerAlgorithm_h
0002 #define SimTracker_SiPhase2Digitizer_Pixel3DDigitizerAlgorithm_h
0003 
0004 //-------------------------------------------------------------
0005 // class Pixel3DDigitizerAlgorithm
0006 //
0007 // Specialization of the tracker digitizer for the 3D pixel
0008 // sensors placed at PXB-Layer1 (and possibly Layer2), and
0009 // at PXF-Disk1 and Disk2
0010 //
0011 // Authors: Jordi Duarte-Campderros (CERN/IFCA)
0012 //          Clara Lasaosa Garcia (IFCA)
0013 //--------------------------------------------------------------
0014 
0015 #include "CondFormats/DataRecord/interface/SiPixelQualityRcd.h"
0016 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
0017 #include "CondFormats/DataRecord/interface/SiPixelLorentzAngleSimRcd.h"
0018 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0019 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0020 #include "FWCore/Utilities/interface/ESGetToken.h"
0021 #include "SimTracker/SiPhase2Digitizer/plugins/PixelDigitizerAlgorithm.h"
0022 
0023 // Data formats
0024 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0025 
0026 // system
0027 #include <functional>
0028 
0029 class Pixel3DDigitizerAlgorithm : public PixelDigitizerAlgorithm {
0030 public:
0031   Pixel3DDigitizerAlgorithm(const edm::ParameterSet& conf, edm::ConsumesCollector iC);
0032   ~Pixel3DDigitizerAlgorithm() override;
0033 
0034   bool select_hit(const PSimHit& hit, double tCorr, double& sigScale) const override;
0035   std::vector<digitizerUtility::SignalPoint> drift(
0036       const PSimHit& hit,
0037       const Phase2TrackerGeomDetUnit* pixdet,
0038       const GlobalVector& bfield,
0039       const std::vector<digitizerUtility::EnergyDepositUnit>& ionization_points) const override;
0040   // overload drift
0041   std::vector<digitizerUtility::SignalPoint> drift(
0042       const PSimHit& hit,
0043       const Phase2TrackerGeomDetUnit* pixdet,
0044       const GlobalVector& bfield,
0045       const std::vector<digitizerUtility::EnergyDepositUnit>& ionization_points,
0046       bool diffusion_activated) const;
0047 
0048   // New diffusion function: check implementation
0049   std::vector<digitizerUtility::EnergyDepositUnit> diffusion(const LocalPoint& pos,
0050                                                              const float& ncarriers,
0051                                                              const std::function<LocalVector(float, float)>& u_drift,
0052                                                              const std::pair<float, float> pitches,
0053                                                              const float& thickness) const;
0054   // Specific for 3D-pixel
0055   void induce_signal(std::vector<PSimHit>::const_iterator inputBegin,
0056                      const PSimHit& hit,
0057                      const size_t hitIndex,
0058                      const size_t firstHitIndex,
0059                      const uint32_t tofBin,
0060                      const Phase2TrackerGeomDetUnit* pixdet,
0061                      const std::vector<digitizerUtility::SignalPoint>& collection_points) override;
0062 
0063 private:
0064   // Radius of Column np and ohmic
0065   const float np_column_radius_;
0066   const float ohm_column_radius_;
0067   // Gap of np column
0068   const float np_column_gap_;
0069 
0070   edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd> siPixelBadModuleToken_;
0071   edm::ESGetToken<SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd> siPixelLorentzAngleToken_;
0072   const edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> fedCablingMapToken_;
0073   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0074 
0075   // Check if a carrier is inside the column: The point should
0076   // be described in the pixel cell frame
0077   const bool is_inside_n_column_(const LocalPoint& p, const float& sensor_thickness) const;
0078   const bool is_inside_ohmic_column_(const LocalPoint& p, const std::pair<float, float>& pitch) const;
0079 };
0080 #endif