Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-18 22:24:07

0001 #ifndef _SimTracker_SiPhase2Digitizer_PixelDigitizerAlgorithm_h
0002 #define _SimTracker_SiPhase2Digitizer_PixelDigitizerAlgorithm_h
0003 
0004 #include "CondFormats/SiPixelObjects/interface/GlobalPixel.h"
0005 #include "CondFormats/DataRecord/interface/SiPixelQualityRcd.h"
0006 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
0007 #include "CondFormats/DataRecord/interface/SiPixelLorentzAngleSimRcd.h"
0008 #include "FWCore/Utilities/interface/ESGetToken.h"
0009 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0010 #include "SimTracker/SiPhase2Digitizer/plugins/Phase2TrackerDigitizerAlgorithm.h"
0011 
0012 class PixelDigitizerAlgorithm : public Phase2TrackerDigitizerAlgorithm {
0013 private:
0014   // A list of 2d points
0015   class TimewalkCurve {
0016   public:
0017     // pset must contain "charge" and "delay" of type vdouble
0018     TimewalkCurve(const edm::ParameterSet& pset);
0019 
0020     // linear interpolation
0021     double operator()(double x) const;
0022 
0023   private:
0024     std::vector<double> x_;
0025     std::vector<double> y_;
0026   };
0027 
0028   // Holds the timewalk model data
0029   class TimewalkModel {
0030   public:
0031     TimewalkModel(const edm::ParameterSet& pset);
0032 
0033     // returns the delay for given input charge and threshold
0034     double operator()(double q_in, double q_threshold) const;
0035 
0036   private:
0037     std::size_t find_closest_index(const std::vector<double>& vec, double value) const;
0038 
0039     std::vector<double> threshold_values;
0040     std::vector<TimewalkCurve> curves;
0041   };
0042 
0043 public:
0044   PixelDigitizerAlgorithm(const edm::ParameterSet& conf, edm::ConsumesCollector iC);
0045   ~PixelDigitizerAlgorithm() override;
0046 
0047   // initialization that cannot be done in the constructor
0048   void init(const edm::EventSetup& es) override;
0049 
0050   bool select_hit(const PSimHit& hit, double tCorr, double& sigScale) const override;
0051   bool isAboveThreshold(const DigitizerUtility::SimHitInfo* hitInfo, float charge, float thr) const override;
0052   void add_cross_talk(const Phase2TrackerGeomDetUnit* pixdet) override;
0053   void module_killing_DB(const Phase2TrackerGeomDetUnit* pixdet) override;
0054 
0055   // Addition four xtalk-related parameters to PixelDigitizerAlgorithm specific parameters initialized in Phase2TrackerDigitizerAlgorithm
0056   double odd_row_interchannelCoupling_next_row_;
0057   double even_row_interchannelCoupling_next_row_;
0058   double odd_column_interchannelCoupling_next_column_;
0059   double even_column_interchannelCoupling_next_column_;
0060 
0061   // Timewalk parameters
0062   bool apply_timewalk_;
0063   const TimewalkModel timewalk_model_;
0064 
0065   edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd> siPixelBadModuleToken_;
0066   edm::ESGetToken<SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd> siPixelLorentzAngleToken_;
0067   const edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> fedCablingMapToken_;
0068   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0069 };
0070 #endif