00001 #include "SimCalorimetry/HcalSimProducers/src/HcalTestHitGenerator.h"
00002 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00003 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00004 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
00005
00006 HcalTestHitGenerator::HcalTestHitGenerator(const edm::ParameterSet & ps)
00007 : theBarrelSampling(ps.getParameter<edm::ParameterSet>("hb").getParameter<std::vector<double> >("samplingFactors")),
00008 theEndcapSampling(ps.getParameter<edm::ParameterSet>("he").getParameter<std::vector<double> >("samplingFactors"))
00009 {
00010 }
00011
00012
00013 void HcalTestHitGenerator::getNoiseHits(std::vector<PCaloHit> & noiseHits)
00014 {
00015
00016 double e = 10.;
00017 double hbTof = 17.;
00018 double heTof = 23.;
00019 double hfTof = 43.;
00020 double hoTof = 22.;
00021 for(int i = 1; i <= 16; ++i)
00022 {
00023 HcalDetId detId(HcalBarrel, i, 1, 1);
00024 PCaloHit hit(detId.rawId(), e/theBarrelSampling[i-1], hbTof, 0., 0);
00025 noiseHits.push_back(hit);
00026 }
00027
00028
00029 HcalDetId detId(HcalEndcap, 16, 1, 3);
00030 PCaloHit hit(detId.rawId(), e/theEndcapSampling[0], heTof, 0., 0);
00031 noiseHits.push_back(hit);
00032
00033 for(int i = 17; i <= 29; ++i)
00034 {
00035 HcalDetId detId(HcalEndcap, i, 1, 1);
00036 PCaloHit hit(detId.rawId(), e/theEndcapSampling[i-16], heTof, 0., 0);
00037 noiseHits.push_back(hit);
00038 }
00039
00040 HcalDetId outerDetId(HcalOuter, 1, 1, 4);
00041 PCaloHit outerHit(outerDetId.rawId(), 0.45, hoTof, 0., 0);
00042
00043 HcalDetId forwardDetId1(HcalForward, 30, 1, 1);
00044 PCaloHit forwardHit1(forwardDetId1.rawId(), 35., hfTof, 0., 0);
00045
00046 HcalDetId forwardDetId2(HcalForward, 30, 1, 2);
00047 PCaloHit forwardHit2(forwardDetId2.rawId(), 48., hfTof, 0., 0);
00048
00049 HcalZDCDetId zdcDetId(HcalZDCDetId::Section(2),true,1);
00050 PCaloHit zdcHit(zdcDetId.rawId(), 50.0, 0.);
00051
00052 noiseHits.push_back(outerHit);
00053 noiseHits.push_back(forwardHit1);
00054 noiseHits.push_back(forwardHit2);
00055
00056
00057 }
00058
00059