CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/SimTracker/SiStripDigitizer/interface/SiStripDigitizerAlgorithm.h

Go to the documentation of this file.
00001 #ifndef SiStripDigitizerAlgorithm_h
00002 #define SiStripDigitizerAlgorithm_h
00003 
00010 #include <string>
00011 
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 
00014 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00015 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
00016 #include "DataFormats/DetId/interface/DetId.h"
00017 #include "DataFormats/Common/interface/DetSet.h"
00018 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00019 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
00020 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
00021 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
00022 #include "CondFormats/SiStripObjects/interface/SiStripThreshold.h"
00023 #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
00024 #include "CalibFormats/SiStripObjects/interface/SiStripGain.h"
00025 #include "SimTracker/SiStripDigitizer/interface/SiTrivialDigitalConverter.h"
00026 #include "SimTracker/SiStripDigitizer/interface/SiGaussianTailNoiseAdder.h"
00027 #include "SimTracker/SiStripDigitizer/interface/SiHitDigitizer.h"
00028 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00029 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
00030 #include "Geometry/CommonTopologies/interface/StripTopology.h"
00031 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00032 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00033 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripFedZeroSuppression.h"
00034 
00035 namespace CLHEP {
00036   class HepRandomEngine;
00037 }
00038 
00039 class SiStripDigitizerAlgorithm {
00040  public:
00041   typedef SiDigitalConverter::DigitalVecType DigitalVecType;
00042   typedef SiDigitalConverter::DigitalRawVecType DigitalRawVecType;
00043   typedef SiPileUpSignals::HitToDigisMapType HitToDigisMapType;
00044   typedef SiPileUpSignals::HitCounterToDigisMapType HitCounterToDigisMapType;
00045   typedef std::map< int, float, std::less<int> > hit_map_type;
00046   typedef float Amplitude;
00047   
00048   // Constructor
00049   SiStripDigitizerAlgorithm(const edm::ParameterSet& conf, CLHEP::HepRandomEngine&);
00050 
00051   // Destructor
00052   ~SiStripDigitizerAlgorithm();
00053 
00054   // Runs the algorithm
00055   void  run(edm::DetSet<SiStripDigi>&, edm::DetSet<SiStripRawDigi>&,
00056             const std::vector<std::pair<const PSimHit*, int > >  &, 
00057             StripGeomDetUnit *, GlobalVector, float, 
00058             edm::ESHandle<SiStripGain> &, edm::ESHandle<SiStripThreshold> &, 
00059             edm::ESHandle<SiStripNoises> &, edm::ESHandle<SiStripPedestals> &, edm::ESHandle<SiStripBadStrip> &);
00060 
00061   // digisimlink
00062   std::vector<StripDigiSimLink> make_link() { return link_coll; }
00063 
00064   // ParticleDataTable
00065   void setParticleDataTable(const ParticleDataTable * pardt) {
00066         theSiHitDigitizer->setParticleDataTable(pardt); 
00067         pdt= pardt; 
00068   }
00069   
00070  private:
00071   edm::ParameterSet conf_;
00072   double theElectronPerADC;
00073   double theThreshold;
00074   double cmnRMStib;
00075   double cmnRMStob;
00076   double cmnRMStid;
00077   double cmnRMStec;
00078   double APVSaturationProb;          
00079   bool peakMode;
00080   bool noise;
00081   bool RealPedestals;              
00082   bool SingleStripNoise;          
00083   bool CommonModeNoise;           
00084   bool BaselineShift;             
00085   bool APVSaturationFromHIP;
00086   
00087   int theFedAlgo;
00088   bool zeroSuppression;
00089   double theTOFCutForPeak;
00090   double theTOFCutForDeconvolution;
00091   double tofCut;
00092   int numStrips; 
00093   int strip;     
00094   //double noiseRMS;
00095   //double pedValue;
00096   double cosmicShift;
00097   double inefficiency;
00098   double pedOffset;
00099 
00100   size_t firstChannelWithSignal;
00101   size_t lastChannelWithSignal;
00102   size_t localFirstChannel;
00103   size_t localLastChannel;
00104 
00105   // local amplitude of detector channels (from processed PSimHit)
00106   std::vector<double> locAmpl;
00107   // total amplitude of detector channels
00108   std::vector<double> detAmpl;
00109 
00110   const ParticleDataTable * pdt;
00111   const ParticleData * particle;
00112   
00113   SiHitDigitizer* theSiHitDigitizer;
00114   SiPileUpSignals* theSiPileUpSignals;
00115   SiGaussianTailNoiseAdder* theSiNoiseAdder;
00116   SiTrivialDigitalConverter* theSiDigitalConverter;
00117   SiStripFedZeroSuppression* theSiZeroSuppress;
00118   CLHEP::HepRandomEngine& rndEngine;
00119 
00120   DigitalVecType digis;
00121   DigitalRawVecType rawdigis;
00122   std::vector<StripDigiSimLink> link_coll;
00123   CLHEP::RandFlat *theFlatDistribution;
00124 
00125   void push_link(const DigitalVecType&,
00126                  const HitToDigisMapType&,
00127                  const HitCounterToDigisMapType&,
00128                  const std::vector<double>&,
00129                  unsigned int);
00130   
00131   void push_link_raw(const DigitalRawVecType&,
00132                      const HitToDigisMapType&,
00133                      const HitCounterToDigisMapType&,
00134                      const std::vector<double>&,
00135                      unsigned int);
00136 };
00137 
00138 #endif