CMS 3D CMS Logo

HcalSimParameterMap.cc
Go to the documentation of this file.
7 
9  theHBParameters(2000.,
10  117, 5,
11  10, 5, true, true,
12  1, std::vector<double>(16, 117.), 10.),
13  theHEParameters(2000.,
14  178, 5,
15  10, 5, true, true,
16  16, std::vector<double>(16, 178.), 10.),
17  theHOParameters( 4000.,
18  217., 5,
19  10, 5, true, true,
20  1, std::vector<double>(16, 217.), 5.),
21  theHOZecotekSiPMParameters( 4000.,
22  217., 5,
23  10, 5, true, true,
24  1, std::vector<double>(16, 217.), 5.),
25  theHOHamamatsuSiPMParameters( 4000.,
26  217., 5,
27  10, 5, true, true,
28  1, std::vector<double>(16, 217.), 5.),
29  theHFParameters1(6., 2.79,
30  1/0.278 , -4,
31  true),
32  theHFParameters2(6., 2.06,
33  1/0.267 , -4,
34  true),
35  theZDCParameters(1., 4.3333,
36  2.09 , -4,
37  false),
38  theHOZecotekDetIds(),
39  theHOHamamatsuDetIds()
40 {
41 }
42 
44 : theHBParameters( p.getParameter<edm::ParameterSet>("hb") ),
45  theHEParameters( p.getParameter<edm::ParameterSet>("he") ),
46  theHOParameters( p.getParameter<edm::ParameterSet>("ho") ),
47  theHOZecotekSiPMParameters( p.getParameter<edm::ParameterSet>("hoZecotek") ),
48  theHOHamamatsuSiPMParameters( p.getParameter<edm::ParameterSet>("hoHamamatsu") ),
49  theHFParameters1( p.getParameter<edm::ParameterSet>("hf1") ),
50  theHFParameters2( p.getParameter<edm::ParameterSet>("hf2") ),
51  theZDCParameters( p.getParameter<edm::ParameterSet>("zdc") )
52 {
53 }
54 
56  HcalGenericDetId genericId(detId);
57  if(genericId.isHcalZDCDetId())
58  return theZDCParameters;
59  HcalDetId hcalDetId(detId);
60  if(hcalDetId.subdet() == HcalBarrel) {
61  return theHBParameters;
62  } else if(hcalDetId.subdet() == HcalEndcap) {
63  return theHEParameters;
64  } else if(hcalDetId.subdet() == HcalOuter) {
65  if(std::find(theHOZecotekDetIds.begin(),
66  theHOZecotekDetIds.end(), hcalDetId) != theHOZecotekDetIds.end())
67  {
69  }
71  theHOHamamatsuDetIds.end(), hcalDetId) != theHOHamamatsuDetIds.end())
72  {
74  }
75  else
76  {
77  return theHOParameters;
78  }
79  } else { // HF
80  if(hcalDetId.depth() == 1 || hcalDetId.depth() == 3) {
81  return theHFParameters1;
82  } else {
83  return theHFParameters2;
84  }
85  }
86 }
87 
89 {
90  theHBParameters.setDbService(dbService);
91  theHEParameters.setDbService(dbService);
92  theHOParameters.setDbService(dbService);
95  theHFParameters1.setDbService(dbService);
96  theHFParameters2.setDbService(dbService);
97  theZDCParameters.setDbService(dbService);
98 }
99 
100 void HcalSimParameterMap::setFrameSize(const DetId & detId, int frameSize)
101 {
102  HcalGenericDetId genericId(detId);
103  if(genericId.isHcalZDCDetId())
104  setFrameSize(theZDCParameters, frameSize);
105  else
106  {
107  HcalDetId hcalDetId(detId);
108  if(hcalDetId.subdet() == HcalForward) {
109  // do both depths
110  setFrameSize(theHFParameters1,frameSize);
111  setFrameSize(theHFParameters2,frameSize);
112  }
113  else
114  {
116  setFrameSize(parameters, frameSize);
117  }
118  }
119 }
120 
121 
123 {
124  int binOfMaximum = 5;
125  if(frameSize == 10) {}
126  else if(frameSize == 6) binOfMaximum = 4;
127  else {
128  edm::LogError("HcalSimParameterMap")<< "Bad HCAL frame size " << frameSize;
129  }
130  if(parameters.readoutFrameSize() != frameSize)
131  {
132  edm::LogWarning("HcalSignalGenerator")<< "Mismatch in frame sizes. Setting to " << frameSize;
133  parameters.setReadoutFrameSize(frameSize);
134  parameters.setBinOfMaximum(binOfMaximum);
135  }
136 }
137 
bool isHcalZDCDetId() const
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
HcalSimParameters theHBParameters
void setDbService(const HcalDbService *service)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
Main class for Parameters in different subdetectors.
HcalSimParameters theHOHamamatsuSiPMParameters
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
HcalSimParameterMap()
hardcoded default parameters
void setReadoutFrameSize(int frameSize)
some datamixing apps need this to be set dynamically
void setBinOfMaximum(int binOfMax)
std::vector< HcalDetId > theHOZecotekDetIds
void setFrameSize(const DetId &detId, int frameSize)
HcalSimParameters theHEParameters
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
HFSimParameters theHFParameters1
Definition: DetId.h:18
HFSimParameters theHFParameters2
std::vector< HcalDetId > theHOHamamatsuDetIds
HLT enums.
void setDbService(const HcalDbService *service)
HcalSimParameters theHOParameters
const CaloSimParameters & simParameters(const DetId &id) const override
HFSimParameters theZDCParameters
void setDbService(const HcalDbService *service)
HcalSimParameters theHOZecotekSiPMParameters