Belle II Software development
VXDGeometryPar.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#include <vxd/dbobjects/VXDGeometryPar.h>
10#include <framework/logging/Logger.h>
11#include <boost/format.hpp>
12
13using namespace Belle2;
14using namespace std;
15
16
18{
19 //Check if component already exists
20 std::map<string, VXDGeoComponentPar>::const_iterator cached = m_componentCache.find(name);
21 if (cached == m_componentCache.end()) {
22 B2FATAL("Could not find component " << name);
23 }
24 return cached->second;
25}
26
27
28
29int VXDGeometryPar::getSensitiveChipID(std::string name) const
30{
31 //Check if sensorType already exists
32 std::map<string, int>::const_iterator cached = m_sensitiveIDCache.find(name);
33 if (cached == m_sensitiveIDCache.end()) {
34 return -1;
35 }
36 return cached->second;
37}
38
39
40
41const VXDGeoSensorPar& VXDGeometryPar::getSensor(string sensorTypeID) const
42{
43 //Check if sensorType already exists
44 std::map<string, VXDGeoSensorPar>::const_iterator cached = m_sensorMap.find(sensorTypeID);
45 if (cached == m_sensorMap.end()) {
46 B2FATAL("Invalid SensorTypeID " << sensorTypeID);
47 }
48 return cached->second;
49}
50
52{
53 //Check if component already exists
54 map<int, VXDGeoLadderPar>::const_iterator cached = m_ladders.find(layer);
55 if (cached == m_ladders.end()) {
56 B2FATAL("Could not find ladder for layer " << (boost::format("%1%") % layer).str());
57 }
58 return cached->second;
59}
60
61
63{
64 //Check if component already exists
65 map<string, VXDAlignmentPar>::const_iterator cached = m_alignment.find(name);
66 if (cached == m_alignment.end()) {
67 B2FATAL("Could not find alignment parameters for component " << name);
68 }
69 return cached->second;
70}
71
72
73
74
75
The Class for VXD Alignment payload.
The Class for VXD geometry component.
The Class for VXD Ladder payload.
The Class for VXD Sensor payload.
VXDAlignmentPar getAlignment(std::string name) const
get alignment parameters for component name
std::map< int, VXDGeoLadderPar > m_ladders
Parameters of the detector ladders.
int getSensitiveChipID(std::string name) const
get Bkg sensitive chip Id
std::map< std::string, VXDAlignmentPar > m_alignment
Alignment parameters for all components.
std::map< std::string, VXDGeoComponentPar > m_componentCache
Cache of all previously created components.
std::map< std::string, int > m_sensitiveIDCache
Cache of all Bkg sensitive chip Ids.
std::map< std::string, VXDGeoSensorPar > m_sensorMap
Map containing Information about all defined sensor types.
const VXDGeoComponentPar & getComponent(std::string name) const
get component
const VXDGeoSensorPar & getSensor(std::string sensorTypeID) const
get sensor type
const VXDGeoLadderPar & getLadder(int layerID) const
get ladder for given layer
Abstract base class for different kinds of events.
STL namespace.