CMS 3D CMS Logo

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 
00016   double e = 10.;
00017 
00018   for(int i = 1; i <= 16; ++i)
00019   {
00020      HcalDetId detId(HcalBarrel, i, 1, 1);
00021      PCaloHit hit(detId.rawId(), e/theBarrelSampling[i-1], 0., 0., 0);
00022      noiseHits.push_back(hit);
00023   }
00024 
00025   // ring 16 is special
00026   HcalDetId detId(HcalEndcap, 16, 1, 3);
00027   PCaloHit hit(detId.rawId(), e/theEndcapSampling[0], 0., 0., 0);
00028   noiseHits.push_back(hit);
00029 
00030   for(int i = 17; i <= 29; ++i)
00031   {
00032      HcalDetId detId(HcalEndcap, i, 1, 1);
00033      PCaloHit hit(detId.rawId(), e/theEndcapSampling[i-16], 0., 0., 0);
00034      noiseHits.push_back(hit);
00035   }
00036 
00037   HcalDetId outerDetId(HcalOuter, 1, 1, 4);
00038   PCaloHit outerHit(outerDetId.rawId(), 0.45, 0., 0., 0);
00039 
00040   HcalDetId forwardDetId1(HcalForward, 30, 1, 1);
00041   PCaloHit forwardHit1(forwardDetId1.rawId(), 35., 0., 0., 0);
00042 
00043   HcalDetId forwardDetId2(HcalForward, 30, 1, 2);
00044   PCaloHit forwardHit2(forwardDetId2.rawId(), 48., 0., 0., 0);
00045 
00046   HcalZDCDetId zdcDetId(HcalZDCDetId::Section(2),true,1);
00047   PCaloHit zdcHit(zdcDetId.rawId(), 50.0, 0.);
00048 
00049   noiseHits.push_back(outerHit);
00050   noiseHits.push_back(forwardHit1);
00051   noiseHits.push_back(forwardHit2);
00052   //noiseHits.push_back(zdcHit);
00053 
00054 }
00055 
00056 

Generated on Tue Jun 9 17:46:23 2009 for CMSSW by  doxygen 1.5.4