Skip to content

Commit

Permalink
remove C-style cast
Browse files Browse the repository at this point in the history
  • Loading branch information
anupama-reghunath authored and olantwin committed Sep 12, 2024
1 parent a7e96d9 commit fbeeb68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion veto/vetoHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ TVector3 vetoHit::GetXYZ()
{
TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
TGeoNode* node = GetNode();
TGeoBBox* shape = (TGeoBBox*)node->GetVolume()->GetShape();
TGeoVolume* volume = node->GetVolume();
TGeoBBox* shape = dynamic_cast<TGeoBBox*>(volume->GetShape());
Double_t origin[3] = {shape->GetOrigin()[0], shape->GetOrigin()[1], shape->GetOrigin()[2]};
Double_t master[3] = {0, 0, 0};
nav->LocalToMaster(origin, master);
TVector3 pos = TVector3(master[0], master[1], master[2]);
return pos;
}


Double_t vetoHit::GetX()
{
TVector3 pos = GetXYZ();
Expand Down

0 comments on commit fbeeb68

Please sign in to comment.