18 #include "TGeoManager.h"
19 #include "TGeoMatrix.h"
21 #include "TGeoShape.h"
29 if (gROOT->FindObjectAny(
"FAIRGeom") == 0){
30 std::cout <<
" -E- PndHypGeoHandling: No Geometry existing!" << std::endl;
38 if (gROOT->FindObjectAny(
"FAIRGeom") == 0){
39 fGeoMan =
new TGeoManager(
"geoMan",
"geoMan");
40 fGeoMan->Import(fileName.Data());
55 fGeoMan->GetBranchNumbers(copyNr, volNr);
56 for (
int i=0;
i<level;
i++){
71 fGeoMan->cd(currentPath.Data());
79 std::vector<std::string> idVector;
83 for(Int_t
i = 0;
i < (int)idVector.size();
i+=2){
85 Int_t VolId = atoi(idVector[
i].c_str());
86 Int_t CopyNr = atoi(idVector[
i+1].c_str());
87 result +=
fGeoMan->GetVolume(VolId)->GetName();
102 TGeoVolume* vol =
fGeoMan->FindVolumeFast(name);
105 result += vol->GetNumber();
114 if (startPath ==
""){
119 if (
fGeoMan->cd(startPath.Data())== 0)
131 TGeoNode* myNode =
fGeoMan->GetCurrentNode();
139 Int_t nDaughters = myNode->GetNdaughters();
140 for (Int_t
i = 0;
i < nDaughters;
i++){
155 TGeoHMatrix* currMatrix =
fGeoMan->GetCurrentMatrix();
156 temp = currMatrix->GetTranslation();
157 o.SetXYZ(temp[0], temp[1], temp[2]);
162 fGeoMan->LocalToMasterVect(temp, result);
163 u.SetXYZ(result[0], result[1], result[2]);
168 fGeoMan->LocalToMasterVect(temp, result);
169 v.SetXYZ(result[0], result[1], result[2]);
170 if(actPath!=
"" && actPath!=
" ")
fGeoMan->cd(actPath);
185 TGeoVolume* actVolume =
gGeoManager->GetCurrentVolume();
186 TGeoBBox* actBox = (TGeoBBox*)(actVolume->GetShape());
187 dim.SetX(actBox->GetDX());
188 dim.SetY(actBox->GetDY());
189 dim.SetZ(actBox->GetDZ());
191 if(actPath!=
"" && actPath!=
" ")
fGeoMan->cd(actPath);
211 temp[0] = master.X();
212 temp[1] = master.Y();
213 temp[2] = master.Z();
217 fGeoMan->MasterToLocal(temp, result);
219 if(actPath !=
"" && actPath !=
" ")
fGeoMan->cd(actPath);
220 return TVector3(result[0],result[1],result[2]);
239 fGeoMan->LocalToMaster(temp, result);
241 if(actPath !=
"" && actPath !=
" ")
fGeoMan->cd(actPath);
242 return TVector3(result[0],result[1],result[2]);
258 temp[0] = master.X();
259 temp[1] = master.Y();
260 temp[2] = master.Z();
263 fGeoMan->MasterToLocalVect(temp,result);
265 for(Int_t
i=0;
i<3;
i++) result[
i]=
fabs(result[
i]);
269 if(actPath !=
"" && actPath !=
" ")
fGeoMan->cd(actPath);
270 return TVector3(result[0],result[1],result[2]);
293 fGeoMan->LocalToMasterVect(tmp,result);
295 for(Int_t
i=0;
i<3;
i++) result[
i]=
fabs(result[
i]);
297 if(actPath !=
"" && actPath !=
" ")
fGeoMan->cd(actPath);
298 return TVector3(result[0],result[1],result[2]);
TVector3 LocalToMasterId(const TVector3 &local, const TString &id)
void GetOUVPath(TString path, TVector3 &o, TVector3 &u, TVector3 &v)
for a volume given by its path the o, u, v vectors for the plane are returned
TVector3 GetSensorDimensionsID(TString id)
Bool_t cd(TString id)
as the cd command of TGeoManager just with the ID
TVector3 MasterToLocalErrorsPath(const TVector3 &master, const TString &id)
TString GetVolumeID(TString name)
returns the volume ID for a given volume name
std::vector< std::string > GetStringVector(void)
void GetOUVId(TString id, TVector3 &o, TVector3 &u, TVector3 &v)
for a volume given by its ID the o, u, v vectors for the plane are returned
Class to access the naming information of the MVD.
TGeoManager * gGeoManager
TVector3 GetSensorDimensionsPath(TString path)
TVector3 MasterToLocalErrorsId(const TVector3 &master, const TString &id)
std::vector< TString > GetNamesLevel(Int_t level, TString startPath="", bool fullPath=false)
TString GetPath(TString id)
for a given ID the path is returned
std::vector< TString > fLevelNames
TString GetCurrentID()
returns the ID of the current node
friend F32vec4 fabs(const F32vec4 &a)
TVector3 MasterToLocalPath(const TVector3 &master, const TString &id)
void FillLevelNames()
fills vector<TString> fLevelNames with the names (or the paths) of the volumes down to the level give...
TString GetID(TString path)
for a given TGeoManager-path the ID is returned
TVector3 LocalToMasterErrorsPath(const TVector3 &local, const TString &id)
TVector3 MasterToLocalId(const TVector3 &master, const TString &id)
TVector3 LocalToMasterErrorsId(const TVector3 &local, const TString &id)
TVector3 LocalToMasterPath(const TVector3 &local, const TString &id)