10 #include <klm/dbobjects/bklm/BKLMGeometryPar.h>
13 #include <framework/gearbox/GearDir.h>
14 #include <framework/logging/Logger.h>
33 B2FATAL(
"The GearDir to look for BKLM geometry parameters is not valid.");
39 m_DoBeamBackgroundStudy = data.getBool(
"BeamBackgroundStudy");
40 m_Rotation = data.getAngle(
"Rotation");
41 m_OffsetZ = data.getLength(
"OffsetZ");
42 m_Phi = data.getLength(
"Phi");
43 m_NSector = data.getNumberNodes(
"Sectors/Forward/Sector");
45 B2FATAL(
"BKLMGeometryPar::read(): sectors array size exceeded:"
46 <<
LogVar(
"# of sectors", m_NSector)
49 m_SolenoidOuterRadius = data.getLength(
"SolenoidOuterRadius");
50 m_OuterRadius = data.getLength(
"OuterRadius");
51 m_HalfLength = data.getLength(
"HalfLength");
52 m_NLayer = data.getNumberNodes(
"Layers/Layer");
54 B2FATAL(
"BKLMGeometryPar::read(): layer array size exceeded:"
55 <<
LogVar(
"# of layers", m_NLayer)
59 m_IronNominalHeight = data.getLength(
"Layers/IronNominalHeight");
60 m_IronActualHeight = data.getLength(
"Layers/IronActualHeight");
61 m_Gap1NominalHeight = data.getLength(
"Layers/Layer[@layer=\"1\"]/GapNominalHeight");
62 m_GapNominalHeight = data.getLength(
"Layers/GapNominalHeight");
63 m_Gap1InnerRadius = data.getLength(
"Layers/InnerRadius");
64 m_Gap1IronWidth = data.getLength(
"Layers/Layer[@layer=\"1\"]/GapIronWidth");
65 m_GapIronWidth = data.getLength(
"Layers/GapIronWidth");
66 m_GapLength = data.getLength(
"Layers/GapLength");
68 m_NZStrips = data.getInt(
"Layers/NZStrips");
69 m_NZStripsChimney = data.getInt(
"Layers/NZStripsChimney");
70 m_NZScints = data.getInt(
"Layers/NZScintillators");
71 m_NZScintsChimney = data.getInt(
"Layers/NZScintillatorsChimney");
72 m_NZScintsChimney = data.getInt(
"Layers/NZScintillatorsChimney");
73 if (m_NZScints > NZSCINT) {
74 B2FATAL(
"BKLMGeometryPar::read(): z-scint array size exceeded:"
75 <<
LogVar(
"# of z scintillators", m_NZScints)
76 <<
LogVar(
"array size", NZSCINT));
78 if (m_NZScintsChimney > NZSCINT) {
79 B2FATAL(
"BKLMGeometryPar::read(): chimney sector z-scint array size exceeded:"
80 <<
LogVar(
"# of z scintillators", m_NZScintsChimney)
81 <<
LogVar(
"array size", NZSCINT));
84 m_ModuleLength = data.getLength(
"Module/Length");
85 m_ModuleLengthChimney = data.getLength(
"Module/LengthChimney");
86 m_ModuleCoverHeight = data.getLength(
"Module/CoverHeight");
87 m_ModuleCopperHeight = data.getLength(
"Module/CopperHeight");
88 m_ModuleFoamHeight = data.getLength(
"Module/FoamHeight");
89 m_ModuleMylarHeight = data.getLength(
"Module/MylarHeight");
90 m_ModuleGlassHeight = data.getLength(
"Module/GlassHeight");
91 m_ModuleGasHeight = data.getLength(
"Module/GasHeight");
92 m_ModuleFrameWidth = data.getLength(
"Module/FrameWidth");
93 m_ModuleFrameThickness = data.getLength(
"Module/FrameThickness");
94 m_ModuleGasSpacerWidth = data.getLength(
"Module/SpacerWidth");
95 m_ModulePolystyreneInnerHeight = data.getLength(
"Module/PolystyreneInnerHeight");
96 m_ModulePolystyreneOuterHeight = data.getLength(
"Module/PolystyreneOuterHeight");
97 m_ScintWidth = data.getLength(
"Module/Scintillator/Width");
98 m_ScintHeight = data.getLength(
"Module/Scintillator/Height");
99 m_ScintBoreRadius = data.getLength(
"Module/Scintillator/BoreRadius");
100 m_ScintFiberRadius = data.getLength(
"Module/Scintillator/FiberRadius");
101 m_ScintTiO2ThicknessTop = data.getLength(
"Module/Scintillator/TiO2ThicknessTop");
102 m_ScintTiO2ThicknessSide = data.getLength(
"Module/Scintillator/TiO2ThicknessSide");
104 m_ChimneyLength = data.getLength(
"Chimney/Length");
105 m_ChimneyWidth = data.getLength(
"Chimney/Width");
106 m_ChimneyCoverThickness = data.getLength(
"Chimney/CoverThickness");
107 m_ChimneyHousingInnerRadius = data.getLength(
"Chimney/HousingInnerRadius");
108 m_ChimneyHousingOuterRadius = data.getLength(
"Chimney/HousingOuterRadius");
109 m_ChimneyShieldInnerRadius = data.getLength(
"Chimney/ShieldInnerRadius");
110 m_ChimneyShieldOuterRadius = data.getLength(
"Chimney/ShieldOuterRadius");
111 m_ChimneyPipeInnerRadius = data.getLength(
"Chimney/PipeInnerRadius");
112 m_ChimneyPipeOuterRadius = data.getLength(
"Chimney/PipeOuterRadius");
114 m_RibThickness = data.getLength(
"RibThickness");
115 m_CablesWidth = data.getLength(
"CablesWidth");
116 m_BraceWidth = data.getLength(
"BraceWidth");
117 m_BraceWidthChimney = data.getLength(
"BraceWidthChimney");
119 m_SupportPlateWidth = data.getLength(
"SupportPlateWidth");
120 m_SupportPlateHeight = data.getLength(
"SupportPlateHeight");
121 m_SupportPlateLength = data.getLength(
"SupportPlateLength");
122 m_SupportPlateLengthChimney = data.getLength(
"SupportPlateLengthChimney");
124 m_BracketWidth = data.getLength(
"BracketWidth");
125 m_BracketThickness = data.getLength(
"BracketThickness");
126 m_BracketLength = data.getLength(
"BracketLength");
127 m_BracketRibWidth = data.getLength(
"BracketRibWidth");
128 m_BracketRibThickness = data.getLength(
"BracketRibThickness");
129 m_BracketInnerRadius = data.getLength(
"BracketInnerRadius");
130 m_BracketInset = data.getLength(
"BracketInset");
131 m_BracketCutoutDphi = data.getAngle(
"BracketCutoutDphi");
133 m_NReadoutStation = data.getNumberNodes(
"Readout/Stations/Station");
134 if (m_NReadoutStation > NSTATION) {
135 B2FATAL(
"BKLMGeometryPar::read(): readout stations array size exceeded:"
136 <<
LogVar(
"# of readout stations", m_NReadoutStation)
137 <<
LogVar(
"array size", NSTATION));
139 for (
int station = 1; station <= m_NReadoutStation; ++station) {
140 sprintf(name,
"/Readout/Stations/Station[@station=\"%d\"]", station);
142 stationContent.
append(name);
143 m_ReadoutStationIsPhi[station - 1] = stationContent.
getBool(
"IsPhi");
144 m_ReadoutStationPosition[station - 1] = stationContent.
getLength(
"Position");
146 m_ReadoutContainerLength = data.getLength(
"Readout/Container/Length");
147 m_ReadoutContainerWidth = data.getLength(
"Readout/Container/Width");
148 m_ReadoutContainerHeight = data.getLength(
"Readout/Container/Height");
149 m_ReadoutCarrierLength = data.getLength(
"Readout/Carrier/Length");
150 m_ReadoutCarrierWidth = data.getLength(
"Readout/Carrier/Width");
151 m_ReadoutCarrierHeight = data.getLength(
"Readout/Carrier/Height");
152 m_ReadoutPreamplifierLength = data.getLength(
"Readout/Preamplifier/Length");
153 m_ReadoutPreamplifierWidth = data.getLength(
"Readout/Preamplifier/Width");
154 m_ReadoutPreamplifierHeight = data.getLength(
"Readout/Preamplifier/Height");
155 m_ReadoutPreamplifierPosition = data.getArray(
"Readout/Preamplifier/Position");
156 m_ReadoutConnectorsLength = data.getLength(
"Readout/Connectors/Length");
157 m_ReadoutConnectorsWidth = data.getLength(
"Readout/Connectors/Width");
158 m_ReadoutConnectorsHeight = data.getLength(
"Readout/Connectors/Height");
159 m_ReadoutConnectorsPosition = data.getLength(
"Readout/Connectors/Position");
160 m_MPPCHousingRadius = data.getLength(
"Readout/MPPC/Housing/Radius");
161 m_MPPCHousingLength = data.getLength(
"Readout/MPPC/Housing/Length");
162 m_MPPCLength = data.getLength(
"Readout/MPPC/Sensor/Length");
163 m_MPPCWidth = data.getLength(
"Readout/MPPC/Sensor/Width");
164 m_MPPCHeight = data.getLength(
"Readout/MPPC/Sensor/Height");
167 for (
int layer = 1; layer <= m_NLayer; ++layer) {
168 sprintf(name,
"/Layers/Layer[@layer=\"%d\"]", layer);
170 layerContent.
append(name);
171 m_HasRPCs[layer - 1] = layerContent.
getBool(
"HasRPCs");
172 m_NPhiStrips[layer - 1] = layerContent.
getInt(
"PhiStrips/NStrips");
173 m_PhiStripWidth[layer - 1] = layerContent.
getLength(
"PhiStrips/Width");
174 m_ZStripWidth[layer - 1] = layerContent.
getLength(
"ZStrips/Width");
175 if (layer <= NSCINTLAYER) {
176 m_ScintEnvelopeOffsetSign[layer - 1] = layerContent.
getInt(
"ScintEnvelopeOffsetSign");
177 m_NPhiScints[layer - 1] = layerContent.
getInt(
"PhiScintillators/NScints", 0);
178 if (m_NPhiScints[layer - 1] > NPHISCINT) {
179 B2FATAL(
"BKLMGeometryPar::read(): phi-scint array size exceeded:"
180 <<
LogVar(
"in zero-based layer", layer - 1)
181 <<
LogVar(
"# of phi scintillators", m_NPhiScints[layer - 1])
182 <<
LogVar(
"array size", NPHISCINT));
184 for (
int scint = 1; scint <= m_NZScints; ++scint) {
185 sprintf(name,
"/ZScintillators/Scint[@scint=\"%d\"]", scint);
186 GearDir scintContent(layerContent);
187 scintContent.
append(name);
188 m_ZScintDLength[layer - 1][scint - 1] = scintContent.
getLength(
"DLength", 0.0);
196 for (
int sector = 1; sector <= m_NSector; ++sector) {
197 sprintf(name,
"/Sectors/%s/Sector[@sector=\"%d\"]", (isForward ?
"Forward" :
"Backward"), sector);
199 sectorContent.
append(name);
200 m_SectorRotation[section][sector - 1] = sectorContent.
getAngle(
"Phi");
201 for (
int layer = 1; layer <= m_NLayer; ++layer) {
202 GearDir layerContent(sectorContent);
203 sprintf(name,
"/Layer[@layer=\"%d\"]", layer);
204 layerContent.
append(name);
205 m_LocalReconstructionShiftX[section][sector - 1][layer - 1] = layerContent.
getLength(
"ReconstructionShift/X");
206 m_LocalReconstructionShiftY[section][sector - 1][layer - 1] = layerContent.
getLength(
"ReconstructionShift/Y");
207 m_LocalReconstructionShiftZ[section][sector - 1][layer - 1] = layerContent.
getLength(
"ReconstructionShift/Z");
208 if (layer <= NSCINTLAYER) {
209 m_IsFlipped[section][sector - 1][layer - 1] = layerContent.
getBool(
"Flip",
false);
static constexpr int getMaximalLayerNumber()
Get maximal layer number (1-based).
@ c_ForwardSection
Forward.
static constexpr int getMaximalSectorNumber()
Get maximal sector number (1-based).
static constexpr int getMaximalSectionNumber()
Get maximal section number (0-based).
~BKLMGeometryPar()
Destructor.
BKLMGeometryPar()
Default constructor.
void read(const GearDir &)
Get geometry parameters from Gearbox.
GearDir is the basic class used for accessing the parameter store.
void append(const std::string &path)
Append something to the current path, modifying the GearDir in place.
double getAngle(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard angle unit.
double getLength(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard length unit.
bool getBool(const std::string &path="") const noexcept(false)
Get the parameter path as a bool.
int getInt(const std::string &path="") const noexcept(false)
Get the parameter path as a int.
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.