16#include "TClonesArray.h"
18#include <fairlogger/Logger.h>
23#include "MFTBase/GeometryTGeo.h"
43 SetUniqueID(uniqueID);
45 LOG(debug1) <<
"Start creating half-disk UniqueID = " << GetUniqueID();
52 mLadders =
new TClonesArray(
"o2::mft::LadderSegmentation");
53 mLadders->SetOwner(kTRUE);
65 mLadders =
new TClonesArray(*(input.mLadders));
67 mLadders =
new TClonesArray(
"o2::mft::LadderSegmentation");
69 mLadders->SetOwner(kTRUE);
96 Double_t ang[3] = {0., 0., 0.};
100 TString nodeName = xml->GetNodeName(node);
101 if (!nodeName.CompareTo(
"ladder")) {
102 XMLAttrPointer_t attr = xml->GetFirstAttr(node);
103 while (attr !=
nullptr) {
104 TString attrName = xml->GetAttrName(attr);
105 TString attrVal = xml->GetAttrValue(attr);
106 if (!attrName.CompareTo(
"iladder")) {
107 iladder = attrVal.Atoi();
109 LOG(fatal) <<
"Wrong ladder number : " << iladder;
111 }
else if (!attrName.CompareTo(
"nsensor")) {
112 nsensor = attrVal.Atoi();
113 }
else if (!attrName.CompareTo(
"xpos")) {
114 pos[0] = attrVal.Atof();
115 }
else if (!attrName.CompareTo(
"ypos")) {
116 pos[1] = attrVal.Atof();
117 }
else if (!attrName.CompareTo(
"zpos")) {
118 pos[2] = attrVal.Atof();
119 }
else if (!attrName.CompareTo(
"phi")) {
120 ang[0] = attrVal.Atof();
121 }
else if (!attrName.CompareTo(
"theta")) {
122 ang[1] = attrVal.Atof();
123 }
else if (!attrName.CompareTo(
"psi")) {
124 ang[2] = attrVal.Atof();
126 LOG(error) <<
"Unknwon Attribute name " << xml->GetAttrName(attr);
128 attr = xml->GetNextAttr(attr);
132 Int_t ladderID = iladder;
141 mftGeom->
getDiskID(GetUniqueID()), plane, ladderID);
144 ladder->setNSensors(nsensor);
145 ladder->setPosition(
pos);
146 ladder->setRotationAngles(ang);
148 ladder->createSensors(xml, node);
157 XMLNodePointer_t child = xml->GetChild(node);
158 while (child !=
nullptr) {
160 child = xml->GetNext(child);
172 for (Int_t iLadder = 0; iLadder < mLadders->GetEntries(); iLadder++) {
189 if (opt && (strstr(opt,
"ladder") || strstr(opt,
"l"))) {
ClassImp(HalfDiskSegmentation)
Class for the description of the structure of a half-disk.
Class handling both virtual segmentation and real volumes.
Definition of the SegmentationAlpide class.
static const Char_t * getMFTDiskPattern()
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 getHalfID(UInt_t uniqueID) const
Returns Half-MFT ID based on Unique ID provided.
static Geometry * instance()
Singleton access.
void createLadders(TXMLEngine *xml, XMLNodePointer_t node)
Creates the Ladders on this half-Disk based on the information contained in the XML file.
Int_t getNLadders() const
Get the number of Ladder on the Half-Disk.
LadderSegmentation * getLadder(Int_t iLadder)
Returns pointer to the ladder segmentation object.
void Clear(const Option_t *) override
Clear the TClonesArray holding the ladder segmentations.
HalfDiskSegmentation()
Default constructor.
void print(Option_t *opt="")
~HalfDiskSegmentation() override
Int_t getNChips()
Returns the number of sensors on the Half-Disk.
Int_t getNSensors() const
Returns number of Sensor on the ladder.
TGeoCombiTrans * getTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"