15#include "TGeoManager.h"
18#include "TGeoVolume.h"
31 std::lock_guard<std::mutex> lock(
fMutex);
44 targetNode = gGeoManager->GetTopNode();
45 targetPath =
"/" + TString(targetNode->GetName());
48 if (TString(targetNode->GetName()).Contains(
"target")) {
52 for (Int_t iNode = 0; iNode < targetNode->GetNdaughters(); ++iNode) {
53 TGeoNode* newNode = targetNode->GetDaughter(iNode);
54 TString newPath = targetPath +
"/" + newNode->GetName();
71 throw std::logic_error(
"cbm::kf::Target: the TGeoManager instance is not initialized on this step. Please be "
72 "ensured to call the Target::Init() after the TGeoManager initialization.");
76 TGeoNode* pTargetNode{
nullptr};
80 throw std::runtime_error(
"cbm::kf::Target: the target node is not found in the setup");
83 Double_t local[3] = {0., 0., 0.};
84 Double_t global[3] = {0};
85 gGeoManager->cd(targetPath);
86 gGeoManager->GetCurrentMatrix()->LocalToMaster(local, global);
91 if (
const auto* pTube =
dynamic_cast<TGeoTube*
>(pTargetNode->GetVolume()->GetShape())) {
93 fRmax = pTube->GetRmax();
96 throw std::logic_error(
"cbm::kf::Target: target is supposed to be a Tube, but it is not. Please, "
97 "provide a proper handling of the new target shape (return it's reference central point "
98 "and half of its thickness)");
Target property initialization and access in CBM (source)
CBM target accessor and property handler.
void Init()
Target initializer.
Target()=default
Default constructor.
static Target * Instance()
Instance access.
static Target * fpInstance
double fRmax
target transverse size [cm]
double fDz
target half-thickness [cm]
double fZ
reference z-coordinate of the target position [cm]
double fX
reference x-coordinate of the target position [cm]
double fY
reference y-coordinate of the target position [cm]
static void FindTargetNode(TString &targetPath, TGeoNode *&targetNode)
Finds a target.