Belle II Software development
GeometryPar.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9/* Own header. */
10#include <klm/bklm/geometry/GeometryPar.h>
11
12/* KLM headers. */
13#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
14#include <klm/dataobjects/KLMChannelIndex.h>
15#include <klm/dbobjects/bklm/BKLMAlignment.h>
16
17/* Basf2 headers. */
18#include <framework/gearbox/GearDir.h>
19#include <framework/logging/Logger.h>
20#include <framework/database/DBObjPtr.h>
21#include <simulation/background/BkgSensitiveDetector.h>
22
23using namespace Belle2::bklm;
24
26
28{
29 if (m_Instance)
30 return m_Instance;
31 B2FATAL("instance() called without initialization");
32 return nullptr; // never reached
33}
34
36{
37 if (!m_Instance)
38 m_Instance = new GeometryPar(content);
39 return m_Instance;
40}
41
43{
44 if (!m_Instance)
45 m_Instance = new GeometryPar(element);
46 return m_Instance;
47}
48
51 m_NSector(BKLMElementNumbers::getMaximalSectorNumber()),
52 m_NLayer(BKLMElementNumbers::getMaximalLayerNumber())
53{
54 clear();
55 read(content);
56 calculate();
57}
58
61 m_NSector(BKLMElementNumbers::getMaximalSectorNumber()),
62 m_NLayer(BKLMElementNumbers::getMaximalLayerNumber())
63{
64 clear();
65 readFromDB(element);
66 calculate();
67}
68
73
75{
76 for (std::map<int, Module*>::iterator m = m_Modules.begin(); m != m_Modules.end(); ++m) { delete m->second; }
77 m_Modules.clear();
78
79 m_Alignments.clear();
80 m_Displacements.clear();
81}
82
83// Get BKLM geometry parameters from Gearbox (no calculations here)
84void GeometryPar::read(const GearDir& content)
85{
86
87 char name[80] = "";
88 m_DoBeamBackgroundStudy = content.getBool("BeamBackgroundStudy");
89 m_Rotation = content.getAngle("Rotation");
90 m_OffsetZ = content.getLength("OffsetZ");
91 m_Phi = content.getLength("Phi");
92 m_NSector = content.getNumberNodes("Sectors/Forward/Sector");
93 if (m_NSector > BKLMElementNumbers::getMaximalSectorNumber()) { // array-bounds check
94 B2FATAL("BKLM GeometryPar::read(): sector array size exceeded:"
95 << LogVar("# of sectors", m_NSector)
97 }
98 m_SolenoidOuterRadius = content.getLength("SolenoidOuterRadius");
99 m_OuterRadius = content.getLength("OuterRadius");
100 m_HalfLength = content.getLength("HalfLength");
101 m_NLayer = content.getNumberNodes("Layers/Layer");
102 if (m_NLayer > BKLMElementNumbers::getMaximalLayerNumber()) { // array-bounds check
103 B2FATAL("BKLM GeometryPar::read(): layer array size exceeded:"
104 << LogVar("# of layers", m_NLayer)
106 }
107
108 m_IronNominalHeight = content.getLength("Layers/IronNominalHeight");
109 m_IronActualHeight = content.getLength("Layers/IronActualHeight");
110 m_Gap1NominalHeight = content.getLength("Layers/Layer[@layer=\"1\"]/GapNominalHeight");
111 m_GapNominalHeight = content.getLength("Layers/GapNominalHeight");
112 m_Gap1InnerRadius = content.getLength("Layers/InnerRadius");
113 m_Gap1IronWidth = content.getLength("Layers/Layer[@layer=\"1\"]/GapIronWidth");
114 m_GapIronWidth = content.getLength("Layers/GapIronWidth");
115 m_GapLength = content.getLength("Layers/GapLength");
116
117 m_NZStrips = content.getInt("Layers/NZStrips");
118 m_NZStripsChimney = content.getInt("Layers/NZStripsChimney");
119 m_NZScints = content.getInt("Layers/NZScintillators");
120 m_NZScintsChimney = content.getInt("Layers/NZScintillatorsChimney");
121 if (m_NZScints > NZSCINT) { // array-bounds check
122 B2FATAL("BKLM GeometryPar::read(): z-scint array size exceeded:"
123 << LogVar("# of z scintillators", m_NZScints)
124 << LogVar("array size", NZSCINT));
125 }
126 if (m_NZScintsChimney > NZSCINT) { // array-bounds check
127 B2FATAL("BKLM GeometryPar::read(): chimney sector z-scint array size exceeded:"
128 << LogVar("# of z scintillators", m_NZScintsChimney)
129 << LogVar("array size", NZSCINT));
130 }
131
132 m_ModuleLength = content.getLength("Module/Length");
133 m_ModuleLengthChimney = content.getLength("Module/LengthChimney");
134 m_ModuleCoverHeight = content.getLength("Module/CoverHeight");
135 m_ModuleCopperHeight = content.getLength("Module/CopperHeight");
136 m_ModuleFoamHeight = content.getLength("Module/FoamHeight");
137 m_ModuleMylarHeight = content.getLength("Module/MylarHeight");
138 m_ModuleGlassHeight = content.getLength("Module/GlassHeight");
139 m_ModuleGasHeight = content.getLength("Module/GasHeight");
140 m_ModuleFrameWidth = content.getLength("Module/FrameWidth");
141 m_ModuleFrameThickness = content.getLength("Module/FrameThickness");
142 m_ModuleGasSpacerWidth = content.getLength("Module/SpacerWidth");
143 m_ModulePolystyreneInnerHeight = content.getLength("Module/PolystyreneInnerHeight");
144 m_ModulePolystyreneOuterHeight = content.getLength("Module/PolystyreneOuterHeight");
145 m_ScintWidth = content.getLength("Module/Scintillator/Width");
146 m_ScintHeight = content.getLength("Module/Scintillator/Height");
147 m_ScintBoreRadius = content.getLength("Module/Scintillator/BoreRadius");
148 m_ScintFiberRadius = content.getLength("Module/Scintillator/FiberRadius");
149 m_ScintTiO2ThicknessTop = content.getLength("Module/Scintillator/TiO2ThicknessTop");
150 m_ScintTiO2ThicknessSide = content.getLength("Module/Scintillator/TiO2ThicknessSide");
151
152 m_ChimneyLength = content.getLength("Chimney/Length");
153 m_ChimneyWidth = content.getLength("Chimney/Width");
154 m_ChimneyCoverThickness = content.getLength("Chimney/CoverThickness");
155 m_ChimneyHousingInnerRadius = content.getLength("Chimney/HousingInnerRadius");
156 m_ChimneyHousingOuterRadius = content.getLength("Chimney/HousingOuterRadius");
157 m_ChimneyShieldInnerRadius = content.getLength("Chimney/ShieldInnerRadius");
158 m_ChimneyShieldOuterRadius = content.getLength("Chimney/ShieldOuterRadius");
159 m_ChimneyPipeInnerRadius = content.getLength("Chimney/PipeInnerRadius");
160 m_ChimneyPipeOuterRadius = content.getLength("Chimney/PipeOuterRadius");
161
162 m_RibThickness = content.getLength("RibThickness");
163 m_CablesWidth = content.getLength("CablesWidth");
164 m_BraceWidth = content.getLength("BraceWidth");
165 m_BraceWidthChimney = content.getLength("BraceWidthChimney");
166
167 m_SupportPlateWidth = content.getLength("SupportPlateWidth");
168 m_SupportPlateHeight = content.getLength("SupportPlateHeight");
169 m_SupportPlateLength = content.getLength("SupportPlateLength");
170 m_SupportPlateLengthChimney = content.getLength("SupportPlateLengthChimney");
171
172 m_BracketWidth = content.getLength("BracketWidth");
173 m_BracketThickness = content.getLength("BracketThickness");
174 m_BracketLength = content.getLength("BracketLength");
175 m_BracketRibWidth = content.getLength("BracketRibWidth");
176 m_BracketRibThickness = content.getLength("BracketRibThickness");
177 m_BracketInnerRadius = content.getLength("BracketInnerRadius");
178 m_BracketInset = content.getLength("BracketInset");
179 m_BracketCutoutDphi = content.getAngle("BracketCutoutDphi");
180
181 m_NReadoutStation = content.getNumberNodes("Readout/Stations/Station");
182 if (m_NReadoutStation > NSTATION) { // array-bounds check
183 B2FATAL("BKLM GeometryPar::read(): readout stations array size exceeded:"
184 << LogVar("# of readout stations", m_NReadoutStation)
185 << LogVar("array size", NSTATION));
186 }
187 for (int station = 1; station <= m_NReadoutStation; ++station) {
188 sprintf(name, "/Readout/Stations/Station[@station=\"%d\"]", station);
189 GearDir stationContent = content;
190 stationContent.append(name);
191 m_ReadoutStationIsPhi[station - 1] = stationContent.getBool("IsPhi");
192 m_ReadoutStationPosition[station - 1] = stationContent.getLength("Position");
193 }
194 m_ReadoutContainerLength = content.getLength("Readout/Container/Length");
195 m_ReadoutContainerWidth = content.getLength("Readout/Container/Width");
196 m_ReadoutContainerHeight = content.getLength("Readout/Container/Height");
197 m_ReadoutCarrierLength = content.getLength("Readout/Carrier/Length");
198 m_ReadoutCarrierWidth = content.getLength("Readout/Carrier/Width");
199 m_ReadoutCarrierHeight = content.getLength("Readout/Carrier/Height");
200 m_ReadoutPreamplifierLength = content.getLength("Readout/Preamplifier/Length");
201 m_ReadoutPreamplifierWidth = content.getLength("Readout/Preamplifier/Width");
202 m_ReadoutPreamplifierHeight = content.getLength("Readout/Preamplifier/Height");
203 m_ReadoutPreamplifierPosition = content.getArray("Readout/Preamplifier/Position");
204 m_ReadoutConnectorsLength = content.getLength("Readout/Connectors/Length");
205 m_ReadoutConnectorsWidth = content.getLength("Readout/Connectors/Width");
206 m_ReadoutConnectorsHeight = content.getLength("Readout/Connectors/Height");
207 m_ReadoutConnectorsPosition = content.getLength("Readout/Connectors/Position");
208 m_MPPCHousingRadius = content.getLength("Readout/MPPC/Housing/Radius");
209 m_MPPCHousingLength = content.getLength("Readout/MPPC/Housing/Length");
210 m_MPPCLength = content.getLength("Readout/MPPC/Sensor/Length");
211 m_MPPCWidth = content.getLength("Readout/MPPC/Sensor/Width");
212 m_MPPCHeight = content.getLength("Readout/MPPC/Sensor/Height");
213 // by-layer values that are common for all sectors and forward/backward
214 for (int layer = 1; layer <= m_NLayer; ++layer) {
215 sprintf(name, "/Layers/Layer[@layer=\"%d\"]", layer);
216 GearDir layerContent = content;
217 layerContent.append(name);
218 m_HasRPCs[layer - 1] = layerContent.getBool("HasRPCs");
219 m_NPhiStrips[layer - 1] = layerContent.getInt("PhiStrips/NStrips");
220 m_PhiStripWidth[layer - 1] = layerContent.getLength("PhiStrips/Width");
221 m_ZStripWidth[layer - 1] = layerContent.getLength("ZStrips/Width");
222 m_ScintEnvelopeOffsetSign[layer - 1] = layerContent.getInt("ScintEnvelopeOffsetSign");
223 m_NPhiScints[layer - 1] = layerContent.getInt("PhiScintillators/NScints", 0);
224 if (m_NPhiScints[layer - 1] > NPHISCINT) { // array-bounds check
225 B2FATAL("BKLM GeometryPar::read(): phi-scint array size exceeded:"
226 << LogVar("in zero-based layer", layer - 1)
227 << LogVar("# phi scintillators", m_NPhiScints[layer - 1])
228 << LogVar("array size", NPHISCINT));
229 }
230 for (int scint = 1; scint <= m_NZScints; ++scint) {
231 sprintf(name, "/ZScintillators/Scint[@scint=\"%d\"]", scint);
232 GearDir scintContent(layerContent);
233 scintContent.append(name);
234 m_ZScintDLength[layer - 1][scint - 1] = scintContent.getLength("DLength", 0.0);
235 }
236 }
237 // values that depend on fb/sector/layer
238 for (int section = 0; section <= BKLMElementNumbers::getMaximalSectionNumber(); ++section) {
239 bool isForward = (section == BKLMElementNumbers::c_ForwardSection);
240 for (int sector = 1; sector <= m_NSector; ++sector) {
241 sprintf(name, "/Sectors/%s/Sector[@sector=\"%d\"]", (isForward ? "Forward" : "Backward"), sector);
242 GearDir sectorContent(content);
243 sectorContent.append(name);
244 m_SectorRotation[section][sector - 1] = sectorContent.getAngle("Phi");
245 for (int layer = 1; layer <= m_NLayer; ++layer) {
246 GearDir layerContent(sectorContent);
247 sprintf(name, "/Layer[@layer=\"%d\"]", layer);
248 layerContent.append(name);
249 m_LocalReconstructionShiftX[section][sector - 1][layer - 1] = layerContent.getLength("ReconstructionShift/X");
250 m_LocalReconstructionShiftY[section][sector - 1][layer - 1] = layerContent.getLength("ReconstructionShift/Y");
251 m_LocalReconstructionShiftZ[section][sector - 1][layer - 1] = layerContent.getLength("ReconstructionShift/Z");
252 m_IsFlipped[section][sector - 1][layer - 1] = layerContent.getBool("Flip", false);
253 }
254 }
255 }
256}
257
258// Get BKLM geometry parameters from dbobject (no calculations here)
260{
261
262 m_DoBeamBackgroundStudy = element.doBeamBackgroundStudy();
263 m_Rotation = element.getRotation();
264 m_OffsetZ = element.getOffsetZ();
265 m_Phi = element.getPhi();
266 m_NSector = element.getNSector(); // array-bounds check has already been done
267 m_SolenoidOuterRadius = element.getSolenoidOuterRadius();
268 m_OuterRadius = element.getOuterRadius();
269 m_HalfLength = element.getHalfLength();
270 m_NLayer = element.getNLayer(); // array-bounds check has already been done
271
272 m_IronNominalHeight = element.getIronNominalHeight();
273 m_IronActualHeight = element.getIronActualHeight();
274 m_Gap1NominalHeight = element.getGap1NominalHeight();
275 m_GapNominalHeight = element.getGapNominalHeight();
276 m_Gap1InnerRadius = element.getGap1InnerRadius();
277 m_Gap1IronWidth = element.getGap1IronWidth();
278 m_GapIronWidth = element.getGapIronWidth();
279 m_GapLength = element.getGapLength();
280
281 m_NZStrips = element.getNZStrips();
282 m_NZStripsChimney = element.getNZStripsChimney();
283 m_NZScints = element.getNZScints(); // array-bounds check has already been done
284 m_NZScintsChimney = element.getNZScintsChimney(); // array-bounds check has already been done
285
286 m_ModuleLength = element.getModuleLength();
287 m_ModuleLengthChimney = element.getModuleLengthChimney();
288 m_ModuleCoverHeight = element.getModuleCoverHeight();
289 m_ModuleCopperHeight = element.getModuleCopperHeight();
290 m_ModuleFoamHeight = element.getModuleFoamHeight();
291 m_ModuleMylarHeight = element.getModuleMylarHeight();
292 m_ModuleGlassHeight = element.getModuleGlassHeight();
293 m_ModuleGasHeight = element.getModuleGasHeight();
294 m_ModuleFrameWidth = element.getModuleFrameWidth();
295 m_ModuleFrameThickness = element.getModuleFrameThickness();
296 m_ModuleGasSpacerWidth = element.getModuleGasSpacerWidth();
297 m_ModulePolystyreneInnerHeight = element.getModulePolystyreneInnerHeight();
298 m_ModulePolystyreneOuterHeight = element.getModulePolystyreneOuterHeight();
299 m_ScintWidth = element.getScintWidth();
300 m_ScintHeight = element.getScintHeight();
301 m_ScintBoreRadius = element.getScintBoreRadius();
302 m_ScintFiberRadius = element.getScintFiberRadius();
303 m_ScintTiO2ThicknessTop = element.getScintTiO2ThicknessTop();
304 m_ScintTiO2ThicknessSide = element.getScintTiO2ThicknessSide();
305
306 m_ChimneyLength = element.getChimneyLength();
307 m_ChimneyWidth = element.getChimneyWidth();
308 m_ChimneyCoverThickness = element.getChimneyCoverThickness();
309 m_ChimneyHousingInnerRadius = element.getChimneyHousingInnerRadius();
310 m_ChimneyHousingOuterRadius = element.getChimneyHousingOuterRadius();
311 m_ChimneyShieldInnerRadius = element.getChimneyShieldInnerRadius();
312 m_ChimneyShieldOuterRadius = element.getChimneyShieldOuterRadius();
313 m_ChimneyPipeInnerRadius = element.getChimneyPipeInnerRadius();
314 m_ChimneyPipeOuterRadius = element.getChimneyPipeOuterRadius();
315
316 m_RibThickness = element.getRibThickness();
317 m_CablesWidth = element.getCablesWidth();
318 m_BraceWidth = element.getBraceWidth();
319 m_BraceWidthChimney = element.getBraceWidthChimney();
320
321 m_SupportPlateWidth = element.getSupportPlateWidth();
322 m_SupportPlateHeight = element.getSupportPlateHeight();
323 m_SupportPlateLength = element.getSupportPlateLength();
324 m_SupportPlateLengthChimney = element.getSupportPlateLengthChimney();
325
326 m_BracketWidth = element.getBracketWidth();
327 m_BracketThickness = element.getBracketThickness();
328 m_BracketLength = element.getBracketLength();
329 m_BracketRibWidth = element.getBracketRibWidth();
330 m_BracketRibThickness = element.getBracketRibThickness();
331 m_BracketInnerRadius = element.getBracketInnerRadius();
332 m_BracketInset = element.getBracketInset();
333 m_BracketCutoutDphi = element.getBracketCutoutDphi();
334
335 m_NReadoutStation = element.getNReadoutStation(); // array-bounds check has already been done
336 for (int station = 1; station <= m_NReadoutStation; ++station) {
337 m_ReadoutStationIsPhi[station - 1] = element.getReadoutStationIsPhi(station);
338 m_ReadoutStationPosition[station - 1] = element.getReadoutStationPosition(station);
339 }
340 m_ReadoutContainerLength = element.getReadoutContainerLength();
341 m_ReadoutContainerWidth = element.getReadoutContainerWidth();
342 m_ReadoutContainerHeight = element.getReadoutContainerHeight();
343 m_ReadoutCarrierLength = element.getReadoutCarrierLength();
344 m_ReadoutCarrierWidth = element.getReadoutCarrierWidth();
345 m_ReadoutCarrierHeight = element.getReadoutCarrierHeight();
346 m_ReadoutPreamplifierLength = element.getReadoutPreamplifierLength();
347 m_ReadoutPreamplifierWidth = element.getReadoutPreamplifierWidth();
348 m_ReadoutPreamplifierHeight = element.getReadoutPreamplifierHeight();
349 for (int preamp = 1; preamp <= element.getNReadoutPreamplifierPosition(); ++preamp) {
350 m_ReadoutPreamplifierPosition.push_back(element.getReadoutPreamplifierPosition(preamp));
351 }
352 m_ReadoutConnectorsLength = element.getReadoutConnectorsLength();
353 m_ReadoutConnectorsWidth = element.getReadoutConnectorsWidth();
354 m_ReadoutConnectorsHeight = element.getReadoutConnectorsHeight();
355 m_ReadoutConnectorsPosition = element.getReadoutConnectorsPosition();
356 m_MPPCHousingRadius = element.getMPPCHousingRadius();
357 m_MPPCHousingLength = element.getMPPCHousingLength();
358 m_MPPCLength = element.getMPPCLength();
359 m_MPPCWidth = element.getMPPCWidth();
360 m_MPPCHeight = element.getMPPCHeight();
361
362 // by-layer values that are common for all sectors and forward/backward
363 for (int layer = 1; layer <= m_NLayer; ++layer) {
364 m_HasRPCs[layer - 1] = element.hasRPCs(layer);
365 m_NPhiStrips[layer - 1] = element.getNPhiStrips(layer);
366 m_PhiStripWidth[layer - 1] = element.getPhiStripWidth(layer);
367 m_ZStripWidth[layer - 1] = element.getZStripWidth(layer);
368 m_NPhiScints[layer - 1] = (m_HasRPCs[layer - 1] ? 0 : element.getNPhiScints(layer)); // array-bounds check has already been done
369 m_ScintEnvelopeOffsetSign[layer - 1] = (m_HasRPCs[layer - 1] ? 0 : element.getScintEnvelopeOffsetSign(layer));
370 for (int scint = 1; scint <= m_NZScints; ++scint) {
371 m_ZScintDLength[layer - 1][scint - 1] = (m_HasRPCs[layer - 1] ? 0.0 : element.getZScintDLength(layer, scint));
372 }
373 }
374 // values that depend on fb/sector/layer
375 for (int section = 0; section <= BKLMElementNumbers::getMaximalSectionNumber(); ++section) {
376 for (int sector = 1; sector <= m_NSector; ++sector) {
377 m_SectorRotation[section][sector - 1] = element.getSectorRotation(section, sector);
378 for (int layer = 1; layer <= m_NLayer; ++layer) {
379 m_LocalReconstructionShiftX[section][sector - 1][layer - 1] = element.getLocalReconstructionShiftX(section, sector, layer);
380 m_LocalReconstructionShiftY[section][sector - 1][layer - 1] = element.getLocalReconstructionShiftY(section, sector, layer);
381 m_LocalReconstructionShiftZ[section][sector - 1][layer - 1] = element.getLocalReconstructionShiftZ(section, sector, layer);
382 m_IsFlipped[section][sector - 1][layer - 1] = false;
383 if (layer <= NSCINTLAYER) {
384 m_IsFlipped[section][sector - 1][layer - 1] = element.isFlipped(section, sector, layer);
385 }
386 }
387 }
388 }
389
390
391}
392
393// Calculate derived quantities from the database-defined values
395{
403
404 // set up displaced geometry
406 // set up ReconstructionAlignment, so that those information can pass to Modules
408
409 for (int section = 0; section <= BKLMElementNumbers::getMaximalSectionNumber(); ++section) {
410 bool isForward = (section == BKLMElementNumbers::c_ForwardSection);
411 for (int sector = 1; sector <= m_NSector; ++sector) {
412 bool hasChimney = (!isForward) && (sector == BKLMElementNumbers::c_ChimneySector);
413 int nZStrips = (hasChimney ? m_NZStripsChimney : m_NZStrips);
414 int nZScints = (hasChimney ? m_NZScintsChimney : m_NZScints);
415 CLHEP::HepRotation rotation;
416 if (!isForward)
417 rotation.rotateX(M_PI);
418 rotation.rotateZ(m_SectorRotation[section][sector - 1]);
419 for (int layer = 1; layer <= m_NLayer; ++layer) {
420 bool isFlipped = m_IsFlipped[section][sector - 1][layer - 1];
421 CLHEP::Hep3Vector localReconstructionShift(m_LocalReconstructionShiftX[section][sector - 1][layer - 1],
422 m_LocalReconstructionShiftY[section][sector - 1][layer - 1],
423 m_LocalReconstructionShiftZ[section][sector - 1][layer - 1]);
424 double dx = getActiveMiddleRadius(section, sector, layer);
425 double dz = getModuleHalfSize(layer, hasChimney).z() - getModuleInteriorHalfSize2(layer, hasChimney).z();
426 CLHEP::Hep3Vector localOrigin(dx, 0.0, dz);
428 section, sector, layer);
429 if (m_HasRPCs[layer - 1]) {
430 localOrigin.setZ(localOrigin.z() + getModuleInteriorHalfSize1(layer, hasChimney).z() - getGasHalfSize(layer, hasChimney).z());
431 Module* pModule = new Module(m_PhiStripWidth[layer - 1],
432 (layer == 1 ? 2 : 1),
433 m_NPhiStrips[layer - 1] - (layer == 1 ? 1 : 0),
434 m_ZStripWidth[layer - 1],
435 nZStrips,
436 CLHEP::Hep3Vector(0.0, 0.0, m_OffsetZ) + rotation(localOrigin),
437 localReconstructionShift,
438 rotation
439 );
440 pModule->setDisplacedGeo(getModuleDisplacedGeo(section, sector, layer));
441 pModule->setAlignment(getModuleAlignment(section, sector, layer));
442 m_Modules.insert(std::pair<int, Module*>(moduleID, pModule));
443 } else {
444 double dy = getScintEnvelopeOffset(layer, hasChimney).y() * getScintEnvelopeOffsetSign(layer) * (isFlipped ? -1.0 : 1.0);
445 localOrigin.setY(dy);
446 Module* pModule = new Module(m_ScintWidth,
447 m_NPhiScints[layer - 1],
449 nZScints,
450 CLHEP::Hep3Vector(0.0, 0.0, m_OffsetZ) + rotation(localOrigin),
451 localReconstructionShift,
452 rotation,
453 isFlipped
454 );
455 pModule->setDisplacedGeo(getModuleDisplacedGeo(section, sector, layer));
456 pModule->setAlignment(getModuleAlignment(section, sector, layer));
457 m_Modules.insert(std::pair<int, Module*>(moduleID, pModule));
458 double base = -0.5 * (m_NPhiScints[layer - 1] + 1) * m_ScintWidth;
459 for (int scint = 1; scint <= m_NPhiScints[layer - 1]; ++scint) {
460 double length = nZScints * m_ScintWidth;
461 if (length > m_MaximalPhiStripLength)
463 pModule->addPhiScint(scint,
464 length,
465 0.0,
466 base + scint * m_ScintWidth
467 );
468 }
469 base = -0.5 * (nZScints + 1) * m_ScintWidth;
470 for (int scint = 1; scint <= nZScints; ++scint) {
471 int scint0 = m_NZScints - getNZScints(hasChimney);
472 double dLength = m_ZScintDLength[layer - 1][scint0 + scint - 1];
473 double length = m_NPhiScints[layer - 1] * m_ScintWidth + dLength;
474 if (length > m_MaximalZStripLength)
475 m_MaximalZStripLength = length;
476 pModule->addZScint(scint,
477 length,
478 -0.5 * dLength,
479 base + scint * m_ScintWidth
480 );
481 }
482 }
483 }
484 }
485 }
486
487}
488
489double GeometryPar::getLayerInnerRadius(int layer) const
490{
491 if (layer == 1) {
492 return m_Gap1InnerRadius;
493 }
494 if (layer > m_NLayer) {
495 return m_OuterRadius;
496 }
497 return m_GapInnerRadius - (m_IronNominalHeight - m_IronActualHeight) / 2.0 + m_LayerHeight * (layer - 1);
498}
499
500double GeometryPar::getLayerOuterRadius(int layer) const
501{
502 return getLayerInnerRadius(layer + 1);
503}
504
505const CLHEP::Hep3Vector GeometryPar::getGapHalfSize(int layer, bool hasChimney) const
506{
507 double r, ds, dx;
508 if (layer == 1) {
510 ds = m_Gap1IronWidth;
511 dx = 0.5 * m_Gap1ActualHeight;
512 } else {
514 ds = m_GapIronWidth;
515 dx = 0.5 * m_GapActualHeight;
516 }
517 double dz = 0.5 * (hasChimney ? m_GapLength - m_ChimneyLength : m_GapLength);
518 return CLHEP::Hep3Vector(dx, r * tan(M_PI / m_NSector) - ds, dz);
519
520}
521
522const CLHEP::Hep3Vector GeometryPar::getModuleHalfSize(int layer, bool hasChimney) const
523{
524 CLHEP::Hep3Vector size = getGapHalfSize(layer, hasChimney);
525 size.setX(0.5 * m_ModuleHeight);
526 size.setZ(0.5 * (hasChimney ? m_ModuleLengthChimney : m_ModuleLength));
527 return size;
528}
529
530const CLHEP::Hep3Vector GeometryPar::getModuleInteriorHalfSize1(int layer, bool hasChimney) const
531{
532 CLHEP::Hep3Vector size = getModuleHalfSize(layer, hasChimney);
533 size.setX(size.x() - m_ModuleCoverHeight);
534 size.setY(size.y() - m_ModuleFrameWidth);
535 size.setZ(size.z() - m_ModuleFrameWidth);
536 return size;
537}
538
539const CLHEP::Hep3Vector GeometryPar::getModuleInteriorHalfSize2(int layer, bool hasChimney) const
540{
541 CLHEP::Hep3Vector size = getModuleHalfSize(layer, hasChimney);
542 size.setX(size.x() - m_ModuleFrameThickness - m_ModuleCoverHeight);
543 size.setY(size.y() - m_ModuleFrameThickness);
544 size.setZ(size.z() - m_ModuleFrameThickness);
545 return size;
546}
547
548const CLHEP::Hep3Vector GeometryPar::getElectrodeHalfSize(int layer, bool hasChimney) const
549{
550 CLHEP::Hep3Vector size = getModuleInteriorHalfSize1(layer, hasChimney);
551 size.setX(2.0 * m_ModuleGlassHeight + m_ModuleGasHeight);
552 return size;
553}
554
555const CLHEP::Hep3Vector GeometryPar::getGasHalfSize(int layer, bool hasChimney) const
556{
557 CLHEP::Hep3Vector size = getElectrodeHalfSize(layer, hasChimney);
558 size.setX(0.5 * m_ModuleGasHeight);
559 size.setY(size.y() - m_ModuleGasSpacerWidth);
560 size.setZ(size.z() - m_ModuleGasSpacerWidth);
561 return size;
562}
563
564const CLHEP::Hep3Vector GeometryPar::getAirHalfSize(int layer, bool hasChimney) const
565{
566 CLHEP::Hep3Vector size = getModuleInteriorHalfSize2(layer, hasChimney);
567 size.setX(m_ScintHeight);
568 return size;
569}
570
571const CLHEP::Hep3Vector GeometryPar::getScintEnvelopeHalfSize(int layer, bool hasChimney) const
572{
573 return CLHEP::Hep3Vector(0.5 * m_ScintHeight,
574 0.5 * m_ScintWidth * getNPhiScints(layer),
575 0.5 * m_ScintWidth * getNZScints(hasChimney)
576 );
577}
578
579int GeometryPar::getNPhiScints(int layer) const
580{
581 if ((layer <= 0) || (layer > m_NLayer))
582 return 0;
583 return m_NPhiScints[layer - 1];
584}
585
590
591double GeometryPar::getGapMiddleRadius(int layer) const
592{
593 if (layer == 1) {
595 }
596 return m_GapInnerRadius + 0.5 * m_GapActualHeight + m_LayerHeight * (layer - 1);
597}
598
600{
601 if (layer == 1) {
603 }
604 return m_GapInnerRadius + 0.5 * m_GapNominalHeight + m_LayerHeight * (layer - 1);
605}
606
607double GeometryPar::getActiveMiddleRadius(int section, int sector, int layer) const
608{
609#ifdef __clang_analyzer__
610 m_NSector = 8;
611#endif
612 // place the active radius midway between the two readout planes
613 // (same as positioning in GeoBKLMCreator.cc)
614 double dx = getModuleMiddleRadius(layer) - getGapMiddleRadius(layer);
615 int s1 = sector - 1;
616 int s2 = m_NSector / 2;
617 if (s1 % s2 == 0) {
618 dx = 0.0;
619 } else if (s1 > s2) {
620 dx = -dx;
621 }
622 double r = getGapMiddleRadius(layer) + dx;
623 if (!hasRPCs(layer)) {
624 if (m_IsFlipped[section][sector - 1][layer - 1]) {
626 } else {
628 }
629 }
630 return r;
631}
632
633const CLHEP::Hep3Vector GeometryPar::getScintEnvelopeOffset(int layer, bool hasChimney) const
634{
635 CLHEP::Hep3Vector airHalfSize = getAirHalfSize(layer, hasChimney);
636 CLHEP::Hep3Vector envelopeHalfSize = getScintEnvelopeHalfSize(layer, hasChimney);
637 CLHEP::Hep3Vector offset((airHalfSize.x() - envelopeHalfSize.x()),
638 (airHalfSize.y() - envelopeHalfSize.y()),
639 -(airHalfSize.z() - envelopeHalfSize.z()));
640 return offset;
641}
642
643const CLHEP::Hep3Vector GeometryPar::getChimneyHalfSize(int layer) const
644{
645 return CLHEP::Hep3Vector(0.5 * (getLayerOuterRadius(layer) - getLayerInnerRadius(layer)),
646 0.5 * m_ChimneyWidth,
648}
649
650const CLHEP::Hep3Vector GeometryPar::getChimneyPosition(int layer) const
651{
652 return CLHEP::Hep3Vector(0.5 * (getLayerOuterRadius(layer) + getLayerInnerRadius(layer)),
653 0.0,
655}
656
657const CLHEP::Hep3Vector GeometryPar::getSupportPlateHalfSize(bool hasChimney) const
658{
659 CLHEP::Hep3Vector size;
660 size.setX(0.5 * m_SupportPlateHeight);
661 size.setY(0.5 * m_SupportPlateWidth);
662 if (hasChimney) {
663 size.setZ(0.5 * m_SupportPlateLengthChimney);
664 } else {
665 size.setZ(0.5 * m_SupportPlateLength);
666 }
667 return size;
668}
669
670double GeometryPar::getBracketZPosition(int bracket, bool hasChimney) const
671{
672 double z = m_BracketInset - 0.5 * m_GapLength;
673 if (bracket == 0)
674 return z;
675 if (hasChimney) {
677 } else {
678 return (bracket == 1 ? 0.0 : -z);
679 }
680}
681
682const CLHEP::Hep3Vector GeometryPar::getReadoutContainerHalfSize(void) const
683{
684 return CLHEP::Hep3Vector(0.5 * m_ReadoutContainerWidth,
687 );
688}
689
690const CLHEP::Hep3Vector GeometryPar::getReadoutCarrierHalfSize(void) const
691{
692 return CLHEP::Hep3Vector(0.5 * m_ReadoutCarrierWidth,
695 );
696}
697
698const CLHEP::Hep3Vector GeometryPar::getReadoutPreamplifierHalfSize(void) const
699{
700 return CLHEP::Hep3Vector(0.5 * m_ReadoutPreamplifierWidth,
703 );
704}
705
706const CLHEP::Hep3Vector GeometryPar::getReadoutConnectorsHalfSize(void) const
707{
708 return CLHEP::Hep3Vector(0.5 * m_ReadoutConnectorsWidth,
711 );
712}
713
714bool GeometryPar::hasRPCs(int layer) const
715{
716 if ((layer <= 0) || (layer > m_NLayer))
717 return false;
718 return m_HasRPCs[layer - 1];
719}
720
721const Module* GeometryPar::findModule(int section, int sector, int layer) const
722{
723 int moduleID = BKLMElementNumbers::moduleNumber(section, sector, layer);
724 std::map<int, Module*>::const_iterator iM = m_Modules.find(moduleID);
725 return (iM == m_Modules.end() ? nullptr : iM->second);
726}
727
728const HepGeom::Transform3D GeometryPar::getModuleAlignment(int section, int sector, int layer) const
729{
730 int moduleID = BKLMElementNumbers::moduleNumber(section, sector, layer);
731 std::map<int, HepGeom::Transform3D>::const_iterator iA = m_Alignments.find(moduleID);
732 return (iA == m_Alignments.end() ? HepGeom::Transform3D() : iA->second);
733}
734
735const HepGeom::Transform3D GeometryPar::getModuleDisplacedGeo(int section, int sector, int layer) const
736{
737 int moduleID = BKLMElementNumbers::moduleNumber(section, sector, layer);
738 std::map<int, HepGeom::Transform3D>::const_iterator iDis = m_Displacements.find(moduleID);
739 return (iDis == m_Displacements.end() ? HepGeom::Transform3D() : iDis->second);
740}
741
743{
744 DBObjPtr<BKLMAlignment> bklmAlignment;
745 if (!bklmAlignment.isValid())
746 B2FATAL("No BKLM alignment data.");
748 for (KLMChannelIndex bklmModule = bklmModules.beginBKLM();
749 bklmModule != bklmModules.endBKLM(); ++bklmModule) {
750 KLMModuleNumber module = bklmModule.getKLMModuleNumber();
751 const KLMAlignmentData* alignmentData =
752 bklmAlignment->getModuleAlignment(module);
753 if (alignmentData == nullptr)
754 B2FATAL("Incomplete BKLM alignment data.");
755 HepGeom::Transform3D alignment;
757 alignmentData->getDeltaU(),
758 alignmentData->getDeltaV(),
759 alignmentData->getDeltaW(),
760 alignmentData->getDeltaAlpha(),
761 alignmentData->getDeltaBeta(),
762 alignmentData->getDeltaGamma());
764 bklmModule.getSection(), bklmModule.getSector(),
765 bklmModule.getLayer());
766 m_Alignments.insert(std::pair<int, HepGeom::Transform3D>(moduleID, alignment));
767 }
768 // Add callback to itself.
769 bklmAlignment.addCallback(this, &bklm::GeometryPar::readAlignmentFromDB);
770}
771
773{
774 DBObjPtr<BKLMAlignment> bklmDisplacement("BKLMDisplacement");
775 if (!bklmDisplacement.isValid())
776 B2FATAL("No BKLM displaced geometry data in database!");
778 for (KLMChannelIndex bklmModule = bklmModules.beginBKLM();
779 bklmModule != bklmModules.endBKLM(); ++bklmModule) {
780 KLMModuleNumber module = bklmModule.getKLMModuleNumber();
781 const KLMAlignmentData* displacementData =
782 bklmDisplacement->getModuleAlignment(module);
783 if (displacementData == nullptr)
784 B2FATAL("Incomplete BKLM displacement data.");
785 HepGeom::Transform3D displacement;
786 displacement = getTransformFromRigidBodyParams(
787 displacementData->getDeltaU(),
788 displacementData->getDeltaV(),
789 displacementData->getDeltaW(),
790 displacementData->getDeltaAlpha(),
791 displacementData->getDeltaBeta(),
792 displacementData->getDeltaGamma());
794 bklmModule.getSection(), bklmModule.getSector(),
795 bklmModule.getLayer());
796 m_Displacements.insert(std::pair<int, HepGeom::Transform3D>(moduleID, displacement));
797 }
798 // Add callback to itself.
800}
801
802HepGeom::Transform3D GeometryPar::getTransformFromRigidBodyParams(double dU, double dV, double dW, double dAlpha, double dBeta,
803 double dGamma)
804{
805
806 CLHEP::HepRotation dy = CLHEP::HepRotationY(-dAlpha);
807 CLHEP::HepRotation dz = CLHEP::HepRotationZ(-dBeta);
808 CLHEP::HepRotation dx = CLHEP::HepRotationX(-dGamma);
809 CLHEP::Hep3Vector shift(dW, dU, dV);
810
811 //we do dx-->dz-->dy ( local w-->v-->u), because angles are defined as intrinsic rotations u-->v'-->w''
812 //the equivalent one is extrinsic rotation with the order w (gamma)--> v(beta) --> u (alpha)
813 //and then we map it to global rotation x -> z -> y axis
814 return HepGeom::Transform3D(dy * dz * dx, shift);
815}
@ c_ChimneySector
Chimney sector: BB3 in 1-based notation; BB2 in 0-based notation.
static constexpr int getMaximalLayerNumber()
Get maximal layer number (1-based).
static constexpr int getMaximalSectorNumber()
Get maximal sector number (1-based).
static KLMModuleNumber moduleNumber(int section, int sector, int layer, bool fatalError=true)
Get module number.
static constexpr int getMaximalSectionNumber()
Get maximal section number (0-based).
The Class for BKLM geometry.
void addCallback(std::function< void(const std::string &)> callback, bool onDestruction=false)
Add a callback method.
bool isValid() const
Check whether a valid object was obtained from the database.
Class for accessing objects in the database.
Definition DBObjPtr.h:21
GearDir is the basic class used for accessing the parameter store.
Definition GearDir.h:31
void append(const std::string &path)
Append something to the current path, modifying the GearDir in place.
Definition GearDir.h:52
KLM Alignment data.
float getDeltaU() const
Get shift in U.
float getDeltaV() const
Get shift in V.
float getDeltaW() const
Get shift in W.
float getDeltaGamma() const
Get rotation in alpha.
float getDeltaAlpha() const
Get rotation in alpha.
float getDeltaBeta() const
Get rotation in alpha.
KLM channel index.
KLMChannelIndex beginBKLM()
First channel for BKLM.
KLMChannelIndex & endBKLM()
Last channel for BKLM.
Provides BKLM geometry parameters for simulation, reconstruction etc (from Gearbox or DataBase)
Definition GeometryPar.h:37
double m_LocalReconstructionShiftX[2][BKLMElementNumbers::getMaximalSectorNumber()][BKLMElementNumbers::getMaximalLayerNumber()]
Reconstruction dx in local system. displacement, not alignment.
double m_GapInnerRadius
Radius of the inner tangent circle of virtual gap 0 (assuming equal-height layers)
double m_BracketRibWidth
width of the innermost-module support plate's bracket's rib
double m_ScintWidth
width of one scintillator strip (cm), including the TiO2 coating
double m_LocalReconstructionShiftZ[2][BKLMElementNumbers::getMaximalSectorNumber()][BKLMElementNumbers::getMaximalLayerNumber()]
Reconstruction dz in local system. displacement, not alignment.
int m_NZStripsChimney
number of z-measuring cathode strips in a chimney-sector RPC module
double m_ReadoutConnectorsHeight
Height of the readout connectors pair.
~GeometryPar()
Hidden destructor.
double m_SupportPlateLengthChimney
length of the innermost-module support plate in the chimney sector
bool m_HasRPCs[BKLMElementNumbers::getMaximalLayerNumber()]
Flag to indicate whether layer contains RPCs (true) or scintillators (false)
double m_ChimneyPipeInnerRadius
inner radius of the chimney pipe
double m_BracketLength
length of the innermost-module support plate's bracket
double m_MaximalZStripLength
maximal Z strip length (for scintillators).
double m_ReadoutContainerHeight
Height of the readout station's container.
double m_ReadoutCarrierHeight
Height of the readout carrier card.
double m_ModuleLengthChimney
length along z of the module in the chimney sector
const CLHEP::Hep3Vector getReadoutContainerHalfSize(void) const
Get the size (dx,dy,dz) of the readout container.
void readDisplacedGeoFromDB()
Initialize and Updates displacements parameters from DB for geometry constructor, registers itself fo...
double m_BracketInnerRadius
inner radius of the innermost-module support plate's bracket
double m_BracketWidth
width of the innermost-module support plate's bracket
double m_BraceWidthChimney
width of the central brace in the middle of the cable-services channel in the chimney sector
int m_NPhiStrips[BKLMElementNumbers::getMaximalLayerNumber()]
Number of phi-readout RPC strips in each layer.
double m_ReadoutContainerLength
Length of the readout station's container.
double m_Gap1IronWidth
Width (at the outer radius) of the adjacent structural iron on either side of innermost gap.
double getLayerOuterRadius(int layer) const
Get the outer radius of specified layer.
const CLHEP::Hep3Vector getModuleHalfSize(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the detector module of specified layer.
double m_IronActualHeight
Actual height of a layer's structural iron.
double m_ZStripWidth[BKLMElementNumbers::getMaximalLayerNumber()]
Width of the z strips on each layer.
double m_ReadoutPreamplifierWidth
Width of the preamplifier card.
double m_IronNominalHeight
Nominal height of a layer's structural iron.
const HepGeom::Transform3D getModuleAlignment(int section, int sector, int layer) const
Get the alignment transformation of a module.
const CLHEP::Hep3Vector getModuleInteriorHalfSize1(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the detector module's interior volume 1.
const Module * findModule(int section, int sector, int layer) const
Get the pointer to the definition of a module.
double m_ScintHeight
height of one scintillator strip (cm), including the TiO2 coating
double m_ChimneyHousingInnerRadius
inner radius of the chimney housing
double m_ModuleFoamHeight
height of a detector module's transmission-line foam
std::map< int, Module * > m_Modules
map of <volumeIDs, pointers to defined modules>
int m_ScintEnvelopeOffsetSign[BKLMElementNumbers::getMaximalLayerNumber()]
Sign (+/-1) of scintillator-envelope's shift along y axis within its enclosing module for MPPC placem...
double m_BracketRibThickness
thickness of the innermost-module support plate's bracket's rib
double m_Gap1NominalHeight
Nominal height of the innermost gap.
int getNPhiScints(int layer) const
Get the number of phi-measuring scintillators in a scintillator module.
const CLHEP::Hep3Vector getScintEnvelopeOffset(int layer, bool hasChimney) const
Get the shift (dx,dy,dz) of the scintillator detector module's scintillator envelope within its enclo...
bool hasRPCs(int layer) const
Determine if the sensitive detectors in a given layer are RPCs (=true) or scintillators (=false)
double m_ScintFiberRadius
radius (cm) of the central WLS fiber in the scintillator strip
double m_ZScintDLength[BKLMElementNumbers::getMaximalLayerNumber()][NZSCINT]
Shortening of the nominal length of the z scintillators.
double m_MPPCLength
MPPC length.
double m_SupportPlateLength
length of the innermost-module support plate
const CLHEP::Hep3Vector getScintEnvelopeHalfSize(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the scintillator detector module's scintillator envelope.
double m_ModuleMylarHeight
height of a detector module's mylar insulation
const CLHEP::Hep3Vector getChimneyPosition(int layer) const
Get the position of the chimney hole in the specified layer.
double m_ModuleFrameThickness
thickness of a detector module's frame ("C" shape - thickness of vertical leg)
int m_NPhiScints[BKLMElementNumbers::getMaximalLayerNumber()]
Number of phi-readout scintillators in each layer.
double m_ChimneyShieldInnerRadius
inner radius of the chimney shield
std::map< int, HepGeom::Transform3D > m_Displacements
map of <volumeIDs, displacement Transform3D>
double m_Rotation
Global rotation about z of the BKLM.
int m_NReadoutStation
Number of preamplifier readout stations.
double getBracketZPosition(int, bool) const
Get the position of a layer-0 support plate's bracket.
double m_ModulePolystyreneOuterHeight
height of the outer polystyrene-filler sheet
const CLHEP::Hep3Vector getReadoutPreamplifierHalfSize(void) const
Get the size (dx,dy,dz) of the preamplifier card.
int getNZScints(bool isChimney) const
Get the number of z-measuring scintillators in a scintillator module.
double m_ChimneyLength
length along z of the chimney hole
double getPolystyreneOffsetX(void) const
Get the radial offset of the scintillator detector module's active envelope due to difference in poly...
double m_ReadoutContainerWidth
Width of the readout station's container.
double m_OffsetZ
Global offset along z of the BKLM.
double m_ModuleGasSpacerWidth
width of a detector module's spacer
double m_PhiStripWidth[BKLMElementNumbers::getMaximalLayerNumber()]
Width of the phi strips on each layer.
const CLHEP::Hep3Vector getReadoutConnectorsHalfSize(void) const
Get the size (dx,dy,dz) of the readout connectors pair.
double m_OuterRadius
Radius of the circle tangent to the sides of the outer polygon.
static GeometryPar * m_Instance
static pointer to the singleton instance of this class
double m_BracketThickness
thickness of the innermost-module support plate's bracket
double m_ModuleGlassHeight
height of a detector module's glass electrode
const CLHEP::Hep3Vector getModuleInteriorHalfSize2(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the scintillator detector module's polystyrene filler.
double m_MaximalPhiStripLength
Maximal phi strip length (for scintillators).
GeometryPar(const GearDir &)
Hidden constructor.
double m_RibThickness
thickness of the radial rib that supports the solenoid / inner detectors
double m_ScintTiO2ThicknessTop
thickness (cm) of the TiO2 coating on the top (and bottom) of the scintillator strip
double m_ModuleReadoutHeight
height of a detector module's readout
const CLHEP::Hep3Vector getGapHalfSize(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the gap [=slot] of specified layer.
double m_ModuleLength
length along z of the module
double m_HalfLength
Half-length along z of the BKLM.
double m_ReadoutPreamplifierHeight
Height of the preamplifier card.
double m_ChimneyWidth
width of the chimney hole
double m_LayerHeight
Height of a layer: internal use only.
double m_ChimneyShieldOuterRadius
outer radius of the chimney shield
int m_NZScintsChimney
number of z-measuring scintillators in a chimney-sector scintillator module
double m_ReadoutConnectorsLength
Length of the readout connectors pair.
double m_SupportPlateWidth
width of the innermost-module support plate
double m_Layer1Height
Height of layer 0: internal use only.
double m_MPPCHeight
MPPC height.
std::map< int, HepGeom::Transform3D > m_Alignments
map of <volumeIDs, alignment Transform3D>
void readAlignmentFromDB()
Initialize and Updates alignment parameters from DB for reconstruction, that is for Module constructi...
int m_NZStrips
number of z-measuring cathode strips in a standard RPC module
double m_SectorRotation[2][BKLMElementNumbers::getMaximalSectorNumber()]
Global rotation angle of a sector.
double m_BracketInset
distance from support plate's end of bracket
int m_NLayer
Number of layers in one sector.
const CLHEP::Hep3Vector getSupportPlateHalfSize(bool) const
Get the size of the layer-0 support plate.
double m_GapLength
Length along z of each gap.
double m_MPPCHousingRadius
MPPC housing radius.
double m_MPPCHousingLength
MPPC housing length.
double m_CablesWidth
width of the cable-services channel at each end
double m_ScintBoreRadius
radius (cm) of the central bore in the scintillator strip
double m_ReadoutCarrierLength
Length of the readout carrier card.
double m_ReadoutConnectorsWidth
Width of the readout connectors pair.
double m_GapIronWidth
Width (at the outer radius) of the adjacent structural iron on either side of a gap.
double m_ReadoutStationPosition[NSTATION]
Position of each readout station along its relevant axis.
double m_ReadoutPreamplifierLength
Length of the preamplifier card.
double m_ModuleGasHeight
height of a detector module's gas gap
double getActiveMiddleRadius(int section, int sector, int layer) const
Get the radial midpoint of the detector module's active volume of specified layer.
double m_BraceWidth
width of the central brace in the middle of the cable-services channel
const CLHEP::Hep3Vector getChimneyHalfSize(int layer) const
Get the size of the chimney hole in the specified layer.
double m_ModuleFrameWidth
width of a detector module's frame ("C" shape - width of horizontal leg)
double m_MPPCWidth
MPPC width.
double m_ChimneyHousingOuterRadius
outer radius of the chimney housing
double getGapMiddleRadius(int layer) const
Get the radial midpoint of the gap of specified layer.
double m_GapNominalHeight
Nominal height of outer gaps.
double m_ReadoutConnectorsPosition
Position of the readout connectors pair along the length of the carrier card.
double m_ModulePolystyreneInnerHeight
height of the inner polystyrene-filler sheet
double m_ChimneyCoverThickness
thickness of the chimney's iron cover plate
void readFromDB(const BKLMGeometryPar &)
Get geometry parameters from Conditions Database.
void clear()
Clear all geometry parameters.
double m_Phi
Starting angle of the polygon shape.
double m_Gap1ActualHeight
Actual height of the innermost gap.
std::vector< double > m_ReadoutPreamplifierPosition
Positions of the preamplifiers along the length of the carrier card.
double m_ModuleHeight
height of a detector module
const CLHEP::Hep3Vector getReadoutCarrierHalfSize(void) const
Get the size (dx,dy,dz) of the carrier card.
void read(const GearDir &)
Get geometry parameters from Gearbox.
const CLHEP::Hep3Vector getGasHalfSize(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the detector module's gas gaps of specified layer.
double m_GapActualHeight
Actual height of outer gaps.
const CLHEP::Hep3Vector getElectrodeHalfSize(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the detector module's electrode of specified layer.
double m_LocalReconstructionShiftY[2][BKLMElementNumbers::getMaximalSectorNumber()][BKLMElementNumbers::getMaximalLayerNumber()]
Reconstruction dy in local system. displacement, not alignment.
static GeometryPar * instance(void)
Static method to get a reference to the singleton GeometryPar instance.
double m_ModuleCoverHeight
height of a detector module's aluminum cover
double m_Gap1InnerRadius
Radius of the inner tangent circle of the innermost gap.
int getScintEnvelopeOffsetSign(int layer) const
Get the sign (+/-1) of scintillator-envelope's shift along y axis within its enclosing module for MPP...
Definition GeometryPar.h:91
double m_SolenoidOuterRadius
Outer radius of the solenoid.
double getModuleMiddleRadius(int layer) const
Get the radial midpoint of the detector module of specified layer.
int m_NSector
Number of sectors (=8 : octagonal)
bool m_DoBeamBackgroundStudy
Flag for enabling beam background study (=use bkg sensitive-detector function too)
double m_ChimneyPipeOuterRadius
outer radius of the chimney pipe
const HepGeom::Transform3D getModuleDisplacedGeo(int section, int sector, int layer) const
Get the displacement transformation of a module.
double getLayerInnerRadius(int layer) const
Get the inner radius of specified layer.
bool m_ReadoutStationIsPhi[NSTATION]
Selector for phi (true) or z (false) readout station.
double m_ReadoutCarrierWidth
Width of the readout carrier card.
double m_SupportPlateHeight
height of the innermost-module support plate
double m_ScintTiO2ThicknessSide
thickness (cm) of the TiO2 coating on the left (and right) side of the scintillator strip
double m_ModuleCopperHeight
height of a detector module's copper readout or ground plane
bool m_IsFlipped[2][BKLMElementNumbers::getMaximalSectorNumber()][BKLMElementNumbers::getMaximalLayerNumber()]
Flag to indicate whether a module is flipped (true) or not (false) by 180 degrees about the z axis.
double m_BracketCutoutDphi
angular width of the innermost-module support plate's bracket's cutout
HepGeom::Transform3D getTransformFromRigidBodyParams(double dU, double dV, double dW, double dAlpha, double dBeta, double dGamma)
Convert 6 rigid body params (alignment/displacement) to corresponding Transform3D Angles in radians,...
const CLHEP::Hep3Vector getAirHalfSize(int layer, bool hasChimney) const
Get the size (dx,dy,dz) of the scintillator detector module's air filler.
void calculate()
Calculate additional geometry parameters.
int m_NZScints
number of z-measuring scintillators in a standard scintillator module
Define the geometry of a BKLM module Each sector [octant] contains Modules.
Definition Module.h:76
void addZScint(int scint, double length, double offset, double position)
Add one z-measuring scintillator strip to the module.
Definition Module.cc:243
void setDisplacedGeo(const HepGeom::Transform3D &moduleDisplacedGeo)
Set the displaced geometry Transformation.
Definition Module.cc:374
void addPhiScint(int scint, double length, double offset, double position)
Add one phi-measuring scintillator strip to the module.
Definition Module.cc:231
void setAlignment(const HepGeom::Transform3D &moduleAlignment)
Set the alignment Transformation.
Definition Module.cc:365
double getAngle(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard angle unit.
Definition Interface.h:299
double getLength(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard length unit.
Definition Interface.h:259
bool getBool(const std::string &path="") const noexcept(false)
Get the parameter path as a bool.
Definition Interface.cc:80
int getInt(const std::string &path="") const noexcept(false)
Get the parameter path as a int.
Definition Interface.cc:60
Class to store variables with their name which were sent to the logging service.
double tan(double a)
tan for double
Definition beamHelpers.h:31
uint16_t KLMModuleNumber
Module number.