18#include <TGeoManager.h>
20#include <TGeoPhysicalNode.h>
47 Bool_t isValid = kTRUE;
48 if (name.Length() != 16) isValid = kFALSE;
50 if (!name.BeginsWith(
"STS")) isValid = kFALSE;
51 if (name[4] !=
'U') isValid = kFALSE;
52 if (name[8] !=
'L') isValid = kFALSE;
53 if (name[13] !=
'M') isValid = kFALSE;
56 LOG(fatal) <<
"GetAddressFromName: Not a valid module name " << name;
60 Int_t unit = 10 * (name[5] -
'0') + name[6] -
'0' - 1;
61 Int_t ladder = 10 * (name[9] -
'0') + name[10] -
'0' - 1;
62 Int_t hLadder = (name[11] ==
'U' ? 0 : 1);
63 Int_t module = 10 * (name[14] -
'0') + name[15] -
'0' - 1;
80 TGeoNode* moduleNode =
fNode->GetNode();
81 TString modulePath =
fNode->GetName();
83 for (Int_t iNode = 0; iNode < moduleNode->GetNdaughters(); iNode++) {
86 TString daughterName = moduleNode->GetDaughter(iNode)->GetName();
87 if (daughterName.Contains(
"Sensor", TString::kIgnoreCase)) {
90 TString daughterPath = modulePath +
"/" + daughterName;
91 TGeoPhysicalNode* sensorNode =
new TGeoPhysicalNode(daughterPath.Data());
ClassImp(CbmConverterManager)
Class representing an element of the STS setup.
std::vector< CbmStsElement * > fDaughters
Array of daughters.
TGeoPhysicalNode * fNode
Pointer to geometry.
Int_t fAddress
Unique element address.
Int_t GetNofDaughters() const
Class representing an instance of a readout unit in the CBM-STS.
virtual void InitDaughters()
Initialise daughters from geometry.
static Int_t GetAddressFromName(TString name)
Get the address from the module name (static)
std::string ToString() const
CbmStsModule(UInt_t address=0, TGeoPhysicalNode *node=nullptr, CbmStsElement *mother=nullptr)
Standard constructor.
virtual ~CbmStsModule()
Destructor.
Class representing an instance of a sensor in the CBM-STS.
int32_t SetElementId(int32_t address, int32_t level, uint32_t newId)
Set the index of an element, leaving the other element levels untouched.
int32_t GetAddress(uint32_t unit=0, uint32_t ladder=0, uint32_t halfladder=0, uint32_t module=0, uint32_t sensor=0, uint32_t side=0, uint32_t version=kCurrentVersion)
Construct address.
std::string ToString(int32_t address)
String output.