Belle II Software  release-08-01-10
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 #ifndef GEOVXDCOMPONENTS_H
10 #define GEOVXDCOMPONENTS_H
11 
12 #include <vxd/geometry/SensorInfoBase.h>
13 
14 #include <string>
15 #include <vector>
16 
17 class G4LogicalVolume;
18 
19 namespace Belle2 {
26  public:
28  enum EPosW {
33  c_above
34  };
36  VXDGeoPlacement(const std::string& name = "", double u = 0, double v = 0,
37  std::string w = "bottom", double woffset = 0);
39  const std::string& getName() const { return m_name; }
41  double getU() const { return m_u; }
43  double getV() const { return m_v; }
45  EPosW getW() const { return m_w; }
47  double getWOffset() const { return m_woffset; }
48  private:
50  std::string m_name;
52  double m_u;
54  double m_v;
58  double m_woffset;
59  };
60 
63  public:
65  VXDGeoComponent(const std::string& material = "", const std::string& color = "",
66  double width = 0, double width2 = 0, double length = 0, double height = 0):
67  m_volume(0), m_material(material), m_color(color), m_width(width), m_width2(width2), m_length(length),
68  m_height(height) {}
70  G4LogicalVolume* getVolume() const { return m_volume; }
72  void setVolume(G4LogicalVolume* volume) { m_volume = volume; }
74  const std::string& getMaterial() const { return m_material; }
76  const std::string& getColor() const { return m_color; }
78  double getWidth() const { return m_width; }
80  void setWidth(double width) { m_width = width; m_width2 = 0; }
82  double getWidth2() const { return m_width2; }
84  double getLength() const { return m_length; }
86  void setLength(double length) { m_length = length; }
88  double& getHeight() { return m_height; }
90  double getHeight() const { return m_height; }
91  private:
93  G4LogicalVolume* m_volume;
95  std::string m_material;
97  std::string m_color;
99  double m_width;
101  double m_width2;
103  double m_length;
105  double m_height;
106  };
107 
110  public:
112  VXDGeoSensor(const std::string& material = "", const std::string& color = "",
113  double width = 0, double width2 = 0, double length = 0, double height = 0, bool slanted = false):
114  VXDGeoComponent(material, color, width, width2, length, height), m_info(0), m_slanted(slanted) {}
119  void setActive(const VXDGeoComponent& area, const VXDGeoPlacement& placement)
120  {
121  m_activeArea = area; m_activePlacement = placement;
122  }
128  void setComponents(const std::vector<VXDGeoPlacement>& component) { m_components = component; }
130  const std::vector<VXDGeoPlacement>& getComponents() const { return m_components; }
132  void setSensorInfo(VXD::SensorInfoBase* info) { m_info = info; }
134  const VXD::SensorInfoBase* getSensorInfo() const { return m_info; }
136  bool getSlanted() const { return m_slanted; }
137  private:
145  bool m_slanted;
147  std::vector<VXDGeoPlacement> m_components;
148  };
149 
152  public:
154  VXDGeoSensorPlacement(int sensorID = 0, const std::string& sensorTypeID = "", double z = 0,
155  bool flipU = false, bool flipV = false, bool flipW = false):
156  m_sensorID(sensorID), m_sensorTypeID(sensorTypeID), m_z(z), m_flipU(flipU), m_flipV(flipV), m_flipW(flipW) {}
158  int getSensorID() const { return m_sensorID; }
160  const std::string& getSensorTypeID() const { return m_sensorTypeID; }
162  double getZ() const { return m_z; }
164  bool getFlipU() const { return m_flipU; }
166  bool getFlipV() const { return m_flipV; }
168  bool getFlipW() const { return m_flipW; }
169  private:
173  std::string m_sensorTypeID;
175  double m_z;
177  bool m_flipU;
179  bool m_flipV;
181  bool m_flipW;
182  };
183 
185  class VXDGeoLadder {
186  public:
188  VXDGeoLadder(int layerID = 0, double shift = 0, double radius = 0,
189  double slantedAngle = 0, double slantedRadius = 0,
190  double glueSize = -1, const std::string& glueMaterial = ""):
191  m_layerID(layerID), m_shift(shift), m_radius(radius),
192  m_slantedAngle(slantedAngle), m_slantedRadius(slantedRadius),
193  m_glueSize(glueSize), m_glueMaterial(glueMaterial) {}
195  int getLayerID() const { return m_layerID; }
197  double getShift() const { return m_shift; }
199  double getRadius() const { return m_radius; }
201  double getSlantedAngle() const { return m_slantedAngle; }
203  double getSlantedRadius() const { return m_slantedRadius; }
205  double getGlueSize() const { return m_glueSize; }
207  const std::string& getGlueMaterial() const { return m_glueMaterial; }
209  const std::vector<VXDGeoSensorPlacement>& getSensors() const { return m_sensors; }
211  void addSensor(const VXDGeoSensorPlacement& sensor) { m_sensors.push_back(sensor); }
212  private:
216  double m_shift;
218  double m_radius;
224  double m_glueSize;
226  std::string m_glueMaterial;
228  std::vector<VXDGeoSensorPlacement> m_sensors;
229  };
230 
232 } // namespace Belle2
233 
234 #endif /* GEOVXDCOMPONENTS_H */
Class holding all parameters for an VXD geometry component.
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
void setLength(double length)
set the length of the component
G4LogicalVolume * getVolume() const
get the pointer to the logical volume, NULL if not yet created
double getWidth2() const
get the forward width of the component, 0 for rectangular
std::string m_color
Name of the color of the component.
const std::string & getColor() const
get the name of the color for the component
double & getHeight()
get the height of the component
void setWidth(double width)
set the width of the component.
double m_length
length of the component
const std::string & getMaterial() const
get the name of the Material for 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
double getLength() const
get the length of the component
Struct containing all parameters of one ladder.
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
int m_layerID
ID of the ladder inside the layer.
double getSlantedAngle() const
get the slant angle for slanted sensors
const std::string & getGlueMaterial() const
get the glue material
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
const std::vector< VXDGeoSensorPlacement > & getSensors() const
get list of sensors
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
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.
const std::string & getName() const
get Name of the component
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
const std::string & getSensorTypeID() const
get the sensor type id, internal id only needed for construction
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
Struct holding all parameters for a completeVXD Sensor.
VXDGeoPlacement m_activePlacement
Position of the active area.
const VXD::SensorInfoBase * getSensorInfo() const
get the pointer to the SensorInfo class
const std::vector< VXDGeoPlacement > & getComponents() const
get the list of sub components
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 wether or not the sensor is slanted (usually only the first sensor in layers 4-6)
VXDGeoComponent m_activeArea
Paramerers of the active area.
VXDGeoComponent & getActiveArea()
get the component description for the active area
bool m_slanted
Indication wether this is a slanted sensor.
std::vector< VXDGeoPlacement > m_components
List of all components to be placed.
const VXDGeoPlacement & getActivePlacement()
get the placement description for the active area
void setComponents(const std::vector< VXDGeoPlacement > &component)
set the list of sub components to be placed
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.
Abstract base class for different kinds of events.