CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/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 
00020 class HcalAmplifier {
00021 public:
00022   HcalAmplifier(const CaloVSimParameterMap * parameters, bool addNoise);
00023   virtual ~HcalAmplifier(){ delete theRandGaussQ; }
00024 
00026   void setDbService(const HcalDbService * service);
00027   void setRandomEngine(CLHEP::HepRandomEngine & engine);
00028   void setIonFeedbackSim(HPDIonFeedbackSim * feedbackSim) {theIonFeedbackSim = feedbackSim;}
00029 
00032   void setNoiseSignalGenerator(const CaloVNoiseSignalGenerator * noiseSignalGenerator) {
00033     theNoiseSignalGenerator = noiseSignalGenerator;
00034   }
00035 
00036   virtual void amplify(CaloSamples & linearFrame) const;
00037 
00038   void setStartingCapId(int capId) {theStartingCapId = capId;}
00039   void setHBtuningParameter(double tp);
00040   void setHEtuningParameter(double tp);
00041   void setHFtuningParameter(double tp);
00042   void setHOtuningParameter(double tp);
00043   void setUseOldHB(bool useOld);
00044   void setUseOldHE(bool useOld);
00045   void setUseOldHF(bool useOld);
00046   void setUseOldHO(bool useOld);
00047   void setCholesky(const HcalCholeskyMatrices * Cholesky) { myCholeskys = Cholesky; }
00048   void setADCPeds(const HcalPedestals * ADCPeds) { myADCPeds = ADCPeds; }
00049 
00050 private:
00051 
00052   void pe2fC(CaloSamples & frame) const;
00053   void addPedestals(CaloSamples & frame) const;
00054   void makeNoiseOld (HcalGenericDetId::HcalGenericSubdetector hcalSubDet, const HcalCalibrationWidths& width, int fFrames, double* fGauss, double* fNoise) const;
00055   void makeNoise (const HcalCholeskyMatrix & thisChanCholesky, int fFrames, double* fGauss, double* fNoise, int m) const;
00056 
00057   const HcalDbService * theDbService;
00058   CLHEP::RandGaussQ * theRandGaussQ;
00059   CLHEP::RandFlat * theRandFlat;
00060   const CaloVSimParameterMap * theParameterMap;
00061   const CaloVNoiseSignalGenerator * theNoiseSignalGenerator;
00062   HPDIonFeedbackSim * theIonFeedbackSim;
00063   unsigned theStartingCapId;
00064   bool addNoise_;
00065   bool useOldHB;
00066   bool useOldHE;
00067   bool useOldHF;
00068   bool useOldHO;
00069 
00070   double HB_ff;
00071   double HE_ff;
00072   double HF_ff;
00073   double HO_ff;
00074   const HcalCholeskyMatrices * myCholeskys;
00075   const HcalPedestals * myADCPeds;
00076 };
00077 
00078 #endif