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 {
79  CaloSimParameters &parameters = const_cast<CaloSimParameters &>(simParameters(detId));
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 }
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
HcalSimParameterMap::theHFParameters1
HFSimParameters theHFParameters1
Definition: HcalSimParameterMap.h:44
HcalGenericDetId
Definition: HcalGenericDetId.h:15
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HFSimParameters::setDbService
void setDbService(const HcalDbService *service)
Definition: HFSimParameters.h:19
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
HcalSimParameterMap::theHFParameters2
HFSimParameters theHFParameters2
Definition: HcalSimParameterMap.h:45
HcalBarrel
Definition: HcalAssistant.h:33
HcalZDCDetId.h
HcalSimParameterMap::HcalSimParameterMap
HcalSimParameterMap()
hardcoded default parameters
Definition: HcalSimParameterMap.cc:8
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HcalSimParameterMap::setDbService
void setDbService(const HcalDbService *service)
Definition: HcalSimParameterMap.cc:57
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HcalGenericDetId::isHcalZDCDetId
bool isHcalZDCDetId() const
Definition: HcalGenericDetId.cc:79
DetId
Definition: DetId.h:17
HcalSimParameterMap.h
HcalSimParameterMap::theHOHamamatsuSiPMParameters
HcalSimParameters theHOHamamatsuSiPMParameters
Definition: HcalSimParameterMap.h:43
CaloSimParameters
Main class for Parameters in different subdetectors.
Definition: CaloSimParameters.h:14
HcalOuter
Definition: HcalAssistant.h:35
HcalSimParameterMap::theHOZecotekDetIds
std::vector< HcalDetId > theHOZecotekDetIds
Definition: HcalSimParameterMap.h:47
funct::true
true
Definition: Factorize.h:173
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
HcalSimParameterMap::theHBParameters
HcalSimParameters theHBParameters
Definition: HcalSimParameterMap.h:39
HcalDetId.h
HcalSimParameterMap::theZDCParameters
HFSimParameters theZDCParameters
Definition: HcalSimParameterMap.h:46
HcalSimParameterMap::setFrameSize
void setFrameSize(const DetId &detId, int frameSize)
Definition: HcalSimParameterMap.cc:68
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HcalSubdetector.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalSimParameterMap::theHOZecotekSiPMParameters
HcalSimParameters theHOZecotekSiPMParameters
Definition: HcalSimParameterMap.h:42
ecalEBTriggerPrimitiveDigis_cfi.binOfMaximum
binOfMaximum
Definition: ecalEBTriggerPrimitiveDigis_cfi.py:9
HcalForward
Definition: HcalAssistant.h:36
HcalSimParameterMap::theHOParameters
HcalSimParameters theHOParameters
Definition: HcalSimParameterMap.h:41
HcalDbService
Definition: HcalDbService.h:26
std
Definition: JetResolutionObject.h:76
HcalEndcap
Definition: HcalAssistant.h:34
DetId.h
HcalSimParameterMap::theHEParameters
HcalSimParameters theHEParameters
Definition: HcalSimParameterMap.h:40
HcalSimParameterMap::theHOHamamatsuDetIds
std::vector< HcalDetId > theHOHamamatsuDetIds
Definition: HcalSimParameterMap.h:48
HcalSimParameterMap::simParameters
const CaloSimParameters & simParameters(const DetId &id) const override
Definition: HcalSimParameterMap.cc:30
HcalSimParameters::setDbService
void setDbService(const HcalDbService *service)
Definition: HcalSimParameters.cc:57