Belle II Software development
GeometryData.h
Go to the documentation of this file.
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#pragma once
10
11/* KLM headers. */
12#include <klm/dbobjects/eklm/EKLMGeometry.h>
13
14/* Basf2 headers. */
15#include <framework/database/IntervalOfValidity.h>
16#include <framework/gearbox/GearDir.h>
17
18/* CLHEP headers. */
19#include <CLHEP/Geometry/Transform3D.h>
20
26namespace Belle2 {
32 namespace EKLM {
33
38 class GeometryData : public EKLMGeometry {
39
40 public:
41
44
47
50
51 };
52
58 static const GeometryData& Instance(
59 enum DataSource dataSource = c_Database,
60 const GearDir* gearDir = nullptr);
61
65 void saveToDatabase(const IntervalOfValidity& iov) const;
66
71 double getStripLength(int strip) const
72 {
73 return m_StripPosition[strip - 1].getLength();
74 }
75
79 double getMaximalStripLength() const
80 {
83 }
84
89 {
90 return m_nStripDifferent;
91 }
92
97 int getStripLengthIndex(int positionIndex) const
98 {
99 return m_StripAllToLen[positionIndex];
100 }
101
106 int getStripPositionIndex(int lengthIndex) const
107 {
108 return m_StripLenToAll[lengthIndex];
109 }
110
117 bool hitInEKLM(double z) const;
118
126 void getSectionTransform(HepGeom::Transform3D* t, int n) const;
127
135 void getLayerTransform(HepGeom::Transform3D* t, int n) const;
136
144 void getSectorTransform(HepGeom::Transform3D* t, int n) const;
145
153 void getPlaneTransform(HepGeom::Transform3D* t, int n) const;
154
162 void getStripTransform(HepGeom::Transform3D* t, int n) const;
163
173 void getSheetTransform(HepGeom::Transform3D* t, int n) const;
174
175 private:
176
182 explicit GeometryData(enum DataSource dataSource, const GearDir* gearDir);
183
188
193 void readEndcapStructureGeometry(const GearDir& gd);
194
199 void initializeFromGearbox(const GearDir* gearDir);
200
205
210
215
219 void readXMLDataStrips(const GearDir& gd);
220
225
228
231
234
237
240
243
244 };
245
246 }
247
249}
double getLength() const
Get length.
Definition: EKLMGeometry.h:146
Class to store EKLM geometry data in the database.
Definition: EKLMGeometry.h:29
ElementPosition * m_StripPosition
Position data for strips.
EKLM geometry data.
Definition: GeometryData.h:38
void getSectorTransform(HepGeom::Transform3D *t, int n) const
Get sector transformation.
int * m_StripLenToAll
Number of strip in position-based array.
Definition: GeometryData.h:236
void fillStripIndexArrays()
Fill strip index arrays.
void getSheetTransform(HepGeom::Transform3D *t, int n) const
Get plastic sheet element transformation.
bool hitInEKLM(double z) const
Check if z coordinate may be in EKLM.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
Definition: GeometryData.cc:33
void calculateSectorSupportGeometry()
Calculate sector support geometry data.
void saveToDatabase(const IntervalOfValidity &iov) const
Save geometry data to database.
int getNStripsDifferentLength() const
Get number of strips with different lengths.
Definition: GeometryData.h:88
void initializeFromGearbox(const GearDir *gearDir)
Initialize from Gearbox (XML).
void getStripTransform(HepGeom::Transform3D *t, int n) const
Get strip transformation.
void readEndcapStructureGeometry(const GearDir &gd)
Read section structure geometry data.
void getSectionTransform(HepGeom::Transform3D *t, int n) const
Get section transformation.
void getLayerTransform(HepGeom::Transform3D *t, int n) const
Get layer transformation.
int getStripLengthIndex(int positionIndex) const
Get index in length-based array.
Definition: GeometryData.h:97
void calculateShieldGeometry()
Calculate shield geometry data.
double m_MaxZBackward
Maximal z coordinate of the backward section.
Definition: GeometryData.h:242
EKLMGeometry * m_Geometry
Copy of data in this class used to write it to database.
Definition: GeometryData.h:227
double getStripLength(int strip) const
Get strip length.
Definition: GeometryData.h:71
double m_MinZForward
Minimal z coordinate of the forward section.
Definition: GeometryData.h:239
void initializeFromDatabase()
Initialize from database.
DataSource
Geometry data source.
Definition: GeometryData.h:43
@ c_Gearbox
Gearbox (XML).
Definition: GeometryData.h:46
int m_nStripDifferent
Number of strips with different lengths in one plane.
Definition: GeometryData.h:230
int getStripPositionIndex(int lengthIndex) const
Get index in position-based array.
Definition: GeometryData.h:106
void getPlaneTransform(HepGeom::Transform3D *t, int n) const
Get plane transformation.
int * m_StripAllToLen
Number of strip in length-based array.
Definition: GeometryData.h:233
void readXMLDataStrips(const GearDir &gd)
Read strip parameters from XML database.
double getMaximalStripLength() const
Get maximal strip length.
Definition: GeometryData.h:79
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
A class that describes the interval of experiments/runs for which an object in the database is valid.
Abstract base class for different kinds of events.