CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HcalTestHitGenerator Class Reference

#include <HcalTestHitGenerator.h>

Inheritance diagram for HcalTestHitGenerator:
CaloVNoiseHitGenerator

Public Member Functions

virtual void getNoiseHits (std::vector< PCaloHit > &noiseHits)
 
 HcalTestHitGenerator (const edm::ParameterSet &ps)
 
virtual ~HcalTestHitGenerator ()
 

Private Attributes

std::vector< double > theBarrelSampling
 
std::vector< double > theEndcapSampling
 

Detailed Description

Definition at line 8 of file HcalTestHitGenerator.h.

Constructor & Destructor Documentation

HcalTestHitGenerator::HcalTestHitGenerator ( const edm::ParameterSet ps)
explicit

Definition at line 6 of file HcalTestHitGenerator.cc.

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 }
T getParameter(std::string const &) const
std::vector< double > theEndcapSampling
std::vector< double > theBarrelSampling
virtual HcalTestHitGenerator::~HcalTestHitGenerator ( )
inlinevirtual

Definition at line 12 of file HcalTestHitGenerator.h.

12 {}

Member Function Documentation

void HcalTestHitGenerator::getNoiseHits ( std::vector< PCaloHit > &  noiseHits)
virtual

Implements CaloVNoiseHitGenerator.

Definition at line 13 of file HcalTestHitGenerator.cc.

References alignCSCRings::e, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, DetId::rawId(), theBarrelSampling, and theEndcapSampling.

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 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > theEndcapSampling
std::vector< double > theBarrelSampling

Member Data Documentation

std::vector<double> HcalTestHitGenerator::theBarrelSampling
private

Definition at line 15 of file HcalTestHitGenerator.h.

Referenced by getNoiseHits().

std::vector<double> HcalTestHitGenerator::theEndcapSampling
private

Definition at line 16 of file HcalTestHitGenerator.h.

Referenced by getNoiseHits().