CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SimCalorimetry/HcalSimAlgos/interface/HcalAmplifier.h

Go to the documentation of this file.
00001 #ifndef HcalSimAlgos_HcalAmplifier_h
00002 #define HcalSimAlgos_HcalAmplifier_h
00003   
00004 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
00005 #include "CalibFormats/HcalObjects/interface/HcalCalibrationWidths.h"
00006 class CaloVSimParameterMap;
00007 class CaloVNoiseSignalGenerator;
00008 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVSimParameterMap.h"
00009 #include "CLHEP/Random/RandGaussQ.h"
00010 #include "CLHEP/Random/RandFlat.h"
00011 #include "CondFormats/HcalObjects/interface/HcalCholeskyMatrices.h"
00012 #include "CondFormats/HcalObjects/interface/HcalCholeskyMatrix.h"
00013 #include "CondFormats/HcalObjects/interface/HcalPedestals.h"
00014 #include "CondFormats/HcalObjects/interface/HcalPedestal.h"
00015 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
00016 
00017 class HcalDbService;
00018 class HPDIonFeedbackSim;
00019 class HcalTimeSlewSim;
00020 
00021 class HcalAmplifier {
00022 public:
00023   HcalAmplifier(const CaloVSimParameterMap * parameters, bool addNoise);
00024   virtual ~HcalAmplifier(){ delete theRandGaussQ; }
00025 
00027   void setDbService(const HcalDbService * service);
00028   void setRandomEngine(CLHEP::HepRandomEngine & engine);
00029   void setIonFeedbackSim(HPDIonFeedbackSim * feedbackSim) {theIonFeedbackSim = feedbackSim;}
00030 
00033   void setNoiseSignalGenerator(const CaloVNoiseSignalGenerator * noiseSignalGenerator) {
00034     theNoiseSignalGenerator = noiseSignalGenerator;
00035   }
00036   void setTimeSlewSim(const HcalTimeSlewSim * timeSlewSim) {
00037     theTimeSlewSim = timeSlewSim;
00038   }
00039 
00040   virtual void amplify(CaloSamples & linearFrame) const;
00041 
00042   void setStartingCapId(int capId) {theStartingCapId = capId;}
00043   void setHBtuningParameter(double tp);
00044   void setHEtuningParameter(double tp);
00045   void setHFtuningParameter(double tp);
00046   void setHOtuningParameter(double tp);
00047   void setUseOldHB(bool useOld);
00048   void setUseOldHE(bool useOld);
00049   void setUseOldHF(bool useOld);
00050   void setUseOldHO(bool useOld);
00051   void setCholesky(const HcalCholeskyMatrices * Cholesky) { myCholeskys = Cholesky; }
00052   void setADCPeds(const HcalPedestals * ADCPeds) { myADCPeds = ADCPeds; }
00053 
00054 private:
00055 
00056   void pe2fC(CaloSamples & frame) const;
00057   void addPedestals(CaloSamples & frame) const;
00058   void makeNoiseOld (HcalGenericDetId::HcalGenericSubdetector hcalSubDet, const HcalCalibrationWidths& width, int fFrames, double* fGauss, double* fNoise) const;
00059   void makeNoise (const HcalCholeskyMatrix & thisChanCholesky, int fFrames, double* fGauss, double* fNoise, int m) const;
00060 
00061   const HcalDbService * theDbService;
00062   CLHEP::RandGaussQ * theRandGaussQ;
00063   CLHEP::RandFlat * theRandFlat;
00064   const CaloVSimParameterMap * theParameterMap;
00065   const CaloVNoiseSignalGenerator * theNoiseSignalGenerator;
00066   HPDIonFeedbackSim * theIonFeedbackSim;
00067   const  HcalTimeSlewSim * theTimeSlewSim;
00068   unsigned theStartingCapId;
00069   bool addNoise_;
00070   bool useOldHB;
00071   bool useOldHE;
00072   bool useOldHF;
00073   bool useOldHO;
00074 
00075   double HB_ff;
00076   double HE_ff;
00077   double HF_ff;
00078   double HO_ff;
00079   const HcalCholeskyMatrices * myCholeskys;
00080   const HcalPedestals * myADCPeds;
00081 };
00082 
00083 #endif