Belle II Software development
GeoVXDComponents.h
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#include <string>
12#include <vector>
13
14class G4LogicalVolume;
15
16namespace Belle2 {
21 namespace VXD {
22 class SensorInfoBase;
23 }
24
27 public:
36
37 VXDGeoPlacement(const std::string& name = "", double u = 0, double v = 0,
38 std::string w = "bottom", double woffset = 0);
40 const std::string& getName() const { return m_name; }
42 double getU() const { return m_u; }
44 double getV() const { return m_v; }
46 EPosW getW() const { return m_w; }
48 double getWOffset() const { return m_woffset; }
49 private:
51 std::string m_name;
53 double m_u;
55 double m_v;
59 double m_woffset;
60 };
61
64 public:
66 VXDGeoComponent(const std::string& material = "", const std::string& color = "",
67 double width = 0, double width2 = 0, double length = 0, double height = 0):
68 m_volume(0), m_material(material), m_color(color), m_width(width), m_width2(width2), m_length(length),
69 m_height(height) {}
70
71 G4LogicalVolume* getVolume() const { return m_volume; }
73 void setVolume(G4LogicalVolume* volume) { m_volume = volume; }
75 const std::string& getMaterial() const { return m_material; }
77 const std::string& getColor() const { return m_color; }
79 double getWidth() const { return m_width; }
81 void setWidth(double width) { m_width = width; m_width2 = 0; }
83 double getWidth2() const { return m_width2; }
85 double getLength() const { return m_length; }
87 void setLength(double length) { m_length = length; }
89 double& getHeight() { return m_height; }
91 double getHeight() const { return m_height; }
92 private:
94 G4LogicalVolume* m_volume;
96 std::string m_material;
98 std::string m_color;
100 double m_width;
102 double m_width2;
104 double m_length;
106 double m_height;
107 };
108
111 public:
113 VXDGeoSensor(const std::string& material = "", const std::string& color = "",
114 double width = 0, double width2 = 0, double length = 0, double height = 0, bool slanted = false):
115 VXDGeoComponent(material, color, width, width2, length, height), m_info(0), m_slanted(slanted) {}
116
120 void setActive(const VXDGeoComponent& area, const VXDGeoPlacement& placement)
121 {
122 m_activeArea = area; m_activePlacement = placement;
123 }
124
129 void setComponents(const std::vector<VXDGeoPlacement>& component) { m_components = component; }
131 const std::vector<VXDGeoPlacement>& getComponents() const { return m_components; }
135 const VXD::SensorInfoBase* getSensorInfo() const { return m_info; }
137 bool getSlanted() const { return m_slanted; }
138 private:
148 std::vector<VXDGeoPlacement> m_components;
149 };
150
153 public:
155 VXDGeoSensorPlacement(int sensorID = 0, const std::string& sensorTypeID = "", double z = 0,
156 bool flipU = false, bool flipV = false, bool flipW = false):
157 m_sensorID(sensorID), m_sensorTypeID(sensorTypeID), m_z(z), m_flipU(flipU), m_flipV(flipV), m_flipW(flipW) {}
158
159 int getSensorID() const { return m_sensorID; }
161 const std::string& getSensorTypeID() const { return m_sensorTypeID; }
163 double getZ() const { return m_z; }
165 bool getFlipU() const { return m_flipU; }
167 bool getFlipV() const { return m_flipV; }
169 bool getFlipW() const { return m_flipW; }
170 private:
174 std::string m_sensorTypeID;
176 double m_z;
183 };
184
187 public:
189 VXDGeoLadder(int layerID = 0, double shift = 0, double radius = 0,
190 double slantedAngle = 0, double slantedRadius = 0,
191 double glueSize = -1, const std::string& glueMaterial = ""):
192 m_layerID(layerID), m_shift(shift), m_radius(radius),
193 m_slantedAngle(slantedAngle), m_slantedRadius(slantedRadius),
194 m_glueSize(glueSize), m_glueMaterial(glueMaterial) {}
195
196 int getLayerID() const { return m_layerID; }
198 double getShift() const { return m_shift; }
200 double getRadius() const { return m_radius; }
202 double getSlantedAngle() const { return m_slantedAngle; }
204 double getSlantedRadius() const { return m_slantedRadius; }
206 double getGlueSize() const { return m_glueSize; }
208 const std::string& getGlueMaterial() const { return m_glueMaterial; }
210 const std::vector<VXDGeoSensorPlacement>& getSensors() const { return m_sensors; }
212 void addSensor(const VXDGeoSensorPlacement& sensor) { m_sensors.push_back(sensor); }
213 private:
217 double m_shift;
219 double m_radius;
227 std::string m_glueMaterial;
229 std::vector<VXDGeoSensorPlacement> m_sensors;
230 };
231
233} // namespace Belle2
double getWidth() const
get the width of the component
double getHeight() const
get the height of the component
std::string m_material
transient member, owned by Geant4
VXDGeoComponent(const std::string &material="", const std::string &color="", double width=0, double width2=0, double length=0, double height=0)
Constructor.
double m_width2
forward width of the component, 0 for recangular
double m_width
width of the component
double & getHeight()
get the height of the component
void setLength(double length)
set the length of the component
const std::string & getColor() const
get the name of the color for the component
double getWidth2() const
get the forward width of the component, 0 for rectangular
std::string m_color
Name of the color of the component.
void setWidth(double width)
set the width of the component.
const std::string & getMaterial() const
get the name of the Material for the component
double m_length
length of the component
double m_height
height of the component
void setVolume(G4LogicalVolume *volume)
set the pointer to the logical volume
G4LogicalVolume * m_volume
Pointer to the Logical volume if already created.
G4LogicalVolume * getVolume() const
get the pointer to the logical volume, NULL if not yet created
double getLength() const
get the length of the component
const std::vector< VXDGeoSensorPlacement > & getSensors() const
get list of sensors
double m_radius
Radius where to place the ladder.
VXDGeoLadder(int layerID=0, double shift=0, double radius=0, double slantedAngle=0, double slantedRadius=0, double glueSize=-1, const std::string &glueMaterial="")
Constructor.
int getLayerID() const
get the layer id
const std::string & getGlueMaterial() const
get the glue material
int m_layerID
ID of the ladder inside the layer.
double getSlantedAngle() const
get the slant angle for slanted sensors
double m_slantedRadius
Radius of the center of the active area for slanted sensors.
std::string m_glueMaterial
name of the Material used as glue
double getRadius() const
get the radius of all sensors except slanted ones
std::vector< VXDGeoSensorPlacement > m_sensors
list of all sensors to be placed in the ladder
double m_shift
Shift of the ladder along local u.
double m_slantedAngle
Angle of the module with respect to the global z-axis for slanted sensors.
double getShift() const
get the shift along the u coordinate for all sensors in the ladder
void addSensor(const VXDGeoSensorPlacement &sensor)
add a sensor to the list of sensors in the ladder
double m_glueSize
Oversize of the glue between the ladders, <0 means no glue.
double getSlantedRadius() const
get the radius for slanted sensors
double getGlueSize() const
get the additional glue size, e.g.
Class holding all parameters to place a VXD geometry subcomponent.
double getU() const
get local u coordinate where to place the component
const std::string & getName() const
get Name of the component
double m_u
u coordinate where to place the component
double getV() const
get local v coordinate where to place the component
double m_v
v coordinate where to place the component
EPosW getW() const
get local w position where to place the component
EPosW
Enum describing where to place the component vertically.
@ c_bottom
Place the component at the bottom of the mother.
@ c_above
Place the component above the mother.
@ c_center
Place the component at the center of the mother.
@ c_top
Place the component at the top of the mother.
@ c_below
Place the component below the mother.
double m_woffset
Offset to the w placement of the component.
EPosW m_w
w coordinate where to place the component
std::string m_name
Name of the component.
double getWOffset() const
get offset to local w position where to place the component
Struct holding the information where a sensor should be placed inside the ladder.
bool m_flipV
flip sensor along v?
bool getFlipV() const
check whether or not the sensor should be flipped around the V coordinate
bool m_flipU
flip sensor along u?
int getSensorID() const
get the sensor id inside the ladder
VXDGeoSensorPlacement(int sensorID=0, const std::string &sensorTypeID="", double z=0, bool flipU=false, bool flipV=false, bool flipW=false)
Constructor.
std::string m_sensorTypeID
Type of the sensor to be used.
bool getFlipU() const
check whether or not the sensor should be flipped around the U coordinate
bool m_flipW
flip sensor along w?
double getZ() const
get the z position of the sensor
int m_sensorID
ID of the sensor inside the ladder.
bool getFlipW() const
check whether or not the sensor should be flipped around the W coordinate
double m_z
global z position of the center of the sensor
const std::string & getSensorTypeID() const
get the sensor type id, internal id only needed for construction
const VXDGeoPlacement & getActivePlacement()
get the placement description for the active area
VXDGeoPlacement m_activePlacement
Position of the active area.
VXD::SensorInfoBase * m_info
Sensor Information instance.
void setActive(const VXDGeoComponent &area, const VXDGeoPlacement &placement)
set the active area
VXDGeoSensor(const std::string &material="", const std::string &color="", double width=0, double width2=0, double length=0, double height=0, bool slanted=false)
Constructor.
void setSensorInfo(VXD::SensorInfoBase *info)
set the pointer to the SensorInfo class
bool getSlanted() const
return whether or not the sensor is slanted (usually only the first sensor in layers 4-6)
VXDGeoComponent m_activeArea
Paramerers of the active area.
const std::vector< VXDGeoPlacement > & getComponents() const
get the list of sub components
const VXD::SensorInfoBase * getSensorInfo() const
get the pointer to the SensorInfo class
bool m_slanted
Indication whether this is a slanted sensor.
std::vector< VXDGeoPlacement > m_components
List of all components to be placed.
void setComponents(const std::vector< VXDGeoPlacement > &component)
set the list of sub components to be placed
VXDGeoComponent & getActiveArea()
get the component description for the active area
Base class to provide Sensor Information for PXD and SVD.
VXDGeoPlacement(const std::string &name="", double u=0, double v=0, std::string w="bottom", double woffset=0)
Constructor.
Namespace to provide code needed by both Vertex Detectors, PXD and SVD, and also testbeam telescopes.
Definition GeoCache.h:33
Abstract base class for different kinds of events.