Belle II Software  release-05-02-19
GeometryData.h
Go to the documentation of this file.
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Kirill Chilikin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* KLM headers. */
14 #include <klm/dbobjects/eklm/EKLMGeometry.h>
15 
16 /* Belle 2 headers. */
17 #include <framework/database/IntervalOfValidity.h>
18 #include <framework/gearbox/GearDir.h>
19 
20 /* CLHEP headers. */
21 #include <CLHEP/Geometry/Transform3D.h>
22 
28 namespace Belle2 {
34  namespace EKLM {
35 
40  class GeometryData : public EKLMGeometry {
41 
42  public:
43 
45  enum DataSource {
46 
49 
52 
53  };
54 
60  static const GeometryData& Instance(
61  enum DataSource dataSource = c_Database,
62  const GearDir* gearDir = nullptr);
63 
67  void saveToDatabase(const IntervalOfValidity& iov) const;
68 
73  double getStripLength(int strip) const
74  {
75  return m_StripPosition[strip - 1].getLength();
76  }
77 
82  {
83  return m_nStripDifferent;
84  }
85 
90  int getStripLengthIndex(int positionIndex) const
91  {
92  return m_StripAllToLen[positionIndex];
93  }
94 
99  int getStripPositionIndex(int lengthIndex) const
100  {
101  return m_StripLenToAll[lengthIndex];
102  }
103 
110  bool hitInEKLM(double z) const;
111 
119  void getSectionTransform(HepGeom::Transform3D* t, int n) const;
120 
128  void getLayerTransform(HepGeom::Transform3D* t, int n) const;
129 
137  void getSectorTransform(HepGeom::Transform3D* t, int n) const;
138 
146  void getPlaneTransform(HepGeom::Transform3D* t, int n) const;
147 
155  void getStripTransform(HepGeom::Transform3D* t, int n) const;
156 
166  void getSheetTransform(HepGeom::Transform3D* t, int n) const;
167 
168  private:
169 
175  explicit GeometryData(enum DataSource dataSource, const GearDir* gearDir);
176 
180  ~GeometryData();
181 
186  void readEndcapStructureGeometry(const GearDir& gd);
187 
192  void initializeFromGearbox(const GearDir* gearDir);
193 
197  void initializeFromDatabase();
198 
203 
207  void fillStripIndexArrays();
208 
212  void readXMLDataStrips(const GearDir& gd);
213 
218 
221 
224 
227 
230 
233 
236 
237  };
238 
239  }
240 
242 }
Belle2::IntervalOfValidity
A class that describes the interval of experiments/runs for which an object in the database is valid.
Definition: IntervalOfValidity.h:35
Belle2::EKLM::GeometryData::~GeometryData
~GeometryData()
Destructor.
Definition: GeometryData.cc:626
Belle2::EKLMGeometry
Class to store EKLM geometry data in the database.
Definition: EKLMGeometry.h:39
Belle2::EKLM::GeometryData::initializeFromDatabase
void initializeFromDatabase()
Initialize from database.
Definition: GeometryData.cc:596
Belle2::EKLM::GeometryData::m_MinZForward
double m_MinZForward
Minimal z coordinate of the forward section.
Definition: GeometryData.h:232
Belle2::EKLM::GeometryData::readEndcapStructureGeometry
void readEndcapStructureGeometry(const GearDir &gd)
Read section structure geometry data.
Definition: GeometryData.cc:471
Belle2::EKLM::GeometryData::fillStripIndexArrays
void fillStripIndexArrays()
Fill strip index arrays.
Definition: GeometryData.cc:204
Belle2::EKLM::GeometryData::getLayerTransform
void getLayerTransform(HepGeom::Transform3D *t, int n) const
Get layer transformation.
Definition: GeometryData.cc:662
Belle2::EKLM::GeometryData::m_StripLenToAll
int * m_StripLenToAll
Number of strip in position-based array.
Definition: GeometryData.h:229
Belle2::EKLM::GeometryData::m_Geometry
EKLMGeometry * m_Geometry
Copy of data in this class used to write it to database.
Definition: GeometryData.h:220
Belle2::EKLM::GeometryData::c_Gearbox
@ c_Gearbox
Gearbox (XML).
Definition: GeometryData.h:48
Belle2::EKLM::GeometryData::calculateSectorSupportGeometry
void calculateSectorSupportGeometry()
Calculate sector support geometry data.
Definition: GeometryData.cc:119
Belle2::EKLM::GeometryData::m_MaxZBackward
double m_MaxZBackward
Maximal z coordinate of the backward section.
Definition: GeometryData.h:235
Belle2::EKLM::GeometryData::getStripLengthIndex
int getStripLengthIndex(int positionIndex) const
Get index in length-based array.
Definition: GeometryData.h:90
Belle2::EKLM::GeometryData::getSheetTransform
void getSheetTransform(HepGeom::Transform3D *t, int n) const
Get plastic sheet element transformation.
Definition: GeometryData.cc:710
Belle2::EKLMGeometry::m_StripPosition
ElementPosition * m_StripPosition
Position data for strips.
Definition: EKLMGeometry.h:1961
Belle2::EKLM::GeometryData::getPlaneTransform
void getPlaneTransform(HepGeom::Transform3D *t, int n) const
Get plane transformation.
Definition: GeometryData.cc:690
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EKLM::GeometryData::getStripLength
double getStripLength(int strip) const
Get strip length.
Definition: GeometryData.h:73
Belle2::EKLM::GeometryData::saveToDatabase
void saveToDatabase(const IntervalOfValidity &iov) const
Save geometry data to database.
Definition: GeometryData.cc:634
Belle2::EKLM::GeometryData::hitInEKLM
bool hitInEKLM(double z) const
Check if z coordinate may be in EKLM.
Definition: GeometryData.cc:639
Belle2::EKLM::GeometryData::c_Database
@ c_Database
Database.
Definition: GeometryData.h:51
Belle2::EKLM::GeometryData::getNStripsDifferentLength
int getNStripsDifferentLength() const
Get number of strips with different lengths.
Definition: GeometryData.h:81
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::EKLM::GeometryData
EKLM geometry data.
Definition: GeometryData.h:40
Belle2::EKLM::GeometryData::m_StripAllToLen
int * m_StripAllToLen
Number of strip in length-based array.
Definition: GeometryData.h:226
Belle2::EKLM::GeometryData::DataSource
DataSource
Geometry data source.
Definition: GeometryData.h:45
Belle2::EKLM::GeometryData::initializeFromGearbox
void initializeFromGearbox(const GearDir *gearDir)
Initialize from Gearbox (XML).
Definition: GeometryData.cc:479
Belle2::EKLM::GeometryData::GeometryData
GeometryData(enum DataSource dataSource, const GearDir *gearDir)
Constructor.
Definition: GeometryData.cc:605
Belle2::EKLM::GeometryData::getStripPositionIndex
int getStripPositionIndex(int lengthIndex) const
Get index in position-based array.
Definition: GeometryData.h:99
Belle2::EKLM::GeometryData::calculateShieldGeometry
void calculateShieldGeometry()
Calculate shield geometry data.
Definition: GeometryData.cc:387
Belle2::EKLM::GeometryData::getStripTransform
void getStripTransform(HepGeom::Transform3D *t, int n) const
Get strip transformation.
Definition: GeometryData.cc:703
Belle2::EKLMGeometry::ElementPosition::getLength
double getLength() const
Get length.
Definition: EKLMGeometry.h:156
Belle2::EKLM::GeometryData::m_nStripDifferent
int m_nStripDifferent
Number of strips with different lengths in one plane.
Definition: GeometryData.h:223
Belle2::EKLM::GeometryData::getSectorTransform
void getSectorTransform(HepGeom::Transform3D *t, int n) const
Get sector transformation.
Definition: GeometryData.cc:670
Belle2::EKLM::GeometryData::readXMLDataStrips
void readXMLDataStrips(const GearDir &gd)
Read strip parameters from XML database.
Definition: GeometryData.cc:260
Belle2::EKLM::GeometryData::getSectionTransform
void getSectionTransform(HepGeom::Transform3D *t, int n) const
Get section transformation.
Definition: GeometryData.cc:650
Belle2::EKLM::GeometryData::Instance
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
Definition: GeometryData.cc:35