9 #include "ERQTelescopeGeoComponentDoubleSi.h" 11 #include "TGeoManager.h" 12 #include "TGeoMatrix.h" 13 #include <TDOMParser.h> 18 #include "FairLogger.h" 20 #include "ERTelescopeSetup.h" 23 void ERQTelescopeGeoComponentDoubleSi::ConstructGeometryVolume(
void) {
25 auto* media = CreateMaterial(fMedia);
30 fVolume = gGeoManager->MakeBox(this->GetVolumeName(), media, fSizeX / 2, fSizeY / 2, fSizeZ / 2);
32 Double_t stripX = fSensX / fStripCountX;
33 Double_t stripY = fSensY;
34 Double_t stripZ = fSensZ - fDeadLayerThicknessFrontSide - fDeadLayerThicknessBackSide;
35 strip = gGeoManager->MakeBox(
"doubleSiStrip" + fOrientAroundZ, media, stripX / 2,
39 Double_t boxX = stripX;
40 Double_t boxY = stripY / fStripCountY;
41 Double_t boxZ = stripZ;
42 box = gGeoManager->MakeBox(
"SensitiveDoubleSiBox"+fOrientAroundZ, media, boxX / 2,
48 TGeoRotation *fZeroRotation =
new TGeoRotation();
49 fZeroRotation->RotateX(0.);
50 fZeroRotation->RotateY(0.);
51 fZeroRotation->RotateZ(0.);
52 for (Int_t iBox = 0; iBox < fStripCountY ; ++iBox ) {
53 Double_t translateY = (fSensY / 2) - boxY / 2 - boxY * iBox ;
54 strip->AddNode(box, iBox,
new TGeoCombiTrans(0, translateY, 0, fZeroRotation));
57 for (Int_t iStripX = 0; iStripX < fStripCountX; iStripX++) {
58 Double_t translateX = fSensX / 2 - stripX *(iStripX)-(stripX / 2);
59 Double_t translateZ = (fDeadLayerThicknessFrontSide - fDeadLayerThicknessBackSide)/2. ;
60 fVolume->AddNode(strip, iStripX,
new TGeoCombiTrans(translateX, 0, translateZ, fZeroRotation));
70 void ERQTelescopeGeoComponentDoubleSi::ParseXmlParameters() {
71 TString xmlFile = ERTelescopeSetup::Instance()->GetXMLParametersFile();
72 TDOMParser *domParser;
74 domParser =
new TDOMParser;
75 domParser->SetValidate(
false);
77 Int_t parsecode = domParser->ParseFile(xmlFile);
79 LOG(FATAL) << domParser->GetParseCodeMessage(parsecode) << FairLogger::FairLogger::endl;
82 TXMLNode *rootNode = domParser->GetXMLDocument()->GetRootNode();
83 TXMLNode *detPartNode = rootNode->GetChildren();
84 TXMLNode *SiTypeNodes;
85 for ( ; detPartNode; detPartNode = detPartNode->GetNextNode()) {
86 if (!strcasecmp(detPartNode->GetNodeName(),
"SiTypes")) {
87 SiTypeNodes = detPartNode->GetChildren();
88 for ( ; SiTypeNodes; SiTypeNodes = SiTypeNodes->GetNextNode()) {
89 if (!strcasecmp(SiTypeNodes->GetNodeName(),
"doubleSiTypes")) {
90 TXMLNode* curNode = SiTypeNodes->GetChildren()->GetNextNode();
91 for(; curNode; curNode = curNode->GetNextNode()) {
94 if (curNode->HasAttributes()){
95 attrList = curNode->GetAttributes();
97 while ((attr=(TXMLAttr*)next())) {
98 if (!strcasecmp(
"id", attr->GetName())) {
106 if(!strcasecmp(fComponentId, attr->GetValue())) {
107 FillTwoSidedChannelAttribute(curNode->GetAttributes());
108 TXMLNode* curNode2 = curNode->GetChildren();
109 for(; curNode2; curNode2 = curNode2->GetNextNode()) {
110 if(!strcasecmp(curNode2->GetNodeName(),
"doubleSiSize")) {
111 attrList = curNode2->GetAttributes();
113 TIter nextSizeAttr(attrList);
114 while ((attr=(TXMLAttr*)nextSizeAttr())) {
115 if (!strcasecmp(
"doubleSiX", attr->GetName())) {
116 fSizeX = atof(attr->GetValue());
118 if (!strcasecmp(
"doubleSiY", attr->GetName())) {
119 fSizeY = atof(attr->GetValue());
121 if (!strcasecmp(
"doubleSiZ", attr->GetName())) {
122 fSizeZ = atof(attr->GetValue());
126 if(!strcasecmp(curNode2->GetNodeName(),
"doubleSiSensAreaSize")) {
127 attrList = curNode2->GetAttributes();
129 TIter nextSensSizeAttr(attrList);
130 while ((attr=(TXMLAttr*)nextSensSizeAttr())) {
131 if (!strcasecmp(
"doubleSiSensX", attr->GetName())) {
132 fSensX = atof(attr->GetValue());
134 if (!strcasecmp(
"doubleSiSensY", attr->GetName())) {
135 fSensY = atof(attr->GetValue());
137 if (!strcasecmp(
"doubleSiSensZ", attr->GetName())) {
138 fSensZ = atof(attr->GetValue());
142 if(!strcasecmp(curNode2->GetNodeName(),
"deadLayerThicknessFrontSide")) {
143 fDeadLayerThicknessFrontSide = atof(curNode2->GetText());
145 if(!strcasecmp(curNode2->GetNodeName(),
"deadLayerThicknessBackSide")) {
146 fDeadLayerThicknessBackSide = atof(curNode2->GetText());
148 if(!strcasecmp(curNode2->GetNodeName(),
"stripCountX")) {
149 fStripCountX = atof(curNode2->GetText());
151 if(!strcasecmp(curNode2->GetNodeName(),
"stripCountY")) {
152 fStripCountY = atof(curNode2->GetText());
154 if(!strcasecmp(curNode2->GetNodeName(),
"doubleSiMedia")) {
155 fMedia = curNode2->GetText();