CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTestHitGenerator.cc
Go to the documentation of this file.
5 
7 : theBarrelSampling(ps.getParameter<edm::ParameterSet>("hb").getParameter<std::vector<double> >("samplingFactors")),
8  theEndcapSampling(ps.getParameter<edm::ParameterSet>("he").getParameter<std::vector<double> >("samplingFactors"))
9 {
10 }
11 
12 
13 void HcalTestHitGenerator::getNoiseHits(std::vector<PCaloHit> & noiseHits)
14 {
15  // just say about a foot a nanosecond, pluis 10 for showers
16  double e = 10.;
17  double hbTof = 17.;
18  double heTof = 23.;
19  double hfTof = 43.;
20  double hoTof = 22.;
21  for(int i = 1; i <= 16; ++i)
22  {
23  HcalDetId detId(HcalBarrel, i, 1, 1);
24  noiseHits.emplace_back(detId.rawId(), e/theBarrelSampling[i-1], hbTof, 0., 0);
25  }
26 
27  // ring 16 is special
28  HcalDetId detId(HcalEndcap, 16, 1, 3);
29  noiseHits.emplace_back(detId.rawId(), e/theEndcapSampling[0], heTof, 0., 0);
30 
31  for(int i = 17; i <= 29; ++i)
32  {
33  HcalDetId detId(HcalEndcap, i, 1, 1);
34  noiseHits.emplace_back(detId.rawId(), e/theEndcapSampling[i-16], heTof, 0., 0);
35  }
36 
37  HcalDetId outerDetId(HcalOuter, 1, 1, 4);
38  noiseHits.emplace_back(outerDetId.rawId(), 0.45, hoTof, 0., 0);
39 
40  HcalDetId forwardDetId1(HcalForward, 30, 1, 1);
41  noiseHits.emplace_back(forwardDetId1.rawId(), 35., hfTof, 0., 0);
42 
43  HcalDetId forwardDetId2(HcalForward, 30, 1, 2);
44  noiseHits.emplace_back(forwardDetId2.rawId(), 48., hfTof, 0., 0);
45 
46  //HcalZDCDetId zdcDetId(HcalZDCDetId::Section(2),true,1);
47  //noiseHits.emplace_back(zdcDetId.rawId(), 50.0, 0.);
48 
49 }
50 
51 
int i
Definition: DBlmapReader.cc:9
std::vector< double > theEndcapSampling
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
std::vector< double > theBarrelSampling
HcalTestHitGenerator(const edm::ParameterSet &ps)
virtual void getNoiseHits(std::vector< PCaloHit > &noiseHits)