Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DigiSimLinkAlgorithm_h
0002 #define DigiSimLinkAlgorithm_h
0003 
0004 /** \DigiSimLinkAlgorithm
0005  *
0006  *
0007  ************************************************************/
0008 
0009 #include <string>
0010 
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 
0013 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0014 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
0015 #include "DataFormats/DetId/interface/DetId.h"
0016 #include "DataFormats/Common/interface/DetSet.h"
0017 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
0018 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
0019 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
0020 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
0021 #include "CondFormats/SiStripObjects/interface/SiStripThreshold.h"
0022 #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
0023 #include "CalibFormats/SiStripObjects/interface/SiStripGain.h"
0024 #include "SimTracker/SiStripDigitizer/interface/SiTrivialDigitalConverter.h"
0025 #include "SimTracker/SiStripDigitizer/interface/SiGaussianTailNoiseAdder.h"
0026 #include "SiHitDigitizer.h"
0027 #include "DigiSimLinkPileUpSignals.h"
0028 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0029 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
0030 #include "Geometry/CommonTopologies/interface/StripTopology.h"
0031 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
0032 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0033 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripFedZeroSuppression.h"
0034 
0035 namespace CLHEP {
0036   class HepRandomEngine;
0037 }
0038 
0039 class TrackerTopolgoy;
0040 
0041 class DigiSimLinkAlgorithm {
0042 public:
0043   typedef SiDigitalConverter::DigitalVecType DigitalVecType;
0044   typedef SiDigitalConverter::DigitalRawVecType DigitalRawVecType;
0045   typedef DigiSimLinkPileUpSignals::HitToDigisMapType HitToDigisMapType;
0046   typedef DigiSimLinkPileUpSignals::HitCounterToDigisMapType HitCounterToDigisMapType;
0047   typedef std::map<int, float, std::less<int> > hit_map_type;
0048   typedef float Amplitude;
0049 
0050   // Constructor
0051   DigiSimLinkAlgorithm(const edm::ParameterSet &conf);
0052 
0053   // Destructor
0054   ~DigiSimLinkAlgorithm();
0055 
0056   // Runs the algorithm
0057   void run(edm::DetSet<SiStripDigi> &,
0058            edm::DetSet<SiStripRawDigi> &,
0059            const std::vector<std::pair<const PSimHit *, int> > &,
0060            StripGeomDetUnit const *,
0061            GlobalVector,
0062            float,
0063            edm::ESHandle<SiStripGain> &,
0064            edm::ESHandle<SiStripThreshold> &,
0065            edm::ESHandle<SiStripNoises> &,
0066            edm::ESHandle<SiStripPedestals> &,
0067            edm::ESHandle<SiStripBadStrip> &,
0068            const TrackerTopology *tTopo,
0069            CLHEP::HepRandomEngine *);
0070 
0071   // digisimlink
0072   std::vector<StripDigiSimLink> make_link() { return link_coll; }
0073 
0074   // ParticleDataTable
0075   void setParticleDataTable(const ParticleDataTable *pardt) {
0076     theSiHitDigitizer->setParticleDataTable(pardt);
0077     pdt = pardt;
0078   }
0079 
0080 private:
0081   edm::ParameterSet conf_;
0082   double theElectronPerADC;
0083   double theThreshold;
0084   double cmnRMStib;
0085   double cmnRMStob;
0086   double cmnRMStid;
0087   double cmnRMStec;
0088   double APVSaturationProb;
0089   bool peakMode;
0090   bool noise;
0091   bool RealPedestals;
0092   bool SingleStripNoise;
0093   bool CommonModeNoise;
0094   bool BaselineShift;
0095   bool APVSaturationFromHIP;
0096 
0097   int theFedAlgo;
0098   bool zeroSuppression;
0099   double theTOFCutForPeak;
0100   double theTOFCutForDeconvolution;
0101   double tofCut;
0102   int numStrips;
0103   int strip;
0104   //double noiseRMS;
0105   //double pedValue;
0106   double cosmicShift;
0107   double inefficiency;
0108   double pedOffset;
0109   bool PreMixing_;
0110 
0111   size_t firstChannelWithSignal;
0112   size_t lastChannelWithSignal;
0113   size_t localFirstChannel;
0114   size_t localLastChannel;
0115 
0116   // local amplitude of detector channels (from processed PSimHit)
0117   std::vector<float> locAmpl;
0118   // total amplitude of detector channels
0119   std::vector<float> detAmpl;
0120 
0121   const ParticleDataTable *pdt;
0122   const ParticleData *particle;
0123 
0124   SiHitDigitizer *theSiHitDigitizer;
0125   DigiSimLinkPileUpSignals *theDigiSimLinkPileUpSignals;
0126   SiGaussianTailNoiseAdder *theSiNoiseAdder;
0127   SiTrivialDigitalConverter *theSiDigitalConverter;
0128   SiStripFedZeroSuppression *theSiZeroSuppress;
0129 
0130   DigitalVecType digis;
0131   DigitalRawVecType rawdigis;
0132   std::vector<StripDigiSimLink> link_coll;
0133 
0134   void push_link(const DigitalVecType &,
0135                  const HitToDigisMapType &,
0136                  const HitCounterToDigisMapType &,
0137                  const std::vector<float> &,
0138                  unsigned int);
0139 
0140   void push_link_raw(const DigitalRawVecType &,
0141                      const HitToDigisMapType &,
0142                      const HitCounterToDigisMapType &,
0143                      const std::vector<float> &,
0144                      unsigned int);
0145 };
0146 
0147 #endif