Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:38

0001 // -*- C++ -*-
0002 #ifndef HcalSimAlgos_HcalSiPMHitResponse_h
0003 #define HcalSimAlgos_HcalSiPMHitResponse_h
0004 
0005 #include "SimCalorimetry/CaloSimAlgos/interface/CaloHitResponse.h"
0006 #include "SimCalorimetry/HcalSimAlgos/interface/HcalSiPM.h"
0007 #include "SimCalorimetry/HcalSimAlgos/interface/HcalSiPMShape.h"
0008 
0009 #include <map>
0010 #include <set>
0011 #include <vector>
0012 
0013 namespace CLHEP {
0014   class HepRandomEngine;
0015 }
0016 
0017 class PCaloHitCompareTimes {
0018 public:
0019   bool operator()(const PCaloHit* a, const PCaloHit* b) const { return a->time() < b->time(); }
0020 };
0021 
0022 class HcalSiPMHitResponse : public CaloHitResponse {
0023 public:
0024   HcalSiPMHitResponse(const CaloVSimParameterMap* parameterMap,
0025                       const CaloShapes* shapes,
0026                       bool PreMix1 = false,
0027                       bool HighFidelity = true);
0028 
0029   ~HcalSiPMHitResponse() override;
0030 
0031   typedef std::vector<unsigned int> photonTimeHist;
0032   typedef std::map<DetId, photonTimeHist> photonTimeMap;
0033 
0034   void initializeHits() override;
0035 
0036   void finalizeHits(CLHEP::HepRandomEngine*) override;
0037 
0038   void add(const PCaloHit& hit, CLHEP::HepRandomEngine*) override;
0039 
0040   void add(const CaloSamples& signal) override;
0041 
0042   virtual void addPEnoise(CLHEP::HepRandomEngine* engine);
0043 
0044   virtual CaloSamples makeBlankSignal(const DetId& detId) const;
0045 
0046   virtual void setDetIds(const std::vector<DetId>& detIds);
0047 
0048   virtual int getReadoutFrameSize(const DetId& id) const;
0049 
0050 protected:
0051   virtual CaloSamples makeSiPMSignal(DetId const& id, photonTimeHist const& photons, CLHEP::HepRandomEngine*);
0052 
0053 private:
0054   HcalSiPM theSiPM;
0055   bool PreMixDigis;
0056   bool HighFidelityPreMix;
0057   int nbins;
0058   double dt, invdt;
0059 
0060   photonTimeMap precisionTimedPhotons;
0061 
0062   const std::vector<DetId>* theDetIds;
0063 
0064   std::map<int, HcalSiPMShape> shapeMap;
0065 };
0066 
0067 #endif  //HcalSimAlgos_HcalSiPMHitResponse_h