16#include <fairlogger/Logger.h>
21#include "MFTBase/GeometryTGeo.h"
39 SetUniqueID(uniqueID);
58 mChips =
new TClonesArray(*(ladder.mChips));
60 mChips =
new TClonesArray(
"o2::mft::ChipSegmentation", mNSensors);
63 mChips->SetOwner(kTRUE);
73 mChips =
new TClonesArray(
"o2::mft::ChipSegmentation", mNSensors);
74 mChips->SetOwner(kTRUE);
79 Double_t ang[3] = {0., 0., 0.};
83 TString nodeName = xml->GetNodeName(node);
84 if (!nodeName.CompareTo(
"chip")) {
85 XMLAttrPointer_t attr = xml->GetFirstAttr(node);
86 while (attr !=
nullptr) {
87 TString attrName = xml->GetAttrName(attr);
88 TString attrVal = xml->GetAttrValue(attr);
89 if (!attrName.CompareTo(
"ichip")) {
90 ichip = attrVal.Atoi();
92 LOG(fatal) <<
"Wrong chip number : " << ichip;
94 }
else if (!attrName.CompareTo(
"xpos")) {
95 pos[0] = attrVal.Atof();
96 }
else if (!attrName.CompareTo(
"ypos")) {
97 pos[1] = attrVal.Atof();
98 }
else if (!attrName.CompareTo(
"zpos")) {
99 pos[2] = attrVal.Atof();
100 }
else if (!attrName.CompareTo(
"phi")) {
101 ang[0] = attrVal.Atof();
102 }
else if (!attrName.CompareTo(
"theta")) {
103 ang[1] = attrVal.Atof();
104 }
else if (!attrName.CompareTo(
"psi")) {
105 ang[2] = attrVal.Atof();
107 LOG(error) <<
"Unknwon Attribute name " << xml->GetAttrName(attr);
109 attr = xml->GetNextAttr(attr);
112 UInt_t chipUniqueID =
125 chip->setPosition(
pos);
126 chip->setRotationAngles(ang);
133 XMLNodePointer_t child = xml->GetChild(node);
134 while (child !=
nullptr) {
136 child = xml->GetNext(child);
147 if (sensorID < 0 || sensorID >= mNSensors) {
164 if (opt && (strstr(opt,
"sensor") || strstr(opt,
"s"))) {
Chip (sensor) segmentation description.
Class handling both virtual segmentation and real volumes.
ClassImp(LadderSegmentation)
Description of the virtual segmentation of a ladder.
static const Char_t * getMFTLadderPattern()
UInt_t getObjectID(ObjectTypes type, Int_t half=-1, Int_t disk=-1, Int_t plane=-1, Int_t ladder=-1, Int_t chip=-1) const
Returns the object Unique ID.
Int_t getDiskID(UInt_t uniqueID) const
Returns Half-Disk ID based on Unique ID provided.
Int_t getLadderID(UInt_t uniqueID) const
Returns Ladder ID based on Unique ID provided.
Int_t getHalfID(UInt_t uniqueID) const
Returns Half-MFT ID based on Unique ID provided.
static Geometry * instance()
Singleton access.
Int_t getPlaneID(UInt_t uniqueID) const
Returns Half-Disk plane (side) ID based on Unique ID provided.
Int_t getNSensors() const
Returns number of Sensor on the ladder.
void print(Option_t *opt="")
void createSensors(TXMLEngine *xml, XMLNodePointer_t node)
Creates the Sensors Segmentation array on the Ladder.
LadderSegmentation()
Default constructor.
ChipSegmentation * getSensor(Int_t sensor) const
TGeoCombiTrans * getTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"