16#ifndef RestCore_TRestDetectorGeometry
17#define RestCore_TRestDetectorGeometry
19#include <TGeoManager.h>
20#include <TGeoMaterial.h>
21#include <TGeoVolume.h>
27#include "TRestDetectorGas.h"
29#if defined USE_Garfield
31#if defined USE_Garfield_OLD
32#include "ComponentBase.hh"
34#include "Component.hh"
37#include "GeometryRoot.hh"
40#if defined USE_Garfield_OLD
41typedef Garfield::ComponentBase Component;
43typedef Garfield::Component Component;
50#if defined USE_Garfield
51 Garfield::GeometryRoot* fGfGeometry;
53 std::vector<Component*> vGfComponent;
54 std::vector<Garfield::Sensor*> vGfSensor;
56 std::vector<TGeoNode*> vReadoutElec;
69#if defined USE_Garfield
72 Garfield::GeometryRoot* GetGfGeometry() {
return fGfGeometry; }
80 void AddGfComponent(Component* c) {
81 c->SetGeometry(fGfGeometry);
82 vGfComponent.push_back(c);
86 void AddGfSensor(Garfield::Sensor* s) { vGfSensor.push_back(s); }
89 void SetDriftElecNode(TGeoNode* n) { fDriftElec = n; }
92 void AddReadoutElecNode(TGeoNode* n) { vReadoutElec.push_back(n); }
95 TGeoNode* GetDriftElecNode() {
return fDriftElec; }
98 int GetNReadoutElecNodes() {
return vReadoutElec.size(); }
101 TGeoNode* GetReadoutElecNode(
unsigned int i) {
102 if (i < vReadoutElec.size())
103 return vReadoutElec[i];
109 Component* GetGfComponent(
unsigned int i) {
110 if (i < vGfComponent.size())
111 return vGfComponent[i];
117 int GetNbOfGfComponent() {
return vGfComponent.size(); }
120 Garfield::Sensor* GetGfSensor(
unsigned int i) {
121 if (i < vGfSensor.size())
128 int GetNbOfGfSensor() {
return vGfSensor.size(); }
131 Garfield::Medium* GetGfMedium(
double x,
double y,
double z) {
132 FindNode(x / 10., y / 10., z / 10.);
133 return fGfGeometry->GetMedium(x / 10., y / 10., z / 10.);
137 void PrintGeometry();
MediumMagboltz * GetGasMedium() const
Return pointer to Garfield::MediumGas for gas properties.
void InitGfGeometry()
initialize Garfield::GeometryRoot geometry object