00001 00002 // -------------------------------------------------------- 00003 // A class to simulated HPD ion feedback noise. 00004 // The deliverable of the class is the ion feedback noise 00005 // for an HcalDetId units of fC or GeV 00006 // 00007 // Project: HPD ion feedback 00008 // Author: T.Yetkin University of Iowa, Feb. 16, 2010 00009 // $Id: HPDIonFeedbackSim.h,v 1.3 2011/02/23 19:51:51 rpw Exp $ 00010 // -------------------------------------------------------- 00011 00012 #ifndef HcalSimAlgos_HPDIonFeedbackSim_h 00013 #define HcalSimAlgos_HPDIonFeedbackSim_h 00014 00015 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h" 00016 #include "DataFormats/HcalDetId/interface/HcalDetId.h" 00017 #include "CalibFormats/HcalObjects/interface/HcalDbService.h" 00018 #include "CalibFormats/CaloObjects/interface/CaloSamples.h" 00019 #include "DataFormats/DetId/interface/DetId.h" 00020 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVPECorrection.h" 00021 // CLHEP Random numbers 00022 #include "CLHEP/Random/RandBinomial.h" 00023 #include "CLHEP/Random/RandFlat.h" 00024 #include "CLHEP/Random/RandGaussQ.h" 00025 #include "CLHEP/Random/RandPoissonQ.h" 00026 class CaloShapes; 00027 00028 class HPDIonFeedbackSim: public CaloVPECorrection 00029 { 00030 public: 00032 HPDIonFeedbackSim(const edm::ParameterSet&, const CaloShapes * shapes); 00033 ~HPDIonFeedbackSim(); 00034 00035 //copied from HFSimParameters.h 00036 void setDbService(const HcalDbService * service) {theDbService = service;} 00038 void setRandomEngine(CLHEP::HepRandomEngine & engine); 00039 00040 // in units of fC 00041 virtual double correctPE(const DetId & detId, double npe) const; 00042 double getIonFeedback(DetId detId, double signal, double pedWidth, bool doThermal, bool isInGeV); 00043 00044 void addThermalNoise(CaloSamples & samples); 00045 00046 private: 00047 double fCtoGeV(const DetId & detId) const; 00048 const HcalDbService * theDbService; 00049 const CaloShapes * theShapes; 00050 00051 mutable CLHEP::RandBinomial * theRandBinomial; 00052 mutable CLHEP::RandFlat* theRandFlat; 00053 mutable CLHEP::RandGaussQ * theRandGauss; 00054 mutable CLHEP::RandPoissonQ* theRandPoissonQ; 00055 00056 }; 00057 #endif