Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HcalSimAlgos_HcalAmplifier_h
0002 #define HcalSimAlgos_HcalAmplifier_h
0003 
0004 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
0005 #include "CalibFormats/HcalObjects/interface/HcalCalibrationWidths.h"
0006 class CaloVSimParameterMap;
0007 class CaloVNoiseSignalGenerator;
0008 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVSimParameterMap.h"
0009 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
0010 
0011 class HcalDbService;
0012 class HPDIonFeedbackSim;
0013 class HcalTimeSlewSim;
0014 class HcalTimeSlew;
0015 
0016 namespace CLHEP {
0017   class HepRandomEngine;
0018 }
0019 
0020 class HcalAmplifier {
0021 public:
0022   HcalAmplifier(const CaloVSimParameterMap* parameters, bool addNoise, bool PreMix1, bool PreMix2);
0023 
0024   virtual ~HcalAmplifier() {}
0025 
0026   /// the Producer will probably update this every event
0027   void setDbService(const HcalDbService* service);
0028   void setIonFeedbackSim(HPDIonFeedbackSim* feedbackSim) { theIonFeedbackSim = feedbackSim; }
0029 
0030   /// if it's set, the amplifier will only use it to check
0031   /// if it has already added noise
0032   void setNoiseSignalGenerator(const CaloVNoiseSignalGenerator* noiseSignalGenerator) {
0033     theNoiseSignalGenerator = noiseSignalGenerator;
0034   }
0035   void setTimeSlewSim(HcalTimeSlewSim* timeSlewSim) { theTimeSlewSim = timeSlewSim; }
0036 
0037   const HcalTimeSlew* theTimeSlew = nullptr;
0038   void setTimeSlew(const HcalTimeSlew* timeSlew) { theTimeSlew = timeSlew; }
0039 
0040   virtual void amplify(CaloSamples& linearFrame, CLHEP::HepRandomEngine*) const;
0041 
0042   void setStartingCapId(int capId) { theStartingCapId = capId; }
0043 
0044 private:
0045   void pe2fC(CaloSamples& frame) const;
0046   void applyQIEdelay(CaloSamples& frame, int delayQIE) const;
0047   void addPedestals(CaloSamples& frame, CLHEP::HepRandomEngine*) const;
0048   void makeNoise(HcalGenericDetId::HcalGenericSubdetector hcalSubDet,
0049                  const HcalCalibrationWidths& width,
0050                  int fFrames,
0051                  double* fGauss,
0052                  double* fNoise) const;
0053 
0054   const HcalDbService* theDbService;
0055   const CaloVSimParameterMap* theParameterMap;
0056   const CaloVNoiseSignalGenerator* theNoiseSignalGenerator;
0057   HPDIonFeedbackSim* theIonFeedbackSim;
0058   HcalTimeSlewSim* theTimeSlewSim;
0059   unsigned theStartingCapId;
0060   bool addNoise_;
0061   bool preMixDigi_;
0062   bool preMixAdd_;
0063 };
0064 
0065 #endif