CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/SimCalorimetry/HcalSimProducers/src/HcalTestHitGenerator.cc

Go to the documentation of this file.
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   // just say about a foot a nanosecond, pluis 10 for showers
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      noiseHits.emplace_back(detId.rawId(), e/theBarrelSampling[i-1], hbTof, 0., 0);
00025   }
00026 
00027   // ring 16 is special
00028   HcalDetId detId(HcalEndcap, 16, 1, 3);
00029   noiseHits.emplace_back(detId.rawId(), e/theEndcapSampling[0], heTof, 0., 0);
00030 
00031   for(int i = 17; i <= 29; ++i)
00032   {
00033      HcalDetId detId(HcalEndcap, i, 1, 1);
00034      noiseHits.emplace_back(detId.rawId(), e/theEndcapSampling[i-16], heTof, 0., 0);
00035   }
00036 
00037   HcalDetId outerDetId(HcalOuter, 1, 1, 4);
00038   noiseHits.emplace_back(outerDetId.rawId(), 0.45, hoTof, 0., 0);
00039 
00040   HcalDetId forwardDetId1(HcalForward, 30, 1, 1);
00041   noiseHits.emplace_back(forwardDetId1.rawId(), 35., hfTof, 0., 0);
00042 
00043   HcalDetId forwardDetId2(HcalForward, 30, 1, 2);
00044   noiseHits.emplace_back(forwardDetId2.rawId(), 48., hfTof, 0., 0);
00045 
00046   //HcalZDCDetId zdcDetId(HcalZDCDetId::Section(2),true,1);
00047   //noiseHits.emplace_back(zdcDetId.rawId(), 50.0, 0.);
00048 
00049 }
00050 
00051