Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EcalSimAlgos_EcalTDigitizer_h
0002 #define EcalSimAlgos_EcalTDigitizer_h
0003 
0004 /** Turns hits into digis.  Assumes that 
0005     there's an ElectroncsSim class with the
0006     interface analogToDigital(CLHEP::HepRandomEngine*, const CaloSamples &, Digi &);
0007 */
0008 
0009 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
0010 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
0011 #include "DataFormats/DetId/interface/DetId.h"
0012 #include "CalibFormats/CaloObjects/interface/CaloTSamplesBase.h"
0013 #include "SimCalorimetry/EcalSimAlgos/interface/EcalBaseSignalGenerator.h"
0014 
0015 class EcalHitResponse;
0016 class EcalBaseSignalGenerator;
0017 
0018 namespace CLHEP {
0019   class HepRandomEngine;
0020 }
0021 
0022 template <class Traits>
0023 class EcalTDigitizer {
0024 public:
0025   typedef typename Traits::ElectronicsSim ElectronicsSim;
0026   typedef typename Traits::Digi Digi;
0027   typedef typename Traits::DigiCollection DigiCollection;
0028   typedef typename Traits::EcalSamples EcalSamples;
0029 
0030   EcalTDigitizer<Traits>(EcalHitResponse* hitResponse, ElectronicsSim* electronicsSim, bool addNoise);
0031 
0032   virtual ~EcalTDigitizer<Traits>();
0033 
0034   void add(const std::vector<PCaloHit>& hits, int bunchCrossing, CLHEP::HepRandomEngine*);
0035 
0036   virtual void initializeHits();
0037 
0038   virtual void run(DigiCollection& output, CLHEP::HepRandomEngine*);
0039 
0040   virtual void run(MixCollection<PCaloHit>& input, DigiCollection& output) { assert(0); }
0041 
0042   void setNoiseSignalGenerator(EcalBaseSignalGenerator* noiseSignalGenerator);
0043 
0044   void addNoiseSignals();
0045 
0046 protected:
0047   bool addNoise() const;
0048 
0049   const EcalHitResponse* hitResponse() const;
0050 
0051   const ElectronicsSim* elecSim() const;
0052 
0053 private:
0054   EcalHitResponse* m_hitResponse;
0055   ElectronicsSim* m_electronicsSim;
0056   bool m_addNoise;
0057 
0058   EcalBaseSignalGenerator* theNoiseSignalGenerator;
0059 };
0060 
0061 #endif