CMS 3D CMS Logo

HcalSimParameterMap.cc
Go to the documentation of this file.
7 
9  : theHBParameters(2000., 117, 5, 10, 5, true, true, 1, std::vector<double>(16, 117.), 10.),
10  theHEParameters(2000., 178, 5, 10, 5, true, true, 16, std::vector<double>(16, 178.), 10.),
11  theHOParameters(4000., 217., 5, 10, 5, true, true, 1, std::vector<double>(16, 217.), 5.),
12  theHOZecotekSiPMParameters(4000., 217., 5, 10, 5, true, true, 1, std::vector<double>(16, 217.), 5.),
13  theHOHamamatsuSiPMParameters(4000., 217., 5, 10, 5, true, true, 1, std::vector<double>(16, 217.), 5.),
14  theHFParameters1(6., 2.79, 1 / 0.278, -4, true),
15  theHFParameters2(6., 2.06, 1 / 0.267, -4, true),
16  theZDCParameters(1., 4.3333, 2.09, -4, false),
17  theHOZecotekDetIds(),
18  theHOHamamatsuDetIds() {}
19 
21  : theHBParameters(p.getParameter<edm::ParameterSet>("hb")),
22  theHEParameters(p.getParameter<edm::ParameterSet>("he")),
23  theHOParameters(p.getParameter<edm::ParameterSet>("ho")),
24  theHOZecotekSiPMParameters(p.getParameter<edm::ParameterSet>("hoZecotek")),
25  theHOHamamatsuSiPMParameters(p.getParameter<edm::ParameterSet>("hoHamamatsu")),
26  theHFParameters1(p.getParameter<edm::ParameterSet>("hf1")),
27  theHFParameters2(p.getParameter<edm::ParameterSet>("hf2")),
28  theZDCParameters(p.getParameter<edm::ParameterSet>("zdc")) {}
29 
31  HcalGenericDetId genericId(detId);
32  if (genericId.isHcalZDCDetId())
33  return theZDCParameters;
34  HcalDetId hcalDetId(detId);
35  if (hcalDetId.subdet() == HcalBarrel) {
36  return theHBParameters;
37  } else if (hcalDetId.subdet() == HcalEndcap) {
38  return theHEParameters;
39  } else if (hcalDetId.subdet() == HcalOuter) {
40  if (std::find(theHOZecotekDetIds.begin(), theHOZecotekDetIds.end(), hcalDetId) != theHOZecotekDetIds.end()) {
42  }
43  if (std::find(theHOHamamatsuDetIds.begin(), theHOHamamatsuDetIds.end(), hcalDetId) != theHOHamamatsuDetIds.end()) {
45  } else {
46  return theHOParameters;
47  }
48  } else { // HF
49  if (hcalDetId.depth() == 1 || hcalDetId.depth() == 3) {
50  return theHFParameters1;
51  } else {
52  return theHFParameters2;
53  }
54  }
55 }
56 
58  theHBParameters.setDbService(dbService);
59  theHEParameters.setDbService(dbService);
60  theHOParameters.setDbService(dbService);
63  theHFParameters1.setDbService(dbService);
64  theHFParameters2.setDbService(dbService);
65  theZDCParameters.setDbService(dbService);
66 }
67 
68 void HcalSimParameterMap::setFrameSize(const DetId &detId, int frameSize) {
69  HcalGenericDetId genericId(detId);
70  if (genericId.isHcalZDCDetId())
71  setFrameSize(theZDCParameters, frameSize);
72  else {
73  HcalDetId hcalDetId(detId);
74  if (hcalDetId.subdet() == HcalForward) {
75  // do both depths
76  setFrameSize(theHFParameters1, frameSize);
77  setFrameSize(theHFParameters2, frameSize);
78  } else {
80  setFrameSize(parameters, frameSize);
81  }
82  }
83 }
84 
86  int binOfMaximum = 5;
87  if (frameSize == 10) {
88  } else if (frameSize == 6)
89  binOfMaximum = 4;
90  else {
91  edm::LogError("HcalSimParameterMap") << "Bad HCAL frame size " << frameSize;
92  }
93  if (parameters.readoutFrameSize() != frameSize) {
94  edm::LogWarning("HcalSignalGenerator") << "Mismatch in frame sizes. Setting to " << frameSize;
95  parameters.setReadoutFrameSize(frameSize);
96  parameters.setBinOfMaximum(binOfMaximum);
97  }
98 }
HcalSimParameters theHBParameters
const CaloSimParameters & simParameters(const DetId &id) const override
void setDbService(const HcalDbService *service)
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Main class for Parameters in different subdetectors.
HcalSimParameters theHOHamamatsuSiPMParameters
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalSimParameterMap()
hardcoded default parameters
std::vector< HcalDetId > theHOZecotekDetIds
void setFrameSize(const DetId &detId, int frameSize)
HcalSimParameters theHEParameters
HFSimParameters theHFParameters1
Definition: DetId.h:17
HFSimParameters theHFParameters2
std::vector< HcalDetId > theHOHamamatsuDetIds
bool isHcalZDCDetId() const
HLT enums.
void setDbService(const HcalDbService *service)
HcalSimParameters theHOParameters
Log< level::Warning, false > LogWarning
HFSimParameters theZDCParameters
void setDbService(const HcalDbService *service)
HcalSimParameters theHOZecotekSiPMParameters
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164