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  PCaloHit hit(detId.rawId(), e/theBarrelSampling[i-1], hbTof, 0., 0);
25  noiseHits.push_back(hit);
26  }
27 
28  // ring 16 is special
29  HcalDetId detId(HcalEndcap, 16, 1, 3);
30  PCaloHit hit(detId.rawId(), e/theEndcapSampling[0], heTof, 0., 0);
31  noiseHits.push_back(hit);
32 
33  for(int i = 17; i <= 29; ++i)
34  {
35  HcalDetId detId(HcalEndcap, i, 1, 1);
36  PCaloHit hit(detId.rawId(), e/theEndcapSampling[i-16], heTof, 0., 0);
37  noiseHits.push_back(hit);
38  }
39 
40  HcalDetId outerDetId(HcalOuter, 1, 1, 4);
41  PCaloHit outerHit(outerDetId.rawId(), 0.45, hoTof, 0., 0);
42 
43  HcalDetId forwardDetId1(HcalForward, 30, 1, 1);
44  PCaloHit forwardHit1(forwardDetId1.rawId(), 35., hfTof, 0., 0);
45 
46  HcalDetId forwardDetId2(HcalForward, 30, 1, 2);
47  PCaloHit forwardHit2(forwardDetId2.rawId(), 48., hfTof, 0., 0);
48 
49  HcalZDCDetId zdcDetId(HcalZDCDetId::Section(2),true,1);
50  PCaloHit zdcHit(zdcDetId.rawId(), 50.0, 0.);
51 
52  noiseHits.push_back(outerHit);
53  noiseHits.push_back(forwardHit1);
54  noiseHits.push_back(forwardHit2);
55  //noiseHits.push_back(zdcHit);
56 
57 }
58 
59 
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)