1 #ifndef FWD_GEOM_UTILS_H
2 #define FWD_GEOM_UTILS_H
4 #include "TGeoVolume.h"
6 #include "TGeoMatrix.h"
7 #include "TGeoNavigator.h"
13 if ( gMan !=
nullptr )
14 _navigator = gMan->AddNavigator();
21 bool cd(
const char* path ){
23 bool ret = _navigator -> cd(path);
27 _matrix = _navigator->GetCurrentMatrix();
28 _node = _navigator->GetCurrentNode();
29 _volume = _node->GetVolume();
31 _matrix = 0; _node = 0; _volume = 0;
36 vector<double> fttZ( vector<double> defaultZ ) {
39 vector<double> z = {z0, fttZ(1), fttZ(2), fttZ(3)};
44 double fttZ(
int index ) {
48 const double ftt_z_delta = -0.5825245;
50 spath <<
"/HALL_1/CAVE_1/STGM_1/STFM_" << (index + 1) * 4 <<
"/";
51 bool can = cd( spath.str().c_str() );
52 if ( can && _matrix !=
nullptr ){
53 return _matrix->GetTranslation()[2] + ftt_z_delta;
58 vector<double> fstZ( vector<double> defaultZ ) {
61 vector<double> z = {z0, fstZ(1), fstZ(2)};
67 double fstZ(
int index ) {
74 spath <<
"/HALL_1/CAVE_1/FSTM_1/FSTD_" << (index + 4) <<
"/";
75 bool can = cd( spath.str().c_str() );
76 if ( can && _matrix !=
nullptr ){
77 return _matrix->GetTranslation()[2];
83 TGeoVolume *_volume =
nullptr;
84 TGeoNode *_node =
nullptr;
85 TGeoHMatrix *_matrix =
nullptr;
86 TGeoIterator *_iter =
nullptr;
87 TGeoNavigator *_navigator =
nullptr;