Belle II Software  release-05-01-25
VXDGeometryPar.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Benjamin Schwenker *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <vxd/dbobjects/VXDGeometryPar.h>
12 #include <framework/logging/Logger.h>
13 #include <boost/format.hpp>
14 
15 using namespace Belle2;
16 using namespace std;
17 
18 
19 const VXDGeoComponentPar& VXDGeometryPar::getComponent(std::string name) const
20 {
21  //Check if component already exists
22  std::map<string, VXDGeoComponentPar>::const_iterator cached = m_componentCache.find(name);
23  if (cached == m_componentCache.end()) {
24  B2FATAL("Could not find component " << name);
25  }
26  return cached->second;
27 }
28 
29 
30 
31 int VXDGeometryPar::getSensitiveChipID(std::string name) const
32 {
33  //Check if sensorType already exists
34  std::map<string, int>::const_iterator cached = m_sensitiveIDCache.find(name);
35  if (cached == m_sensitiveIDCache.end()) {
36  return -1;
37  }
38  return cached->second;
39 }
40 
41 
42 
43 const VXDGeoSensorPar& VXDGeometryPar::getSensor(string sensorTypeID) const
44 {
45  //Check if sensorType already exists
46  std::map<string, VXDGeoSensorPar>::const_iterator cached = m_sensorMap.find(sensorTypeID);
47  if (cached == m_sensorMap.end()) {
48  B2FATAL("Invalid SensorTypeID " << sensorTypeID);
49  }
50  return cached->second;
51 }
52 
54 {
55  //Check if component already exists
56  map<int, VXDGeoLadderPar>::const_iterator cached = m_ladders.find(layer);
57  if (cached == m_ladders.end()) {
58  B2FATAL("Could not find ladder for layer " << (boost::format("%1%") % layer).str());
59  }
60  return cached->second;
61 }
62 
63 
65 {
66  //Check if component already exists
67  map<string, VXDAlignmentPar>::const_iterator cached = m_alignment.find(name);
68  if (cached == m_alignment.end()) {
69  B2FATAL("Could not find alignment parameters for component " << name);
70  }
71  return cached->second;
72 }
73 
74 
75 
76 
77 
Belle2::VXDAlignmentPar
The Class for VXD Alignment payload.
Definition: VXDAlignmentPar.h:33
Belle2::VXDGeoLadderPar
The Class for VXD Ladder payload.
Definition: VXDGeoLadderPar.h:39
Belle2::VXDGeoSensorPar
The Class for VXD Sensor payload.
Definition: VXDGeoSensorPar.h:39
Belle2::VXDGeometryPar::getLadder
const VXDGeoLadderPar & getLadder(int layerID) const
get ladder for given layer
Definition: VXDGeometryPar.cc:53
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VXDGeometryPar::getSensitiveChipID
int getSensitiveChipID(std::string name) const
get Bkg sensitive chip Id
Definition: VXDGeometryPar.cc:31
Belle2::VXDGeoComponentPar
The Class for VXD geometry component.
Definition: VXDGeoComponentPar.h:36
Belle2::VXDGeometryPar::getComponent
const VXDGeoComponentPar & getComponent(std::string name) const
get component
Definition: VXDGeometryPar.cc:19
Belle2::VXDGeometryPar::getAlignment
VXDAlignmentPar getAlignment(std::string name) const
get alignment parameters for component name
Definition: VXDGeometryPar.cc:64
Belle2::VXDGeometryPar::getSensor
const VXDGeoSensorPar & getSensor(std::string sensorTypeID) const
get sensor type
Definition: VXDGeometryPar.cc:43