10#include <klm/dbobjects/bklm/BKLMGeometryPar.h>
13#include <framework/gearbox/GearDir.h>
14#include <framework/logging/Logger.h>
32 B2FATAL(
"The GearDir to look for BKLM geometry parameters is not valid.");
41 m_Phi = data.getLength(
"Phi");
42 m_NSector = data.getNumberNodes(
"Sectors/Forward/Sector");
44 B2FATAL(
"BKLMGeometryPar::read(): sectors array size exceeded:"
51 m_NLayer = data.getNumberNodes(
"Layers/Layer");
53 B2FATAL(
"BKLMGeometryPar::read(): layer array size exceeded:"
63 m_Gap1IronWidth = data.getLength(
"Layers/Layer[@layer=\"1\"]/GapIronWidth");
69 m_NZScints = data.getInt(
"Layers/NZScintillators");
73 B2FATAL(
"BKLMGeometryPar::read(): z-scint array size exceeded:"
75 <<
LogVar(
"array size", NZSCINT));
78 B2FATAL(
"BKLMGeometryPar::read(): chimney sector z-scint array size exceeded:"
80 <<
LogVar(
"array size", NZSCINT));
96 m_ScintWidth = data.getLength(
"Module/Scintillator/Width");
134 B2FATAL(
"BKLMGeometryPar::read(): readout stations array size exceeded:"
136 <<
LogVar(
"array size", NSTATION));
139 sprintf(name,
"/Readout/Stations/Station[@station=\"%d\"]", station);
141 stationContent.
append(name);
161 m_MPPCLength = data.getLength(
"Readout/MPPC/Sensor/Length");
162 m_MPPCWidth = data.getLength(
"Readout/MPPC/Sensor/Width");
163 m_MPPCHeight = data.getLength(
"Readout/MPPC/Sensor/Height");
166 for (
int layer = 1; layer <=
m_NLayer; ++layer) {
167 sprintf(name,
"/Layers/Layer[@layer=\"%d\"]", layer);
169 layerContent.
append(name);
174 if (layer <= NSCINTLAYER) {
178 B2FATAL(
"BKLMGeometryPar::read(): phi-scint array size exceeded:"
179 <<
LogVar(
"in zero-based layer", layer - 1)
181 <<
LogVar(
"array size", NPHISCINT));
183 for (
int scint = 1; scint <=
m_NZScints; ++scint) {
184 sprintf(name,
"/ZScintillators/Scint[@scint=\"%d\"]", scint);
185 GearDir scintContent(layerContent);
186 scintContent.
append(name);
195 for (
int sector = 1; sector <=
m_NSector; ++sector) {
196 sprintf(name,
"/Sectors/%s/Sector[@sector=\"%d\"]", (isForward ?
"Forward" :
"Backward"), sector);
198 sectorContent.
append(name);
200 for (
int layer = 1; layer <=
m_NLayer; ++layer) {
201 GearDir layerContent(sectorContent);
202 sprintf(name,
"/Layer[@layer=\"%d\"]", layer);
203 layerContent.
append(name);
207 if (layer <= NSCINTLAYER) {
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).
double m_LocalReconstructionShiftX[2][BKLMElementNumbers::getMaximalSectorNumber()][BKLMElementNumbers::getMaximalLayerNumber()]
Reconstruction dx in local system. displacement, not alignment.
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.
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_ReadoutContainerHeight
Height of the readout station.
double m_ReadoutCarrierHeight
Height of the readout carrier card.
double m_ModuleLengthChimney
Length along z of the module in the chimney sector.
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.
double m_Gap1IronWidth
Width (at the outer radius) of the adjacent structural iron on either side of innermost gap.
~BKLMGeometryPar()
Destructor.
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.
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.
double m_BracketRibThickness
Thickness of the innermost-module support plate's bracket's rib.
double m_Gap1NominalHeight
Nominal height of the innermost gap.
double m_ScintFiberRadius
Radius (cm) of the central WLS fiber in the scintillator strip.
double m_MPPCLength
MPPC length.
int m_ScintEnvelopeOffsetSign[NSCINTLAYER]
Sign (+/-1) of scintillator-envelope's shift along y axis within its enclosing module for MPPC placem...
double m_SupportPlateLength
Length of the innermost-module support plate.
double m_ModuleMylarHeight
Height of a detector module's mylar insulation.
double m_ModuleFrameThickness
Thickness of a detector module's frame ("C" shape - thickness of vertical leg)
double m_ChimneyShieldInnerRadius
Inner radius of the chimney shield.
double m_Rotation
Global rotation angle about z of the BKLM.
double m_ZScintDLength[NSCINTLAYER][NZSCINT]
Shortening of the nominal length of the z scintillators for scintillator layers only
int m_NReadoutStation
Number of preamplifier readout stations.
double m_ModulePolystyreneOuterHeight
Height of the outer polystyrene-filler sheet.
double m_ChimneyLength
Length along z of the chimney hole.
double m_ReadoutContainerWidth
Width of the readout station.
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.
double m_OuterRadius
Radius of the circle tangent to the sides of the outer polygon.
double m_BracketThickness
Thickness of the innermost-module support plate's bracket.
double m_ModuleGlassHeight
Height of a detector module's glass electrode.
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.
BKLMGeometryPar()
Default constructor.
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_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_MPPCHeight
MPPC height.
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.
double m_GapLength
Length along z of each gap.
double m_MPPCHousingRadius
MPPC housing radius.
double m_MPPCHousingLength
MPPC housing length.
int m_NPhiScints[NSCINTLAYER]
Number of phi-readout scintillators in each layer for scintillator layers only
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 m_BraceWidth
Width of the central brace in the middle of the cable-services channel.
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 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.
bool m_IsFlipped[2][BKLMElementNumbers::getMaximalSectorNumber()][NSCINTLAYER]
Flag of z-phi planes flip for scintillator layers only
double m_Phi
Starting angle of the polygon shape.
std::vector< double > m_ReadoutPreamplifierPosition
Positions of the preamplifiers along the length of the carrier card.
void read(const GearDir &)
Get geometry parameters from Gearbox.
double m_LocalReconstructionShiftY[2][BKLMElementNumbers::getMaximalSectorNumber()][BKLMElementNumbers::getMaximalLayerNumber()]
Reconstruction dy in local system. displacement, not alignment.
double m_ModuleCoverHeight
Height of a detector module's aluminum cover.
double m_Gap1InnerRadius
Radius of the inner tangent circle of the innermost gap.
double m_SolenoidOuterRadius
Outer radius of the solenoid.
int m_NSector
Number of sectors (=8 : octagonal)
bool m_DoBeamBackgroundStudy
Flag for enabling beam background study (=alternate sensitive-detector function)
double m_ChimneyPipeOuterRadius
Outer radius of the chimney pipe.
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.
double m_BracketCutoutDphi
Angular width of the innermost-module support plate's bracket's cutout.
int m_NZScints
Number of z-measuring scintillators in a standard scintillator module.
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.