CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalSimParameterMap.cc
Go to the documentation of this file.
7 
9  theHBParameters(2000., std::vector<double>(16, 0.3305),
10  117, 5,
11  10, 5, true, true,
12  1, std::vector<double>(16, 117.)),
13  theHEParameters(2000., std::vector<double>(16, 0.3305),
14  178, 5,
15  10, 5, true, true,
16  16, std::vector<double>(16, 178.)),
17  theHOParameters( 4000., std::vector<double>(16, 0.3065),
18  217., 5,
19  10, 5, true, true,
20  1, std::vector<double>(16, 217.)),
21  theHOZecotekSiPMParameters( 4000., std::vector<double>(16, 3.0), // 1 mip = 15 pe = 45 fC
22  217., 5,
23  10, 5, true, true,
24  1, std::vector<double>(16, 217.)),
25  theHOHamamatsuSiPMParameters( 4000., std::vector<double>(16, 3.0),
26  217., 5,
27  10, 5, true, true,
28  1, std::vector<double>(16, 217.)),
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 {
43 }
44 /*
45  CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog,
46  double samplingFactor, double timePhase,
47  int readoutFrameSize, int binOfMaximum,
48  bool doPhotostatistics, bool syncPhase=true);
49 
50 */
51 
53 : theHBParameters( p.getParameter<edm::ParameterSet>("hb") ),
54  theHEParameters( p.getParameter<edm::ParameterSet>("he") ),
55  theHOParameters( p.getParameter<edm::ParameterSet>("ho") ),
56  theHOZecotekSiPMParameters( p.getParameter<edm::ParameterSet>("hoZecotek") ),
57  theHOHamamatsuSiPMParameters( p.getParameter<edm::ParameterSet>("hoHamamatsu") ),
58  theHFParameters1( p.getParameter<edm::ParameterSet>("hf1") ),
59  theHFParameters2( p.getParameter<edm::ParameterSet>("hf2") ),
60  theZDCParameters( p.getParameter<edm::ParameterSet>("zdc") )
61 {
62 }
63 
65  HcalGenericDetId genericId(detId);
66  if(genericId.isHcalZDCDetId())
67  return theZDCParameters;
68  HcalDetId hcalDetId(detId);
69  if(hcalDetId.subdet() == HcalBarrel) {
70  return theHBParameters;
71  } else if(hcalDetId.subdet() == HcalEndcap) {
72  return theHEParameters;
73  } else if(hcalDetId.subdet() == HcalOuter) {
74  if(std::find(theHOZecotekDetIds.begin(),
75  theHOZecotekDetIds.end(), hcalDetId) != theHOZecotekDetIds.end())
76  {
78  }
80  theHOHamamatsuDetIds.end(), hcalDetId) != theHOHamamatsuDetIds.end())
81  {
83  }
84  else
85  {
86  return theHOParameters;
87  }
88  } else { // HF
89  if(hcalDetId.depth() == 1) {
90  return theHFParameters1;
91  } else {
92  return theHFParameters2;
93  }
94  }
95 }
96 
98 {
99  theHBParameters.setDbService(dbService);
100  theHEParameters.setDbService(dbService);
101  theHOParameters.setDbService(dbService);
104  theHFParameters1.setDbService(dbService);
105  theHFParameters2.setDbService(dbService);
106  theZDCParameters.setDbService(dbService);
107 }
108 
109 void HcalSimParameterMap::setFrameSize(const DetId & detId, int frameSize)
110 {
111  HcalGenericDetId genericId(detId);
112  if(genericId.isHcalZDCDetId())
113  setFrameSize(theZDCParameters, frameSize);
114  else
115  {
116  HcalDetId hcalDetId(detId);
117  if(hcalDetId.subdet() == HcalForward) {
118  // do both depths
119  setFrameSize(theHFParameters1,frameSize);
120  setFrameSize(theHFParameters2,frameSize);
121  }
122  else
123  {
125  setFrameSize(parameters, frameSize);
126  }
127  }
128 }
129 
130 
132 {
133  int binOfMaximum = 5;
134  if(frameSize == 10) {}
135  else if(frameSize == 6) binOfMaximum = 4;
136  else {
137  edm::LogError("HcalSimParameterMap")<< "Bad HCAL frame size " << frameSize;
138  }
139  if(parameters.readoutFrameSize() != frameSize)
140  {
141  edm::LogWarning("HcalSignalGenerator")<< "Mismatch in frame sizes. Setting to " << frameSize;
142  parameters.setReadoutFrameSize(frameSize);
143  parameters.setBinOfMaximum(binOfMaximum);
144  }
145 }
146 
bool isHcalZDCDetId() const
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
virtual const CaloSimParameters & simParameters(const DetId &id) const
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:7
Main class for Parameters in different subdetectors.
HcalSimParameters theHOHamamatsuSiPMParameters
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
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
void setDbService(const HcalDbService *service)
HcalSimParameters theHOParameters
volatile std::atomic< bool > shutdown_flag false
HFSimParameters theZDCParameters
void setDbService(const HcalDbService *service)
HcalSimParameters theHOZecotekSiPMParameters